@pixodesk/svg-animator-react 1.0.6
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.
- package/LICENSE +21 -0
- package/README.md +104 -0
- package/dist/index.cjs +309 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +111 -0
- package/dist/index.d.ts +111 -0
- package/dist/index.js +272 -0
- package/dist/index.js.map +1 -0
- package/dist/index.umd.js +3487 -0
- package/dist/index.umd.js.map +1 -0
- package/package.json +62 -0
|
@@ -0,0 +1,3487 @@
|
|
|
1
|
+
var React = window.React; var ReactDOM = window.ReactDOM; var PixodeskAnimatorWeb = window.PixodeskAnimator;
|
|
2
|
+
"use strict";
|
|
3
|
+
var PixodeskAnimatorReact = (() => {
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
11
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
12
|
+
};
|
|
13
|
+
var __export = (target, all) => {
|
|
14
|
+
for (var name in all)
|
|
15
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
16
|
+
};
|
|
17
|
+
var __copyProps = (to, from, except, desc) => {
|
|
18
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
19
|
+
for (let key of __getOwnPropNames(from))
|
|
20
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
21
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
22
|
+
}
|
|
23
|
+
return to;
|
|
24
|
+
};
|
|
25
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
26
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
27
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
28
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
29
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
30
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
31
|
+
mod
|
|
32
|
+
));
|
|
33
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
34
|
+
|
|
35
|
+
// ../../node_modules/.pnpm/react@19.2.4/node_modules/react/cjs/react.production.js
|
|
36
|
+
var require_react_production = __commonJS({
|
|
37
|
+
"../../node_modules/.pnpm/react@19.2.4/node_modules/react/cjs/react.production.js"(exports) {
|
|
38
|
+
"use strict";
|
|
39
|
+
var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element");
|
|
40
|
+
var REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal");
|
|
41
|
+
var REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
42
|
+
var REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode");
|
|
43
|
+
var REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler");
|
|
44
|
+
var REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer");
|
|
45
|
+
var REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context");
|
|
46
|
+
var REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref");
|
|
47
|
+
var REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense");
|
|
48
|
+
var REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo");
|
|
49
|
+
var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
|
|
50
|
+
var REACT_ACTIVITY_TYPE = /* @__PURE__ */ Symbol.for("react.activity");
|
|
51
|
+
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
|
52
|
+
function getIteratorFn(maybeIterable) {
|
|
53
|
+
if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
|
|
54
|
+
maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
|
|
55
|
+
return "function" === typeof maybeIterable ? maybeIterable : null;
|
|
56
|
+
}
|
|
57
|
+
var ReactNoopUpdateQueue = {
|
|
58
|
+
isMounted: function() {
|
|
59
|
+
return false;
|
|
60
|
+
},
|
|
61
|
+
enqueueForceUpdate: function() {
|
|
62
|
+
},
|
|
63
|
+
enqueueReplaceState: function() {
|
|
64
|
+
},
|
|
65
|
+
enqueueSetState: function() {
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
var assign = Object.assign;
|
|
69
|
+
var emptyObject = {};
|
|
70
|
+
function Component(props, context, updater) {
|
|
71
|
+
this.props = props;
|
|
72
|
+
this.context = context;
|
|
73
|
+
this.refs = emptyObject;
|
|
74
|
+
this.updater = updater || ReactNoopUpdateQueue;
|
|
75
|
+
}
|
|
76
|
+
Component.prototype.isReactComponent = {};
|
|
77
|
+
Component.prototype.setState = function(partialState, callback) {
|
|
78
|
+
if ("object" !== typeof partialState && "function" !== typeof partialState && null != partialState)
|
|
79
|
+
throw Error(
|
|
80
|
+
"takes an object of state variables to update or a function which returns an object of state variables."
|
|
81
|
+
);
|
|
82
|
+
this.updater.enqueueSetState(this, partialState, callback, "setState");
|
|
83
|
+
};
|
|
84
|
+
Component.prototype.forceUpdate = function(callback) {
|
|
85
|
+
this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
|
|
86
|
+
};
|
|
87
|
+
function ComponentDummy() {
|
|
88
|
+
}
|
|
89
|
+
ComponentDummy.prototype = Component.prototype;
|
|
90
|
+
function PureComponent(props, context, updater) {
|
|
91
|
+
this.props = props;
|
|
92
|
+
this.context = context;
|
|
93
|
+
this.refs = emptyObject;
|
|
94
|
+
this.updater = updater || ReactNoopUpdateQueue;
|
|
95
|
+
}
|
|
96
|
+
var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
|
|
97
|
+
pureComponentPrototype.constructor = PureComponent;
|
|
98
|
+
assign(pureComponentPrototype, Component.prototype);
|
|
99
|
+
pureComponentPrototype.isPureReactComponent = true;
|
|
100
|
+
var isArrayImpl = Array.isArray;
|
|
101
|
+
function noop() {
|
|
102
|
+
}
|
|
103
|
+
var ReactSharedInternals = { H: null, A: null, T: null, S: null };
|
|
104
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
105
|
+
function ReactElement(type, key, props) {
|
|
106
|
+
var refProp = props.ref;
|
|
107
|
+
return {
|
|
108
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
109
|
+
type,
|
|
110
|
+
key,
|
|
111
|
+
ref: void 0 !== refProp ? refProp : null,
|
|
112
|
+
props
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
function cloneAndReplaceKey(oldElement, newKey) {
|
|
116
|
+
return ReactElement(oldElement.type, newKey, oldElement.props);
|
|
117
|
+
}
|
|
118
|
+
function isValidElement(object) {
|
|
119
|
+
return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
120
|
+
}
|
|
121
|
+
function escape(key) {
|
|
122
|
+
var escaperLookup = { "=": "=0", ":": "=2" };
|
|
123
|
+
return "$" + key.replace(/[=:]/g, function(match) {
|
|
124
|
+
return escaperLookup[match];
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
var userProvidedKeyEscapeRegex = /\/+/g;
|
|
128
|
+
function getElementKey(element, index) {
|
|
129
|
+
return "object" === typeof element && null !== element && null != element.key ? escape("" + element.key) : index.toString(36);
|
|
130
|
+
}
|
|
131
|
+
function resolveThenable(thenable) {
|
|
132
|
+
switch (thenable.status) {
|
|
133
|
+
case "fulfilled":
|
|
134
|
+
return thenable.value;
|
|
135
|
+
case "rejected":
|
|
136
|
+
throw thenable.reason;
|
|
137
|
+
default:
|
|
138
|
+
switch ("string" === typeof thenable.status ? thenable.then(noop, noop) : (thenable.status = "pending", thenable.then(
|
|
139
|
+
function(fulfilledValue) {
|
|
140
|
+
"pending" === thenable.status && (thenable.status = "fulfilled", thenable.value = fulfilledValue);
|
|
141
|
+
},
|
|
142
|
+
function(error) {
|
|
143
|
+
"pending" === thenable.status && (thenable.status = "rejected", thenable.reason = error);
|
|
144
|
+
}
|
|
145
|
+
)), thenable.status) {
|
|
146
|
+
case "fulfilled":
|
|
147
|
+
return thenable.value;
|
|
148
|
+
case "rejected":
|
|
149
|
+
throw thenable.reason;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
throw thenable;
|
|
153
|
+
}
|
|
154
|
+
function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
|
|
155
|
+
var type = typeof children;
|
|
156
|
+
if ("undefined" === type || "boolean" === type) children = null;
|
|
157
|
+
var invokeCallback = false;
|
|
158
|
+
if (null === children) invokeCallback = true;
|
|
159
|
+
else
|
|
160
|
+
switch (type) {
|
|
161
|
+
case "bigint":
|
|
162
|
+
case "string":
|
|
163
|
+
case "number":
|
|
164
|
+
invokeCallback = true;
|
|
165
|
+
break;
|
|
166
|
+
case "object":
|
|
167
|
+
switch (children.$$typeof) {
|
|
168
|
+
case REACT_ELEMENT_TYPE:
|
|
169
|
+
case REACT_PORTAL_TYPE:
|
|
170
|
+
invokeCallback = true;
|
|
171
|
+
break;
|
|
172
|
+
case REACT_LAZY_TYPE:
|
|
173
|
+
return invokeCallback = children._init, mapIntoArray(
|
|
174
|
+
invokeCallback(children._payload),
|
|
175
|
+
array,
|
|
176
|
+
escapedPrefix,
|
|
177
|
+
nameSoFar,
|
|
178
|
+
callback
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
if (invokeCallback)
|
|
183
|
+
return callback = callback(children), invokeCallback = "" === nameSoFar ? "." + getElementKey(children, 0) : nameSoFar, isArrayImpl(callback) ? (escapedPrefix = "", null != invokeCallback && (escapedPrefix = invokeCallback.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), mapIntoArray(callback, array, escapedPrefix, "", function(c) {
|
|
184
|
+
return c;
|
|
185
|
+
})) : null != callback && (isValidElement(callback) && (callback = cloneAndReplaceKey(
|
|
186
|
+
callback,
|
|
187
|
+
escapedPrefix + (null == callback.key || children && children.key === callback.key ? "" : ("" + callback.key).replace(
|
|
188
|
+
userProvidedKeyEscapeRegex,
|
|
189
|
+
"$&/"
|
|
190
|
+
) + "/") + invokeCallback
|
|
191
|
+
)), array.push(callback)), 1;
|
|
192
|
+
invokeCallback = 0;
|
|
193
|
+
var nextNamePrefix = "" === nameSoFar ? "." : nameSoFar + ":";
|
|
194
|
+
if (isArrayImpl(children))
|
|
195
|
+
for (var i = 0; i < children.length; i++)
|
|
196
|
+
nameSoFar = children[i], type = nextNamePrefix + getElementKey(nameSoFar, i), invokeCallback += mapIntoArray(
|
|
197
|
+
nameSoFar,
|
|
198
|
+
array,
|
|
199
|
+
escapedPrefix,
|
|
200
|
+
type,
|
|
201
|
+
callback
|
|
202
|
+
);
|
|
203
|
+
else if (i = getIteratorFn(children), "function" === typeof i)
|
|
204
|
+
for (children = i.call(children), i = 0; !(nameSoFar = children.next()).done; )
|
|
205
|
+
nameSoFar = nameSoFar.value, type = nextNamePrefix + getElementKey(nameSoFar, i++), invokeCallback += mapIntoArray(
|
|
206
|
+
nameSoFar,
|
|
207
|
+
array,
|
|
208
|
+
escapedPrefix,
|
|
209
|
+
type,
|
|
210
|
+
callback
|
|
211
|
+
);
|
|
212
|
+
else if ("object" === type) {
|
|
213
|
+
if ("function" === typeof children.then)
|
|
214
|
+
return mapIntoArray(
|
|
215
|
+
resolveThenable(children),
|
|
216
|
+
array,
|
|
217
|
+
escapedPrefix,
|
|
218
|
+
nameSoFar,
|
|
219
|
+
callback
|
|
220
|
+
);
|
|
221
|
+
array = String(children);
|
|
222
|
+
throw Error(
|
|
223
|
+
"Objects are not valid as a React child (found: " + ("[object Object]" === array ? "object with keys {" + Object.keys(children).join(", ") + "}" : array) + "). If you meant to render a collection of children, use an array instead."
|
|
224
|
+
);
|
|
225
|
+
}
|
|
226
|
+
return invokeCallback;
|
|
227
|
+
}
|
|
228
|
+
function mapChildren(children, func, context) {
|
|
229
|
+
if (null == children) return children;
|
|
230
|
+
var result = [], count = 0;
|
|
231
|
+
mapIntoArray(children, result, "", "", function(child) {
|
|
232
|
+
return func.call(context, child, count++);
|
|
233
|
+
});
|
|
234
|
+
return result;
|
|
235
|
+
}
|
|
236
|
+
function lazyInitializer(payload) {
|
|
237
|
+
if (-1 === payload._status) {
|
|
238
|
+
var ctor = payload._result;
|
|
239
|
+
ctor = ctor();
|
|
240
|
+
ctor.then(
|
|
241
|
+
function(moduleObject) {
|
|
242
|
+
if (0 === payload._status || -1 === payload._status)
|
|
243
|
+
payload._status = 1, payload._result = moduleObject;
|
|
244
|
+
},
|
|
245
|
+
function(error) {
|
|
246
|
+
if (0 === payload._status || -1 === payload._status)
|
|
247
|
+
payload._status = 2, payload._result = error;
|
|
248
|
+
}
|
|
249
|
+
);
|
|
250
|
+
-1 === payload._status && (payload._status = 0, payload._result = ctor);
|
|
251
|
+
}
|
|
252
|
+
if (1 === payload._status) return payload._result.default;
|
|
253
|
+
throw payload._result;
|
|
254
|
+
}
|
|
255
|
+
var reportGlobalError = "function" === typeof reportError ? reportError : function(error) {
|
|
256
|
+
if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
|
|
257
|
+
var event = new window.ErrorEvent("error", {
|
|
258
|
+
bubbles: true,
|
|
259
|
+
cancelable: true,
|
|
260
|
+
message: "object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error),
|
|
261
|
+
error
|
|
262
|
+
});
|
|
263
|
+
if (!window.dispatchEvent(event)) return;
|
|
264
|
+
} else if ("object" === typeof process && "function" === typeof process.emit) {
|
|
265
|
+
process.emit("uncaughtException", error);
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
console.error(error);
|
|
269
|
+
};
|
|
270
|
+
var Children = {
|
|
271
|
+
map: mapChildren,
|
|
272
|
+
forEach: function(children, forEachFunc, forEachContext) {
|
|
273
|
+
mapChildren(
|
|
274
|
+
children,
|
|
275
|
+
function() {
|
|
276
|
+
forEachFunc.apply(this, arguments);
|
|
277
|
+
},
|
|
278
|
+
forEachContext
|
|
279
|
+
);
|
|
280
|
+
},
|
|
281
|
+
count: function(children) {
|
|
282
|
+
var n = 0;
|
|
283
|
+
mapChildren(children, function() {
|
|
284
|
+
n++;
|
|
285
|
+
});
|
|
286
|
+
return n;
|
|
287
|
+
},
|
|
288
|
+
toArray: function(children) {
|
|
289
|
+
return mapChildren(children, function(child) {
|
|
290
|
+
return child;
|
|
291
|
+
}) || [];
|
|
292
|
+
},
|
|
293
|
+
only: function(children) {
|
|
294
|
+
if (!isValidElement(children))
|
|
295
|
+
throw Error(
|
|
296
|
+
"React.Children.only expected to receive a single React element child."
|
|
297
|
+
);
|
|
298
|
+
return children;
|
|
299
|
+
}
|
|
300
|
+
};
|
|
301
|
+
exports.Activity = REACT_ACTIVITY_TYPE;
|
|
302
|
+
exports.Children = Children;
|
|
303
|
+
exports.Component = Component;
|
|
304
|
+
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
305
|
+
exports.Profiler = REACT_PROFILER_TYPE;
|
|
306
|
+
exports.PureComponent = PureComponent;
|
|
307
|
+
exports.StrictMode = REACT_STRICT_MODE_TYPE;
|
|
308
|
+
exports.Suspense = REACT_SUSPENSE_TYPE;
|
|
309
|
+
exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
|
|
310
|
+
exports.__COMPILER_RUNTIME = {
|
|
311
|
+
__proto__: null,
|
|
312
|
+
c: function(size) {
|
|
313
|
+
return ReactSharedInternals.H.useMemoCache(size);
|
|
314
|
+
}
|
|
315
|
+
};
|
|
316
|
+
exports.cache = function(fn) {
|
|
317
|
+
return function() {
|
|
318
|
+
return fn.apply(null, arguments);
|
|
319
|
+
};
|
|
320
|
+
};
|
|
321
|
+
exports.cacheSignal = function() {
|
|
322
|
+
return null;
|
|
323
|
+
};
|
|
324
|
+
exports.cloneElement = function(element, config, children) {
|
|
325
|
+
if (null === element || void 0 === element)
|
|
326
|
+
throw Error(
|
|
327
|
+
"The argument must be a React element, but you passed " + element + "."
|
|
328
|
+
);
|
|
329
|
+
var props = assign({}, element.props), key = element.key;
|
|
330
|
+
if (null != config)
|
|
331
|
+
for (propName in void 0 !== config.key && (key = "" + config.key), config)
|
|
332
|
+
!hasOwnProperty.call(config, propName) || "key" === propName || "__self" === propName || "__source" === propName || "ref" === propName && void 0 === config.ref || (props[propName] = config[propName]);
|
|
333
|
+
var propName = arguments.length - 2;
|
|
334
|
+
if (1 === propName) props.children = children;
|
|
335
|
+
else if (1 < propName) {
|
|
336
|
+
for (var childArray = Array(propName), i = 0; i < propName; i++)
|
|
337
|
+
childArray[i] = arguments[i + 2];
|
|
338
|
+
props.children = childArray;
|
|
339
|
+
}
|
|
340
|
+
return ReactElement(element.type, key, props);
|
|
341
|
+
};
|
|
342
|
+
exports.createContext = function(defaultValue) {
|
|
343
|
+
defaultValue = {
|
|
344
|
+
$$typeof: REACT_CONTEXT_TYPE,
|
|
345
|
+
_currentValue: defaultValue,
|
|
346
|
+
_currentValue2: defaultValue,
|
|
347
|
+
_threadCount: 0,
|
|
348
|
+
Provider: null,
|
|
349
|
+
Consumer: null
|
|
350
|
+
};
|
|
351
|
+
defaultValue.Provider = defaultValue;
|
|
352
|
+
defaultValue.Consumer = {
|
|
353
|
+
$$typeof: REACT_CONSUMER_TYPE,
|
|
354
|
+
_context: defaultValue
|
|
355
|
+
};
|
|
356
|
+
return defaultValue;
|
|
357
|
+
};
|
|
358
|
+
exports.createElement = function(type, config, children) {
|
|
359
|
+
var propName, props = {}, key = null;
|
|
360
|
+
if (null != config)
|
|
361
|
+
for (propName in void 0 !== config.key && (key = "" + config.key), config)
|
|
362
|
+
hasOwnProperty.call(config, propName) && "key" !== propName && "__self" !== propName && "__source" !== propName && (props[propName] = config[propName]);
|
|
363
|
+
var childrenLength = arguments.length - 2;
|
|
364
|
+
if (1 === childrenLength) props.children = children;
|
|
365
|
+
else if (1 < childrenLength) {
|
|
366
|
+
for (var childArray = Array(childrenLength), i = 0; i < childrenLength; i++)
|
|
367
|
+
childArray[i] = arguments[i + 2];
|
|
368
|
+
props.children = childArray;
|
|
369
|
+
}
|
|
370
|
+
if (type && type.defaultProps)
|
|
371
|
+
for (propName in childrenLength = type.defaultProps, childrenLength)
|
|
372
|
+
void 0 === props[propName] && (props[propName] = childrenLength[propName]);
|
|
373
|
+
return ReactElement(type, key, props);
|
|
374
|
+
};
|
|
375
|
+
exports.createRef = function() {
|
|
376
|
+
return { current: null };
|
|
377
|
+
};
|
|
378
|
+
exports.forwardRef = function(render) {
|
|
379
|
+
return { $$typeof: REACT_FORWARD_REF_TYPE, render };
|
|
380
|
+
};
|
|
381
|
+
exports.isValidElement = isValidElement;
|
|
382
|
+
exports.lazy = function(ctor) {
|
|
383
|
+
return {
|
|
384
|
+
$$typeof: REACT_LAZY_TYPE,
|
|
385
|
+
_payload: { _status: -1, _result: ctor },
|
|
386
|
+
_init: lazyInitializer
|
|
387
|
+
};
|
|
388
|
+
};
|
|
389
|
+
exports.memo = function(type, compare) {
|
|
390
|
+
return {
|
|
391
|
+
$$typeof: REACT_MEMO_TYPE,
|
|
392
|
+
type,
|
|
393
|
+
compare: void 0 === compare ? null : compare
|
|
394
|
+
};
|
|
395
|
+
};
|
|
396
|
+
exports.startTransition = function(scope) {
|
|
397
|
+
var prevTransition = ReactSharedInternals.T, currentTransition = {};
|
|
398
|
+
ReactSharedInternals.T = currentTransition;
|
|
399
|
+
try {
|
|
400
|
+
var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S;
|
|
401
|
+
null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
|
|
402
|
+
"object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && returnValue.then(noop, reportGlobalError);
|
|
403
|
+
} catch (error) {
|
|
404
|
+
reportGlobalError(error);
|
|
405
|
+
} finally {
|
|
406
|
+
null !== prevTransition && null !== currentTransition.types && (prevTransition.types = currentTransition.types), ReactSharedInternals.T = prevTransition;
|
|
407
|
+
}
|
|
408
|
+
};
|
|
409
|
+
exports.unstable_useCacheRefresh = function() {
|
|
410
|
+
return ReactSharedInternals.H.useCacheRefresh();
|
|
411
|
+
};
|
|
412
|
+
exports.use = function(usable) {
|
|
413
|
+
return ReactSharedInternals.H.use(usable);
|
|
414
|
+
};
|
|
415
|
+
exports.useActionState = function(action, initialState, permalink) {
|
|
416
|
+
return ReactSharedInternals.H.useActionState(action, initialState, permalink);
|
|
417
|
+
};
|
|
418
|
+
exports.useCallback = function(callback, deps) {
|
|
419
|
+
return ReactSharedInternals.H.useCallback(callback, deps);
|
|
420
|
+
};
|
|
421
|
+
exports.useContext = function(Context) {
|
|
422
|
+
return ReactSharedInternals.H.useContext(Context);
|
|
423
|
+
};
|
|
424
|
+
exports.useDebugValue = function() {
|
|
425
|
+
};
|
|
426
|
+
exports.useDeferredValue = function(value, initialValue) {
|
|
427
|
+
return ReactSharedInternals.H.useDeferredValue(value, initialValue);
|
|
428
|
+
};
|
|
429
|
+
exports.useEffect = function(create, deps) {
|
|
430
|
+
return ReactSharedInternals.H.useEffect(create, deps);
|
|
431
|
+
};
|
|
432
|
+
exports.useEffectEvent = function(callback) {
|
|
433
|
+
return ReactSharedInternals.H.useEffectEvent(callback);
|
|
434
|
+
};
|
|
435
|
+
exports.useId = function() {
|
|
436
|
+
return ReactSharedInternals.H.useId();
|
|
437
|
+
};
|
|
438
|
+
exports.useImperativeHandle = function(ref, create, deps) {
|
|
439
|
+
return ReactSharedInternals.H.useImperativeHandle(ref, create, deps);
|
|
440
|
+
};
|
|
441
|
+
exports.useInsertionEffect = function(create, deps) {
|
|
442
|
+
return ReactSharedInternals.H.useInsertionEffect(create, deps);
|
|
443
|
+
};
|
|
444
|
+
exports.useLayoutEffect = function(create, deps) {
|
|
445
|
+
return ReactSharedInternals.H.useLayoutEffect(create, deps);
|
|
446
|
+
};
|
|
447
|
+
exports.useMemo = function(create, deps) {
|
|
448
|
+
return ReactSharedInternals.H.useMemo(create, deps);
|
|
449
|
+
};
|
|
450
|
+
exports.useOptimistic = function(passthrough, reducer) {
|
|
451
|
+
return ReactSharedInternals.H.useOptimistic(passthrough, reducer);
|
|
452
|
+
};
|
|
453
|
+
exports.useReducer = function(reducer, initialArg, init) {
|
|
454
|
+
return ReactSharedInternals.H.useReducer(reducer, initialArg, init);
|
|
455
|
+
};
|
|
456
|
+
exports.useRef = function(initialValue) {
|
|
457
|
+
return ReactSharedInternals.H.useRef(initialValue);
|
|
458
|
+
};
|
|
459
|
+
exports.useState = function(initialState) {
|
|
460
|
+
return ReactSharedInternals.H.useState(initialState);
|
|
461
|
+
};
|
|
462
|
+
exports.useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) {
|
|
463
|
+
return ReactSharedInternals.H.useSyncExternalStore(
|
|
464
|
+
subscribe,
|
|
465
|
+
getSnapshot,
|
|
466
|
+
getServerSnapshot
|
|
467
|
+
);
|
|
468
|
+
};
|
|
469
|
+
exports.useTransition = function() {
|
|
470
|
+
return ReactSharedInternals.H.useTransition();
|
|
471
|
+
};
|
|
472
|
+
exports.version = "19.2.4";
|
|
473
|
+
}
|
|
474
|
+
});
|
|
475
|
+
|
|
476
|
+
// ../../node_modules/.pnpm/react@19.2.4/node_modules/react/cjs/react.development.js
|
|
477
|
+
var require_react_development = __commonJS({
|
|
478
|
+
"../../node_modules/.pnpm/react@19.2.4/node_modules/react/cjs/react.development.js"(exports, module) {
|
|
479
|
+
"use strict";
|
|
480
|
+
"production" !== process.env.NODE_ENV && (function() {
|
|
481
|
+
function defineDeprecationWarning(methodName, info) {
|
|
482
|
+
Object.defineProperty(Component.prototype, methodName, {
|
|
483
|
+
get: function() {
|
|
484
|
+
console.warn(
|
|
485
|
+
"%s(...) is deprecated in plain JavaScript React classes. %s",
|
|
486
|
+
info[0],
|
|
487
|
+
info[1]
|
|
488
|
+
);
|
|
489
|
+
}
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
function getIteratorFn(maybeIterable) {
|
|
493
|
+
if (null === maybeIterable || "object" !== typeof maybeIterable)
|
|
494
|
+
return null;
|
|
495
|
+
maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
|
|
496
|
+
return "function" === typeof maybeIterable ? maybeIterable : null;
|
|
497
|
+
}
|
|
498
|
+
function warnNoop(publicInstance, callerName) {
|
|
499
|
+
publicInstance = (publicInstance = publicInstance.constructor) && (publicInstance.displayName || publicInstance.name) || "ReactClass";
|
|
500
|
+
var warningKey = publicInstance + "." + callerName;
|
|
501
|
+
didWarnStateUpdateForUnmountedComponent[warningKey] || (console.error(
|
|
502
|
+
"Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",
|
|
503
|
+
callerName,
|
|
504
|
+
publicInstance
|
|
505
|
+
), didWarnStateUpdateForUnmountedComponent[warningKey] = true);
|
|
506
|
+
}
|
|
507
|
+
function Component(props, context, updater) {
|
|
508
|
+
this.props = props;
|
|
509
|
+
this.context = context;
|
|
510
|
+
this.refs = emptyObject;
|
|
511
|
+
this.updater = updater || ReactNoopUpdateQueue;
|
|
512
|
+
}
|
|
513
|
+
function ComponentDummy() {
|
|
514
|
+
}
|
|
515
|
+
function PureComponent(props, context, updater) {
|
|
516
|
+
this.props = props;
|
|
517
|
+
this.context = context;
|
|
518
|
+
this.refs = emptyObject;
|
|
519
|
+
this.updater = updater || ReactNoopUpdateQueue;
|
|
520
|
+
}
|
|
521
|
+
function noop() {
|
|
522
|
+
}
|
|
523
|
+
function testStringCoercion(value) {
|
|
524
|
+
return "" + value;
|
|
525
|
+
}
|
|
526
|
+
function checkKeyStringCoercion(value) {
|
|
527
|
+
try {
|
|
528
|
+
testStringCoercion(value);
|
|
529
|
+
var JSCompiler_inline_result = false;
|
|
530
|
+
} catch (e) {
|
|
531
|
+
JSCompiler_inline_result = true;
|
|
532
|
+
}
|
|
533
|
+
if (JSCompiler_inline_result) {
|
|
534
|
+
JSCompiler_inline_result = console;
|
|
535
|
+
var JSCompiler_temp_const = JSCompiler_inline_result.error;
|
|
536
|
+
var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
|
|
537
|
+
JSCompiler_temp_const.call(
|
|
538
|
+
JSCompiler_inline_result,
|
|
539
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
540
|
+
JSCompiler_inline_result$jscomp$0
|
|
541
|
+
);
|
|
542
|
+
return testStringCoercion(value);
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
function getComponentNameFromType(type) {
|
|
546
|
+
if (null == type) return null;
|
|
547
|
+
if ("function" === typeof type)
|
|
548
|
+
return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
|
|
549
|
+
if ("string" === typeof type) return type;
|
|
550
|
+
switch (type) {
|
|
551
|
+
case REACT_FRAGMENT_TYPE:
|
|
552
|
+
return "Fragment";
|
|
553
|
+
case REACT_PROFILER_TYPE:
|
|
554
|
+
return "Profiler";
|
|
555
|
+
case REACT_STRICT_MODE_TYPE:
|
|
556
|
+
return "StrictMode";
|
|
557
|
+
case REACT_SUSPENSE_TYPE:
|
|
558
|
+
return "Suspense";
|
|
559
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
560
|
+
return "SuspenseList";
|
|
561
|
+
case REACT_ACTIVITY_TYPE:
|
|
562
|
+
return "Activity";
|
|
563
|
+
}
|
|
564
|
+
if ("object" === typeof type)
|
|
565
|
+
switch ("number" === typeof type.tag && console.error(
|
|
566
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
567
|
+
), type.$$typeof) {
|
|
568
|
+
case REACT_PORTAL_TYPE:
|
|
569
|
+
return "Portal";
|
|
570
|
+
case REACT_CONTEXT_TYPE:
|
|
571
|
+
return type.displayName || "Context";
|
|
572
|
+
case REACT_CONSUMER_TYPE:
|
|
573
|
+
return (type._context.displayName || "Context") + ".Consumer";
|
|
574
|
+
case REACT_FORWARD_REF_TYPE:
|
|
575
|
+
var innerType = type.render;
|
|
576
|
+
type = type.displayName;
|
|
577
|
+
type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
|
|
578
|
+
return type;
|
|
579
|
+
case REACT_MEMO_TYPE:
|
|
580
|
+
return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
|
|
581
|
+
case REACT_LAZY_TYPE:
|
|
582
|
+
innerType = type._payload;
|
|
583
|
+
type = type._init;
|
|
584
|
+
try {
|
|
585
|
+
return getComponentNameFromType(type(innerType));
|
|
586
|
+
} catch (x) {
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
return null;
|
|
590
|
+
}
|
|
591
|
+
function getTaskName(type) {
|
|
592
|
+
if (type === REACT_FRAGMENT_TYPE) return "<>";
|
|
593
|
+
if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE)
|
|
594
|
+
return "<...>";
|
|
595
|
+
try {
|
|
596
|
+
var name = getComponentNameFromType(type);
|
|
597
|
+
return name ? "<" + name + ">" : "<...>";
|
|
598
|
+
} catch (x) {
|
|
599
|
+
return "<...>";
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
function getOwner() {
|
|
603
|
+
var dispatcher = ReactSharedInternals.A;
|
|
604
|
+
return null === dispatcher ? null : dispatcher.getOwner();
|
|
605
|
+
}
|
|
606
|
+
function UnknownOwner() {
|
|
607
|
+
return Error("react-stack-top-frame");
|
|
608
|
+
}
|
|
609
|
+
function hasValidKey(config) {
|
|
610
|
+
if (hasOwnProperty.call(config, "key")) {
|
|
611
|
+
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
|
612
|
+
if (getter && getter.isReactWarning) return false;
|
|
613
|
+
}
|
|
614
|
+
return void 0 !== config.key;
|
|
615
|
+
}
|
|
616
|
+
function defineKeyPropWarningGetter(props, displayName) {
|
|
617
|
+
function warnAboutAccessingKey() {
|
|
618
|
+
specialPropKeyWarningShown || (specialPropKeyWarningShown = true, console.error(
|
|
619
|
+
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
620
|
+
displayName
|
|
621
|
+
));
|
|
622
|
+
}
|
|
623
|
+
warnAboutAccessingKey.isReactWarning = true;
|
|
624
|
+
Object.defineProperty(props, "key", {
|
|
625
|
+
get: warnAboutAccessingKey,
|
|
626
|
+
configurable: true
|
|
627
|
+
});
|
|
628
|
+
}
|
|
629
|
+
function elementRefGetterWithDeprecationWarning() {
|
|
630
|
+
var componentName = getComponentNameFromType(this.type);
|
|
631
|
+
didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = true, console.error(
|
|
632
|
+
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
633
|
+
));
|
|
634
|
+
componentName = this.props.ref;
|
|
635
|
+
return void 0 !== componentName ? componentName : null;
|
|
636
|
+
}
|
|
637
|
+
function ReactElement(type, key, props, owner, debugStack, debugTask) {
|
|
638
|
+
var refProp = props.ref;
|
|
639
|
+
type = {
|
|
640
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
641
|
+
type,
|
|
642
|
+
key,
|
|
643
|
+
props,
|
|
644
|
+
_owner: owner
|
|
645
|
+
};
|
|
646
|
+
null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type, "ref", {
|
|
647
|
+
enumerable: false,
|
|
648
|
+
get: elementRefGetterWithDeprecationWarning
|
|
649
|
+
}) : Object.defineProperty(type, "ref", { enumerable: false, value: null });
|
|
650
|
+
type._store = {};
|
|
651
|
+
Object.defineProperty(type._store, "validated", {
|
|
652
|
+
configurable: false,
|
|
653
|
+
enumerable: false,
|
|
654
|
+
writable: true,
|
|
655
|
+
value: 0
|
|
656
|
+
});
|
|
657
|
+
Object.defineProperty(type, "_debugInfo", {
|
|
658
|
+
configurable: false,
|
|
659
|
+
enumerable: false,
|
|
660
|
+
writable: true,
|
|
661
|
+
value: null
|
|
662
|
+
});
|
|
663
|
+
Object.defineProperty(type, "_debugStack", {
|
|
664
|
+
configurable: false,
|
|
665
|
+
enumerable: false,
|
|
666
|
+
writable: true,
|
|
667
|
+
value: debugStack
|
|
668
|
+
});
|
|
669
|
+
Object.defineProperty(type, "_debugTask", {
|
|
670
|
+
configurable: false,
|
|
671
|
+
enumerable: false,
|
|
672
|
+
writable: true,
|
|
673
|
+
value: debugTask
|
|
674
|
+
});
|
|
675
|
+
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
|
|
676
|
+
return type;
|
|
677
|
+
}
|
|
678
|
+
function cloneAndReplaceKey(oldElement, newKey) {
|
|
679
|
+
newKey = ReactElement(
|
|
680
|
+
oldElement.type,
|
|
681
|
+
newKey,
|
|
682
|
+
oldElement.props,
|
|
683
|
+
oldElement._owner,
|
|
684
|
+
oldElement._debugStack,
|
|
685
|
+
oldElement._debugTask
|
|
686
|
+
);
|
|
687
|
+
oldElement._store && (newKey._store.validated = oldElement._store.validated);
|
|
688
|
+
return newKey;
|
|
689
|
+
}
|
|
690
|
+
function validateChildKeys(node) {
|
|
691
|
+
isValidElement(node) ? node._store && (node._store.validated = 1) : "object" === typeof node && null !== node && node.$$typeof === REACT_LAZY_TYPE && ("fulfilled" === node._payload.status ? isValidElement(node._payload.value) && node._payload.value._store && (node._payload.value._store.validated = 1) : node._store && (node._store.validated = 1));
|
|
692
|
+
}
|
|
693
|
+
function isValidElement(object) {
|
|
694
|
+
return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
695
|
+
}
|
|
696
|
+
function escape(key) {
|
|
697
|
+
var escaperLookup = { "=": "=0", ":": "=2" };
|
|
698
|
+
return "$" + key.replace(/[=:]/g, function(match) {
|
|
699
|
+
return escaperLookup[match];
|
|
700
|
+
});
|
|
701
|
+
}
|
|
702
|
+
function getElementKey(element, index) {
|
|
703
|
+
return "object" === typeof element && null !== element && null != element.key ? (checkKeyStringCoercion(element.key), escape("" + element.key)) : index.toString(36);
|
|
704
|
+
}
|
|
705
|
+
function resolveThenable(thenable) {
|
|
706
|
+
switch (thenable.status) {
|
|
707
|
+
case "fulfilled":
|
|
708
|
+
return thenable.value;
|
|
709
|
+
case "rejected":
|
|
710
|
+
throw thenable.reason;
|
|
711
|
+
default:
|
|
712
|
+
switch ("string" === typeof thenable.status ? thenable.then(noop, noop) : (thenable.status = "pending", thenable.then(
|
|
713
|
+
function(fulfilledValue) {
|
|
714
|
+
"pending" === thenable.status && (thenable.status = "fulfilled", thenable.value = fulfilledValue);
|
|
715
|
+
},
|
|
716
|
+
function(error) {
|
|
717
|
+
"pending" === thenable.status && (thenable.status = "rejected", thenable.reason = error);
|
|
718
|
+
}
|
|
719
|
+
)), thenable.status) {
|
|
720
|
+
case "fulfilled":
|
|
721
|
+
return thenable.value;
|
|
722
|
+
case "rejected":
|
|
723
|
+
throw thenable.reason;
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
throw thenable;
|
|
727
|
+
}
|
|
728
|
+
function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
|
|
729
|
+
var type = typeof children;
|
|
730
|
+
if ("undefined" === type || "boolean" === type) children = null;
|
|
731
|
+
var invokeCallback = false;
|
|
732
|
+
if (null === children) invokeCallback = true;
|
|
733
|
+
else
|
|
734
|
+
switch (type) {
|
|
735
|
+
case "bigint":
|
|
736
|
+
case "string":
|
|
737
|
+
case "number":
|
|
738
|
+
invokeCallback = true;
|
|
739
|
+
break;
|
|
740
|
+
case "object":
|
|
741
|
+
switch (children.$$typeof) {
|
|
742
|
+
case REACT_ELEMENT_TYPE:
|
|
743
|
+
case REACT_PORTAL_TYPE:
|
|
744
|
+
invokeCallback = true;
|
|
745
|
+
break;
|
|
746
|
+
case REACT_LAZY_TYPE:
|
|
747
|
+
return invokeCallback = children._init, mapIntoArray(
|
|
748
|
+
invokeCallback(children._payload),
|
|
749
|
+
array,
|
|
750
|
+
escapedPrefix,
|
|
751
|
+
nameSoFar,
|
|
752
|
+
callback
|
|
753
|
+
);
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
if (invokeCallback) {
|
|
757
|
+
invokeCallback = children;
|
|
758
|
+
callback = callback(invokeCallback);
|
|
759
|
+
var childKey = "" === nameSoFar ? "." + getElementKey(invokeCallback, 0) : nameSoFar;
|
|
760
|
+
isArrayImpl(callback) ? (escapedPrefix = "", null != childKey && (escapedPrefix = childKey.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), mapIntoArray(callback, array, escapedPrefix, "", function(c) {
|
|
761
|
+
return c;
|
|
762
|
+
})) : null != callback && (isValidElement(callback) && (null != callback.key && (invokeCallback && invokeCallback.key === callback.key || checkKeyStringCoercion(callback.key)), escapedPrefix = cloneAndReplaceKey(
|
|
763
|
+
callback,
|
|
764
|
+
escapedPrefix + (null == callback.key || invokeCallback && invokeCallback.key === callback.key ? "" : ("" + callback.key).replace(
|
|
765
|
+
userProvidedKeyEscapeRegex,
|
|
766
|
+
"$&/"
|
|
767
|
+
) + "/") + childKey
|
|
768
|
+
), "" !== nameSoFar && null != invokeCallback && isValidElement(invokeCallback) && null == invokeCallback.key && invokeCallback._store && !invokeCallback._store.validated && (escapedPrefix._store.validated = 2), callback = escapedPrefix), array.push(callback));
|
|
769
|
+
return 1;
|
|
770
|
+
}
|
|
771
|
+
invokeCallback = 0;
|
|
772
|
+
childKey = "" === nameSoFar ? "." : nameSoFar + ":";
|
|
773
|
+
if (isArrayImpl(children))
|
|
774
|
+
for (var i = 0; i < children.length; i++)
|
|
775
|
+
nameSoFar = children[i], type = childKey + getElementKey(nameSoFar, i), invokeCallback += mapIntoArray(
|
|
776
|
+
nameSoFar,
|
|
777
|
+
array,
|
|
778
|
+
escapedPrefix,
|
|
779
|
+
type,
|
|
780
|
+
callback
|
|
781
|
+
);
|
|
782
|
+
else if (i = getIteratorFn(children), "function" === typeof i)
|
|
783
|
+
for (i === children.entries && (didWarnAboutMaps || console.warn(
|
|
784
|
+
"Using Maps as children is not supported. Use an array of keyed ReactElements instead."
|
|
785
|
+
), didWarnAboutMaps = true), children = i.call(children), i = 0; !(nameSoFar = children.next()).done; )
|
|
786
|
+
nameSoFar = nameSoFar.value, type = childKey + getElementKey(nameSoFar, i++), invokeCallback += mapIntoArray(
|
|
787
|
+
nameSoFar,
|
|
788
|
+
array,
|
|
789
|
+
escapedPrefix,
|
|
790
|
+
type,
|
|
791
|
+
callback
|
|
792
|
+
);
|
|
793
|
+
else if ("object" === type) {
|
|
794
|
+
if ("function" === typeof children.then)
|
|
795
|
+
return mapIntoArray(
|
|
796
|
+
resolveThenable(children),
|
|
797
|
+
array,
|
|
798
|
+
escapedPrefix,
|
|
799
|
+
nameSoFar,
|
|
800
|
+
callback
|
|
801
|
+
);
|
|
802
|
+
array = String(children);
|
|
803
|
+
throw Error(
|
|
804
|
+
"Objects are not valid as a React child (found: " + ("[object Object]" === array ? "object with keys {" + Object.keys(children).join(", ") + "}" : array) + "). If you meant to render a collection of children, use an array instead."
|
|
805
|
+
);
|
|
806
|
+
}
|
|
807
|
+
return invokeCallback;
|
|
808
|
+
}
|
|
809
|
+
function mapChildren(children, func, context) {
|
|
810
|
+
if (null == children) return children;
|
|
811
|
+
var result = [], count = 0;
|
|
812
|
+
mapIntoArray(children, result, "", "", function(child) {
|
|
813
|
+
return func.call(context, child, count++);
|
|
814
|
+
});
|
|
815
|
+
return result;
|
|
816
|
+
}
|
|
817
|
+
function lazyInitializer(payload) {
|
|
818
|
+
if (-1 === payload._status) {
|
|
819
|
+
var ioInfo = payload._ioInfo;
|
|
820
|
+
null != ioInfo && (ioInfo.start = ioInfo.end = performance.now());
|
|
821
|
+
ioInfo = payload._result;
|
|
822
|
+
var thenable = ioInfo();
|
|
823
|
+
thenable.then(
|
|
824
|
+
function(moduleObject) {
|
|
825
|
+
if (0 === payload._status || -1 === payload._status) {
|
|
826
|
+
payload._status = 1;
|
|
827
|
+
payload._result = moduleObject;
|
|
828
|
+
var _ioInfo = payload._ioInfo;
|
|
829
|
+
null != _ioInfo && (_ioInfo.end = performance.now());
|
|
830
|
+
void 0 === thenable.status && (thenable.status = "fulfilled", thenable.value = moduleObject);
|
|
831
|
+
}
|
|
832
|
+
},
|
|
833
|
+
function(error) {
|
|
834
|
+
if (0 === payload._status || -1 === payload._status) {
|
|
835
|
+
payload._status = 2;
|
|
836
|
+
payload._result = error;
|
|
837
|
+
var _ioInfo2 = payload._ioInfo;
|
|
838
|
+
null != _ioInfo2 && (_ioInfo2.end = performance.now());
|
|
839
|
+
void 0 === thenable.status && (thenable.status = "rejected", thenable.reason = error);
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
);
|
|
843
|
+
ioInfo = payload._ioInfo;
|
|
844
|
+
if (null != ioInfo) {
|
|
845
|
+
ioInfo.value = thenable;
|
|
846
|
+
var displayName = thenable.displayName;
|
|
847
|
+
"string" === typeof displayName && (ioInfo.name = displayName);
|
|
848
|
+
}
|
|
849
|
+
-1 === payload._status && (payload._status = 0, payload._result = thenable);
|
|
850
|
+
}
|
|
851
|
+
if (1 === payload._status)
|
|
852
|
+
return ioInfo = payload._result, void 0 === ioInfo && console.error(
|
|
853
|
+
"lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?",
|
|
854
|
+
ioInfo
|
|
855
|
+
), "default" in ioInfo || console.error(
|
|
856
|
+
"lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",
|
|
857
|
+
ioInfo
|
|
858
|
+
), ioInfo.default;
|
|
859
|
+
throw payload._result;
|
|
860
|
+
}
|
|
861
|
+
function resolveDispatcher() {
|
|
862
|
+
var dispatcher = ReactSharedInternals.H;
|
|
863
|
+
null === dispatcher && console.error(
|
|
864
|
+
"Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."
|
|
865
|
+
);
|
|
866
|
+
return dispatcher;
|
|
867
|
+
}
|
|
868
|
+
function releaseAsyncTransition() {
|
|
869
|
+
ReactSharedInternals.asyncTransitions--;
|
|
870
|
+
}
|
|
871
|
+
function enqueueTask(task) {
|
|
872
|
+
if (null === enqueueTaskImpl)
|
|
873
|
+
try {
|
|
874
|
+
var requireString = ("require" + Math.random()).slice(0, 7);
|
|
875
|
+
enqueueTaskImpl = (module && module[requireString]).call(
|
|
876
|
+
module,
|
|
877
|
+
"timers"
|
|
878
|
+
).setImmediate;
|
|
879
|
+
} catch (_err) {
|
|
880
|
+
enqueueTaskImpl = function(callback) {
|
|
881
|
+
false === didWarnAboutMessageChannel && (didWarnAboutMessageChannel = true, "undefined" === typeof MessageChannel && console.error(
|
|
882
|
+
"This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."
|
|
883
|
+
));
|
|
884
|
+
var channel = new MessageChannel();
|
|
885
|
+
channel.port1.onmessage = callback;
|
|
886
|
+
channel.port2.postMessage(void 0);
|
|
887
|
+
};
|
|
888
|
+
}
|
|
889
|
+
return enqueueTaskImpl(task);
|
|
890
|
+
}
|
|
891
|
+
function aggregateErrors(errors) {
|
|
892
|
+
return 1 < errors.length && "function" === typeof AggregateError ? new AggregateError(errors) : errors[0];
|
|
893
|
+
}
|
|
894
|
+
function popActScope(prevActQueue, prevActScopeDepth) {
|
|
895
|
+
prevActScopeDepth !== actScopeDepth - 1 && console.error(
|
|
896
|
+
"You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "
|
|
897
|
+
);
|
|
898
|
+
actScopeDepth = prevActScopeDepth;
|
|
899
|
+
}
|
|
900
|
+
function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
|
|
901
|
+
var queue = ReactSharedInternals.actQueue;
|
|
902
|
+
if (null !== queue)
|
|
903
|
+
if (0 !== queue.length)
|
|
904
|
+
try {
|
|
905
|
+
flushActQueue(queue);
|
|
906
|
+
enqueueTask(function() {
|
|
907
|
+
return recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
|
908
|
+
});
|
|
909
|
+
return;
|
|
910
|
+
} catch (error) {
|
|
911
|
+
ReactSharedInternals.thrownErrors.push(error);
|
|
912
|
+
}
|
|
913
|
+
else ReactSharedInternals.actQueue = null;
|
|
914
|
+
0 < ReactSharedInternals.thrownErrors.length ? (queue = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, reject(queue)) : resolve(returnValue);
|
|
915
|
+
}
|
|
916
|
+
function flushActQueue(queue) {
|
|
917
|
+
if (!isFlushing) {
|
|
918
|
+
isFlushing = true;
|
|
919
|
+
var i = 0;
|
|
920
|
+
try {
|
|
921
|
+
for (; i < queue.length; i++) {
|
|
922
|
+
var callback = queue[i];
|
|
923
|
+
do {
|
|
924
|
+
ReactSharedInternals.didUsePromise = false;
|
|
925
|
+
var continuation = callback(false);
|
|
926
|
+
if (null !== continuation) {
|
|
927
|
+
if (ReactSharedInternals.didUsePromise) {
|
|
928
|
+
queue[i] = callback;
|
|
929
|
+
queue.splice(0, i);
|
|
930
|
+
return;
|
|
931
|
+
}
|
|
932
|
+
callback = continuation;
|
|
933
|
+
} else break;
|
|
934
|
+
} while (1);
|
|
935
|
+
}
|
|
936
|
+
queue.length = 0;
|
|
937
|
+
} catch (error) {
|
|
938
|
+
queue.splice(0, i + 1), ReactSharedInternals.thrownErrors.push(error);
|
|
939
|
+
} finally {
|
|
940
|
+
isFlushing = false;
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
}
|
|
944
|
+
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
945
|
+
var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo"), REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = /* @__PURE__ */ Symbol.for("react.activity"), MAYBE_ITERATOR_SYMBOL = Symbol.iterator, didWarnStateUpdateForUnmountedComponent = {}, ReactNoopUpdateQueue = {
|
|
946
|
+
isMounted: function() {
|
|
947
|
+
return false;
|
|
948
|
+
},
|
|
949
|
+
enqueueForceUpdate: function(publicInstance) {
|
|
950
|
+
warnNoop(publicInstance, "forceUpdate");
|
|
951
|
+
},
|
|
952
|
+
enqueueReplaceState: function(publicInstance) {
|
|
953
|
+
warnNoop(publicInstance, "replaceState");
|
|
954
|
+
},
|
|
955
|
+
enqueueSetState: function(publicInstance) {
|
|
956
|
+
warnNoop(publicInstance, "setState");
|
|
957
|
+
}
|
|
958
|
+
}, assign = Object.assign, emptyObject = {};
|
|
959
|
+
Object.freeze(emptyObject);
|
|
960
|
+
Component.prototype.isReactComponent = {};
|
|
961
|
+
Component.prototype.setState = function(partialState, callback) {
|
|
962
|
+
if ("object" !== typeof partialState && "function" !== typeof partialState && null != partialState)
|
|
963
|
+
throw Error(
|
|
964
|
+
"takes an object of state variables to update or a function which returns an object of state variables."
|
|
965
|
+
);
|
|
966
|
+
this.updater.enqueueSetState(this, partialState, callback, "setState");
|
|
967
|
+
};
|
|
968
|
+
Component.prototype.forceUpdate = function(callback) {
|
|
969
|
+
this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
|
|
970
|
+
};
|
|
971
|
+
var deprecatedAPIs = {
|
|
972
|
+
isMounted: [
|
|
973
|
+
"isMounted",
|
|
974
|
+
"Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."
|
|
975
|
+
],
|
|
976
|
+
replaceState: [
|
|
977
|
+
"replaceState",
|
|
978
|
+
"Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."
|
|
979
|
+
]
|
|
980
|
+
};
|
|
981
|
+
for (fnName in deprecatedAPIs)
|
|
982
|
+
deprecatedAPIs.hasOwnProperty(fnName) && defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
|
|
983
|
+
ComponentDummy.prototype = Component.prototype;
|
|
984
|
+
deprecatedAPIs = PureComponent.prototype = new ComponentDummy();
|
|
985
|
+
deprecatedAPIs.constructor = PureComponent;
|
|
986
|
+
assign(deprecatedAPIs, Component.prototype);
|
|
987
|
+
deprecatedAPIs.isPureReactComponent = true;
|
|
988
|
+
var isArrayImpl = Array.isArray, REACT_CLIENT_REFERENCE = /* @__PURE__ */ Symbol.for("react.client.reference"), ReactSharedInternals = {
|
|
989
|
+
H: null,
|
|
990
|
+
A: null,
|
|
991
|
+
T: null,
|
|
992
|
+
S: null,
|
|
993
|
+
actQueue: null,
|
|
994
|
+
asyncTransitions: 0,
|
|
995
|
+
isBatchingLegacy: false,
|
|
996
|
+
didScheduleLegacyUpdate: false,
|
|
997
|
+
didUsePromise: false,
|
|
998
|
+
thrownErrors: [],
|
|
999
|
+
getCurrentStack: null,
|
|
1000
|
+
recentlyCreatedOwnerStacks: 0
|
|
1001
|
+
}, hasOwnProperty = Object.prototype.hasOwnProperty, createTask = console.createTask ? console.createTask : function() {
|
|
1002
|
+
return null;
|
|
1003
|
+
};
|
|
1004
|
+
deprecatedAPIs = {
|
|
1005
|
+
react_stack_bottom_frame: function(callStackForError) {
|
|
1006
|
+
return callStackForError();
|
|
1007
|
+
}
|
|
1008
|
+
};
|
|
1009
|
+
var specialPropKeyWarningShown, didWarnAboutOldJSXRuntime;
|
|
1010
|
+
var didWarnAboutElementRef = {};
|
|
1011
|
+
var unknownOwnerDebugStack = deprecatedAPIs.react_stack_bottom_frame.bind(
|
|
1012
|
+
deprecatedAPIs,
|
|
1013
|
+
UnknownOwner
|
|
1014
|
+
)();
|
|
1015
|
+
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
|
1016
|
+
var didWarnAboutMaps = false, userProvidedKeyEscapeRegex = /\/+/g, reportGlobalError = "function" === typeof reportError ? reportError : function(error) {
|
|
1017
|
+
if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
|
|
1018
|
+
var event = new window.ErrorEvent("error", {
|
|
1019
|
+
bubbles: true,
|
|
1020
|
+
cancelable: true,
|
|
1021
|
+
message: "object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error),
|
|
1022
|
+
error
|
|
1023
|
+
});
|
|
1024
|
+
if (!window.dispatchEvent(event)) return;
|
|
1025
|
+
} else if ("object" === typeof process && "function" === typeof process.emit) {
|
|
1026
|
+
process.emit("uncaughtException", error);
|
|
1027
|
+
return;
|
|
1028
|
+
}
|
|
1029
|
+
console.error(error);
|
|
1030
|
+
}, didWarnAboutMessageChannel = false, enqueueTaskImpl = null, actScopeDepth = 0, didWarnNoAwaitAct = false, isFlushing = false, queueSeveralMicrotasks = "function" === typeof queueMicrotask ? function(callback) {
|
|
1031
|
+
queueMicrotask(function() {
|
|
1032
|
+
return queueMicrotask(callback);
|
|
1033
|
+
});
|
|
1034
|
+
} : enqueueTask;
|
|
1035
|
+
deprecatedAPIs = Object.freeze({
|
|
1036
|
+
__proto__: null,
|
|
1037
|
+
c: function(size) {
|
|
1038
|
+
return resolveDispatcher().useMemoCache(size);
|
|
1039
|
+
}
|
|
1040
|
+
});
|
|
1041
|
+
var fnName = {
|
|
1042
|
+
map: mapChildren,
|
|
1043
|
+
forEach: function(children, forEachFunc, forEachContext) {
|
|
1044
|
+
mapChildren(
|
|
1045
|
+
children,
|
|
1046
|
+
function() {
|
|
1047
|
+
forEachFunc.apply(this, arguments);
|
|
1048
|
+
},
|
|
1049
|
+
forEachContext
|
|
1050
|
+
);
|
|
1051
|
+
},
|
|
1052
|
+
count: function(children) {
|
|
1053
|
+
var n = 0;
|
|
1054
|
+
mapChildren(children, function() {
|
|
1055
|
+
n++;
|
|
1056
|
+
});
|
|
1057
|
+
return n;
|
|
1058
|
+
},
|
|
1059
|
+
toArray: function(children) {
|
|
1060
|
+
return mapChildren(children, function(child) {
|
|
1061
|
+
return child;
|
|
1062
|
+
}) || [];
|
|
1063
|
+
},
|
|
1064
|
+
only: function(children) {
|
|
1065
|
+
if (!isValidElement(children))
|
|
1066
|
+
throw Error(
|
|
1067
|
+
"React.Children.only expected to receive a single React element child."
|
|
1068
|
+
);
|
|
1069
|
+
return children;
|
|
1070
|
+
}
|
|
1071
|
+
};
|
|
1072
|
+
exports.Activity = REACT_ACTIVITY_TYPE;
|
|
1073
|
+
exports.Children = fnName;
|
|
1074
|
+
exports.Component = Component;
|
|
1075
|
+
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
1076
|
+
exports.Profiler = REACT_PROFILER_TYPE;
|
|
1077
|
+
exports.PureComponent = PureComponent;
|
|
1078
|
+
exports.StrictMode = REACT_STRICT_MODE_TYPE;
|
|
1079
|
+
exports.Suspense = REACT_SUSPENSE_TYPE;
|
|
1080
|
+
exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
|
|
1081
|
+
exports.__COMPILER_RUNTIME = deprecatedAPIs;
|
|
1082
|
+
exports.act = function(callback) {
|
|
1083
|
+
var prevActQueue = ReactSharedInternals.actQueue, prevActScopeDepth = actScopeDepth;
|
|
1084
|
+
actScopeDepth++;
|
|
1085
|
+
var queue = ReactSharedInternals.actQueue = null !== prevActQueue ? prevActQueue : [], didAwaitActCall = false;
|
|
1086
|
+
try {
|
|
1087
|
+
var result = callback();
|
|
1088
|
+
} catch (error) {
|
|
1089
|
+
ReactSharedInternals.thrownErrors.push(error);
|
|
1090
|
+
}
|
|
1091
|
+
if (0 < ReactSharedInternals.thrownErrors.length)
|
|
1092
|
+
throw popActScope(prevActQueue, prevActScopeDepth), callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
|
|
1093
|
+
if (null !== result && "object" === typeof result && "function" === typeof result.then) {
|
|
1094
|
+
var thenable = result;
|
|
1095
|
+
queueSeveralMicrotasks(function() {
|
|
1096
|
+
didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = true, console.error(
|
|
1097
|
+
"You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"
|
|
1098
|
+
));
|
|
1099
|
+
});
|
|
1100
|
+
return {
|
|
1101
|
+
then: function(resolve, reject) {
|
|
1102
|
+
didAwaitActCall = true;
|
|
1103
|
+
thenable.then(
|
|
1104
|
+
function(returnValue) {
|
|
1105
|
+
popActScope(prevActQueue, prevActScopeDepth);
|
|
1106
|
+
if (0 === prevActScopeDepth) {
|
|
1107
|
+
try {
|
|
1108
|
+
flushActQueue(queue), enqueueTask(function() {
|
|
1109
|
+
return recursivelyFlushAsyncActWork(
|
|
1110
|
+
returnValue,
|
|
1111
|
+
resolve,
|
|
1112
|
+
reject
|
|
1113
|
+
);
|
|
1114
|
+
});
|
|
1115
|
+
} catch (error$0) {
|
|
1116
|
+
ReactSharedInternals.thrownErrors.push(error$0);
|
|
1117
|
+
}
|
|
1118
|
+
if (0 < ReactSharedInternals.thrownErrors.length) {
|
|
1119
|
+
var _thrownError = aggregateErrors(
|
|
1120
|
+
ReactSharedInternals.thrownErrors
|
|
1121
|
+
);
|
|
1122
|
+
ReactSharedInternals.thrownErrors.length = 0;
|
|
1123
|
+
reject(_thrownError);
|
|
1124
|
+
}
|
|
1125
|
+
} else resolve(returnValue);
|
|
1126
|
+
},
|
|
1127
|
+
function(error) {
|
|
1128
|
+
popActScope(prevActQueue, prevActScopeDepth);
|
|
1129
|
+
0 < ReactSharedInternals.thrownErrors.length ? (error = aggregateErrors(
|
|
1130
|
+
ReactSharedInternals.thrownErrors
|
|
1131
|
+
), ReactSharedInternals.thrownErrors.length = 0, reject(error)) : reject(error);
|
|
1132
|
+
}
|
|
1133
|
+
);
|
|
1134
|
+
}
|
|
1135
|
+
};
|
|
1136
|
+
}
|
|
1137
|
+
var returnValue$jscomp$0 = result;
|
|
1138
|
+
popActScope(prevActQueue, prevActScopeDepth);
|
|
1139
|
+
0 === prevActScopeDepth && (flushActQueue(queue), 0 !== queue.length && queueSeveralMicrotasks(function() {
|
|
1140
|
+
didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = true, console.error(
|
|
1141
|
+
"A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"
|
|
1142
|
+
));
|
|
1143
|
+
}), ReactSharedInternals.actQueue = null);
|
|
1144
|
+
if (0 < ReactSharedInternals.thrownErrors.length)
|
|
1145
|
+
throw callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
|
|
1146
|
+
return {
|
|
1147
|
+
then: function(resolve, reject) {
|
|
1148
|
+
didAwaitActCall = true;
|
|
1149
|
+
0 === prevActScopeDepth ? (ReactSharedInternals.actQueue = queue, enqueueTask(function() {
|
|
1150
|
+
return recursivelyFlushAsyncActWork(
|
|
1151
|
+
returnValue$jscomp$0,
|
|
1152
|
+
resolve,
|
|
1153
|
+
reject
|
|
1154
|
+
);
|
|
1155
|
+
})) : resolve(returnValue$jscomp$0);
|
|
1156
|
+
}
|
|
1157
|
+
};
|
|
1158
|
+
};
|
|
1159
|
+
exports.cache = function(fn) {
|
|
1160
|
+
return function() {
|
|
1161
|
+
return fn.apply(null, arguments);
|
|
1162
|
+
};
|
|
1163
|
+
};
|
|
1164
|
+
exports.cacheSignal = function() {
|
|
1165
|
+
return null;
|
|
1166
|
+
};
|
|
1167
|
+
exports.captureOwnerStack = function() {
|
|
1168
|
+
var getCurrentStack = ReactSharedInternals.getCurrentStack;
|
|
1169
|
+
return null === getCurrentStack ? null : getCurrentStack();
|
|
1170
|
+
};
|
|
1171
|
+
exports.cloneElement = function(element, config, children) {
|
|
1172
|
+
if (null === element || void 0 === element)
|
|
1173
|
+
throw Error(
|
|
1174
|
+
"The argument must be a React element, but you passed " + element + "."
|
|
1175
|
+
);
|
|
1176
|
+
var props = assign({}, element.props), key = element.key, owner = element._owner;
|
|
1177
|
+
if (null != config) {
|
|
1178
|
+
var JSCompiler_inline_result;
|
|
1179
|
+
a: {
|
|
1180
|
+
if (hasOwnProperty.call(config, "ref") && (JSCompiler_inline_result = Object.getOwnPropertyDescriptor(
|
|
1181
|
+
config,
|
|
1182
|
+
"ref"
|
|
1183
|
+
).get) && JSCompiler_inline_result.isReactWarning) {
|
|
1184
|
+
JSCompiler_inline_result = false;
|
|
1185
|
+
break a;
|
|
1186
|
+
}
|
|
1187
|
+
JSCompiler_inline_result = void 0 !== config.ref;
|
|
1188
|
+
}
|
|
1189
|
+
JSCompiler_inline_result && (owner = getOwner());
|
|
1190
|
+
hasValidKey(config) && (checkKeyStringCoercion(config.key), key = "" + config.key);
|
|
1191
|
+
for (propName in config)
|
|
1192
|
+
!hasOwnProperty.call(config, propName) || "key" === propName || "__self" === propName || "__source" === propName || "ref" === propName && void 0 === config.ref || (props[propName] = config[propName]);
|
|
1193
|
+
}
|
|
1194
|
+
var propName = arguments.length - 2;
|
|
1195
|
+
if (1 === propName) props.children = children;
|
|
1196
|
+
else if (1 < propName) {
|
|
1197
|
+
JSCompiler_inline_result = Array(propName);
|
|
1198
|
+
for (var i = 0; i < propName; i++)
|
|
1199
|
+
JSCompiler_inline_result[i] = arguments[i + 2];
|
|
1200
|
+
props.children = JSCompiler_inline_result;
|
|
1201
|
+
}
|
|
1202
|
+
props = ReactElement(
|
|
1203
|
+
element.type,
|
|
1204
|
+
key,
|
|
1205
|
+
props,
|
|
1206
|
+
owner,
|
|
1207
|
+
element._debugStack,
|
|
1208
|
+
element._debugTask
|
|
1209
|
+
);
|
|
1210
|
+
for (key = 2; key < arguments.length; key++)
|
|
1211
|
+
validateChildKeys(arguments[key]);
|
|
1212
|
+
return props;
|
|
1213
|
+
};
|
|
1214
|
+
exports.createContext = function(defaultValue) {
|
|
1215
|
+
defaultValue = {
|
|
1216
|
+
$$typeof: REACT_CONTEXT_TYPE,
|
|
1217
|
+
_currentValue: defaultValue,
|
|
1218
|
+
_currentValue2: defaultValue,
|
|
1219
|
+
_threadCount: 0,
|
|
1220
|
+
Provider: null,
|
|
1221
|
+
Consumer: null
|
|
1222
|
+
};
|
|
1223
|
+
defaultValue.Provider = defaultValue;
|
|
1224
|
+
defaultValue.Consumer = {
|
|
1225
|
+
$$typeof: REACT_CONSUMER_TYPE,
|
|
1226
|
+
_context: defaultValue
|
|
1227
|
+
};
|
|
1228
|
+
defaultValue._currentRenderer = null;
|
|
1229
|
+
defaultValue._currentRenderer2 = null;
|
|
1230
|
+
return defaultValue;
|
|
1231
|
+
};
|
|
1232
|
+
exports.createElement = function(type, config, children) {
|
|
1233
|
+
for (var i = 2; i < arguments.length; i++)
|
|
1234
|
+
validateChildKeys(arguments[i]);
|
|
1235
|
+
i = {};
|
|
1236
|
+
var key = null;
|
|
1237
|
+
if (null != config)
|
|
1238
|
+
for (propName in didWarnAboutOldJSXRuntime || !("__self" in config) || "key" in config || (didWarnAboutOldJSXRuntime = true, console.warn(
|
|
1239
|
+
"Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform"
|
|
1240
|
+
)), hasValidKey(config) && (checkKeyStringCoercion(config.key), key = "" + config.key), config)
|
|
1241
|
+
hasOwnProperty.call(config, propName) && "key" !== propName && "__self" !== propName && "__source" !== propName && (i[propName] = config[propName]);
|
|
1242
|
+
var childrenLength = arguments.length - 2;
|
|
1243
|
+
if (1 === childrenLength) i.children = children;
|
|
1244
|
+
else if (1 < childrenLength) {
|
|
1245
|
+
for (var childArray = Array(childrenLength), _i = 0; _i < childrenLength; _i++)
|
|
1246
|
+
childArray[_i] = arguments[_i + 2];
|
|
1247
|
+
Object.freeze && Object.freeze(childArray);
|
|
1248
|
+
i.children = childArray;
|
|
1249
|
+
}
|
|
1250
|
+
if (type && type.defaultProps)
|
|
1251
|
+
for (propName in childrenLength = type.defaultProps, childrenLength)
|
|
1252
|
+
void 0 === i[propName] && (i[propName] = childrenLength[propName]);
|
|
1253
|
+
key && defineKeyPropWarningGetter(
|
|
1254
|
+
i,
|
|
1255
|
+
"function" === typeof type ? type.displayName || type.name || "Unknown" : type
|
|
1256
|
+
);
|
|
1257
|
+
var propName = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
|
1258
|
+
return ReactElement(
|
|
1259
|
+
type,
|
|
1260
|
+
key,
|
|
1261
|
+
i,
|
|
1262
|
+
getOwner(),
|
|
1263
|
+
propName ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
|
|
1264
|
+
propName ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
|
1265
|
+
);
|
|
1266
|
+
};
|
|
1267
|
+
exports.createRef = function() {
|
|
1268
|
+
var refObject = { current: null };
|
|
1269
|
+
Object.seal(refObject);
|
|
1270
|
+
return refObject;
|
|
1271
|
+
};
|
|
1272
|
+
exports.forwardRef = function(render) {
|
|
1273
|
+
null != render && render.$$typeof === REACT_MEMO_TYPE ? console.error(
|
|
1274
|
+
"forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."
|
|
1275
|
+
) : "function" !== typeof render ? console.error(
|
|
1276
|
+
"forwardRef requires a render function but was given %s.",
|
|
1277
|
+
null === render ? "null" : typeof render
|
|
1278
|
+
) : 0 !== render.length && 2 !== render.length && console.error(
|
|
1279
|
+
"forwardRef render functions accept exactly two parameters: props and ref. %s",
|
|
1280
|
+
1 === render.length ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined."
|
|
1281
|
+
);
|
|
1282
|
+
null != render && null != render.defaultProps && console.error(
|
|
1283
|
+
"forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?"
|
|
1284
|
+
);
|
|
1285
|
+
var elementType = { $$typeof: REACT_FORWARD_REF_TYPE, render }, ownName;
|
|
1286
|
+
Object.defineProperty(elementType, "displayName", {
|
|
1287
|
+
enumerable: false,
|
|
1288
|
+
configurable: true,
|
|
1289
|
+
get: function() {
|
|
1290
|
+
return ownName;
|
|
1291
|
+
},
|
|
1292
|
+
set: function(name) {
|
|
1293
|
+
ownName = name;
|
|
1294
|
+
render.name || render.displayName || (Object.defineProperty(render, "name", { value: name }), render.displayName = name);
|
|
1295
|
+
}
|
|
1296
|
+
});
|
|
1297
|
+
return elementType;
|
|
1298
|
+
};
|
|
1299
|
+
exports.isValidElement = isValidElement;
|
|
1300
|
+
exports.lazy = function(ctor) {
|
|
1301
|
+
ctor = { _status: -1, _result: ctor };
|
|
1302
|
+
var lazyType = {
|
|
1303
|
+
$$typeof: REACT_LAZY_TYPE,
|
|
1304
|
+
_payload: ctor,
|
|
1305
|
+
_init: lazyInitializer
|
|
1306
|
+
}, ioInfo = {
|
|
1307
|
+
name: "lazy",
|
|
1308
|
+
start: -1,
|
|
1309
|
+
end: -1,
|
|
1310
|
+
value: null,
|
|
1311
|
+
owner: null,
|
|
1312
|
+
debugStack: Error("react-stack-top-frame"),
|
|
1313
|
+
debugTask: console.createTask ? console.createTask("lazy()") : null
|
|
1314
|
+
};
|
|
1315
|
+
ctor._ioInfo = ioInfo;
|
|
1316
|
+
lazyType._debugInfo = [{ awaited: ioInfo }];
|
|
1317
|
+
return lazyType;
|
|
1318
|
+
};
|
|
1319
|
+
exports.memo = function(type, compare) {
|
|
1320
|
+
null == type && console.error(
|
|
1321
|
+
"memo: The first argument must be a component. Instead received: %s",
|
|
1322
|
+
null === type ? "null" : typeof type
|
|
1323
|
+
);
|
|
1324
|
+
compare = {
|
|
1325
|
+
$$typeof: REACT_MEMO_TYPE,
|
|
1326
|
+
type,
|
|
1327
|
+
compare: void 0 === compare ? null : compare
|
|
1328
|
+
};
|
|
1329
|
+
var ownName;
|
|
1330
|
+
Object.defineProperty(compare, "displayName", {
|
|
1331
|
+
enumerable: false,
|
|
1332
|
+
configurable: true,
|
|
1333
|
+
get: function() {
|
|
1334
|
+
return ownName;
|
|
1335
|
+
},
|
|
1336
|
+
set: function(name) {
|
|
1337
|
+
ownName = name;
|
|
1338
|
+
type.name || type.displayName || (Object.defineProperty(type, "name", { value: name }), type.displayName = name);
|
|
1339
|
+
}
|
|
1340
|
+
});
|
|
1341
|
+
return compare;
|
|
1342
|
+
};
|
|
1343
|
+
exports.startTransition = function(scope) {
|
|
1344
|
+
var prevTransition = ReactSharedInternals.T, currentTransition = {};
|
|
1345
|
+
currentTransition._updatedFibers = /* @__PURE__ */ new Set();
|
|
1346
|
+
ReactSharedInternals.T = currentTransition;
|
|
1347
|
+
try {
|
|
1348
|
+
var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S;
|
|
1349
|
+
null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
|
|
1350
|
+
"object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && (ReactSharedInternals.asyncTransitions++, returnValue.then(releaseAsyncTransition, releaseAsyncTransition), returnValue.then(noop, reportGlobalError));
|
|
1351
|
+
} catch (error) {
|
|
1352
|
+
reportGlobalError(error);
|
|
1353
|
+
} finally {
|
|
1354
|
+
null === prevTransition && currentTransition._updatedFibers && (scope = currentTransition._updatedFibers.size, currentTransition._updatedFibers.clear(), 10 < scope && console.warn(
|
|
1355
|
+
"Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."
|
|
1356
|
+
)), null !== prevTransition && null !== currentTransition.types && (null !== prevTransition.types && prevTransition.types !== currentTransition.types && console.error(
|
|
1357
|
+
"We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."
|
|
1358
|
+
), prevTransition.types = currentTransition.types), ReactSharedInternals.T = prevTransition;
|
|
1359
|
+
}
|
|
1360
|
+
};
|
|
1361
|
+
exports.unstable_useCacheRefresh = function() {
|
|
1362
|
+
return resolveDispatcher().useCacheRefresh();
|
|
1363
|
+
};
|
|
1364
|
+
exports.use = function(usable) {
|
|
1365
|
+
return resolveDispatcher().use(usable);
|
|
1366
|
+
};
|
|
1367
|
+
exports.useActionState = function(action, initialState, permalink) {
|
|
1368
|
+
return resolveDispatcher().useActionState(
|
|
1369
|
+
action,
|
|
1370
|
+
initialState,
|
|
1371
|
+
permalink
|
|
1372
|
+
);
|
|
1373
|
+
};
|
|
1374
|
+
exports.useCallback = function(callback, deps) {
|
|
1375
|
+
return resolveDispatcher().useCallback(callback, deps);
|
|
1376
|
+
};
|
|
1377
|
+
exports.useContext = function(Context) {
|
|
1378
|
+
var dispatcher = resolveDispatcher();
|
|
1379
|
+
Context.$$typeof === REACT_CONSUMER_TYPE && console.error(
|
|
1380
|
+
"Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"
|
|
1381
|
+
);
|
|
1382
|
+
return dispatcher.useContext(Context);
|
|
1383
|
+
};
|
|
1384
|
+
exports.useDebugValue = function(value, formatterFn) {
|
|
1385
|
+
return resolveDispatcher().useDebugValue(value, formatterFn);
|
|
1386
|
+
};
|
|
1387
|
+
exports.useDeferredValue = function(value, initialValue) {
|
|
1388
|
+
return resolveDispatcher().useDeferredValue(value, initialValue);
|
|
1389
|
+
};
|
|
1390
|
+
exports.useEffect = function(create, deps) {
|
|
1391
|
+
null == create && console.warn(
|
|
1392
|
+
"React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"
|
|
1393
|
+
);
|
|
1394
|
+
return resolveDispatcher().useEffect(create, deps);
|
|
1395
|
+
};
|
|
1396
|
+
exports.useEffectEvent = function(callback) {
|
|
1397
|
+
return resolveDispatcher().useEffectEvent(callback);
|
|
1398
|
+
};
|
|
1399
|
+
exports.useId = function() {
|
|
1400
|
+
return resolveDispatcher().useId();
|
|
1401
|
+
};
|
|
1402
|
+
exports.useImperativeHandle = function(ref, create, deps) {
|
|
1403
|
+
return resolveDispatcher().useImperativeHandle(ref, create, deps);
|
|
1404
|
+
};
|
|
1405
|
+
exports.useInsertionEffect = function(create, deps) {
|
|
1406
|
+
null == create && console.warn(
|
|
1407
|
+
"React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"
|
|
1408
|
+
);
|
|
1409
|
+
return resolveDispatcher().useInsertionEffect(create, deps);
|
|
1410
|
+
};
|
|
1411
|
+
exports.useLayoutEffect = function(create, deps) {
|
|
1412
|
+
null == create && console.warn(
|
|
1413
|
+
"React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"
|
|
1414
|
+
);
|
|
1415
|
+
return resolveDispatcher().useLayoutEffect(create, deps);
|
|
1416
|
+
};
|
|
1417
|
+
exports.useMemo = function(create, deps) {
|
|
1418
|
+
return resolveDispatcher().useMemo(create, deps);
|
|
1419
|
+
};
|
|
1420
|
+
exports.useOptimistic = function(passthrough, reducer) {
|
|
1421
|
+
return resolveDispatcher().useOptimistic(passthrough, reducer);
|
|
1422
|
+
};
|
|
1423
|
+
exports.useReducer = function(reducer, initialArg, init) {
|
|
1424
|
+
return resolveDispatcher().useReducer(reducer, initialArg, init);
|
|
1425
|
+
};
|
|
1426
|
+
exports.useRef = function(initialValue) {
|
|
1427
|
+
return resolveDispatcher().useRef(initialValue);
|
|
1428
|
+
};
|
|
1429
|
+
exports.useState = function(initialState) {
|
|
1430
|
+
return resolveDispatcher().useState(initialState);
|
|
1431
|
+
};
|
|
1432
|
+
exports.useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) {
|
|
1433
|
+
return resolveDispatcher().useSyncExternalStore(
|
|
1434
|
+
subscribe,
|
|
1435
|
+
getSnapshot,
|
|
1436
|
+
getServerSnapshot
|
|
1437
|
+
);
|
|
1438
|
+
};
|
|
1439
|
+
exports.useTransition = function() {
|
|
1440
|
+
return resolveDispatcher().useTransition();
|
|
1441
|
+
};
|
|
1442
|
+
exports.version = "19.2.4";
|
|
1443
|
+
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
1444
|
+
})();
|
|
1445
|
+
}
|
|
1446
|
+
});
|
|
1447
|
+
|
|
1448
|
+
// ../../node_modules/.pnpm/react@19.2.4/node_modules/react/index.js
|
|
1449
|
+
var require_react = __commonJS({
|
|
1450
|
+
"../../node_modules/.pnpm/react@19.2.4/node_modules/react/index.js"(exports, module) {
|
|
1451
|
+
"use strict";
|
|
1452
|
+
if (process.env.NODE_ENV === "production") {
|
|
1453
|
+
module.exports = require_react_production();
|
|
1454
|
+
} else {
|
|
1455
|
+
module.exports = require_react_development();
|
|
1456
|
+
}
|
|
1457
|
+
}
|
|
1458
|
+
});
|
|
1459
|
+
|
|
1460
|
+
// ../../node_modules/.pnpm/react@19.2.4/node_modules/react/cjs/react-jsx-runtime.production.js
|
|
1461
|
+
var require_react_jsx_runtime_production = __commonJS({
|
|
1462
|
+
"../../node_modules/.pnpm/react@19.2.4/node_modules/react/cjs/react-jsx-runtime.production.js"(exports) {
|
|
1463
|
+
"use strict";
|
|
1464
|
+
var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element");
|
|
1465
|
+
var REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
1466
|
+
function jsxProd(type, config, maybeKey) {
|
|
1467
|
+
var key = null;
|
|
1468
|
+
void 0 !== maybeKey && (key = "" + maybeKey);
|
|
1469
|
+
void 0 !== config.key && (key = "" + config.key);
|
|
1470
|
+
if ("key" in config) {
|
|
1471
|
+
maybeKey = {};
|
|
1472
|
+
for (var propName in config)
|
|
1473
|
+
"key" !== propName && (maybeKey[propName] = config[propName]);
|
|
1474
|
+
} else maybeKey = config;
|
|
1475
|
+
config = maybeKey.ref;
|
|
1476
|
+
return {
|
|
1477
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
1478
|
+
type,
|
|
1479
|
+
key,
|
|
1480
|
+
ref: void 0 !== config ? config : null,
|
|
1481
|
+
props: maybeKey
|
|
1482
|
+
};
|
|
1483
|
+
}
|
|
1484
|
+
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
1485
|
+
exports.jsx = jsxProd;
|
|
1486
|
+
exports.jsxs = jsxProd;
|
|
1487
|
+
}
|
|
1488
|
+
});
|
|
1489
|
+
|
|
1490
|
+
// ../../node_modules/.pnpm/react@19.2.4/node_modules/react/cjs/react-jsx-runtime.development.js
|
|
1491
|
+
var require_react_jsx_runtime_development = __commonJS({
|
|
1492
|
+
"../../node_modules/.pnpm/react@19.2.4/node_modules/react/cjs/react-jsx-runtime.development.js"(exports) {
|
|
1493
|
+
"use strict";
|
|
1494
|
+
"production" !== process.env.NODE_ENV && (function() {
|
|
1495
|
+
function getComponentNameFromType(type) {
|
|
1496
|
+
if (null == type) return null;
|
|
1497
|
+
if ("function" === typeof type)
|
|
1498
|
+
return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
|
|
1499
|
+
if ("string" === typeof type) return type;
|
|
1500
|
+
switch (type) {
|
|
1501
|
+
case REACT_FRAGMENT_TYPE:
|
|
1502
|
+
return "Fragment";
|
|
1503
|
+
case REACT_PROFILER_TYPE:
|
|
1504
|
+
return "Profiler";
|
|
1505
|
+
case REACT_STRICT_MODE_TYPE:
|
|
1506
|
+
return "StrictMode";
|
|
1507
|
+
case REACT_SUSPENSE_TYPE:
|
|
1508
|
+
return "Suspense";
|
|
1509
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
1510
|
+
return "SuspenseList";
|
|
1511
|
+
case REACT_ACTIVITY_TYPE:
|
|
1512
|
+
return "Activity";
|
|
1513
|
+
}
|
|
1514
|
+
if ("object" === typeof type)
|
|
1515
|
+
switch ("number" === typeof type.tag && console.error(
|
|
1516
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
1517
|
+
), type.$$typeof) {
|
|
1518
|
+
case REACT_PORTAL_TYPE:
|
|
1519
|
+
return "Portal";
|
|
1520
|
+
case REACT_CONTEXT_TYPE:
|
|
1521
|
+
return type.displayName || "Context";
|
|
1522
|
+
case REACT_CONSUMER_TYPE:
|
|
1523
|
+
return (type._context.displayName || "Context") + ".Consumer";
|
|
1524
|
+
case REACT_FORWARD_REF_TYPE:
|
|
1525
|
+
var innerType = type.render;
|
|
1526
|
+
type = type.displayName;
|
|
1527
|
+
type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
|
|
1528
|
+
return type;
|
|
1529
|
+
case REACT_MEMO_TYPE:
|
|
1530
|
+
return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
|
|
1531
|
+
case REACT_LAZY_TYPE:
|
|
1532
|
+
innerType = type._payload;
|
|
1533
|
+
type = type._init;
|
|
1534
|
+
try {
|
|
1535
|
+
return getComponentNameFromType(type(innerType));
|
|
1536
|
+
} catch (x) {
|
|
1537
|
+
}
|
|
1538
|
+
}
|
|
1539
|
+
return null;
|
|
1540
|
+
}
|
|
1541
|
+
function testStringCoercion(value) {
|
|
1542
|
+
return "" + value;
|
|
1543
|
+
}
|
|
1544
|
+
function checkKeyStringCoercion(value) {
|
|
1545
|
+
try {
|
|
1546
|
+
testStringCoercion(value);
|
|
1547
|
+
var JSCompiler_inline_result = false;
|
|
1548
|
+
} catch (e) {
|
|
1549
|
+
JSCompiler_inline_result = true;
|
|
1550
|
+
}
|
|
1551
|
+
if (JSCompiler_inline_result) {
|
|
1552
|
+
JSCompiler_inline_result = console;
|
|
1553
|
+
var JSCompiler_temp_const = JSCompiler_inline_result.error;
|
|
1554
|
+
var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
|
|
1555
|
+
JSCompiler_temp_const.call(
|
|
1556
|
+
JSCompiler_inline_result,
|
|
1557
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
1558
|
+
JSCompiler_inline_result$jscomp$0
|
|
1559
|
+
);
|
|
1560
|
+
return testStringCoercion(value);
|
|
1561
|
+
}
|
|
1562
|
+
}
|
|
1563
|
+
function getTaskName(type) {
|
|
1564
|
+
if (type === REACT_FRAGMENT_TYPE) return "<>";
|
|
1565
|
+
if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE)
|
|
1566
|
+
return "<...>";
|
|
1567
|
+
try {
|
|
1568
|
+
var name = getComponentNameFromType(type);
|
|
1569
|
+
return name ? "<" + name + ">" : "<...>";
|
|
1570
|
+
} catch (x) {
|
|
1571
|
+
return "<...>";
|
|
1572
|
+
}
|
|
1573
|
+
}
|
|
1574
|
+
function getOwner() {
|
|
1575
|
+
var dispatcher = ReactSharedInternals.A;
|
|
1576
|
+
return null === dispatcher ? null : dispatcher.getOwner();
|
|
1577
|
+
}
|
|
1578
|
+
function UnknownOwner() {
|
|
1579
|
+
return Error("react-stack-top-frame");
|
|
1580
|
+
}
|
|
1581
|
+
function hasValidKey(config) {
|
|
1582
|
+
if (hasOwnProperty.call(config, "key")) {
|
|
1583
|
+
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
|
1584
|
+
if (getter && getter.isReactWarning) return false;
|
|
1585
|
+
}
|
|
1586
|
+
return void 0 !== config.key;
|
|
1587
|
+
}
|
|
1588
|
+
function defineKeyPropWarningGetter(props, displayName) {
|
|
1589
|
+
function warnAboutAccessingKey() {
|
|
1590
|
+
specialPropKeyWarningShown || (specialPropKeyWarningShown = true, console.error(
|
|
1591
|
+
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
1592
|
+
displayName
|
|
1593
|
+
));
|
|
1594
|
+
}
|
|
1595
|
+
warnAboutAccessingKey.isReactWarning = true;
|
|
1596
|
+
Object.defineProperty(props, "key", {
|
|
1597
|
+
get: warnAboutAccessingKey,
|
|
1598
|
+
configurable: true
|
|
1599
|
+
});
|
|
1600
|
+
}
|
|
1601
|
+
function elementRefGetterWithDeprecationWarning() {
|
|
1602
|
+
var componentName = getComponentNameFromType(this.type);
|
|
1603
|
+
didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = true, console.error(
|
|
1604
|
+
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
1605
|
+
));
|
|
1606
|
+
componentName = this.props.ref;
|
|
1607
|
+
return void 0 !== componentName ? componentName : null;
|
|
1608
|
+
}
|
|
1609
|
+
function ReactElement(type, key, props, owner, debugStack, debugTask) {
|
|
1610
|
+
var refProp = props.ref;
|
|
1611
|
+
type = {
|
|
1612
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
1613
|
+
type,
|
|
1614
|
+
key,
|
|
1615
|
+
props,
|
|
1616
|
+
_owner: owner
|
|
1617
|
+
};
|
|
1618
|
+
null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type, "ref", {
|
|
1619
|
+
enumerable: false,
|
|
1620
|
+
get: elementRefGetterWithDeprecationWarning
|
|
1621
|
+
}) : Object.defineProperty(type, "ref", { enumerable: false, value: null });
|
|
1622
|
+
type._store = {};
|
|
1623
|
+
Object.defineProperty(type._store, "validated", {
|
|
1624
|
+
configurable: false,
|
|
1625
|
+
enumerable: false,
|
|
1626
|
+
writable: true,
|
|
1627
|
+
value: 0
|
|
1628
|
+
});
|
|
1629
|
+
Object.defineProperty(type, "_debugInfo", {
|
|
1630
|
+
configurable: false,
|
|
1631
|
+
enumerable: false,
|
|
1632
|
+
writable: true,
|
|
1633
|
+
value: null
|
|
1634
|
+
});
|
|
1635
|
+
Object.defineProperty(type, "_debugStack", {
|
|
1636
|
+
configurable: false,
|
|
1637
|
+
enumerable: false,
|
|
1638
|
+
writable: true,
|
|
1639
|
+
value: debugStack
|
|
1640
|
+
});
|
|
1641
|
+
Object.defineProperty(type, "_debugTask", {
|
|
1642
|
+
configurable: false,
|
|
1643
|
+
enumerable: false,
|
|
1644
|
+
writable: true,
|
|
1645
|
+
value: debugTask
|
|
1646
|
+
});
|
|
1647
|
+
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
|
|
1648
|
+
return type;
|
|
1649
|
+
}
|
|
1650
|
+
function jsxDEVImpl(type, config, maybeKey, isStaticChildren, debugStack, debugTask) {
|
|
1651
|
+
var children = config.children;
|
|
1652
|
+
if (void 0 !== children)
|
|
1653
|
+
if (isStaticChildren)
|
|
1654
|
+
if (isArrayImpl(children)) {
|
|
1655
|
+
for (isStaticChildren = 0; isStaticChildren < children.length; isStaticChildren++)
|
|
1656
|
+
validateChildKeys(children[isStaticChildren]);
|
|
1657
|
+
Object.freeze && Object.freeze(children);
|
|
1658
|
+
} else
|
|
1659
|
+
console.error(
|
|
1660
|
+
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
1661
|
+
);
|
|
1662
|
+
else validateChildKeys(children);
|
|
1663
|
+
if (hasOwnProperty.call(config, "key")) {
|
|
1664
|
+
children = getComponentNameFromType(type);
|
|
1665
|
+
var keys = Object.keys(config).filter(function(k) {
|
|
1666
|
+
return "key" !== k;
|
|
1667
|
+
});
|
|
1668
|
+
isStaticChildren = 0 < keys.length ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
1669
|
+
didWarnAboutKeySpread[children + isStaticChildren] || (keys = 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
1670
|
+
'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',
|
|
1671
|
+
isStaticChildren,
|
|
1672
|
+
children,
|
|
1673
|
+
keys,
|
|
1674
|
+
children
|
|
1675
|
+
), didWarnAboutKeySpread[children + isStaticChildren] = true);
|
|
1676
|
+
}
|
|
1677
|
+
children = null;
|
|
1678
|
+
void 0 !== maybeKey && (checkKeyStringCoercion(maybeKey), children = "" + maybeKey);
|
|
1679
|
+
hasValidKey(config) && (checkKeyStringCoercion(config.key), children = "" + config.key);
|
|
1680
|
+
if ("key" in config) {
|
|
1681
|
+
maybeKey = {};
|
|
1682
|
+
for (var propName in config)
|
|
1683
|
+
"key" !== propName && (maybeKey[propName] = config[propName]);
|
|
1684
|
+
} else maybeKey = config;
|
|
1685
|
+
children && defineKeyPropWarningGetter(
|
|
1686
|
+
maybeKey,
|
|
1687
|
+
"function" === typeof type ? type.displayName || type.name || "Unknown" : type
|
|
1688
|
+
);
|
|
1689
|
+
return ReactElement(
|
|
1690
|
+
type,
|
|
1691
|
+
children,
|
|
1692
|
+
maybeKey,
|
|
1693
|
+
getOwner(),
|
|
1694
|
+
debugStack,
|
|
1695
|
+
debugTask
|
|
1696
|
+
);
|
|
1697
|
+
}
|
|
1698
|
+
function validateChildKeys(node) {
|
|
1699
|
+
isValidElement(node) ? node._store && (node._store.validated = 1) : "object" === typeof node && null !== node && node.$$typeof === REACT_LAZY_TYPE && ("fulfilled" === node._payload.status ? isValidElement(node._payload.value) && node._payload.value._store && (node._payload.value._store.validated = 1) : node._store && (node._store.validated = 1));
|
|
1700
|
+
}
|
|
1701
|
+
function isValidElement(object) {
|
|
1702
|
+
return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
1703
|
+
}
|
|
1704
|
+
var React2 = require_react(), REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo"), REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = /* @__PURE__ */ Symbol.for("react.activity"), REACT_CLIENT_REFERENCE = /* @__PURE__ */ Symbol.for("react.client.reference"), ReactSharedInternals = React2.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, hasOwnProperty = Object.prototype.hasOwnProperty, isArrayImpl = Array.isArray, createTask = console.createTask ? console.createTask : function() {
|
|
1705
|
+
return null;
|
|
1706
|
+
};
|
|
1707
|
+
React2 = {
|
|
1708
|
+
react_stack_bottom_frame: function(callStackForError) {
|
|
1709
|
+
return callStackForError();
|
|
1710
|
+
}
|
|
1711
|
+
};
|
|
1712
|
+
var specialPropKeyWarningShown;
|
|
1713
|
+
var didWarnAboutElementRef = {};
|
|
1714
|
+
var unknownOwnerDebugStack = React2.react_stack_bottom_frame.bind(
|
|
1715
|
+
React2,
|
|
1716
|
+
UnknownOwner
|
|
1717
|
+
)();
|
|
1718
|
+
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
|
1719
|
+
var didWarnAboutKeySpread = {};
|
|
1720
|
+
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
1721
|
+
exports.jsx = function(type, config, maybeKey) {
|
|
1722
|
+
var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
|
1723
|
+
return jsxDEVImpl(
|
|
1724
|
+
type,
|
|
1725
|
+
config,
|
|
1726
|
+
maybeKey,
|
|
1727
|
+
false,
|
|
1728
|
+
trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
|
|
1729
|
+
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
|
1730
|
+
);
|
|
1731
|
+
};
|
|
1732
|
+
exports.jsxs = function(type, config, maybeKey) {
|
|
1733
|
+
var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
|
1734
|
+
return jsxDEVImpl(
|
|
1735
|
+
type,
|
|
1736
|
+
config,
|
|
1737
|
+
maybeKey,
|
|
1738
|
+
true,
|
|
1739
|
+
trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
|
|
1740
|
+
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
|
1741
|
+
);
|
|
1742
|
+
};
|
|
1743
|
+
})();
|
|
1744
|
+
}
|
|
1745
|
+
});
|
|
1746
|
+
|
|
1747
|
+
// ../../node_modules/.pnpm/react@19.2.4/node_modules/react/jsx-runtime.js
|
|
1748
|
+
var require_jsx_runtime = __commonJS({
|
|
1749
|
+
"../../node_modules/.pnpm/react@19.2.4/node_modules/react/jsx-runtime.js"(exports, module) {
|
|
1750
|
+
"use strict";
|
|
1751
|
+
if (process.env.NODE_ENV === "production") {
|
|
1752
|
+
module.exports = require_react_jsx_runtime_production();
|
|
1753
|
+
} else {
|
|
1754
|
+
module.exports = require_react_jsx_runtime_development();
|
|
1755
|
+
}
|
|
1756
|
+
}
|
|
1757
|
+
});
|
|
1758
|
+
|
|
1759
|
+
// src/index.ts
|
|
1760
|
+
var index_exports = {};
|
|
1761
|
+
__export(index_exports, {
|
|
1762
|
+
PixodeskSvgAnimator: () => PixodeskSvgAnimator_default
|
|
1763
|
+
});
|
|
1764
|
+
|
|
1765
|
+
// ../svg-animator-web/dist/index.js
|
|
1766
|
+
var __defProp2 = Object.defineProperty;
|
|
1767
|
+
var __defProps = Object.defineProperties;
|
|
1768
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
1769
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
1770
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
1771
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
1772
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1773
|
+
var __spreadValues = (a, b) => {
|
|
1774
|
+
for (var prop in b || (b = {}))
|
|
1775
|
+
if (__hasOwnProp2.call(b, prop))
|
|
1776
|
+
__defNormalProp(a, prop, b[prop]);
|
|
1777
|
+
if (__getOwnPropSymbols)
|
|
1778
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
1779
|
+
if (__propIsEnum.call(b, prop))
|
|
1780
|
+
__defNormalProp(a, prop, b[prop]);
|
|
1781
|
+
}
|
|
1782
|
+
return a;
|
|
1783
|
+
};
|
|
1784
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
1785
|
+
var __objRest = (source, exclude) => {
|
|
1786
|
+
var target = {};
|
|
1787
|
+
for (var prop in source)
|
|
1788
|
+
if (__hasOwnProp2.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1789
|
+
target[prop] = source[prop];
|
|
1790
|
+
if (source != null && __getOwnPropSymbols)
|
|
1791
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
1792
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
1793
|
+
target[prop] = source[prop];
|
|
1794
|
+
}
|
|
1795
|
+
return target;
|
|
1796
|
+
};
|
|
1797
|
+
function bezierToSvgPath(path) {
|
|
1798
|
+
var _a, _b, _c, _d;
|
|
1799
|
+
const v = path.v;
|
|
1800
|
+
const i = path.i;
|
|
1801
|
+
const o = path.o;
|
|
1802
|
+
const c = path.c;
|
|
1803
|
+
if (!v.length) return "";
|
|
1804
|
+
const d = [];
|
|
1805
|
+
const len = v.length;
|
|
1806
|
+
d.push("M" + v[0][0] + "," + v[0][1]);
|
|
1807
|
+
for (let idx = 1; idx < len; idx++) {
|
|
1808
|
+
const prevV = v[idx - 1];
|
|
1809
|
+
const prevO = (_a = o == null ? void 0 : o[idx - 1]) != null ? _a : prevV;
|
|
1810
|
+
const currI = (_b = i == null ? void 0 : i[idx]) != null ? _b : v[idx];
|
|
1811
|
+
const currV = v[idx];
|
|
1812
|
+
const isLine = prevO[0] === prevV[0] && prevO[1] === prevV[1] && (currI[0] === currV[0] && currI[1] === currV[1]);
|
|
1813
|
+
if (isLine) {
|
|
1814
|
+
d.push("L" + currV[0] + "," + currV[1]);
|
|
1815
|
+
} else {
|
|
1816
|
+
d.push("C" + prevO[0] + "," + prevO[1] + "," + currI[0] + "," + currI[1] + "," + currV[0] + "," + currV[1]);
|
|
1817
|
+
}
|
|
1818
|
+
}
|
|
1819
|
+
if (c && len > 0) {
|
|
1820
|
+
const lastV = v[len - 1];
|
|
1821
|
+
const lastO = (_c = o == null ? void 0 : o[len - 1]) != null ? _c : lastV;
|
|
1822
|
+
const firstI = (_d = i == null ? void 0 : i[0]) != null ? _d : v[0];
|
|
1823
|
+
const firstV = v[0];
|
|
1824
|
+
const isLine = lastO[0] === lastV[0] && lastO[1] === lastV[1] && (firstI[0] === firstV[0] && firstI[1] === firstV[1]);
|
|
1825
|
+
if (!isLine) {
|
|
1826
|
+
d.push("C" + lastO[0] + "," + lastO[1] + "," + firstI[0] + "," + firstI[1] + "," + firstV[0] + "," + firstV[1]);
|
|
1827
|
+
}
|
|
1828
|
+
d.push("z");
|
|
1829
|
+
}
|
|
1830
|
+
return d.join("");
|
|
1831
|
+
}
|
|
1832
|
+
function interpolateNum(a, b, t) {
|
|
1833
|
+
return a + (b - a) * t;
|
|
1834
|
+
}
|
|
1835
|
+
function interpolateVec(a, b, t) {
|
|
1836
|
+
const res = [];
|
|
1837
|
+
const count = Math.max(a.length, b.length);
|
|
1838
|
+
for (let i = 0; i < count; i++) {
|
|
1839
|
+
res[i] = interpolateNum(a[i] || 0, b[i] || 0, t);
|
|
1840
|
+
}
|
|
1841
|
+
return res;
|
|
1842
|
+
}
|
|
1843
|
+
function interpolateColor(a, b, t) {
|
|
1844
|
+
return [
|
|
1845
|
+
interpolateNum(a[0] || 0, b[0] || 0, t),
|
|
1846
|
+
interpolateNum(a[1] || 0, b[1] || 0, t),
|
|
1847
|
+
interpolateNum(a[2] || 0, b[2] || 0, t),
|
|
1848
|
+
interpolateNum(a[3] === void 0 ? 1 : a[3], b[3] === void 0 ? 1 : b[3], t)
|
|
1849
|
+
];
|
|
1850
|
+
}
|
|
1851
|
+
function interpolateBeziers(paths1, paths2, progress) {
|
|
1852
|
+
const count = Math.max(paths1.length, paths2.length);
|
|
1853
|
+
const res = [];
|
|
1854
|
+
for (let i = 0; i < count; i++) {
|
|
1855
|
+
res.push(interpolateBezier(paths1[i], paths2[i], progress));
|
|
1856
|
+
}
|
|
1857
|
+
return res;
|
|
1858
|
+
}
|
|
1859
|
+
function interpolateBezier(path1, path2, progress) {
|
|
1860
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
1861
|
+
if (!path1 || !path2) return path1 || path2 || { v: [] };
|
|
1862
|
+
const t = Math.min(Math.max(progress, 0), 1);
|
|
1863
|
+
const len = Math.min(path1.v.length, path2.v.length);
|
|
1864
|
+
const v = [];
|
|
1865
|
+
const i = [];
|
|
1866
|
+
const o = [];
|
|
1867
|
+
for (let idx = 0; idx < len; idx++) {
|
|
1868
|
+
const v1 = path1.v[idx];
|
|
1869
|
+
const v2 = path2.v[idx];
|
|
1870
|
+
v.push(interpolateVec(v1, v2, t));
|
|
1871
|
+
const i1 = (_b = (_a = path1.i) == null ? void 0 : _a[idx]) != null ? _b : v1;
|
|
1872
|
+
const i2 = (_d = (_c = path2.i) == null ? void 0 : _c[idx]) != null ? _d : v2;
|
|
1873
|
+
i.push(interpolateVec(i1, i2, t));
|
|
1874
|
+
const o1 = (_f = (_e = path1.o) == null ? void 0 : _e[idx]) != null ? _f : v1;
|
|
1875
|
+
const o2 = (_h = (_g = path2.o) == null ? void 0 : _g[idx]) != null ? _h : v2;
|
|
1876
|
+
o.push(interpolateVec(o1, o2, t));
|
|
1877
|
+
}
|
|
1878
|
+
return { v, i: i.length ? i : void 0, o: o.length ? o : void 0, c: (_i = path1.c) != null ? _i : path2.c };
|
|
1879
|
+
}
|
|
1880
|
+
function remap(value, inMin, inMax, outMin, outMax) {
|
|
1881
|
+
if (inMax === inMin) return outMin;
|
|
1882
|
+
const t = (value - inMin) / (inMax - inMin);
|
|
1883
|
+
return outMin + t * (outMax - outMin);
|
|
1884
|
+
}
|
|
1885
|
+
function cubicBezier(easing) {
|
|
1886
|
+
const [p1x, p1y, p2x, p2y] = easing;
|
|
1887
|
+
const cx = 3 * p1x;
|
|
1888
|
+
const bx = 3 * (p2x - p1x) - cx;
|
|
1889
|
+
const ax = 1 - cx - bx;
|
|
1890
|
+
const cy = 3 * p1y;
|
|
1891
|
+
const by = 3 * (p2y - p1y) - cy;
|
|
1892
|
+
const ay = 1 - cy - by;
|
|
1893
|
+
function sampleCurveX(t) {
|
|
1894
|
+
return ((ax * t + bx) * t + cx) * t;
|
|
1895
|
+
}
|
|
1896
|
+
function sampleCurveY(t) {
|
|
1897
|
+
return ((ay * t + by) * t + cy) * t;
|
|
1898
|
+
}
|
|
1899
|
+
function sampleCurveDerivativeX(t) {
|
|
1900
|
+
return (3 * ax * t + 2 * bx) * t + cx;
|
|
1901
|
+
}
|
|
1902
|
+
function solveCurveX(x) {
|
|
1903
|
+
if (x <= 0) return 0;
|
|
1904
|
+
if (x >= 1) return 1;
|
|
1905
|
+
let t2 = x;
|
|
1906
|
+
let t0 = 0;
|
|
1907
|
+
let t1 = 1;
|
|
1908
|
+
for (let i = 0; i < 8; i++) {
|
|
1909
|
+
const x2 = sampleCurveX(t2) - x;
|
|
1910
|
+
if (Math.abs(x2) < 1e-6) return t2;
|
|
1911
|
+
const d2 = sampleCurveDerivativeX(t2);
|
|
1912
|
+
if (Math.abs(d2) < 1e-6) break;
|
|
1913
|
+
t2 -= x2 / d2;
|
|
1914
|
+
}
|
|
1915
|
+
t2 = x;
|
|
1916
|
+
while (t0 < t1) {
|
|
1917
|
+
const x2 = sampleCurveX(t2);
|
|
1918
|
+
if (Math.abs(x2 - x) < 1e-6) return t2;
|
|
1919
|
+
if (x > x2) t0 = t2;
|
|
1920
|
+
else t1 = t2;
|
|
1921
|
+
t2 = (t1 + t0) / 2;
|
|
1922
|
+
}
|
|
1923
|
+
return t2;
|
|
1924
|
+
}
|
|
1925
|
+
return function(x) {
|
|
1926
|
+
return sampleCurveY(solveCurveX(x));
|
|
1927
|
+
};
|
|
1928
|
+
}
|
|
1929
|
+
function toRGBA(color) {
|
|
1930
|
+
const r = Math.round(color[0] * 255);
|
|
1931
|
+
const g = Math.round(color[1] * 255);
|
|
1932
|
+
const b = Math.round(color[2] * 255);
|
|
1933
|
+
return color.length === 4 ? "rgba(" + r + "," + g + "," + b + "," + color[3] + ")" : "rgb(" + r + "," + g + "," + b + ")";
|
|
1934
|
+
}
|
|
1935
|
+
function parseRgba(s) {
|
|
1936
|
+
var _a;
|
|
1937
|
+
const inner = (_a = s.match(/rgba?\((.*)\)/)) == null ? void 0 : _a[1];
|
|
1938
|
+
if (!inner) throw new Error("Invalid rgb/rgba format");
|
|
1939
|
+
const parts = inner.split(",").map((v) => +v.trim());
|
|
1940
|
+
return [parts[0] / 255, parts[1] / 255, parts[2] / 255, ...parts[3] !== void 0 ? [parts[3]] : []];
|
|
1941
|
+
}
|
|
1942
|
+
function parseHex(s) {
|
|
1943
|
+
const hex = s.slice(1);
|
|
1944
|
+
const isShort = hex.length <= 4;
|
|
1945
|
+
const r = isShort ? hex[0] + hex[0] : hex.slice(0, 2);
|
|
1946
|
+
const g = isShort ? hex[1] + hex[1] : hex.slice(2, 4);
|
|
1947
|
+
const b = isShort ? hex[2] + hex[2] : hex.slice(4, 6);
|
|
1948
|
+
const a = hex.length === 4 ? hex[3] + hex[3] : hex.length === 8 ? hex.slice(6, 8) : null;
|
|
1949
|
+
const result = [
|
|
1950
|
+
parseInt(r, 16) / 255,
|
|
1951
|
+
parseInt(g, 16) / 255,
|
|
1952
|
+
parseInt(b, 16) / 255
|
|
1953
|
+
];
|
|
1954
|
+
if (a !== null) {
|
|
1955
|
+
result.push(parseInt(a, 16) / 255);
|
|
1956
|
+
}
|
|
1957
|
+
return result;
|
|
1958
|
+
}
|
|
1959
|
+
function parseColor(s) {
|
|
1960
|
+
if (!s) return void 0;
|
|
1961
|
+
if (Array.isArray(s)) return s;
|
|
1962
|
+
if (typeof s !== "string") return void 0;
|
|
1963
|
+
if (s.startsWith("#")) {
|
|
1964
|
+
return parseHex(s);
|
|
1965
|
+
} else if (s.startsWith("rgb")) {
|
|
1966
|
+
return parseRgba(s);
|
|
1967
|
+
} else {
|
|
1968
|
+
console.warn("Unsupported color format: " + s);
|
|
1969
|
+
}
|
|
1970
|
+
return void 0;
|
|
1971
|
+
}
|
|
1972
|
+
var COLOUR_ATTR_NAMES = /* @__PURE__ */ new Set(["color", "fill", "flood-color", "lighting-color", "stop-color", "stroke"]);
|
|
1973
|
+
var TRANSFORM_FN_NAMES = /* @__PURE__ */ new Set(["translate", "rotate", "scale", "skew"]);
|
|
1974
|
+
var PCT_BASED_ATTR_NAMES = /* @__PURE__ */ new Set(["offset-distance", "offsetDistance"]);
|
|
1975
|
+
var STYLE_ATTR_NAMES = /* @__PURE__ */ new Set(["offset-distance", "offsetDistance"]);
|
|
1976
|
+
var DEFAULT_DURATION_MS = 1e3;
|
|
1977
|
+
function kebabToCamelCaseWord(kebab) {
|
|
1978
|
+
return kebab.includes("-") ? kebab.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase()) : kebab;
|
|
1979
|
+
}
|
|
1980
|
+
function isCamelCaseWord(word) {
|
|
1981
|
+
return !word.includes("-") && /[a-z][A-Z]/.test(word);
|
|
1982
|
+
}
|
|
1983
|
+
var SVG_CAMEL_CASE_ATTRS = /* @__PURE__ */ new Set([
|
|
1984
|
+
// Transform/positioning
|
|
1985
|
+
"viewBox",
|
|
1986
|
+
"preserveAspectRatio",
|
|
1987
|
+
// Gradient
|
|
1988
|
+
"gradientUnits",
|
|
1989
|
+
"gradientTransform",
|
|
1990
|
+
"spreadMethod",
|
|
1991
|
+
// Pattern
|
|
1992
|
+
"patternUnits",
|
|
1993
|
+
"patternContentUnits",
|
|
1994
|
+
"patternTransform",
|
|
1995
|
+
// Clipping/masking
|
|
1996
|
+
"clipPathUnits",
|
|
1997
|
+
"maskUnits",
|
|
1998
|
+
"maskContentUnits",
|
|
1999
|
+
// Text
|
|
2000
|
+
"textLength",
|
|
2001
|
+
"lengthAdjust",
|
|
2002
|
+
"startOffset",
|
|
2003
|
+
// Filter
|
|
2004
|
+
"filterUnits",
|
|
2005
|
+
"primitiveUnits",
|
|
2006
|
+
"stdDeviation",
|
|
2007
|
+
"baseFrequency",
|
|
2008
|
+
"numOctaves",
|
|
2009
|
+
"surfaceScale",
|
|
2010
|
+
"diffuseConstant",
|
|
2011
|
+
"specularConstant",
|
|
2012
|
+
"specularExponent",
|
|
2013
|
+
"kernelMatrix",
|
|
2014
|
+
"kernelUnitLength",
|
|
2015
|
+
"edgeMode",
|
|
2016
|
+
"preserveAlpha",
|
|
2017
|
+
"targetX",
|
|
2018
|
+
"targetY"
|
|
2019
|
+
// // Animation
|
|
2020
|
+
// 'attributeName',
|
|
2021
|
+
// 'attributeType',
|
|
2022
|
+
// 'calcMode',
|
|
2023
|
+
// 'keyTimes',
|
|
2024
|
+
// 'keySplines',
|
|
2025
|
+
// 'repeatCount',
|
|
2026
|
+
// 'repeatDur'
|
|
2027
|
+
]);
|
|
2028
|
+
function camelCaseToKebabWordIfNeeded(camel) {
|
|
2029
|
+
return SVG_CAMEL_CASE_ATTRS.has(camel) ? camel : camel.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
2030
|
+
}
|
|
2031
|
+
function clamp(value, min, max) {
|
|
2032
|
+
return Math.max(min, Math.min(value, max));
|
|
2033
|
+
}
|
|
2034
|
+
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
2035
|
+
var INTERNAL_ATTRS = /* @__PURE__ */ new Set(["type", "children", "animate", "style", "animator", "defs", "bindings"]);
|
|
2036
|
+
function createElement(tagName, props, style, children) {
|
|
2037
|
+
const element = document.createElementNS(SVG_NS, tagName);
|
|
2038
|
+
for (const propName in props) {
|
|
2039
|
+
element.setAttribute(camelCaseToKebabWordIfNeeded(propName), props[propName]);
|
|
2040
|
+
}
|
|
2041
|
+
if (style) {
|
|
2042
|
+
for (const styleProp in style) {
|
|
2043
|
+
element.style[styleProp] = String(style[styleProp]);
|
|
2044
|
+
}
|
|
2045
|
+
}
|
|
2046
|
+
if (children) {
|
|
2047
|
+
for (const child of children) {
|
|
2048
|
+
element.appendChild(child);
|
|
2049
|
+
}
|
|
2050
|
+
}
|
|
2051
|
+
return element;
|
|
2052
|
+
}
|
|
2053
|
+
function resolveStyle(style, defs) {
|
|
2054
|
+
var _a;
|
|
2055
|
+
if (!style) return void 0;
|
|
2056
|
+
if (typeof style === "string") {
|
|
2057
|
+
return (_a = defs == null ? void 0 : defs.styles) == null ? void 0 : _a[style];
|
|
2058
|
+
}
|
|
2059
|
+
return style;
|
|
2060
|
+
}
|
|
2061
|
+
function getNormalizedProps(props) {
|
|
2062
|
+
const propsCopy = {};
|
|
2063
|
+
for (const key of Object.keys(props)) {
|
|
2064
|
+
if (INTERNAL_ATTRS.has(key)) continue;
|
|
2065
|
+
let value = props[key];
|
|
2066
|
+
if (COLOUR_ATTR_NAMES.has(key) && Array.isArray(value)) {
|
|
2067
|
+
propsCopy[key] = toRGBA(value);
|
|
2068
|
+
} else if (TRANSFORM_FN_NAMES.has(key)) {
|
|
2069
|
+
if (Array.isArray(value)) {
|
|
2070
|
+
if (key === "translate") value = value.map((v) => v + "px");
|
|
2071
|
+
value = value.join(",");
|
|
2072
|
+
}
|
|
2073
|
+
if (key === "rotate") value = value + "deg";
|
|
2074
|
+
propsCopy["transform"] = key + "(" + value + ")";
|
|
2075
|
+
} else if (value !== void 0 && value !== null) {
|
|
2076
|
+
propsCopy[key] = String(value);
|
|
2077
|
+
}
|
|
2078
|
+
}
|
|
2079
|
+
return propsCopy;
|
|
2080
|
+
}
|
|
2081
|
+
function renderNode(node, defs) {
|
|
2082
|
+
if (!node) return null;
|
|
2083
|
+
const _a = node, { type, children, animate, style } = _a, props = __objRest(_a, ["type", "children", "animate", "style"]);
|
|
2084
|
+
const nodeDefs = node.defs || defs;
|
|
2085
|
+
const resolvedStyle = resolveStyle(style, nodeDefs);
|
|
2086
|
+
let childElements;
|
|
2087
|
+
if (children) {
|
|
2088
|
+
for (const ch of children) {
|
|
2089
|
+
const child = renderNode(ch, nodeDefs);
|
|
2090
|
+
if (child) {
|
|
2091
|
+
if (!childElements) childElements = [];
|
|
2092
|
+
childElements.push(child);
|
|
2093
|
+
}
|
|
2094
|
+
}
|
|
2095
|
+
}
|
|
2096
|
+
return createElement(
|
|
2097
|
+
type || "g",
|
|
2098
|
+
getNormalizedProps(props),
|
|
2099
|
+
resolvedStyle,
|
|
2100
|
+
childElements
|
|
2101
|
+
);
|
|
2102
|
+
}
|
|
2103
|
+
function setupAnimationTriggers(api, config) {
|
|
2104
|
+
const { startOn, outAction = "continue", scrollIntoViewThreshold = 0.5 } = config;
|
|
2105
|
+
const root = api.getRootElement();
|
|
2106
|
+
if (!root) {
|
|
2107
|
+
console.warn("setupAnimationTriggers: No root element found for animation.");
|
|
2108
|
+
return api;
|
|
2109
|
+
}
|
|
2110
|
+
const start = () => {
|
|
2111
|
+
api.play();
|
|
2112
|
+
};
|
|
2113
|
+
const handleEndAction = () => {
|
|
2114
|
+
switch (outAction) {
|
|
2115
|
+
case "pause":
|
|
2116
|
+
api.pause();
|
|
2117
|
+
break;
|
|
2118
|
+
case "reset":
|
|
2119
|
+
api.cancel();
|
|
2120
|
+
break;
|
|
2121
|
+
case "reverse":
|
|
2122
|
+
api.play();
|
|
2123
|
+
break;
|
|
2124
|
+
case "continue":
|
|
2125
|
+
default:
|
|
2126
|
+
break;
|
|
2127
|
+
}
|
|
2128
|
+
};
|
|
2129
|
+
switch (startOn) {
|
|
2130
|
+
case "load": {
|
|
2131
|
+
const startHandler = () => start();
|
|
2132
|
+
if (document.readyState === "complete") {
|
|
2133
|
+
startHandler();
|
|
2134
|
+
} else {
|
|
2135
|
+
window.addEventListener("load", startHandler, { once: true });
|
|
2136
|
+
}
|
|
2137
|
+
break;
|
|
2138
|
+
}
|
|
2139
|
+
case "mouseOver": {
|
|
2140
|
+
const mouseOverHandler = () => start();
|
|
2141
|
+
const mouseOutHandler = () => handleEndAction();
|
|
2142
|
+
root.addEventListener("mouseenter", mouseOverHandler);
|
|
2143
|
+
root.addEventListener("mouseleave", mouseOutHandler);
|
|
2144
|
+
break;
|
|
2145
|
+
}
|
|
2146
|
+
case "click": {
|
|
2147
|
+
const clickHandler = () => {
|
|
2148
|
+
if (api.isPlaying()) {
|
|
2149
|
+
handleEndAction();
|
|
2150
|
+
} else {
|
|
2151
|
+
start();
|
|
2152
|
+
}
|
|
2153
|
+
};
|
|
2154
|
+
root.addEventListener("click", clickHandler);
|
|
2155
|
+
break;
|
|
2156
|
+
}
|
|
2157
|
+
case "scrollIntoView": {
|
|
2158
|
+
const observer = new IntersectionObserver(
|
|
2159
|
+
(entries) => {
|
|
2160
|
+
entries.forEach((entry) => {
|
|
2161
|
+
if (entry.isIntersecting && entry.intersectionRatio >= scrollIntoViewThreshold) {
|
|
2162
|
+
start();
|
|
2163
|
+
} else {
|
|
2164
|
+
handleEndAction();
|
|
2165
|
+
}
|
|
2166
|
+
});
|
|
2167
|
+
},
|
|
2168
|
+
{ threshold: scrollIntoViewThreshold }
|
|
2169
|
+
);
|
|
2170
|
+
observer.observe(root);
|
|
2171
|
+
break;
|
|
2172
|
+
}
|
|
2173
|
+
case "programmatic":
|
|
2174
|
+
break;
|
|
2175
|
+
}
|
|
2176
|
+
return api;
|
|
2177
|
+
}
|
|
2178
|
+
var PX_ANIM_SRC_ATTR_NAME = "data-px-animation-src";
|
|
2179
|
+
var PX_ANIM_ATTR_NAME = "_px_animator";
|
|
2180
|
+
function isPxElementFileFormat(fileJson) {
|
|
2181
|
+
if (!(fileJson && typeof fileJson === "object" && !Array.isArray(fileJson))) {
|
|
2182
|
+
return false;
|
|
2183
|
+
}
|
|
2184
|
+
return fileJson["type"] === "svg" || fileJson["tagName"] === "svg";
|
|
2185
|
+
}
|
|
2186
|
+
function getAnimatorConfig(doc) {
|
|
2187
|
+
var _a, _b;
|
|
2188
|
+
return (doc == null ? void 0 : doc.animator) || ((_a = doc == null ? void 0 : doc.meta) == null ? void 0 : _a.animator) || (doc == null ? void 0 : doc.animation) || ((_b = doc == null ? void 0 : doc.meta) == null ? void 0 : _b.animation);
|
|
2189
|
+
}
|
|
2190
|
+
function getDefs(doc) {
|
|
2191
|
+
var _a;
|
|
2192
|
+
if (!doc) return void 0;
|
|
2193
|
+
return doc.defs || ((_a = doc.meta) == null ? void 0 : _a.defs);
|
|
2194
|
+
}
|
|
2195
|
+
function getBindings(doc) {
|
|
2196
|
+
var _a;
|
|
2197
|
+
if (!doc) return void 0;
|
|
2198
|
+
return doc.bindings || ((_a = doc.meta) == null ? void 0 : _a.bindings);
|
|
2199
|
+
}
|
|
2200
|
+
function parsePathCommands(d) {
|
|
2201
|
+
const tokens = d.split(/([MLCZmlcz]|[\s,]+)/).map((t) => t.trim()).filter((t) => t && t !== ",");
|
|
2202
|
+
const commands = [];
|
|
2203
|
+
let currentCommand = null;
|
|
2204
|
+
for (const token of tokens) {
|
|
2205
|
+
if (/[MLCZmlcz]/.test(token)) {
|
|
2206
|
+
currentCommand = { type: token, values: [] };
|
|
2207
|
+
commands.push(currentCommand);
|
|
2208
|
+
} else if (currentCommand) {
|
|
2209
|
+
const value = +token;
|
|
2210
|
+
currentCommand.values.push(Number.isNaN(value) ? 0 : value);
|
|
2211
|
+
}
|
|
2212
|
+
}
|
|
2213
|
+
return commands;
|
|
2214
|
+
}
|
|
2215
|
+
function parseSvgPathToBezier(d) {
|
|
2216
|
+
const res = [];
|
|
2217
|
+
let currentPath;
|
|
2218
|
+
const commands = parsePathCommands(d);
|
|
2219
|
+
for (const command of commands) {
|
|
2220
|
+
const type = command.type;
|
|
2221
|
+
const values = command.values;
|
|
2222
|
+
if (type === "M" || type === "m") {
|
|
2223
|
+
const x = values[0] || 0;
|
|
2224
|
+
const y = values[1] || 0;
|
|
2225
|
+
currentPath = {
|
|
2226
|
+
v: [[x, y]],
|
|
2227
|
+
i: [[x, y]],
|
|
2228
|
+
o: [[x, y]],
|
|
2229
|
+
c: false
|
|
2230
|
+
};
|
|
2231
|
+
res.push(currentPath);
|
|
2232
|
+
continue;
|
|
2233
|
+
}
|
|
2234
|
+
if (!currentPath) {
|
|
2235
|
+
currentPath = {
|
|
2236
|
+
v: [[0, 0]],
|
|
2237
|
+
i: [[0, 0]],
|
|
2238
|
+
o: [[0, 0]],
|
|
2239
|
+
c: false
|
|
2240
|
+
};
|
|
2241
|
+
res.push(currentPath);
|
|
2242
|
+
}
|
|
2243
|
+
if (type === "L") {
|
|
2244
|
+
const x = values[0] || 0;
|
|
2245
|
+
const y = values[1] || 0;
|
|
2246
|
+
currentPath.v.push([x, y]);
|
|
2247
|
+
currentPath.i.push([x, y]);
|
|
2248
|
+
currentPath.o.push([x, y]);
|
|
2249
|
+
} else if (type === "C") {
|
|
2250
|
+
const outX = values[0] || 0;
|
|
2251
|
+
const outY = values[1] || 0;
|
|
2252
|
+
const inX2 = values[2] || 0;
|
|
2253
|
+
const inY2 = values[3] || 0;
|
|
2254
|
+
const x2 = values[4] || 0;
|
|
2255
|
+
const y2 = values[5] || 0;
|
|
2256
|
+
currentPath.o[currentPath.o.length - 1] = [outX, outY];
|
|
2257
|
+
currentPath.v.push([x2, y2]);
|
|
2258
|
+
currentPath.i.push([inX2, inY2]);
|
|
2259
|
+
currentPath.o.push([x2, y2]);
|
|
2260
|
+
} else if (type === "Z" || type === "z") {
|
|
2261
|
+
currentPath.c = true;
|
|
2262
|
+
}
|
|
2263
|
+
}
|
|
2264
|
+
return res;
|
|
2265
|
+
}
|
|
2266
|
+
function extractPathData(str) {
|
|
2267
|
+
if (str.startsWith("path(") && str.endsWith(")")) {
|
|
2268
|
+
return str.slice(5, -1);
|
|
2269
|
+
}
|
|
2270
|
+
if (/^[MmZzLlHhVvCcSsQqTtAa]/.test(str)) {
|
|
2271
|
+
return str;
|
|
2272
|
+
}
|
|
2273
|
+
return void 0;
|
|
2274
|
+
}
|
|
2275
|
+
function isPathString(value) {
|
|
2276
|
+
return typeof value === "string" && extractPathData(value) !== void 0;
|
|
2277
|
+
}
|
|
2278
|
+
function normalizePathValue(value) {
|
|
2279
|
+
if (value && typeof value === "object" && "paths" in value) {
|
|
2280
|
+
const pathsArray = value.paths;
|
|
2281
|
+
if (Array.isArray(pathsArray) && pathsArray.length > 0) {
|
|
2282
|
+
if (isPathString(pathsArray[0])) {
|
|
2283
|
+
const paths = [];
|
|
2284
|
+
for (const pathStr of pathsArray) {
|
|
2285
|
+
const d = extractPathData(pathStr);
|
|
2286
|
+
if (d) {
|
|
2287
|
+
paths.push(...parseSvgPathToBezier(d));
|
|
2288
|
+
}
|
|
2289
|
+
}
|
|
2290
|
+
return { paths };
|
|
2291
|
+
}
|
|
2292
|
+
}
|
|
2293
|
+
return value;
|
|
2294
|
+
}
|
|
2295
|
+
if (Array.isArray(value)) {
|
|
2296
|
+
if (value.length > 0 && isPathString(value[0])) {
|
|
2297
|
+
const paths = [];
|
|
2298
|
+
for (const pathStr of value) {
|
|
2299
|
+
const d = extractPathData(pathStr);
|
|
2300
|
+
if (d) {
|
|
2301
|
+
paths.push(...parseSvgPathToBezier(d));
|
|
2302
|
+
}
|
|
2303
|
+
}
|
|
2304
|
+
return { paths };
|
|
2305
|
+
}
|
|
2306
|
+
return { paths: value };
|
|
2307
|
+
}
|
|
2308
|
+
if (isPathString(value)) {
|
|
2309
|
+
const d = extractPathData(value);
|
|
2310
|
+
return { paths: parseSvgPathToBezier(d) };
|
|
2311
|
+
}
|
|
2312
|
+
return value;
|
|
2313
|
+
}
|
|
2314
|
+
function resolveEasing(easing, defs) {
|
|
2315
|
+
var _a;
|
|
2316
|
+
if (!easing) return void 0;
|
|
2317
|
+
if (Array.isArray(easing)) {
|
|
2318
|
+
return easing;
|
|
2319
|
+
}
|
|
2320
|
+
if ((_a = defs == null ? void 0 : defs.easings) == null ? void 0 : _a[easing]) {
|
|
2321
|
+
return defs.easings[easing];
|
|
2322
|
+
}
|
|
2323
|
+
console.warn("Unknown easing name: " + easing);
|
|
2324
|
+
return void 0;
|
|
2325
|
+
}
|
|
2326
|
+
function resolveAnimation(animRef, defs) {
|
|
2327
|
+
var _a;
|
|
2328
|
+
if (typeof animRef === "string") {
|
|
2329
|
+
const resolved = (_a = defs == null ? void 0 : defs.animations) == null ? void 0 : _a[animRef];
|
|
2330
|
+
if (!resolved) {
|
|
2331
|
+
console.warn("Unknown animation name: " + animRef);
|
|
2332
|
+
}
|
|
2333
|
+
return resolved;
|
|
2334
|
+
}
|
|
2335
|
+
return animRef;
|
|
2336
|
+
}
|
|
2337
|
+
function resolveElementAnimation(animate, defs) {
|
|
2338
|
+
if (!animate) return [];
|
|
2339
|
+
const results = [];
|
|
2340
|
+
if (typeof animate === "string") {
|
|
2341
|
+
const resolved = resolveAnimation(animate, defs);
|
|
2342
|
+
if (resolved) results.push(resolved);
|
|
2343
|
+
} else if (Array.isArray(animate)) {
|
|
2344
|
+
for (const item of animate) {
|
|
2345
|
+
const resolved = resolveAnimation(item, defs);
|
|
2346
|
+
if (resolved) results.push(resolved);
|
|
2347
|
+
}
|
|
2348
|
+
} else {
|
|
2349
|
+
results.push(animate);
|
|
2350
|
+
}
|
|
2351
|
+
return results;
|
|
2352
|
+
}
|
|
2353
|
+
function normalizeKeyframes(propName, propAnim, duration, defs) {
|
|
2354
|
+
var _a, _b, _c, _d, _e;
|
|
2355
|
+
const keyframes = propAnim.keyframes || propAnim.kfs || [];
|
|
2356
|
+
const normalized = [];
|
|
2357
|
+
for (const kf of keyframes) {
|
|
2358
|
+
const timePct = (_b = (_a = kf.time) != null ? _a : kf.t) != null ? _b : 0;
|
|
2359
|
+
let value = (_c = kf.value) != null ? _c : kf.v;
|
|
2360
|
+
const easing = (_d = kf.easing) != null ? _d : kf.e;
|
|
2361
|
+
if (propName === "d") {
|
|
2362
|
+
value = normalizePathValue(value);
|
|
2363
|
+
}
|
|
2364
|
+
if (COLOUR_ATTR_NAMES.has(propName)) {
|
|
2365
|
+
value = (_e = parseColor(value)) != null ? _e : value;
|
|
2366
|
+
}
|
|
2367
|
+
normalized.push({
|
|
2368
|
+
t: timePct,
|
|
2369
|
+
v: value,
|
|
2370
|
+
e: resolveEasing(easing, defs)
|
|
2371
|
+
});
|
|
2372
|
+
}
|
|
2373
|
+
normalized.sort((a, b) => {
|
|
2374
|
+
var _a2, _b2;
|
|
2375
|
+
return ((_a2 = a.t) != null ? _a2 : 0) - ((_b2 = b.t) != null ? _b2 : 0);
|
|
2376
|
+
});
|
|
2377
|
+
return normalized;
|
|
2378
|
+
}
|
|
2379
|
+
function mergeAnimationDefinitions(animations) {
|
|
2380
|
+
const merged = {};
|
|
2381
|
+
for (const anim of animations) {
|
|
2382
|
+
for (const [prop, propAnim] of Object.entries(anim)) {
|
|
2383
|
+
merged[prop] = propAnim;
|
|
2384
|
+
}
|
|
2385
|
+
}
|
|
2386
|
+
return merged;
|
|
2387
|
+
}
|
|
2388
|
+
var _elementIdCounter = 0;
|
|
2389
|
+
function generateElementId() {
|
|
2390
|
+
return "_px_el_" + ++_elementIdCounter;
|
|
2391
|
+
}
|
|
2392
|
+
function normalizeAnimationDefinition(animDef, duration, defs) {
|
|
2393
|
+
const normalized = {};
|
|
2394
|
+
for (const [propName, propAnim] of Object.entries(animDef)) {
|
|
2395
|
+
const normalizedKfs = normalizeKeyframes(propName, propAnim, duration, defs);
|
|
2396
|
+
if (normalizedKfs.length > 0) {
|
|
2397
|
+
normalized[propName] = { kfs: normalizedKfs };
|
|
2398
|
+
}
|
|
2399
|
+
}
|
|
2400
|
+
return normalized;
|
|
2401
|
+
}
|
|
2402
|
+
function getNormalisedBindings(doc) {
|
|
2403
|
+
const animatorConfig = getAnimatorConfig(doc) || {};
|
|
2404
|
+
const defs = getDefs(doc);
|
|
2405
|
+
const duration = animatorConfig.duration || 1e3;
|
|
2406
|
+
const bindings = [];
|
|
2407
|
+
const processAnimation = (id, animate) => {
|
|
2408
|
+
if (!animate) return null;
|
|
2409
|
+
const animDefs = resolveElementAnimation(animate, defs);
|
|
2410
|
+
if (animDefs.length === 0) return null;
|
|
2411
|
+
const merged = mergeAnimationDefinitions(animDefs);
|
|
2412
|
+
const normalizedAnim = normalizeAnimationDefinition(merged, duration, defs);
|
|
2413
|
+
if (Object.keys(normalizedAnim).length === 0) return null;
|
|
2414
|
+
return {
|
|
2415
|
+
id,
|
|
2416
|
+
animate: normalizedAnim
|
|
2417
|
+
};
|
|
2418
|
+
};
|
|
2419
|
+
const docBindings = getBindings(doc);
|
|
2420
|
+
if (docBindings) {
|
|
2421
|
+
for (const binding of docBindings) {
|
|
2422
|
+
const normalized = processAnimation(binding.id, binding.animate);
|
|
2423
|
+
if (normalized) bindings.push(normalized);
|
|
2424
|
+
}
|
|
2425
|
+
}
|
|
2426
|
+
const processNode = (node) => {
|
|
2427
|
+
if (node.animate) {
|
|
2428
|
+
const nodeId = node.id || generateElementId();
|
|
2429
|
+
node.id = nodeId;
|
|
2430
|
+
const normalized = processAnimation(nodeId, node.animate);
|
|
2431
|
+
if (normalized) bindings.push(normalized);
|
|
2432
|
+
}
|
|
2433
|
+
if (node.children) {
|
|
2434
|
+
for (let i = 0; i < node.children.length; i++) {
|
|
2435
|
+
processNode(node.children[i]);
|
|
2436
|
+
}
|
|
2437
|
+
}
|
|
2438
|
+
};
|
|
2439
|
+
if (doc.children) {
|
|
2440
|
+
for (let i = 0; i < doc.children.length; i++) {
|
|
2441
|
+
processNode(doc.children[i]);
|
|
2442
|
+
}
|
|
2443
|
+
}
|
|
2444
|
+
return bindings;
|
|
2445
|
+
}
|
|
2446
|
+
function getKeyframesPair(keyframes, progress) {
|
|
2447
|
+
var _a, _b;
|
|
2448
|
+
let prevKf = keyframes[0];
|
|
2449
|
+
let nextKf = keyframes[keyframes.length - 1];
|
|
2450
|
+
for (let j = 0; j < keyframes.length - 1; j++) {
|
|
2451
|
+
const aOff = (_a = keyframes[j].t) != null ? _a : 0;
|
|
2452
|
+
const bOff = (_b = keyframes[j + 1].t) != null ? _b : 0;
|
|
2453
|
+
if (aOff <= progress && progress <= bOff) {
|
|
2454
|
+
prevKf = keyframes[j];
|
|
2455
|
+
nextKf = keyframes[j + 1];
|
|
2456
|
+
break;
|
|
2457
|
+
}
|
|
2458
|
+
}
|
|
2459
|
+
return { prevKf, nextKf };
|
|
2460
|
+
}
|
|
2461
|
+
function calcPropertyValue(propName, propAnim, progress) {
|
|
2462
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
2463
|
+
const keyframes = propAnim.kfs || propAnim.keyframes || [];
|
|
2464
|
+
if (keyframes.length === 0) return null;
|
|
2465
|
+
const { prevKf, nextKf } = getKeyframesPair(keyframes, progress);
|
|
2466
|
+
let localProgress = prevKf === nextKf ? 0 : remap(progress, (_a = prevKf.t) != null ? _a : 0, (_b = nextKf.t) != null ? _b : 0, 0, 1);
|
|
2467
|
+
localProgress = clamp(localProgress, 0, 1);
|
|
2468
|
+
const easing = (_c = prevKf.e) != null ? _c : prevKf.easing;
|
|
2469
|
+
if (easing && Array.isArray(easing)) {
|
|
2470
|
+
try {
|
|
2471
|
+
localProgress = cubicBezier(easing)(localProgress);
|
|
2472
|
+
} catch (e) {
|
|
2473
|
+
}
|
|
2474
|
+
}
|
|
2475
|
+
let cssAttrName = isCamelCaseWord(propName) ? camelCaseToKebabWordIfNeeded(propName) : propName;
|
|
2476
|
+
let cssValue = null;
|
|
2477
|
+
const prevV = (_d = prevKf == null ? void 0 : prevKf.v) != null ? _d : prevKf == null ? void 0 : prevKf.value;
|
|
2478
|
+
const nextV = (_e = nextKf == null ? void 0 : nextKf.v) != null ? _e : nextKf == null ? void 0 : nextKf.value;
|
|
2479
|
+
if (cssAttrName === "d") {
|
|
2480
|
+
const prevPaths = (_f = prevV == null ? void 0 : prevV.paths) != null ? _f : Array.isArray(prevV) ? prevV : [];
|
|
2481
|
+
const nextPaths = (_g = nextV == null ? void 0 : nextV.paths) != null ? _g : Array.isArray(nextV) ? nextV : [];
|
|
2482
|
+
cssValue = interpolateBeziers(
|
|
2483
|
+
prevPaths,
|
|
2484
|
+
nextPaths,
|
|
2485
|
+
localProgress
|
|
2486
|
+
).map((bz) => bezierToSvgPath(bz)).join("");
|
|
2487
|
+
} else if (COLOUR_ATTR_NAMES.has(cssAttrName)) {
|
|
2488
|
+
cssValue = toRGBA(interpolateColor(
|
|
2489
|
+
prevV || [0, 0, 0, 1],
|
|
2490
|
+
nextV || [0, 0, 0, 1],
|
|
2491
|
+
localProgress
|
|
2492
|
+
));
|
|
2493
|
+
cssAttrName = propName;
|
|
2494
|
+
} else if (cssAttrName === "stroke-dasharray") {
|
|
2495
|
+
cssValue = interpolateVec(
|
|
2496
|
+
prevV || [],
|
|
2497
|
+
nextV || [],
|
|
2498
|
+
localProgress
|
|
2499
|
+
).join(" ");
|
|
2500
|
+
cssAttrName = propName;
|
|
2501
|
+
} else if (cssAttrName === "translate") {
|
|
2502
|
+
const v = interpolateVec(
|
|
2503
|
+
prevV || [0, 0],
|
|
2504
|
+
nextV || [0, 0],
|
|
2505
|
+
localProgress
|
|
2506
|
+
);
|
|
2507
|
+
cssValue = "translate(" + v.join(",") + ")";
|
|
2508
|
+
cssAttrName = "transform";
|
|
2509
|
+
} else if (cssAttrName === "rotate") {
|
|
2510
|
+
const v = interpolateNum(
|
|
2511
|
+
+(prevV || 0),
|
|
2512
|
+
+(nextV || 0),
|
|
2513
|
+
localProgress
|
|
2514
|
+
);
|
|
2515
|
+
cssValue = "rotate(" + v + ")";
|
|
2516
|
+
cssAttrName = "transform";
|
|
2517
|
+
} else if (cssAttrName === "scale") {
|
|
2518
|
+
const v = interpolateVec(
|
|
2519
|
+
prevV || [1, 1],
|
|
2520
|
+
nextV || [1, 1],
|
|
2521
|
+
localProgress
|
|
2522
|
+
);
|
|
2523
|
+
cssValue = "scale(" + v.join(",") + ")";
|
|
2524
|
+
cssAttrName = "transform";
|
|
2525
|
+
} else {
|
|
2526
|
+
const num = interpolateNum(
|
|
2527
|
+
+(prevV || 0),
|
|
2528
|
+
+(nextV || 0),
|
|
2529
|
+
localProgress
|
|
2530
|
+
);
|
|
2531
|
+
cssValue = num;
|
|
2532
|
+
}
|
|
2533
|
+
if (PCT_BASED_ATTR_NAMES.has(cssAttrName) && typeof cssValue === "number") {
|
|
2534
|
+
cssValue = cssValue * 100 + "%";
|
|
2535
|
+
}
|
|
2536
|
+
return { k: cssAttrName, v: cssValue === null ? "" : "" + cssValue };
|
|
2537
|
+
}
|
|
2538
|
+
function calcAnimationValues(animDef, progress) {
|
|
2539
|
+
const result = {};
|
|
2540
|
+
for (const [propName, propAnim] of Object.entries(animDef)) {
|
|
2541
|
+
const computed = calcPropertyValue(propName, propAnim, progress);
|
|
2542
|
+
if (computed) {
|
|
2543
|
+
result[computed.k] = computed.v;
|
|
2544
|
+
}
|
|
2545
|
+
}
|
|
2546
|
+
return result;
|
|
2547
|
+
}
|
|
2548
|
+
function getSelector(id) {
|
|
2549
|
+
return "#" + id;
|
|
2550
|
+
}
|
|
2551
|
+
function createBasicFrameLoopAnimator(doc, adapter, callbacks) {
|
|
2552
|
+
const config = getAnimatorConfig(doc) || {};
|
|
2553
|
+
const bindings = getNormalisedBindings(doc);
|
|
2554
|
+
const _iterations = config.iterations;
|
|
2555
|
+
let iterations = 1;
|
|
2556
|
+
if (typeof _iterations === "number") iterations = _iterations || 1;
|
|
2557
|
+
if (_iterations === "infinite") iterations = Infinity;
|
|
2558
|
+
if (iterations < 1) iterations = 1;
|
|
2559
|
+
const duration = +(config.duration || DEFAULT_DURATION_MS);
|
|
2560
|
+
const totalDuration = duration && iterations ? duration * (iterations === Infinity ? Infinity : iterations) : duration ? (iterations != null ? iterations : 1) * duration : 0;
|
|
2561
|
+
const direction = config.direction || "normal";
|
|
2562
|
+
let timerId = null;
|
|
2563
|
+
let playing = false;
|
|
2564
|
+
let timeBeforeLastStartMs = config.delay || 0;
|
|
2565
|
+
let lastStartedTs = 0;
|
|
2566
|
+
let playbackRate = 1;
|
|
2567
|
+
let finishCalled = false;
|
|
2568
|
+
const frameRate = config.frameRate;
|
|
2569
|
+
const minFrameIntervalMs = frameRate && frameRate > 0 ? 1e3 / frameRate : 0;
|
|
2570
|
+
let lastRenderTs = 0;
|
|
2571
|
+
const getAnimCurrentTime = () => {
|
|
2572
|
+
const runningElapsed = lastStartedTs ? (Date.now() - lastStartedTs) * playbackRate : 0;
|
|
2573
|
+
let time = timeBeforeLastStartMs + runningElapsed;
|
|
2574
|
+
if (Number.isFinite(totalDuration) && time > totalDuration) time = totalDuration;
|
|
2575
|
+
if (time < 0) time = 0;
|
|
2576
|
+
return time;
|
|
2577
|
+
};
|
|
2578
|
+
function renderFrame(currentTimeMs) {
|
|
2579
|
+
function getEffectiveProgress() {
|
|
2580
|
+
const safeDuration = duration > 0 ? duration : 1;
|
|
2581
|
+
let rawProgress = 0;
|
|
2582
|
+
let iteration = 0;
|
|
2583
|
+
if (duration > 0) {
|
|
2584
|
+
currentTimeMs = clamp(currentTimeMs, 0, iterations * safeDuration);
|
|
2585
|
+
iteration = Math.max(0, Math.ceil(currentTimeMs / safeDuration) - 1);
|
|
2586
|
+
iteration = Math.min(iteration, iterations - 1);
|
|
2587
|
+
const iterationTime = currentTimeMs - iteration * safeDuration;
|
|
2588
|
+
rawProgress = clamp(iterationTime / safeDuration, 0, 1);
|
|
2589
|
+
} else {
|
|
2590
|
+
rawProgress = currentTimeMs;
|
|
2591
|
+
}
|
|
2592
|
+
let baseProgress = rawProgress;
|
|
2593
|
+
const dir = direction || "normal";
|
|
2594
|
+
let effectiveProgress2 = baseProgress;
|
|
2595
|
+
if (dir === "reverse") {
|
|
2596
|
+
effectiveProgress2 = 1 - baseProgress;
|
|
2597
|
+
} else if (dir === "alternate") {
|
|
2598
|
+
if (iteration % 2 === 1) effectiveProgress2 = 1 - baseProgress;
|
|
2599
|
+
} else if (dir === "alternate-reverse") {
|
|
2600
|
+
if (iteration % 2 === 0) effectiveProgress2 = 1 - baseProgress;
|
|
2601
|
+
}
|
|
2602
|
+
return effectiveProgress2;
|
|
2603
|
+
}
|
|
2604
|
+
let effectiveProgress = getEffectiveProgress();
|
|
2605
|
+
for (const binding of bindings || []) {
|
|
2606
|
+
const animDef = binding.animate;
|
|
2607
|
+
if (!animDef || typeof animDef !== "object" || Array.isArray(animDef)) {
|
|
2608
|
+
console.warn("Empty or unresolved binding", binding);
|
|
2609
|
+
continue;
|
|
2610
|
+
}
|
|
2611
|
+
const computedValues = calcAnimationValues(animDef, effectiveProgress * duration);
|
|
2612
|
+
for (const [attrName, value] of Object.entries(computedValues)) {
|
|
2613
|
+
adapter.setAttribute(binding.id, attrName, value);
|
|
2614
|
+
}
|
|
2615
|
+
}
|
|
2616
|
+
}
|
|
2617
|
+
const tick = () => {
|
|
2618
|
+
var _a;
|
|
2619
|
+
if (!adapter.isConnected()) {
|
|
2620
|
+
pauseAnim();
|
|
2621
|
+
return;
|
|
2622
|
+
}
|
|
2623
|
+
const currentTime = getAnimCurrentTime();
|
|
2624
|
+
if (minFrameIntervalMs > 0) {
|
|
2625
|
+
const now = Date.now();
|
|
2626
|
+
if (lastRenderTs && now - lastRenderTs < minFrameIntervalMs) {
|
|
2627
|
+
return;
|
|
2628
|
+
}
|
|
2629
|
+
lastRenderTs = now;
|
|
2630
|
+
}
|
|
2631
|
+
if (duration <= 0) {
|
|
2632
|
+
}
|
|
2633
|
+
if (totalDuration && Number.isFinite(totalDuration) && currentTime >= totalDuration) {
|
|
2634
|
+
renderFrame(totalDuration);
|
|
2635
|
+
if (!finishCalled) {
|
|
2636
|
+
finishCalled = true;
|
|
2637
|
+
(_a = callbacks == null ? void 0 : callbacks.onFinish) == null ? void 0 : _a.call(callbacks);
|
|
2638
|
+
}
|
|
2639
|
+
pauseAnim();
|
|
2640
|
+
return;
|
|
2641
|
+
}
|
|
2642
|
+
renderFrame(currentTime);
|
|
2643
|
+
};
|
|
2644
|
+
if (config.delay) {
|
|
2645
|
+
renderFrame(getAnimCurrentTime());
|
|
2646
|
+
}
|
|
2647
|
+
const _isPlaying = () => {
|
|
2648
|
+
if (!playing) return false;
|
|
2649
|
+
if (!adapter.isConnected()) {
|
|
2650
|
+
return false;
|
|
2651
|
+
}
|
|
2652
|
+
if (Number.isFinite(totalDuration) && getAnimCurrentTime() >= totalDuration) return false;
|
|
2653
|
+
return true;
|
|
2654
|
+
};
|
|
2655
|
+
const loopAnim = (isFirst) => {
|
|
2656
|
+
if (timerId !== null) {
|
|
2657
|
+
cancelAnimationFrame(timerId);
|
|
2658
|
+
timerId = null;
|
|
2659
|
+
}
|
|
2660
|
+
if (!(isFirst || _isPlaying())) {
|
|
2661
|
+
return;
|
|
2662
|
+
}
|
|
2663
|
+
timerId = requestAnimationFrame(() => {
|
|
2664
|
+
timerId = null;
|
|
2665
|
+
tick();
|
|
2666
|
+
loopAnim();
|
|
2667
|
+
});
|
|
2668
|
+
};
|
|
2669
|
+
const startAnim = () => {
|
|
2670
|
+
if (playing) return;
|
|
2671
|
+
playing = true;
|
|
2672
|
+
lastStartedTs = Date.now();
|
|
2673
|
+
loopAnim(true);
|
|
2674
|
+
};
|
|
2675
|
+
const pauseAnim = () => {
|
|
2676
|
+
if (!playing) return;
|
|
2677
|
+
timeBeforeLastStartMs = getAnimCurrentTime();
|
|
2678
|
+
lastStartedTs = 0;
|
|
2679
|
+
playing = false;
|
|
2680
|
+
if (timerId !== null) {
|
|
2681
|
+
cancelAnimationFrame(timerId);
|
|
2682
|
+
timerId = null;
|
|
2683
|
+
}
|
|
2684
|
+
renderFrame(timeBeforeLastStartMs);
|
|
2685
|
+
};
|
|
2686
|
+
const cancelAnim = () => {
|
|
2687
|
+
var _a;
|
|
2688
|
+
pauseAnim();
|
|
2689
|
+
timeBeforeLastStartMs = 0;
|
|
2690
|
+
lastStartedTs = 0;
|
|
2691
|
+
playing = false;
|
|
2692
|
+
finishCalled = false;
|
|
2693
|
+
renderFrame(timeBeforeLastStartMs);
|
|
2694
|
+
(_a = callbacks == null ? void 0 : callbacks.onCancel) == null ? void 0 : _a.call(callbacks);
|
|
2695
|
+
};
|
|
2696
|
+
const finishAnim = (callOnFinish = true) => {
|
|
2697
|
+
var _a;
|
|
2698
|
+
if (Number.isFinite(totalDuration)) {
|
|
2699
|
+
timeBeforeLastStartMs = totalDuration;
|
|
2700
|
+
} else {
|
|
2701
|
+
timeBeforeLastStartMs = getAnimCurrentTime();
|
|
2702
|
+
}
|
|
2703
|
+
lastStartedTs = 0;
|
|
2704
|
+
playing = false;
|
|
2705
|
+
renderFrame(timeBeforeLastStartMs);
|
|
2706
|
+
if (callOnFinish && !finishCalled) {
|
|
2707
|
+
finishCalled = true;
|
|
2708
|
+
(_a = callbacks == null ? void 0 : callbacks.onFinish) == null ? void 0 : _a.call(callbacks);
|
|
2709
|
+
}
|
|
2710
|
+
};
|
|
2711
|
+
const api = {
|
|
2712
|
+
"isReady": () => true,
|
|
2713
|
+
"getRootElement": () => null,
|
|
2714
|
+
"isPlaying": () => {
|
|
2715
|
+
return _isPlaying();
|
|
2716
|
+
},
|
|
2717
|
+
"play": () => {
|
|
2718
|
+
var _a;
|
|
2719
|
+
startAnim();
|
|
2720
|
+
(_a = callbacks == null ? void 0 : callbacks.onPlay) == null ? void 0 : _a.call(callbacks);
|
|
2721
|
+
},
|
|
2722
|
+
"pause": () => {
|
|
2723
|
+
var _a;
|
|
2724
|
+
pauseAnim();
|
|
2725
|
+
(_a = callbacks == null ? void 0 : callbacks.onPause) == null ? void 0 : _a.call(callbacks);
|
|
2726
|
+
},
|
|
2727
|
+
"cancel": () => {
|
|
2728
|
+
cancelAnim();
|
|
2729
|
+
},
|
|
2730
|
+
"finish": () => {
|
|
2731
|
+
finishAnim(true);
|
|
2732
|
+
},
|
|
2733
|
+
"setPlaybackRate": (rate) => {
|
|
2734
|
+
if (!isFinite(rate) || rate === 0) {
|
|
2735
|
+
console.warn("setPlaybackRate: rate must be finite and non-zero");
|
|
2736
|
+
return;
|
|
2737
|
+
}
|
|
2738
|
+
const current = getAnimCurrentTime();
|
|
2739
|
+
playbackRate = rate;
|
|
2740
|
+
timeBeforeLastStartMs = current;
|
|
2741
|
+
if (playing) lastStartedTs = Date.now();
|
|
2742
|
+
},
|
|
2743
|
+
"getCurrentTime": () => {
|
|
2744
|
+
return getAnimCurrentTime();
|
|
2745
|
+
},
|
|
2746
|
+
"setCurrentTime": (newTime) => {
|
|
2747
|
+
if (newTime < 0) newTime = 0;
|
|
2748
|
+
if (Number.isFinite(totalDuration) && newTime > totalDuration) newTime = totalDuration;
|
|
2749
|
+
timeBeforeLastStartMs = newTime;
|
|
2750
|
+
if (playing) lastStartedTs = Date.now();
|
|
2751
|
+
renderFrame(getAnimCurrentTime());
|
|
2752
|
+
},
|
|
2753
|
+
"destroy": () => {
|
|
2754
|
+
api.cancel();
|
|
2755
|
+
}
|
|
2756
|
+
};
|
|
2757
|
+
return api;
|
|
2758
|
+
}
|
|
2759
|
+
function createFrameLoopAnimator(doc, adapter, callbacks, rootElement) {
|
|
2760
|
+
const config = getAnimatorConfig(doc) || {};
|
|
2761
|
+
if (!rootElement) {
|
|
2762
|
+
if (doc.id) {
|
|
2763
|
+
const rootSelector = getSelector(doc.id);
|
|
2764
|
+
rootElement = document.querySelector(rootSelector);
|
|
2765
|
+
if (!rootElement) console.warn("createFrameLoopAnimator: No root element found for selector: ", rootSelector);
|
|
2766
|
+
} else {
|
|
2767
|
+
console.warn("createFrameLoopAnimator: No root element provided");
|
|
2768
|
+
}
|
|
2769
|
+
}
|
|
2770
|
+
let api = createBasicFrameLoopAnimator(
|
|
2771
|
+
doc,
|
|
2772
|
+
adapter || createDomAdapter(rootElement),
|
|
2773
|
+
callbacks
|
|
2774
|
+
);
|
|
2775
|
+
api = __spreadProps(__spreadValues({}, api), {
|
|
2776
|
+
"getRootElement": () => rootElement || null
|
|
2777
|
+
});
|
|
2778
|
+
if (config.trigger) setupAnimationTriggers(api, config.trigger);
|
|
2779
|
+
return api;
|
|
2780
|
+
}
|
|
2781
|
+
function createDomAdapter(rootElement) {
|
|
2782
|
+
const warnedSelectors = /* @__PURE__ */ new Set();
|
|
2783
|
+
const adapter = {
|
|
2784
|
+
isConnected: () => {
|
|
2785
|
+
if (!rootElement) return true;
|
|
2786
|
+
return rootElement.isConnected;
|
|
2787
|
+
},
|
|
2788
|
+
setAttribute: (id, attrName, value) => {
|
|
2789
|
+
attrName = camelCaseToKebabWordIfNeeded(attrName);
|
|
2790
|
+
const selector = getSelector(id);
|
|
2791
|
+
const elements = (rootElement == null ? void 0 : rootElement.querySelectorAll(selector)) || document.querySelectorAll(selector);
|
|
2792
|
+
if (elements.length === 0 && !warnedSelectors.has(selector)) {
|
|
2793
|
+
warnedSelectors.add(selector);
|
|
2794
|
+
console.warn('setAttribute: No elements found for selector "' + selector + '"');
|
|
2795
|
+
}
|
|
2796
|
+
for (let i = 0; i < elements.length; i++) {
|
|
2797
|
+
const element = elements[i];
|
|
2798
|
+
element.setAttribute(attrName, value);
|
|
2799
|
+
if (STYLE_ATTR_NAMES.has(attrName)) {
|
|
2800
|
+
element.style[attrName] = value;
|
|
2801
|
+
}
|
|
2802
|
+
}
|
|
2803
|
+
}
|
|
2804
|
+
};
|
|
2805
|
+
return adapter;
|
|
2806
|
+
}
|
|
2807
|
+
function convertToWebApiKeyframes(animDef, unsupportedSet, config) {
|
|
2808
|
+
var _a, _b, _c, _d;
|
|
2809
|
+
const result = /* @__PURE__ */ new Map();
|
|
2810
|
+
for (const [propName, propAnim] of Object.entries(animDef)) {
|
|
2811
|
+
const keyframes = propAnim.kfs || propAnim.keyframes || [];
|
|
2812
|
+
const cssKeyframes = [];
|
|
2813
|
+
for (const kf of keyframes) {
|
|
2814
|
+
let t = (_b = (_a = kf.t) != null ? _a : kf.time) != null ? _b : 0;
|
|
2815
|
+
t = clamp(t / (config.duration || 1), 0, 1);
|
|
2816
|
+
let value = (_c = kf.v) != null ? _c : kf.value;
|
|
2817
|
+
const e = (_d = kf.e) != null ? _d : kf.easing;
|
|
2818
|
+
const cssKf = {
|
|
2819
|
+
offset: t,
|
|
2820
|
+
easing: e && Array.isArray(e) ? "cubic-bezier(" + e.join(",") + ")" : void 0
|
|
2821
|
+
};
|
|
2822
|
+
let cssValue;
|
|
2823
|
+
let cssKey = propName;
|
|
2824
|
+
if (COLOUR_ATTR_NAMES.has(propName) && Array.isArray(value)) {
|
|
2825
|
+
cssValue = toRGBA(value);
|
|
2826
|
+
} else if (TRANSFORM_FN_NAMES.has(propName)) {
|
|
2827
|
+
if (Array.isArray(value)) {
|
|
2828
|
+
if (propName === "translate") value = value.map((v) => v + "px");
|
|
2829
|
+
value = value.join(",");
|
|
2830
|
+
}
|
|
2831
|
+
if (propName === "rotate") value = value + "deg";
|
|
2832
|
+
cssValue = propName + "(" + value + ")";
|
|
2833
|
+
cssKey = "transform";
|
|
2834
|
+
} else {
|
|
2835
|
+
cssValue = "" + value;
|
|
2836
|
+
}
|
|
2837
|
+
if (!CSS.supports(cssKey, cssValue)) unsupportedSet.add(cssKey);
|
|
2838
|
+
cssKey = kebabToCamelCaseWord(cssKey);
|
|
2839
|
+
cssKf[cssKey] = cssValue;
|
|
2840
|
+
cssKeyframes.push(cssKf);
|
|
2841
|
+
}
|
|
2842
|
+
if (cssKeyframes.length > 0) {
|
|
2843
|
+
result.set(propName, cssKeyframes);
|
|
2844
|
+
}
|
|
2845
|
+
}
|
|
2846
|
+
return result;
|
|
2847
|
+
}
|
|
2848
|
+
function createWebApiAnimator(doc, callbacks, rootElement, forceEvenIfHasUnsupportedAttrs) {
|
|
2849
|
+
const config = getAnimatorConfig(doc) || {};
|
|
2850
|
+
const bindings = getNormalisedBindings(doc);
|
|
2851
|
+
if (!rootElement) {
|
|
2852
|
+
if (doc.id) {
|
|
2853
|
+
const rootSelector = getSelector(doc.id);
|
|
2854
|
+
rootElement = document.querySelector(rootSelector);
|
|
2855
|
+
if (!rootElement) console.warn("createFrameLoopAnimator: No root element found for selector: ", rootSelector);
|
|
2856
|
+
} else {
|
|
2857
|
+
console.warn("createFrameLoopAnimator: No root element provided");
|
|
2858
|
+
}
|
|
2859
|
+
}
|
|
2860
|
+
const animations = [];
|
|
2861
|
+
const _iterations = config.iterations;
|
|
2862
|
+
let iterations;
|
|
2863
|
+
if (typeof _iterations === "number") iterations = _iterations;
|
|
2864
|
+
if (_iterations === "infinite") iterations = Infinity;
|
|
2865
|
+
const unsupportedSet = /* @__PURE__ */ new Set();
|
|
2866
|
+
if (!(bindings == null ? void 0 : bindings.length)) {
|
|
2867
|
+
console.warn("createWebApiAnimator: No animation bindings defined");
|
|
2868
|
+
}
|
|
2869
|
+
for (const binding of bindings || []) {
|
|
2870
|
+
const animDef = binding.animate;
|
|
2871
|
+
if (!animDef || typeof animDef !== "object" || Array.isArray(animDef)) {
|
|
2872
|
+
console.warn("createWebApiAnimator: Empty or unresolved binding", binding);
|
|
2873
|
+
continue;
|
|
2874
|
+
}
|
|
2875
|
+
const selector = getSelector(binding.id);
|
|
2876
|
+
const elements = (rootElement == null ? void 0 : rootElement.querySelectorAll(selector)) || document.querySelectorAll(selector);
|
|
2877
|
+
if (elements.length === 0) {
|
|
2878
|
+
console.warn('createWebApiAnimator: No elements found for selector "' + selector + '"');
|
|
2879
|
+
}
|
|
2880
|
+
const keyframesMap = convertToWebApiKeyframes(animDef, unsupportedSet, config);
|
|
2881
|
+
for (let i = 0; i < elements.length; i++) {
|
|
2882
|
+
const element = elements[i];
|
|
2883
|
+
const positiveDelay = config.delay && config.delay > 0 ? config.delay : void 0;
|
|
2884
|
+
const seekPosition = config.delay && config.delay < 0 && config.duration ? -config.delay % config.duration : void 0;
|
|
2885
|
+
const effectOptions = {
|
|
2886
|
+
duration: config.duration,
|
|
2887
|
+
delay: positiveDelay,
|
|
2888
|
+
fill: config.fill,
|
|
2889
|
+
direction: config.direction,
|
|
2890
|
+
iterations
|
|
2891
|
+
};
|
|
2892
|
+
for (const [, keyframes] of keyframesMap) {
|
|
2893
|
+
if (keyframes.length > 0) {
|
|
2894
|
+
try {
|
|
2895
|
+
const effect = new KeyframeEffect(element, keyframes, effectOptions);
|
|
2896
|
+
const anim = new Animation(effect, document.timeline);
|
|
2897
|
+
if (callbacks == null ? void 0 : callbacks.onFinish) anim.onfinish = () => {
|
|
2898
|
+
var _a;
|
|
2899
|
+
return (_a = callbacks.onFinish) == null ? void 0 : _a.call(callbacks);
|
|
2900
|
+
};
|
|
2901
|
+
if (callbacks == null ? void 0 : callbacks.onRemove) anim.onremove = () => {
|
|
2902
|
+
var _a;
|
|
2903
|
+
return (_a = callbacks.onRemove) == null ? void 0 : _a.call(callbacks);
|
|
2904
|
+
};
|
|
2905
|
+
if (seekPosition) {
|
|
2906
|
+
anim.currentTime = seekPosition;
|
|
2907
|
+
}
|
|
2908
|
+
animations.push(anim);
|
|
2909
|
+
} catch (e) {
|
|
2910
|
+
console.warn(e);
|
|
2911
|
+
}
|
|
2912
|
+
}
|
|
2913
|
+
}
|
|
2914
|
+
}
|
|
2915
|
+
}
|
|
2916
|
+
if (!forceEvenIfHasUnsupportedAttrs && unsupportedSet.size) {
|
|
2917
|
+
console.warn("Unsupported CSS attrs: " + [...unsupportedSet].join(", "));
|
|
2918
|
+
return null;
|
|
2919
|
+
}
|
|
2920
|
+
const api = {
|
|
2921
|
+
"isReady": () => true,
|
|
2922
|
+
"getRootElement": () => rootElement || null,
|
|
2923
|
+
"isPlaying": () => {
|
|
2924
|
+
var _a;
|
|
2925
|
+
return ((_a = animations[0]) == null ? void 0 : _a.playState) === "running";
|
|
2926
|
+
},
|
|
2927
|
+
"play": () => {
|
|
2928
|
+
var _a;
|
|
2929
|
+
animations.forEach((a) => a.play());
|
|
2930
|
+
(_a = callbacks == null ? void 0 : callbacks.onPlay) == null ? void 0 : _a.call(callbacks);
|
|
2931
|
+
},
|
|
2932
|
+
"pause": () => {
|
|
2933
|
+
var _a;
|
|
2934
|
+
animations.forEach((a) => a.pause());
|
|
2935
|
+
(_a = callbacks == null ? void 0 : callbacks.onPause) == null ? void 0 : _a.call(callbacks);
|
|
2936
|
+
},
|
|
2937
|
+
"cancel": () => {
|
|
2938
|
+
var _a;
|
|
2939
|
+
animations.forEach((a) => a.cancel());
|
|
2940
|
+
(_a = callbacks == null ? void 0 : callbacks.onCancel) == null ? void 0 : _a.call(callbacks);
|
|
2941
|
+
},
|
|
2942
|
+
"finish": () => {
|
|
2943
|
+
animations.forEach((a) => a.finish());
|
|
2944
|
+
},
|
|
2945
|
+
"setPlaybackRate": (rate) => {
|
|
2946
|
+
animations.forEach((a) => a.playbackRate = rate);
|
|
2947
|
+
return api;
|
|
2948
|
+
},
|
|
2949
|
+
"getCurrentTime": () => {
|
|
2950
|
+
var _a, _b;
|
|
2951
|
+
const res = (_b = (_a = animations[0]) == null ? void 0 : _a.currentTime) != null ? _b : null;
|
|
2952
|
+
return res !== null ? +res : null;
|
|
2953
|
+
},
|
|
2954
|
+
"setCurrentTime": (time) => {
|
|
2955
|
+
animations.forEach((a) => {
|
|
2956
|
+
a.currentTime = time;
|
|
2957
|
+
});
|
|
2958
|
+
},
|
|
2959
|
+
"destroy": () => {
|
|
2960
|
+
api.cancel();
|
|
2961
|
+
animations.splice(0, animations.length);
|
|
2962
|
+
}
|
|
2963
|
+
};
|
|
2964
|
+
if (config.trigger) {
|
|
2965
|
+
setupAnimationTriggers(api, config.trigger);
|
|
2966
|
+
}
|
|
2967
|
+
return api;
|
|
2968
|
+
}
|
|
2969
|
+
function createAnimatorFromConfig(doc, adapter, callbacks, rootElement) {
|
|
2970
|
+
const animatorConfig = getAnimatorConfig(doc) || {};
|
|
2971
|
+
let res;
|
|
2972
|
+
if (animatorConfig.mode === "frames") {
|
|
2973
|
+
res = createFrameLoopAnimator(doc, adapter, callbacks, rootElement);
|
|
2974
|
+
} else {
|
|
2975
|
+
res = createWebApiAnimator(
|
|
2976
|
+
doc,
|
|
2977
|
+
callbacks,
|
|
2978
|
+
rootElement,
|
|
2979
|
+
animatorConfig.mode === "webapi"
|
|
2980
|
+
// Forcing "webapi"
|
|
2981
|
+
) || createFrameLoopAnimator(doc, adapter, callbacks, rootElement);
|
|
2982
|
+
}
|
|
2983
|
+
if (animatorConfig.debugInstName) {
|
|
2984
|
+
window[animatorConfig.debugInstName] = res;
|
|
2985
|
+
}
|
|
2986
|
+
return res;
|
|
2987
|
+
}
|
|
2988
|
+
var _idCounter = 0;
|
|
2989
|
+
function generateUniqueId() {
|
|
2990
|
+
const timestamp = Date.now().toString(36);
|
|
2991
|
+
const counter = (++_idCounter).toString(36);
|
|
2992
|
+
const random = Math.random().toString(36).substring(2, 6);
|
|
2993
|
+
return "_px_" + timestamp + counter + random;
|
|
2994
|
+
}
|
|
2995
|
+
function deepClone(value) {
|
|
2996
|
+
if (value === null || typeof value !== "object") return value;
|
|
2997
|
+
if (Array.isArray(value)) return value.map((item) => deepClone(item));
|
|
2998
|
+
const obj = value;
|
|
2999
|
+
const cloned = {};
|
|
3000
|
+
for (const key of Object.keys(obj)) {
|
|
3001
|
+
cloned[key] = deepClone(obj[key]);
|
|
3002
|
+
}
|
|
3003
|
+
return cloned;
|
|
3004
|
+
}
|
|
3005
|
+
function generateNewIds(doc) {
|
|
3006
|
+
const cloned = deepClone(doc);
|
|
3007
|
+
const idMap = /* @__PURE__ */ new Map();
|
|
3008
|
+
const hashRefAttrs = /* @__PURE__ */ new Set(["href", "xlink:href"]);
|
|
3009
|
+
const urlRefAttrs = /* @__PURE__ */ new Set([
|
|
3010
|
+
"fill",
|
|
3011
|
+
"stroke",
|
|
3012
|
+
"clip-path",
|
|
3013
|
+
"clipPath",
|
|
3014
|
+
"mask",
|
|
3015
|
+
"marker",
|
|
3016
|
+
"marker-start",
|
|
3017
|
+
"marker-mid",
|
|
3018
|
+
"marker-end",
|
|
3019
|
+
"filter",
|
|
3020
|
+
"flood-color",
|
|
3021
|
+
"lighting-color"
|
|
3022
|
+
]);
|
|
3023
|
+
const directIdRefAttrs = /* @__PURE__ */ new Set(["baseId", "targetId", "boundElementId"]);
|
|
3024
|
+
function collectIds(node) {
|
|
3025
|
+
if (!node || typeof node !== "object") return;
|
|
3026
|
+
if (node.id && typeof node.id === "string") {
|
|
3027
|
+
const oldId = node.id;
|
|
3028
|
+
const newId = generateUniqueId();
|
|
3029
|
+
idMap.set(oldId, newId);
|
|
3030
|
+
node.id = newId;
|
|
3031
|
+
}
|
|
3032
|
+
if (Array.isArray(node.children)) {
|
|
3033
|
+
for (const child of node.children) {
|
|
3034
|
+
collectIds(child);
|
|
3035
|
+
}
|
|
3036
|
+
}
|
|
3037
|
+
}
|
|
3038
|
+
function updateRefs(node) {
|
|
3039
|
+
if (!node || typeof node !== "object") return;
|
|
3040
|
+
for (const [key, value] of Object.entries(node)) {
|
|
3041
|
+
if (key === "children") {
|
|
3042
|
+
if (Array.isArray(value)) {
|
|
3043
|
+
for (const child of value) {
|
|
3044
|
+
updateRefs(child);
|
|
3045
|
+
}
|
|
3046
|
+
}
|
|
3047
|
+
continue;
|
|
3048
|
+
}
|
|
3049
|
+
if (typeof value === "string") {
|
|
3050
|
+
if (hashRefAttrs.has(key) && value.startsWith("#")) {
|
|
3051
|
+
const oldId = value.slice(1);
|
|
3052
|
+
const newId = idMap.get(oldId);
|
|
3053
|
+
if (newId) {
|
|
3054
|
+
node[key] = "#" + newId;
|
|
3055
|
+
}
|
|
3056
|
+
} else if (urlRefAttrs.has(key)) {
|
|
3057
|
+
node[key] = replaceUrlRefs(value, idMap);
|
|
3058
|
+
} else if (directIdRefAttrs.has(key)) {
|
|
3059
|
+
const newId = idMap.get(value);
|
|
3060
|
+
if (newId) {
|
|
3061
|
+
node[key] = newId;
|
|
3062
|
+
}
|
|
3063
|
+
} else if (value.includes("url(#")) {
|
|
3064
|
+
node[key] = replaceUrlRefs(value, idMap);
|
|
3065
|
+
}
|
|
3066
|
+
} else if (key === "style" && typeof value === "object" && value !== null) {
|
|
3067
|
+
for (const [styleProp, styleValue] of Object.entries(value)) {
|
|
3068
|
+
if (typeof styleValue === "string") {
|
|
3069
|
+
value[styleProp] = replaceUrlRefs(styleValue, idMap);
|
|
3070
|
+
}
|
|
3071
|
+
}
|
|
3072
|
+
} else if (typeof value === "object" && value !== null && key !== "animate") {
|
|
3073
|
+
updateRefs(value);
|
|
3074
|
+
}
|
|
3075
|
+
}
|
|
3076
|
+
}
|
|
3077
|
+
collectIds(cloned);
|
|
3078
|
+
updateRefs(cloned);
|
|
3079
|
+
const docBindings = cloned.bindings;
|
|
3080
|
+
if (Array.isArray(docBindings)) {
|
|
3081
|
+
for (const binding of docBindings) {
|
|
3082
|
+
if (binding.id) {
|
|
3083
|
+
const newId = idMap.get(binding.id);
|
|
3084
|
+
if (newId) {
|
|
3085
|
+
binding.id = newId;
|
|
3086
|
+
}
|
|
3087
|
+
}
|
|
3088
|
+
}
|
|
3089
|
+
}
|
|
3090
|
+
return cloned;
|
|
3091
|
+
}
|
|
3092
|
+
function replaceUrlRefs(value, idMap) {
|
|
3093
|
+
return value.replace(/url\(#([^)]+)\)/g, (match, oldId) => {
|
|
3094
|
+
const newId = idMap.get(oldId);
|
|
3095
|
+
return newId ? "url(#" + newId + ")" : match;
|
|
3096
|
+
});
|
|
3097
|
+
}
|
|
3098
|
+
function createAnimatorImpl(doc, adapter, callbacks, containerElement) {
|
|
3099
|
+
const animatorConfig = getAnimatorConfig(doc) || {};
|
|
3100
|
+
animatorConfig.debug = true;
|
|
3101
|
+
let rootElement = null;
|
|
3102
|
+
if (containerElement && doc.children) {
|
|
3103
|
+
doc = generateNewIds(doc);
|
|
3104
|
+
const containerEl = typeof containerElement === "string" ? document.querySelector(containerElement) : containerElement;
|
|
3105
|
+
if (containerEl) {
|
|
3106
|
+
rootElement = renderNode(doc);
|
|
3107
|
+
if (rootElement) {
|
|
3108
|
+
containerEl.replaceChildren(rootElement);
|
|
3109
|
+
}
|
|
3110
|
+
}
|
|
3111
|
+
}
|
|
3112
|
+
return createAnimatorFromConfig(doc, adapter, callbacks, rootElement);
|
|
3113
|
+
}
|
|
3114
|
+
function createAnimator(docOrUrl, adapter, callbacks, containerElement) {
|
|
3115
|
+
if (typeof docOrUrl === "object") {
|
|
3116
|
+
return createAnimatorImpl(docOrUrl, adapter, callbacks, containerElement);
|
|
3117
|
+
}
|
|
3118
|
+
let animator = null;
|
|
3119
|
+
fetch(docOrUrl).then((res) => res.json()).then((json) => {
|
|
3120
|
+
if (isPxElementFileFormat(json)) {
|
|
3121
|
+
animator = createAnimatorImpl(json, adapter, callbacks, containerElement);
|
|
3122
|
+
} else {
|
|
3123
|
+
console.error("Invalid animation document format");
|
|
3124
|
+
}
|
|
3125
|
+
});
|
|
3126
|
+
return {
|
|
3127
|
+
"isReady": () => !!animator,
|
|
3128
|
+
"getRootElement": () => animator ? animator.getRootElement() : null,
|
|
3129
|
+
"isPlaying": () => (animator == null ? void 0 : animator.isPlaying()) || false,
|
|
3130
|
+
"play": () => {
|
|
3131
|
+
animator == null ? void 0 : animator.play();
|
|
3132
|
+
},
|
|
3133
|
+
"pause": () => {
|
|
3134
|
+
animator == null ? void 0 : animator.pause();
|
|
3135
|
+
},
|
|
3136
|
+
"cancel": () => {
|
|
3137
|
+
animator == null ? void 0 : animator.cancel();
|
|
3138
|
+
},
|
|
3139
|
+
"finish": () => {
|
|
3140
|
+
animator == null ? void 0 : animator.finish();
|
|
3141
|
+
},
|
|
3142
|
+
"setPlaybackRate": (rate) => {
|
|
3143
|
+
animator == null ? void 0 : animator.setPlaybackRate(rate);
|
|
3144
|
+
},
|
|
3145
|
+
"getCurrentTime": () => (animator == null ? void 0 : animator.getCurrentTime()) || 0,
|
|
3146
|
+
"setCurrentTime": (time) => {
|
|
3147
|
+
animator == null ? void 0 : animator.setCurrentTime(time);
|
|
3148
|
+
},
|
|
3149
|
+
"destroy": () => {
|
|
3150
|
+
animator == null ? void 0 : animator.destroy();
|
|
3151
|
+
}
|
|
3152
|
+
};
|
|
3153
|
+
}
|
|
3154
|
+
function loadTagAnimators() {
|
|
3155
|
+
const elements = document.querySelectorAll("[" + PX_ANIM_SRC_ATTR_NAME + "]");
|
|
3156
|
+
for (let i = 0; i < elements.length; i++) {
|
|
3157
|
+
const element = elements[i];
|
|
3158
|
+
if (!element[PX_ANIM_ATTR_NAME]) {
|
|
3159
|
+
const src = element.getAttribute(PX_ANIM_SRC_ATTR_NAME);
|
|
3160
|
+
if (src) {
|
|
3161
|
+
element[PX_ANIM_ATTR_NAME] = createAnimator(src, void 0, void 0, element);
|
|
3162
|
+
}
|
|
3163
|
+
}
|
|
3164
|
+
}
|
|
3165
|
+
}
|
|
3166
|
+
if (typeof window !== "undefined") {
|
|
3167
|
+
window["loadTagAnimators"] = loadTagAnimators;
|
|
3168
|
+
window["createAnimator"] = createAnimator;
|
|
3169
|
+
window["setupAnimationTriggers"] = setupAnimationTriggers;
|
|
3170
|
+
}
|
|
3171
|
+
|
|
3172
|
+
// src/PixodeskSvgAnimator.tsx
|
|
3173
|
+
var import_react2 = __toESM(require_react(), 1);
|
|
3174
|
+
|
|
3175
|
+
// src/Utils.ts
|
|
3176
|
+
var import_react = __toESM(require_react(), 1);
|
|
3177
|
+
function deepEquals(a, b) {
|
|
3178
|
+
if (a === b) return true;
|
|
3179
|
+
if (a == null || b == null) return false;
|
|
3180
|
+
if (typeof a !== "object" || typeof b !== "object") return false;
|
|
3181
|
+
const seen = /* @__PURE__ */ new WeakSet();
|
|
3182
|
+
function equals(x, y) {
|
|
3183
|
+
if (x === y) return true;
|
|
3184
|
+
if (x == null || y == null) return false;
|
|
3185
|
+
if (typeof x !== "object" || typeof y !== "object") return false;
|
|
3186
|
+
if (seen.has(x)) {
|
|
3187
|
+
throw new Error("Circular reference detected");
|
|
3188
|
+
}
|
|
3189
|
+
seen.add(x);
|
|
3190
|
+
const xIsArray = Array.isArray(x);
|
|
3191
|
+
const yIsArray = Array.isArray(y);
|
|
3192
|
+
if (xIsArray !== yIsArray) return false;
|
|
3193
|
+
if (xIsArray) {
|
|
3194
|
+
if (x.length !== y.length) return false;
|
|
3195
|
+
for (let i = 0; i < x.length; i++) {
|
|
3196
|
+
if (!equals(x[i], y[i])) return false;
|
|
3197
|
+
}
|
|
3198
|
+
return true;
|
|
3199
|
+
}
|
|
3200
|
+
const xKeys = Object.keys(x);
|
|
3201
|
+
const yKeys = Object.keys(y);
|
|
3202
|
+
if (xKeys.length !== yKeys.length) return false;
|
|
3203
|
+
for (const key of xKeys) {
|
|
3204
|
+
if (!yKeys.includes(key)) return false;
|
|
3205
|
+
if (!equals(x[key], y[key])) return false;
|
|
3206
|
+
}
|
|
3207
|
+
return true;
|
|
3208
|
+
}
|
|
3209
|
+
return equals(a, b);
|
|
3210
|
+
}
|
|
3211
|
+
function areDepsEqual(prevDeps, nextDeps) {
|
|
3212
|
+
if (prevDeps.length !== nextDeps.length) return false;
|
|
3213
|
+
for (let i = 0; i < prevDeps.length; i++) {
|
|
3214
|
+
if (prevDeps[i] === nextDeps[i]) continue;
|
|
3215
|
+
if (!deepEquals(prevDeps[i], nextDeps[i])) return false;
|
|
3216
|
+
}
|
|
3217
|
+
return true;
|
|
3218
|
+
}
|
|
3219
|
+
function useDepsVersion(...deps) {
|
|
3220
|
+
const cache = (0, import_react.useRef)(null);
|
|
3221
|
+
if (cache.current === null) {
|
|
3222
|
+
cache.current = {
|
|
3223
|
+
versionId: 1,
|
|
3224
|
+
deps
|
|
3225
|
+
};
|
|
3226
|
+
return 1;
|
|
3227
|
+
}
|
|
3228
|
+
if (!areDepsEqual(cache.current.deps, deps)) {
|
|
3229
|
+
cache.current = {
|
|
3230
|
+
versionId: cache.current.versionId + 1,
|
|
3231
|
+
deps
|
|
3232
|
+
};
|
|
3233
|
+
}
|
|
3234
|
+
return cache.current.versionId;
|
|
3235
|
+
}
|
|
3236
|
+
|
|
3237
|
+
// src/PixodeskSvgAnimator.tsx
|
|
3238
|
+
var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
|
|
3239
|
+
function createReactAdapter(elementRefs) {
|
|
3240
|
+
const warnedSelectors = /* @__PURE__ */ new Set();
|
|
3241
|
+
const adapter = {
|
|
3242
|
+
isConnected: () => {
|
|
3243
|
+
return true;
|
|
3244
|
+
},
|
|
3245
|
+
setAttribute: (id, attrName, value) => {
|
|
3246
|
+
attrName = camelCaseToKebabWordIfNeeded(attrName);
|
|
3247
|
+
const selector = getSelector2(id);
|
|
3248
|
+
const element = elementRefs.current.get(id);
|
|
3249
|
+
if (!element && !warnedSelectors.has(selector)) {
|
|
3250
|
+
warnedSelectors.add(selector);
|
|
3251
|
+
console.warn('setAttribute: No elements found for selector "' + selector + '"');
|
|
3252
|
+
console.warn(elementRefs.current);
|
|
3253
|
+
}
|
|
3254
|
+
if (element) {
|
|
3255
|
+
element.setAttribute(attrName, value);
|
|
3256
|
+
if (STYLE_ATTR_NAMES.has(attrName)) {
|
|
3257
|
+
element.style[attrName] = value;
|
|
3258
|
+
}
|
|
3259
|
+
}
|
|
3260
|
+
}
|
|
3261
|
+
};
|
|
3262
|
+
return adapter;
|
|
3263
|
+
}
|
|
3264
|
+
function getSelector2(id) {
|
|
3265
|
+
return "#" + id;
|
|
3266
|
+
}
|
|
3267
|
+
var PixodeskSvgAnimatorImpl = ({
|
|
3268
|
+
className,
|
|
3269
|
+
style,
|
|
3270
|
+
doc,
|
|
3271
|
+
compMode,
|
|
3272
|
+
apiHolderRef
|
|
3273
|
+
}) => {
|
|
3274
|
+
doc = generateNewIds(doc);
|
|
3275
|
+
const elementRefs = (0, import_react2.useRef)(/* @__PURE__ */ new Map());
|
|
3276
|
+
const renderNode2 = (node) => {
|
|
3277
|
+
if (!node) return null;
|
|
3278
|
+
const { type, animate, meta, children, ...props } = node;
|
|
3279
|
+
const normProps = getNormalizedProps(props);
|
|
3280
|
+
normProps["ref"] = (domEl) => {
|
|
3281
|
+
console.log("MOUNTED");
|
|
3282
|
+
if (node["id"]) elementRefs.current.set(node["id"], domEl);
|
|
3283
|
+
return () => {
|
|
3284
|
+
console.log("UN-MOUNTED");
|
|
3285
|
+
};
|
|
3286
|
+
};
|
|
3287
|
+
return (0, import_react2.createElement)(type, normProps, children?.map((child) => renderNode2(child)));
|
|
3288
|
+
};
|
|
3289
|
+
const root = doc ? renderNode2(doc) : null;
|
|
3290
|
+
(0, import_react2.useEffect)(() => {
|
|
3291
|
+
let api = createAnimator(doc, createReactAdapter(elementRefs));
|
|
3292
|
+
apiHolderRef.current = api;
|
|
3293
|
+
return () => {
|
|
3294
|
+
api?.destroy();
|
|
3295
|
+
apiHolderRef.current = null;
|
|
3296
|
+
};
|
|
3297
|
+
}, [doc]);
|
|
3298
|
+
return root;
|
|
3299
|
+
};
|
|
3300
|
+
var PixodeskSvgAnimatorImplOnce = import_react2.default.memo(
|
|
3301
|
+
PixodeskSvgAnimatorImpl,
|
|
3302
|
+
() => true
|
|
3303
|
+
// Don't re-render
|
|
3304
|
+
);
|
|
3305
|
+
var PixodeskSvgAnimator = ({
|
|
3306
|
+
className,
|
|
3307
|
+
style,
|
|
3308
|
+
doc,
|
|
3309
|
+
autoplay,
|
|
3310
|
+
play,
|
|
3311
|
+
pause,
|
|
3312
|
+
time,
|
|
3313
|
+
timeMs,
|
|
3314
|
+
apiRef,
|
|
3315
|
+
timeline,
|
|
3316
|
+
// Overrides
|
|
3317
|
+
mode,
|
|
3318
|
+
delay,
|
|
3319
|
+
fill,
|
|
3320
|
+
iterations,
|
|
3321
|
+
duration,
|
|
3322
|
+
direction,
|
|
3323
|
+
frameRate,
|
|
3324
|
+
startOn,
|
|
3325
|
+
outAction,
|
|
3326
|
+
scrollIntoViewThreshold
|
|
3327
|
+
}) => {
|
|
3328
|
+
let compMode = "static" /* static */;
|
|
3329
|
+
if (apiRef) {
|
|
3330
|
+
compMode = "imperativeApi" /* imperativeApi */;
|
|
3331
|
+
} else if (autoplay) {
|
|
3332
|
+
compMode = "autoplay" /* autoplay */;
|
|
3333
|
+
} else if (time !== void 0 || timeMs !== void 0) {
|
|
3334
|
+
compMode = "fixedTime" /* fixedTime */;
|
|
3335
|
+
} else {
|
|
3336
|
+
compMode = "play" /* play */;
|
|
3337
|
+
}
|
|
3338
|
+
if (compMode !== "autoplay" /* autoplay */) {
|
|
3339
|
+
const startOn2 = doc.animator?.trigger?.startOn;
|
|
3340
|
+
if (startOn2 && startOn2 !== "programmatic") {
|
|
3341
|
+
doc = {
|
|
3342
|
+
...doc,
|
|
3343
|
+
animator: {
|
|
3344
|
+
...doc.animator,
|
|
3345
|
+
trigger: {
|
|
3346
|
+
...doc.animator?.trigger,
|
|
3347
|
+
startOn: "programmatic"
|
|
3348
|
+
// FIXME: use enum
|
|
3349
|
+
}
|
|
3350
|
+
}
|
|
3351
|
+
};
|
|
3352
|
+
}
|
|
3353
|
+
}
|
|
3354
|
+
if (mode !== void 0 || duration !== void 0 || delay !== void 0 || iterations !== void 0 || fill !== void 0 || direction !== void 0 || frameRate !== void 0) {
|
|
3355
|
+
const animator = doc.animator || {};
|
|
3356
|
+
doc = {
|
|
3357
|
+
...doc,
|
|
3358
|
+
animator: {
|
|
3359
|
+
...animator,
|
|
3360
|
+
mode: mode !== void 0 ? mode : animator.mode,
|
|
3361
|
+
duration: duration !== void 0 ? duration : animator.duration,
|
|
3362
|
+
delay: delay !== void 0 ? delay : animator.delay,
|
|
3363
|
+
iterations: iterations !== void 0 ? iterations : animator.iterations,
|
|
3364
|
+
fill: fill !== void 0 ? fill : animator.fill,
|
|
3365
|
+
direction: direction !== void 0 ? direction : animator.direction,
|
|
3366
|
+
frameRate: frameRate !== void 0 ? frameRate : animator.frameRate
|
|
3367
|
+
}
|
|
3368
|
+
};
|
|
3369
|
+
}
|
|
3370
|
+
if (startOn !== void 0 || outAction !== void 0 || scrollIntoViewThreshold !== void 0) {
|
|
3371
|
+
const trigger = doc.animator?.trigger || {};
|
|
3372
|
+
doc = {
|
|
3373
|
+
...doc,
|
|
3374
|
+
animator: {
|
|
3375
|
+
...doc.animator,
|
|
3376
|
+
trigger: {
|
|
3377
|
+
...trigger,
|
|
3378
|
+
startOn: startOn !== void 0 ? startOn : trigger.startOn,
|
|
3379
|
+
outAction: outAction !== void 0 ? outAction : trigger.outAction,
|
|
3380
|
+
scrollIntoViewThreshold: scrollIntoViewThreshold !== void 0 ? scrollIntoViewThreshold : trigger.scrollIntoViewThreshold
|
|
3381
|
+
}
|
|
3382
|
+
}
|
|
3383
|
+
};
|
|
3384
|
+
}
|
|
3385
|
+
if (compMode === "fixedTime" /* fixedTime */) {
|
|
3386
|
+
let delay2 = 0;
|
|
3387
|
+
if (time !== void 0) delay2 = -time;
|
|
3388
|
+
if (timeMs !== void 0) delay2 = -timeMs;
|
|
3389
|
+
const animator = doc.animator || {};
|
|
3390
|
+
doc = {
|
|
3391
|
+
...doc,
|
|
3392
|
+
animator: {
|
|
3393
|
+
...animator,
|
|
3394
|
+
delay: delay2
|
|
3395
|
+
}
|
|
3396
|
+
};
|
|
3397
|
+
}
|
|
3398
|
+
console.log("doc", doc);
|
|
3399
|
+
const apiHolderRef = (0, import_react2.useRef)(null);
|
|
3400
|
+
(0, import_react2.useImperativeHandle)(apiRef, () => {
|
|
3401
|
+
return {
|
|
3402
|
+
isPlaying: () => apiHolderRef.current?.isPlaying() || false,
|
|
3403
|
+
play: () => apiHolderRef.current?.play(),
|
|
3404
|
+
pause: () => apiHolderRef.current?.pause(),
|
|
3405
|
+
cancel: () => apiHolderRef.current?.cancel(),
|
|
3406
|
+
finish: () => apiHolderRef.current?.finish(),
|
|
3407
|
+
getCurrentTime: () => apiHolderRef.current?.getCurrentTime() || null,
|
|
3408
|
+
setCurrentTime: (time2) => apiHolderRef.current?.setCurrentTime(time2)
|
|
3409
|
+
};
|
|
3410
|
+
}, []);
|
|
3411
|
+
(0, import_react2.useEffect)(() => {
|
|
3412
|
+
if (compMode === "play" /* play */) {
|
|
3413
|
+
if (play && !pause) {
|
|
3414
|
+
apiHolderRef.current?.play();
|
|
3415
|
+
} else if (pause) {
|
|
3416
|
+
apiHolderRef.current?.pause();
|
|
3417
|
+
} else {
|
|
3418
|
+
apiHolderRef.current?.finish();
|
|
3419
|
+
}
|
|
3420
|
+
}
|
|
3421
|
+
return () => {
|
|
3422
|
+
if (compMode === "play" /* play */) {
|
|
3423
|
+
apiHolderRef.current?.pause();
|
|
3424
|
+
}
|
|
3425
|
+
};
|
|
3426
|
+
}, [compMode, play, pause]);
|
|
3427
|
+
const key = useDepsVersion(compMode, doc);
|
|
3428
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
3429
|
+
PixodeskSvgAnimatorImplOnce,
|
|
3430
|
+
{
|
|
3431
|
+
compMode,
|
|
3432
|
+
doc,
|
|
3433
|
+
apiHolderRef
|
|
3434
|
+
},
|
|
3435
|
+
key
|
|
3436
|
+
);
|
|
3437
|
+
};
|
|
3438
|
+
var PixodeskSvgAnimator_default = PixodeskSvgAnimator;
|
|
3439
|
+
return __toCommonJS(index_exports);
|
|
3440
|
+
})();
|
|
3441
|
+
/*! Bundled license information:
|
|
3442
|
+
|
|
3443
|
+
react/cjs/react.production.js:
|
|
3444
|
+
(**
|
|
3445
|
+
* @license React
|
|
3446
|
+
* react.production.js
|
|
3447
|
+
*
|
|
3448
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3449
|
+
*
|
|
3450
|
+
* This source code is licensed under the MIT license found in the
|
|
3451
|
+
* LICENSE file in the root directory of this source tree.
|
|
3452
|
+
*)
|
|
3453
|
+
|
|
3454
|
+
react/cjs/react.development.js:
|
|
3455
|
+
(**
|
|
3456
|
+
* @license React
|
|
3457
|
+
* react.development.js
|
|
3458
|
+
*
|
|
3459
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3460
|
+
*
|
|
3461
|
+
* This source code is licensed under the MIT license found in the
|
|
3462
|
+
* LICENSE file in the root directory of this source tree.
|
|
3463
|
+
*)
|
|
3464
|
+
|
|
3465
|
+
react/cjs/react-jsx-runtime.production.js:
|
|
3466
|
+
(**
|
|
3467
|
+
* @license React
|
|
3468
|
+
* react-jsx-runtime.production.js
|
|
3469
|
+
*
|
|
3470
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3471
|
+
*
|
|
3472
|
+
* This source code is licensed under the MIT license found in the
|
|
3473
|
+
* LICENSE file in the root directory of this source tree.
|
|
3474
|
+
*)
|
|
3475
|
+
|
|
3476
|
+
react/cjs/react-jsx-runtime.development.js:
|
|
3477
|
+
(**
|
|
3478
|
+
* @license React
|
|
3479
|
+
* react-jsx-runtime.development.js
|
|
3480
|
+
*
|
|
3481
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3482
|
+
*
|
|
3483
|
+
* This source code is licensed under the MIT license found in the
|
|
3484
|
+
* LICENSE file in the root directory of this source tree.
|
|
3485
|
+
*)
|
|
3486
|
+
*/
|
|
3487
|
+
//# sourceMappingURL=index.umd.js.map
|