sales-frontend-bridge 0.0.19 → 0.0.20
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/dist/index.cjs +1860 -105
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +251 -93
- package/dist/index.d.ts +251 -93
- package/dist/index.js +1852 -107
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -2,15 +2,1439 @@
|
|
|
2
2
|
|
|
3
3
|
var salesFrontendUtils = require('sales-frontend-utils');
|
|
4
4
|
|
|
5
|
+
var __create = Object.create;
|
|
5
6
|
var __defProp = Object.defineProperty;
|
|
7
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
8
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
9
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
10
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
11
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
12
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
13
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
14
|
+
};
|
|
15
|
+
var __copyProps = (to, from, except, desc) => {
|
|
16
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
+
for (let key of __getOwnPropNames(from))
|
|
18
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
19
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
22
|
+
};
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
24
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
25
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
26
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
27
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
28
|
+
__defProp(target, "default", { value: mod, enumerable: true }) ,
|
|
29
|
+
mod
|
|
30
|
+
));
|
|
31
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
32
|
+
|
|
33
|
+
// ../../node_modules/.pnpm/react@19.1.0/node_modules/react/cjs/react.production.js
|
|
34
|
+
var require_react_production = __commonJS({
|
|
35
|
+
"../../node_modules/.pnpm/react@19.1.0/node_modules/react/cjs/react.production.js"(exports) {
|
|
36
|
+
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element");
|
|
37
|
+
var REACT_PORTAL_TYPE = Symbol.for("react.portal");
|
|
38
|
+
var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
|
39
|
+
var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
|
|
40
|
+
var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
|
41
|
+
var REACT_CONSUMER_TYPE = Symbol.for("react.consumer");
|
|
42
|
+
var REACT_CONTEXT_TYPE = Symbol.for("react.context");
|
|
43
|
+
var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
|
|
44
|
+
var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
|
|
45
|
+
var REACT_MEMO_TYPE = Symbol.for("react.memo");
|
|
46
|
+
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
47
|
+
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
|
48
|
+
function getIteratorFn(maybeIterable) {
|
|
49
|
+
if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
|
|
50
|
+
maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
|
|
51
|
+
return "function" === typeof maybeIterable ? maybeIterable : null;
|
|
52
|
+
}
|
|
53
|
+
var ReactNoopUpdateQueue = {
|
|
54
|
+
isMounted: function() {
|
|
55
|
+
return false;
|
|
56
|
+
},
|
|
57
|
+
enqueueForceUpdate: function() {
|
|
58
|
+
},
|
|
59
|
+
enqueueReplaceState: function() {
|
|
60
|
+
},
|
|
61
|
+
enqueueSetState: function() {
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
var assign = Object.assign;
|
|
65
|
+
var emptyObject = {};
|
|
66
|
+
function Component(props, context, updater) {
|
|
67
|
+
this.props = props;
|
|
68
|
+
this.context = context;
|
|
69
|
+
this.refs = emptyObject;
|
|
70
|
+
this.updater = updater || ReactNoopUpdateQueue;
|
|
71
|
+
}
|
|
72
|
+
Component.prototype.isReactComponent = {};
|
|
73
|
+
Component.prototype.setState = function(partialState, callback) {
|
|
74
|
+
if ("object" !== typeof partialState && "function" !== typeof partialState && null != partialState)
|
|
75
|
+
throw Error(
|
|
76
|
+
"takes an object of state variables to update or a function which returns an object of state variables."
|
|
77
|
+
);
|
|
78
|
+
this.updater.enqueueSetState(this, partialState, callback, "setState");
|
|
79
|
+
};
|
|
80
|
+
Component.prototype.forceUpdate = function(callback) {
|
|
81
|
+
this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
|
|
82
|
+
};
|
|
83
|
+
function ComponentDummy() {
|
|
84
|
+
}
|
|
85
|
+
ComponentDummy.prototype = Component.prototype;
|
|
86
|
+
function PureComponent(props, context, updater) {
|
|
87
|
+
this.props = props;
|
|
88
|
+
this.context = context;
|
|
89
|
+
this.refs = emptyObject;
|
|
90
|
+
this.updater = updater || ReactNoopUpdateQueue;
|
|
91
|
+
}
|
|
92
|
+
var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
|
|
93
|
+
pureComponentPrototype.constructor = PureComponent;
|
|
94
|
+
assign(pureComponentPrototype, Component.prototype);
|
|
95
|
+
pureComponentPrototype.isPureReactComponent = true;
|
|
96
|
+
var isArrayImpl = Array.isArray;
|
|
97
|
+
var ReactSharedInternals = { H: null, A: null, T: null, S: null, V: null };
|
|
98
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
99
|
+
function ReactElement(type, key, self, source, owner, props) {
|
|
100
|
+
self = props.ref;
|
|
101
|
+
return {
|
|
102
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
103
|
+
type,
|
|
104
|
+
key,
|
|
105
|
+
ref: void 0 !== self ? self : null,
|
|
106
|
+
props
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
function cloneAndReplaceKey(oldElement, newKey) {
|
|
110
|
+
return ReactElement(
|
|
111
|
+
oldElement.type,
|
|
112
|
+
newKey,
|
|
113
|
+
void 0,
|
|
114
|
+
void 0,
|
|
115
|
+
void 0,
|
|
116
|
+
oldElement.props
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
function isValidElement(object) {
|
|
120
|
+
return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
121
|
+
}
|
|
122
|
+
function escape(key) {
|
|
123
|
+
var escaperLookup = { "=": "=0", ":": "=2" };
|
|
124
|
+
return "$" + key.replace(/[=:]/g, function(match) {
|
|
125
|
+
return escaperLookup[match];
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
var userProvidedKeyEscapeRegex = /\/+/g;
|
|
129
|
+
function getElementKey(element, index) {
|
|
130
|
+
return "object" === typeof element && null !== element && null != element.key ? escape("" + element.key) : index.toString(36);
|
|
131
|
+
}
|
|
132
|
+
function noop$1() {
|
|
133
|
+
}
|
|
134
|
+
function resolveThenable(thenable) {
|
|
135
|
+
switch (thenable.status) {
|
|
136
|
+
case "fulfilled":
|
|
137
|
+
return thenable.value;
|
|
138
|
+
case "rejected":
|
|
139
|
+
throw thenable.reason;
|
|
140
|
+
default:
|
|
141
|
+
switch ("string" === typeof thenable.status ? thenable.then(noop$1, noop$1) : (thenable.status = "pending", thenable.then(
|
|
142
|
+
function(fulfilledValue) {
|
|
143
|
+
"pending" === thenable.status && (thenable.status = "fulfilled", thenable.value = fulfilledValue);
|
|
144
|
+
},
|
|
145
|
+
function(error) {
|
|
146
|
+
"pending" === thenable.status && (thenable.status = "rejected", thenable.reason = error);
|
|
147
|
+
}
|
|
148
|
+
)), thenable.status) {
|
|
149
|
+
case "fulfilled":
|
|
150
|
+
return thenable.value;
|
|
151
|
+
case "rejected":
|
|
152
|
+
throw thenable.reason;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
throw thenable;
|
|
156
|
+
}
|
|
157
|
+
function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
|
|
158
|
+
var type = typeof children;
|
|
159
|
+
if ("undefined" === type || "boolean" === type) children = null;
|
|
160
|
+
var invokeCallback = false;
|
|
161
|
+
if (null === children) invokeCallback = true;
|
|
162
|
+
else
|
|
163
|
+
switch (type) {
|
|
164
|
+
case "bigint":
|
|
165
|
+
case "string":
|
|
166
|
+
case "number":
|
|
167
|
+
invokeCallback = true;
|
|
168
|
+
break;
|
|
169
|
+
case "object":
|
|
170
|
+
switch (children.$$typeof) {
|
|
171
|
+
case REACT_ELEMENT_TYPE:
|
|
172
|
+
case REACT_PORTAL_TYPE:
|
|
173
|
+
invokeCallback = true;
|
|
174
|
+
break;
|
|
175
|
+
case REACT_LAZY_TYPE:
|
|
176
|
+
return invokeCallback = children._init, mapIntoArray(
|
|
177
|
+
invokeCallback(children._payload),
|
|
178
|
+
array,
|
|
179
|
+
escapedPrefix,
|
|
180
|
+
nameSoFar,
|
|
181
|
+
callback
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
if (invokeCallback)
|
|
186
|
+
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) {
|
|
187
|
+
return c;
|
|
188
|
+
})) : null != callback && (isValidElement(callback) && (callback = cloneAndReplaceKey(
|
|
189
|
+
callback,
|
|
190
|
+
escapedPrefix + (null == callback.key || children && children.key === callback.key ? "" : ("" + callback.key).replace(
|
|
191
|
+
userProvidedKeyEscapeRegex,
|
|
192
|
+
"$&/"
|
|
193
|
+
) + "/") + invokeCallback
|
|
194
|
+
)), array.push(callback)), 1;
|
|
195
|
+
invokeCallback = 0;
|
|
196
|
+
var nextNamePrefix = "" === nameSoFar ? "." : nameSoFar + ":";
|
|
197
|
+
if (isArrayImpl(children))
|
|
198
|
+
for (var i = 0; i < children.length; i++)
|
|
199
|
+
nameSoFar = children[i], type = nextNamePrefix + getElementKey(nameSoFar, i), invokeCallback += mapIntoArray(
|
|
200
|
+
nameSoFar,
|
|
201
|
+
array,
|
|
202
|
+
escapedPrefix,
|
|
203
|
+
type,
|
|
204
|
+
callback
|
|
205
|
+
);
|
|
206
|
+
else if (i = getIteratorFn(children), "function" === typeof i)
|
|
207
|
+
for (children = i.call(children), i = 0; !(nameSoFar = children.next()).done; )
|
|
208
|
+
nameSoFar = nameSoFar.value, type = nextNamePrefix + getElementKey(nameSoFar, i++), invokeCallback += mapIntoArray(
|
|
209
|
+
nameSoFar,
|
|
210
|
+
array,
|
|
211
|
+
escapedPrefix,
|
|
212
|
+
type,
|
|
213
|
+
callback
|
|
214
|
+
);
|
|
215
|
+
else if ("object" === type) {
|
|
216
|
+
if ("function" === typeof children.then)
|
|
217
|
+
return mapIntoArray(
|
|
218
|
+
resolveThenable(children),
|
|
219
|
+
array,
|
|
220
|
+
escapedPrefix,
|
|
221
|
+
nameSoFar,
|
|
222
|
+
callback
|
|
223
|
+
);
|
|
224
|
+
array = String(children);
|
|
225
|
+
throw Error(
|
|
226
|
+
"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."
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
return invokeCallback;
|
|
230
|
+
}
|
|
231
|
+
function mapChildren(children, func, context) {
|
|
232
|
+
if (null == children) return children;
|
|
233
|
+
var result = [], count = 0;
|
|
234
|
+
mapIntoArray(children, result, "", "", function(child) {
|
|
235
|
+
return func.call(context, child, count++);
|
|
236
|
+
});
|
|
237
|
+
return result;
|
|
238
|
+
}
|
|
239
|
+
function lazyInitializer(payload) {
|
|
240
|
+
if (-1 === payload._status) {
|
|
241
|
+
var ctor = payload._result;
|
|
242
|
+
ctor = ctor();
|
|
243
|
+
ctor.then(
|
|
244
|
+
function(moduleObject) {
|
|
245
|
+
if (0 === payload._status || -1 === payload._status)
|
|
246
|
+
payload._status = 1, payload._result = moduleObject;
|
|
247
|
+
},
|
|
248
|
+
function(error) {
|
|
249
|
+
if (0 === payload._status || -1 === payload._status)
|
|
250
|
+
payload._status = 2, payload._result = error;
|
|
251
|
+
}
|
|
252
|
+
);
|
|
253
|
+
-1 === payload._status && (payload._status = 0, payload._result = ctor);
|
|
254
|
+
}
|
|
255
|
+
if (1 === payload._status) return payload._result.default;
|
|
256
|
+
throw payload._result;
|
|
257
|
+
}
|
|
258
|
+
var reportGlobalError = "function" === typeof reportError ? reportError : function(error) {
|
|
259
|
+
if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
|
|
260
|
+
var event = new window.ErrorEvent("error", {
|
|
261
|
+
bubbles: true,
|
|
262
|
+
cancelable: true,
|
|
263
|
+
message: "object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error),
|
|
264
|
+
error
|
|
265
|
+
});
|
|
266
|
+
if (!window.dispatchEvent(event)) return;
|
|
267
|
+
} else if ("object" === typeof process && "function" === typeof process.emit) {
|
|
268
|
+
process.emit("uncaughtException", error);
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
console.error(error);
|
|
272
|
+
};
|
|
273
|
+
function noop() {
|
|
274
|
+
}
|
|
275
|
+
exports.Children = {
|
|
276
|
+
map: mapChildren,
|
|
277
|
+
forEach: function(children, forEachFunc, forEachContext) {
|
|
278
|
+
mapChildren(
|
|
279
|
+
children,
|
|
280
|
+
function() {
|
|
281
|
+
forEachFunc.apply(this, arguments);
|
|
282
|
+
},
|
|
283
|
+
forEachContext
|
|
284
|
+
);
|
|
285
|
+
},
|
|
286
|
+
count: function(children) {
|
|
287
|
+
var n = 0;
|
|
288
|
+
mapChildren(children, function() {
|
|
289
|
+
n++;
|
|
290
|
+
});
|
|
291
|
+
return n;
|
|
292
|
+
},
|
|
293
|
+
toArray: function(children) {
|
|
294
|
+
return mapChildren(children, function(child) {
|
|
295
|
+
return child;
|
|
296
|
+
}) || [];
|
|
297
|
+
},
|
|
298
|
+
only: function(children) {
|
|
299
|
+
if (!isValidElement(children))
|
|
300
|
+
throw Error(
|
|
301
|
+
"React.Children.only expected to receive a single React element child."
|
|
302
|
+
);
|
|
303
|
+
return children;
|
|
304
|
+
}
|
|
305
|
+
};
|
|
306
|
+
exports.Component = Component;
|
|
307
|
+
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
308
|
+
exports.Profiler = REACT_PROFILER_TYPE;
|
|
309
|
+
exports.PureComponent = PureComponent;
|
|
310
|
+
exports.StrictMode = REACT_STRICT_MODE_TYPE;
|
|
311
|
+
exports.Suspense = REACT_SUSPENSE_TYPE;
|
|
312
|
+
exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
|
|
313
|
+
exports.__COMPILER_RUNTIME = {
|
|
314
|
+
__proto__: null,
|
|
315
|
+
c: function(size) {
|
|
316
|
+
return ReactSharedInternals.H.useMemoCache(size);
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
exports.cache = function(fn) {
|
|
320
|
+
return function() {
|
|
321
|
+
return fn.apply(null, arguments);
|
|
322
|
+
};
|
|
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, owner = void 0;
|
|
330
|
+
if (null != config)
|
|
331
|
+
for (propName in void 0 !== config.ref && (owner = void 0), 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, void 0, void 0, owner, 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, void 0, void 0, null, 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
|
+
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, createDeps, update) {
|
|
430
|
+
var dispatcher = ReactSharedInternals.H;
|
|
431
|
+
if ("function" === typeof update)
|
|
432
|
+
throw Error(
|
|
433
|
+
"useEffect CRUD overload is not enabled in this build of React."
|
|
434
|
+
);
|
|
435
|
+
return dispatcher.useEffect(create, createDeps);
|
|
436
|
+
};
|
|
437
|
+
exports.useId = function() {
|
|
438
|
+
return ReactSharedInternals.H.useId();
|
|
439
|
+
};
|
|
440
|
+
exports.useImperativeHandle = function(ref, create, deps) {
|
|
441
|
+
return ReactSharedInternals.H.useImperativeHandle(ref, create, deps);
|
|
442
|
+
};
|
|
443
|
+
exports.useInsertionEffect = function(create, deps) {
|
|
444
|
+
return ReactSharedInternals.H.useInsertionEffect(create, deps);
|
|
445
|
+
};
|
|
446
|
+
exports.useLayoutEffect = function(create, deps) {
|
|
447
|
+
return ReactSharedInternals.H.useLayoutEffect(create, deps);
|
|
448
|
+
};
|
|
449
|
+
exports.useMemo = function(create, deps) {
|
|
450
|
+
return ReactSharedInternals.H.useMemo(create, deps);
|
|
451
|
+
};
|
|
452
|
+
exports.useOptimistic = function(passthrough, reducer) {
|
|
453
|
+
return ReactSharedInternals.H.useOptimistic(passthrough, reducer);
|
|
454
|
+
};
|
|
455
|
+
exports.useReducer = function(reducer, initialArg, init) {
|
|
456
|
+
return ReactSharedInternals.H.useReducer(reducer, initialArg, init);
|
|
457
|
+
};
|
|
458
|
+
exports.useRef = function(initialValue) {
|
|
459
|
+
return ReactSharedInternals.H.useRef(initialValue);
|
|
460
|
+
};
|
|
461
|
+
exports.useState = function(initialState) {
|
|
462
|
+
return ReactSharedInternals.H.useState(initialState);
|
|
463
|
+
};
|
|
464
|
+
exports.useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) {
|
|
465
|
+
return ReactSharedInternals.H.useSyncExternalStore(
|
|
466
|
+
subscribe,
|
|
467
|
+
getSnapshot,
|
|
468
|
+
getServerSnapshot
|
|
469
|
+
);
|
|
470
|
+
};
|
|
471
|
+
exports.useTransition = function() {
|
|
472
|
+
return ReactSharedInternals.H.useTransition();
|
|
473
|
+
};
|
|
474
|
+
exports.version = "19.1.0";
|
|
475
|
+
}
|
|
476
|
+
});
|
|
477
|
+
|
|
478
|
+
// ../../node_modules/.pnpm/react@19.1.0/node_modules/react/cjs/react.development.js
|
|
479
|
+
var require_react_development = __commonJS({
|
|
480
|
+
"../../node_modules/.pnpm/react@19.1.0/node_modules/react/cjs/react.development.js"(exports, module) {
|
|
481
|
+
"production" !== process.env.NODE_ENV && function() {
|
|
482
|
+
function defineDeprecationWarning(methodName, info) {
|
|
483
|
+
Object.defineProperty(Component.prototype, methodName, {
|
|
484
|
+
get: function() {
|
|
485
|
+
console.warn(
|
|
486
|
+
"%s(...) is deprecated in plain JavaScript React classes. %s",
|
|
487
|
+
info[0],
|
|
488
|
+
info[1]
|
|
489
|
+
);
|
|
490
|
+
}
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
function getIteratorFn(maybeIterable) {
|
|
494
|
+
if (null === maybeIterable || "object" !== typeof maybeIterable)
|
|
495
|
+
return null;
|
|
496
|
+
maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
|
|
497
|
+
return "function" === typeof maybeIterable ? maybeIterable : null;
|
|
498
|
+
}
|
|
499
|
+
function warnNoop(publicInstance, callerName) {
|
|
500
|
+
publicInstance = (publicInstance = publicInstance.constructor) && (publicInstance.displayName || publicInstance.name) || "ReactClass";
|
|
501
|
+
var warningKey = publicInstance + "." + callerName;
|
|
502
|
+
didWarnStateUpdateForUnmountedComponent[warningKey] || (console.error(
|
|
503
|
+
"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.",
|
|
504
|
+
callerName,
|
|
505
|
+
publicInstance
|
|
506
|
+
), didWarnStateUpdateForUnmountedComponent[warningKey] = true);
|
|
507
|
+
}
|
|
508
|
+
function Component(props, context, updater) {
|
|
509
|
+
this.props = props;
|
|
510
|
+
this.context = context;
|
|
511
|
+
this.refs = emptyObject;
|
|
512
|
+
this.updater = updater || ReactNoopUpdateQueue;
|
|
513
|
+
}
|
|
514
|
+
function ComponentDummy() {
|
|
515
|
+
}
|
|
516
|
+
function PureComponent(props, context, updater) {
|
|
517
|
+
this.props = props;
|
|
518
|
+
this.context = context;
|
|
519
|
+
this.refs = emptyObject;
|
|
520
|
+
this.updater = updater || ReactNoopUpdateQueue;
|
|
521
|
+
}
|
|
522
|
+
function testStringCoercion(value) {
|
|
523
|
+
return "" + value;
|
|
524
|
+
}
|
|
525
|
+
function checkKeyStringCoercion(value) {
|
|
526
|
+
try {
|
|
527
|
+
testStringCoercion(value);
|
|
528
|
+
var JSCompiler_inline_result = false;
|
|
529
|
+
} catch (e) {
|
|
530
|
+
JSCompiler_inline_result = true;
|
|
531
|
+
}
|
|
532
|
+
if (JSCompiler_inline_result) {
|
|
533
|
+
JSCompiler_inline_result = console;
|
|
534
|
+
var JSCompiler_temp_const = JSCompiler_inline_result.error;
|
|
535
|
+
var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
|
|
536
|
+
JSCompiler_temp_const.call(
|
|
537
|
+
JSCompiler_inline_result,
|
|
538
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
539
|
+
JSCompiler_inline_result$jscomp$0
|
|
540
|
+
);
|
|
541
|
+
return testStringCoercion(value);
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
function getComponentNameFromType(type) {
|
|
545
|
+
if (null == type) return null;
|
|
546
|
+
if ("function" === typeof type)
|
|
547
|
+
return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
|
|
548
|
+
if ("string" === typeof type) return type;
|
|
549
|
+
switch (type) {
|
|
550
|
+
case REACT_FRAGMENT_TYPE:
|
|
551
|
+
return "Fragment";
|
|
552
|
+
case REACT_PROFILER_TYPE:
|
|
553
|
+
return "Profiler";
|
|
554
|
+
case REACT_STRICT_MODE_TYPE:
|
|
555
|
+
return "StrictMode";
|
|
556
|
+
case REACT_SUSPENSE_TYPE:
|
|
557
|
+
return "Suspense";
|
|
558
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
559
|
+
return "SuspenseList";
|
|
560
|
+
case REACT_ACTIVITY_TYPE:
|
|
561
|
+
return "Activity";
|
|
562
|
+
}
|
|
563
|
+
if ("object" === typeof type)
|
|
564
|
+
switch ("number" === typeof type.tag && console.error(
|
|
565
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
566
|
+
), type.$$typeof) {
|
|
567
|
+
case REACT_PORTAL_TYPE:
|
|
568
|
+
return "Portal";
|
|
569
|
+
case REACT_CONTEXT_TYPE:
|
|
570
|
+
return (type.displayName || "Context") + ".Provider";
|
|
571
|
+
case REACT_CONSUMER_TYPE:
|
|
572
|
+
return (type._context.displayName || "Context") + ".Consumer";
|
|
573
|
+
case REACT_FORWARD_REF_TYPE:
|
|
574
|
+
var innerType = type.render;
|
|
575
|
+
type = type.displayName;
|
|
576
|
+
type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
|
|
577
|
+
return type;
|
|
578
|
+
case REACT_MEMO_TYPE:
|
|
579
|
+
return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
|
|
580
|
+
case REACT_LAZY_TYPE:
|
|
581
|
+
innerType = type._payload;
|
|
582
|
+
type = type._init;
|
|
583
|
+
try {
|
|
584
|
+
return getComponentNameFromType(type(innerType));
|
|
585
|
+
} catch (x) {
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
return null;
|
|
589
|
+
}
|
|
590
|
+
function getTaskName(type) {
|
|
591
|
+
if (type === REACT_FRAGMENT_TYPE) return "<>";
|
|
592
|
+
if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE)
|
|
593
|
+
return "<...>";
|
|
594
|
+
try {
|
|
595
|
+
var name = getComponentNameFromType(type);
|
|
596
|
+
return name ? "<" + name + ">" : "<...>";
|
|
597
|
+
} catch (x) {
|
|
598
|
+
return "<...>";
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
function getOwner() {
|
|
602
|
+
var dispatcher = ReactSharedInternals.A;
|
|
603
|
+
return null === dispatcher ? null : dispatcher.getOwner();
|
|
604
|
+
}
|
|
605
|
+
function UnknownOwner() {
|
|
606
|
+
return Error("react-stack-top-frame");
|
|
607
|
+
}
|
|
608
|
+
function hasValidKey(config) {
|
|
609
|
+
if (hasOwnProperty.call(config, "key")) {
|
|
610
|
+
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
|
611
|
+
if (getter && getter.isReactWarning) return false;
|
|
612
|
+
}
|
|
613
|
+
return void 0 !== config.key;
|
|
614
|
+
}
|
|
615
|
+
function defineKeyPropWarningGetter(props, displayName) {
|
|
616
|
+
function warnAboutAccessingKey() {
|
|
617
|
+
specialPropKeyWarningShown || (specialPropKeyWarningShown = true, console.error(
|
|
618
|
+
"%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)",
|
|
619
|
+
displayName
|
|
620
|
+
));
|
|
621
|
+
}
|
|
622
|
+
warnAboutAccessingKey.isReactWarning = true;
|
|
623
|
+
Object.defineProperty(props, "key", {
|
|
624
|
+
get: warnAboutAccessingKey,
|
|
625
|
+
configurable: true
|
|
626
|
+
});
|
|
627
|
+
}
|
|
628
|
+
function elementRefGetterWithDeprecationWarning() {
|
|
629
|
+
var componentName = getComponentNameFromType(this.type);
|
|
630
|
+
didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = true, console.error(
|
|
631
|
+
"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."
|
|
632
|
+
));
|
|
633
|
+
componentName = this.props.ref;
|
|
634
|
+
return void 0 !== componentName ? componentName : null;
|
|
635
|
+
}
|
|
636
|
+
function ReactElement(type, key, self, source, owner, props, debugStack, debugTask) {
|
|
637
|
+
self = props.ref;
|
|
638
|
+
type = {
|
|
639
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
640
|
+
type,
|
|
641
|
+
key,
|
|
642
|
+
props,
|
|
643
|
+
_owner: owner
|
|
644
|
+
};
|
|
645
|
+
null !== (void 0 !== self ? self : null) ? Object.defineProperty(type, "ref", {
|
|
646
|
+
enumerable: false,
|
|
647
|
+
get: elementRefGetterWithDeprecationWarning
|
|
648
|
+
}) : Object.defineProperty(type, "ref", { enumerable: false, value: null });
|
|
649
|
+
type._store = {};
|
|
650
|
+
Object.defineProperty(type._store, "validated", {
|
|
651
|
+
configurable: false,
|
|
652
|
+
enumerable: false,
|
|
653
|
+
writable: true,
|
|
654
|
+
value: 0
|
|
655
|
+
});
|
|
656
|
+
Object.defineProperty(type, "_debugInfo", {
|
|
657
|
+
configurable: false,
|
|
658
|
+
enumerable: false,
|
|
659
|
+
writable: true,
|
|
660
|
+
value: null
|
|
661
|
+
});
|
|
662
|
+
Object.defineProperty(type, "_debugStack", {
|
|
663
|
+
configurable: false,
|
|
664
|
+
enumerable: false,
|
|
665
|
+
writable: true,
|
|
666
|
+
value: debugStack
|
|
667
|
+
});
|
|
668
|
+
Object.defineProperty(type, "_debugTask", {
|
|
669
|
+
configurable: false,
|
|
670
|
+
enumerable: false,
|
|
671
|
+
writable: true,
|
|
672
|
+
value: debugTask
|
|
673
|
+
});
|
|
674
|
+
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
|
|
675
|
+
return type;
|
|
676
|
+
}
|
|
677
|
+
function cloneAndReplaceKey(oldElement, newKey) {
|
|
678
|
+
newKey = ReactElement(
|
|
679
|
+
oldElement.type,
|
|
680
|
+
newKey,
|
|
681
|
+
void 0,
|
|
682
|
+
void 0,
|
|
683
|
+
oldElement._owner,
|
|
684
|
+
oldElement.props,
|
|
685
|
+
oldElement._debugStack,
|
|
686
|
+
oldElement._debugTask
|
|
687
|
+
);
|
|
688
|
+
oldElement._store && (newKey._store.validated = oldElement._store.validated);
|
|
689
|
+
return newKey;
|
|
690
|
+
}
|
|
691
|
+
function isValidElement(object) {
|
|
692
|
+
return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
693
|
+
}
|
|
694
|
+
function escape(key) {
|
|
695
|
+
var escaperLookup = { "=": "=0", ":": "=2" };
|
|
696
|
+
return "$" + key.replace(/[=:]/g, function(match) {
|
|
697
|
+
return escaperLookup[match];
|
|
698
|
+
});
|
|
699
|
+
}
|
|
700
|
+
function getElementKey(element, index) {
|
|
701
|
+
return "object" === typeof element && null !== element && null != element.key ? (checkKeyStringCoercion(element.key), escape("" + element.key)) : index.toString(36);
|
|
702
|
+
}
|
|
703
|
+
function noop$1() {
|
|
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$1, noop$1) : (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 ctor = payload._result;
|
|
820
|
+
ctor = ctor();
|
|
821
|
+
ctor.then(
|
|
822
|
+
function(moduleObject) {
|
|
823
|
+
if (0 === payload._status || -1 === payload._status)
|
|
824
|
+
payload._status = 1, payload._result = moduleObject;
|
|
825
|
+
},
|
|
826
|
+
function(error) {
|
|
827
|
+
if (0 === payload._status || -1 === payload._status)
|
|
828
|
+
payload._status = 2, payload._result = error;
|
|
829
|
+
}
|
|
830
|
+
);
|
|
831
|
+
-1 === payload._status && (payload._status = 0, payload._result = ctor);
|
|
832
|
+
}
|
|
833
|
+
if (1 === payload._status)
|
|
834
|
+
return ctor = payload._result, void 0 === ctor && console.error(
|
|
835
|
+
"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?",
|
|
836
|
+
ctor
|
|
837
|
+
), "default" in ctor || console.error(
|
|
838
|
+
"lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",
|
|
839
|
+
ctor
|
|
840
|
+
), ctor.default;
|
|
841
|
+
throw payload._result;
|
|
842
|
+
}
|
|
843
|
+
function resolveDispatcher() {
|
|
844
|
+
var dispatcher = ReactSharedInternals.H;
|
|
845
|
+
null === dispatcher && console.error(
|
|
846
|
+
"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."
|
|
847
|
+
);
|
|
848
|
+
return dispatcher;
|
|
849
|
+
}
|
|
850
|
+
function noop() {
|
|
851
|
+
}
|
|
852
|
+
function enqueueTask(task) {
|
|
853
|
+
if (null === enqueueTaskImpl)
|
|
854
|
+
try {
|
|
855
|
+
var requireString = ("require" + Math.random()).slice(0, 7);
|
|
856
|
+
enqueueTaskImpl = (module && module[requireString]).call(
|
|
857
|
+
module,
|
|
858
|
+
"timers"
|
|
859
|
+
).setImmediate;
|
|
860
|
+
} catch (_err) {
|
|
861
|
+
enqueueTaskImpl = function(callback) {
|
|
862
|
+
false === didWarnAboutMessageChannel && (didWarnAboutMessageChannel = true, "undefined" === typeof MessageChannel && console.error(
|
|
863
|
+
"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."
|
|
864
|
+
));
|
|
865
|
+
var channel = new MessageChannel();
|
|
866
|
+
channel.port1.onmessage = callback;
|
|
867
|
+
channel.port2.postMessage(void 0);
|
|
868
|
+
};
|
|
869
|
+
}
|
|
870
|
+
return enqueueTaskImpl(task);
|
|
871
|
+
}
|
|
872
|
+
function aggregateErrors(errors) {
|
|
873
|
+
return 1 < errors.length && "function" === typeof AggregateError ? new AggregateError(errors) : errors[0];
|
|
874
|
+
}
|
|
875
|
+
function popActScope(prevActQueue, prevActScopeDepth) {
|
|
876
|
+
prevActScopeDepth !== actScopeDepth - 1 && console.error(
|
|
877
|
+
"You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "
|
|
878
|
+
);
|
|
879
|
+
actScopeDepth = prevActScopeDepth;
|
|
880
|
+
}
|
|
881
|
+
function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
|
|
882
|
+
var queue = ReactSharedInternals.actQueue;
|
|
883
|
+
if (null !== queue)
|
|
884
|
+
if (0 !== queue.length)
|
|
885
|
+
try {
|
|
886
|
+
flushActQueue(queue);
|
|
887
|
+
enqueueTask(function() {
|
|
888
|
+
return recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
|
889
|
+
});
|
|
890
|
+
return;
|
|
891
|
+
} catch (error) {
|
|
892
|
+
ReactSharedInternals.thrownErrors.push(error);
|
|
893
|
+
}
|
|
894
|
+
else ReactSharedInternals.actQueue = null;
|
|
895
|
+
0 < ReactSharedInternals.thrownErrors.length ? (queue = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, reject(queue)) : resolve(returnValue);
|
|
896
|
+
}
|
|
897
|
+
function flushActQueue(queue) {
|
|
898
|
+
if (!isFlushing) {
|
|
899
|
+
isFlushing = true;
|
|
900
|
+
var i = 0;
|
|
901
|
+
try {
|
|
902
|
+
for (; i < queue.length; i++) {
|
|
903
|
+
var callback = queue[i];
|
|
904
|
+
do {
|
|
905
|
+
ReactSharedInternals.didUsePromise = false;
|
|
906
|
+
var continuation = callback(false);
|
|
907
|
+
if (null !== continuation) {
|
|
908
|
+
if (ReactSharedInternals.didUsePromise) {
|
|
909
|
+
queue[i] = callback;
|
|
910
|
+
queue.splice(0, i);
|
|
911
|
+
return;
|
|
912
|
+
}
|
|
913
|
+
callback = continuation;
|
|
914
|
+
} else break;
|
|
915
|
+
} while (1);
|
|
916
|
+
}
|
|
917
|
+
queue.length = 0;
|
|
918
|
+
} catch (error) {
|
|
919
|
+
queue.splice(0, i + 1), ReactSharedInternals.thrownErrors.push(error);
|
|
920
|
+
} finally {
|
|
921
|
+
isFlushing = false;
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
926
|
+
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
|
927
|
+
var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), MAYBE_ITERATOR_SYMBOL = Symbol.iterator, didWarnStateUpdateForUnmountedComponent = {}, ReactNoopUpdateQueue = {
|
|
928
|
+
isMounted: function() {
|
|
929
|
+
return false;
|
|
930
|
+
},
|
|
931
|
+
enqueueForceUpdate: function(publicInstance) {
|
|
932
|
+
warnNoop(publicInstance, "forceUpdate");
|
|
933
|
+
},
|
|
934
|
+
enqueueReplaceState: function(publicInstance) {
|
|
935
|
+
warnNoop(publicInstance, "replaceState");
|
|
936
|
+
},
|
|
937
|
+
enqueueSetState: function(publicInstance) {
|
|
938
|
+
warnNoop(publicInstance, "setState");
|
|
939
|
+
}
|
|
940
|
+
}, assign = Object.assign, emptyObject = {};
|
|
941
|
+
Object.freeze(emptyObject);
|
|
942
|
+
Component.prototype.isReactComponent = {};
|
|
943
|
+
Component.prototype.setState = function(partialState, callback) {
|
|
944
|
+
if ("object" !== typeof partialState && "function" !== typeof partialState && null != partialState)
|
|
945
|
+
throw Error(
|
|
946
|
+
"takes an object of state variables to update or a function which returns an object of state variables."
|
|
947
|
+
);
|
|
948
|
+
this.updater.enqueueSetState(this, partialState, callback, "setState");
|
|
949
|
+
};
|
|
950
|
+
Component.prototype.forceUpdate = function(callback) {
|
|
951
|
+
this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
|
|
952
|
+
};
|
|
953
|
+
var deprecatedAPIs = {
|
|
954
|
+
isMounted: [
|
|
955
|
+
"isMounted",
|
|
956
|
+
"Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."
|
|
957
|
+
],
|
|
958
|
+
replaceState: [
|
|
959
|
+
"replaceState",
|
|
960
|
+
"Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."
|
|
961
|
+
]
|
|
962
|
+
}, fnName;
|
|
963
|
+
for (fnName in deprecatedAPIs)
|
|
964
|
+
deprecatedAPIs.hasOwnProperty(fnName) && defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
|
|
965
|
+
ComponentDummy.prototype = Component.prototype;
|
|
966
|
+
deprecatedAPIs = PureComponent.prototype = new ComponentDummy();
|
|
967
|
+
deprecatedAPIs.constructor = PureComponent;
|
|
968
|
+
assign(deprecatedAPIs, Component.prototype);
|
|
969
|
+
deprecatedAPIs.isPureReactComponent = true;
|
|
970
|
+
var isArrayImpl = Array.isArray, REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = {
|
|
971
|
+
H: null,
|
|
972
|
+
A: null,
|
|
973
|
+
T: null,
|
|
974
|
+
S: null,
|
|
975
|
+
V: null,
|
|
976
|
+
actQueue: null,
|
|
977
|
+
isBatchingLegacy: false,
|
|
978
|
+
didScheduleLegacyUpdate: false,
|
|
979
|
+
didUsePromise: false,
|
|
980
|
+
thrownErrors: [],
|
|
981
|
+
getCurrentStack: null,
|
|
982
|
+
recentlyCreatedOwnerStacks: 0
|
|
983
|
+
}, hasOwnProperty = Object.prototype.hasOwnProperty, createTask = console.createTask ? console.createTask : function() {
|
|
984
|
+
return null;
|
|
985
|
+
};
|
|
986
|
+
deprecatedAPIs = {
|
|
987
|
+
"react-stack-bottom-frame": function(callStackForError) {
|
|
988
|
+
return callStackForError();
|
|
989
|
+
}
|
|
990
|
+
};
|
|
991
|
+
var specialPropKeyWarningShown, didWarnAboutOldJSXRuntime;
|
|
992
|
+
var didWarnAboutElementRef = {};
|
|
993
|
+
var unknownOwnerDebugStack = deprecatedAPIs["react-stack-bottom-frame"].bind(deprecatedAPIs, UnknownOwner)();
|
|
994
|
+
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
|
995
|
+
var didWarnAboutMaps = false, userProvidedKeyEscapeRegex = /\/+/g, reportGlobalError = "function" === typeof reportError ? reportError : function(error) {
|
|
996
|
+
if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
|
|
997
|
+
var event = new window.ErrorEvent("error", {
|
|
998
|
+
bubbles: true,
|
|
999
|
+
cancelable: true,
|
|
1000
|
+
message: "object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error),
|
|
1001
|
+
error
|
|
1002
|
+
});
|
|
1003
|
+
if (!window.dispatchEvent(event)) return;
|
|
1004
|
+
} else if ("object" === typeof process && "function" === typeof process.emit) {
|
|
1005
|
+
process.emit("uncaughtException", error);
|
|
1006
|
+
return;
|
|
1007
|
+
}
|
|
1008
|
+
console.error(error);
|
|
1009
|
+
}, didWarnAboutMessageChannel = false, enqueueTaskImpl = null, actScopeDepth = 0, didWarnNoAwaitAct = false, isFlushing = false, queueSeveralMicrotasks = "function" === typeof queueMicrotask ? function(callback) {
|
|
1010
|
+
queueMicrotask(function() {
|
|
1011
|
+
return queueMicrotask(callback);
|
|
1012
|
+
});
|
|
1013
|
+
} : enqueueTask;
|
|
1014
|
+
deprecatedAPIs = Object.freeze({
|
|
1015
|
+
__proto__: null,
|
|
1016
|
+
c: function(size) {
|
|
1017
|
+
return resolveDispatcher().useMemoCache(size);
|
|
1018
|
+
}
|
|
1019
|
+
});
|
|
1020
|
+
exports.Children = {
|
|
1021
|
+
map: mapChildren,
|
|
1022
|
+
forEach: function(children, forEachFunc, forEachContext) {
|
|
1023
|
+
mapChildren(
|
|
1024
|
+
children,
|
|
1025
|
+
function() {
|
|
1026
|
+
forEachFunc.apply(this, arguments);
|
|
1027
|
+
},
|
|
1028
|
+
forEachContext
|
|
1029
|
+
);
|
|
1030
|
+
},
|
|
1031
|
+
count: function(children) {
|
|
1032
|
+
var n = 0;
|
|
1033
|
+
mapChildren(children, function() {
|
|
1034
|
+
n++;
|
|
1035
|
+
});
|
|
1036
|
+
return n;
|
|
1037
|
+
},
|
|
1038
|
+
toArray: function(children) {
|
|
1039
|
+
return mapChildren(children, function(child) {
|
|
1040
|
+
return child;
|
|
1041
|
+
}) || [];
|
|
1042
|
+
},
|
|
1043
|
+
only: function(children) {
|
|
1044
|
+
if (!isValidElement(children))
|
|
1045
|
+
throw Error(
|
|
1046
|
+
"React.Children.only expected to receive a single React element child."
|
|
1047
|
+
);
|
|
1048
|
+
return children;
|
|
1049
|
+
}
|
|
1050
|
+
};
|
|
1051
|
+
exports.Component = Component;
|
|
1052
|
+
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
1053
|
+
exports.Profiler = REACT_PROFILER_TYPE;
|
|
1054
|
+
exports.PureComponent = PureComponent;
|
|
1055
|
+
exports.StrictMode = REACT_STRICT_MODE_TYPE;
|
|
1056
|
+
exports.Suspense = REACT_SUSPENSE_TYPE;
|
|
1057
|
+
exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
|
|
1058
|
+
exports.__COMPILER_RUNTIME = deprecatedAPIs;
|
|
1059
|
+
exports.act = function(callback) {
|
|
1060
|
+
var prevActQueue = ReactSharedInternals.actQueue, prevActScopeDepth = actScopeDepth;
|
|
1061
|
+
actScopeDepth++;
|
|
1062
|
+
var queue = ReactSharedInternals.actQueue = null !== prevActQueue ? prevActQueue : [], didAwaitActCall = false;
|
|
1063
|
+
try {
|
|
1064
|
+
var result = callback();
|
|
1065
|
+
} catch (error) {
|
|
1066
|
+
ReactSharedInternals.thrownErrors.push(error);
|
|
1067
|
+
}
|
|
1068
|
+
if (0 < ReactSharedInternals.thrownErrors.length)
|
|
1069
|
+
throw popActScope(prevActQueue, prevActScopeDepth), callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
|
|
1070
|
+
if (null !== result && "object" === typeof result && "function" === typeof result.then) {
|
|
1071
|
+
var thenable = result;
|
|
1072
|
+
queueSeveralMicrotasks(function() {
|
|
1073
|
+
didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = true, console.error(
|
|
1074
|
+
"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 () => ...);"
|
|
1075
|
+
));
|
|
1076
|
+
});
|
|
1077
|
+
return {
|
|
1078
|
+
then: function(resolve, reject) {
|
|
1079
|
+
didAwaitActCall = true;
|
|
1080
|
+
thenable.then(
|
|
1081
|
+
function(returnValue) {
|
|
1082
|
+
popActScope(prevActQueue, prevActScopeDepth);
|
|
1083
|
+
if (0 === prevActScopeDepth) {
|
|
1084
|
+
try {
|
|
1085
|
+
flushActQueue(queue), enqueueTask(function() {
|
|
1086
|
+
return recursivelyFlushAsyncActWork(
|
|
1087
|
+
returnValue,
|
|
1088
|
+
resolve,
|
|
1089
|
+
reject
|
|
1090
|
+
);
|
|
1091
|
+
});
|
|
1092
|
+
} catch (error$0) {
|
|
1093
|
+
ReactSharedInternals.thrownErrors.push(error$0);
|
|
1094
|
+
}
|
|
1095
|
+
if (0 < ReactSharedInternals.thrownErrors.length) {
|
|
1096
|
+
var _thrownError = aggregateErrors(
|
|
1097
|
+
ReactSharedInternals.thrownErrors
|
|
1098
|
+
);
|
|
1099
|
+
ReactSharedInternals.thrownErrors.length = 0;
|
|
1100
|
+
reject(_thrownError);
|
|
1101
|
+
}
|
|
1102
|
+
} else resolve(returnValue);
|
|
1103
|
+
},
|
|
1104
|
+
function(error) {
|
|
1105
|
+
popActScope(prevActQueue, prevActScopeDepth);
|
|
1106
|
+
0 < ReactSharedInternals.thrownErrors.length ? (error = aggregateErrors(
|
|
1107
|
+
ReactSharedInternals.thrownErrors
|
|
1108
|
+
), ReactSharedInternals.thrownErrors.length = 0, reject(error)) : reject(error);
|
|
1109
|
+
}
|
|
1110
|
+
);
|
|
1111
|
+
}
|
|
1112
|
+
};
|
|
1113
|
+
}
|
|
1114
|
+
var returnValue$jscomp$0 = result;
|
|
1115
|
+
popActScope(prevActQueue, prevActScopeDepth);
|
|
1116
|
+
0 === prevActScopeDepth && (flushActQueue(queue), 0 !== queue.length && queueSeveralMicrotasks(function() {
|
|
1117
|
+
didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = true, console.error(
|
|
1118
|
+
"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(() => ...)"
|
|
1119
|
+
));
|
|
1120
|
+
}), ReactSharedInternals.actQueue = null);
|
|
1121
|
+
if (0 < ReactSharedInternals.thrownErrors.length)
|
|
1122
|
+
throw callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
|
|
1123
|
+
return {
|
|
1124
|
+
then: function(resolve, reject) {
|
|
1125
|
+
didAwaitActCall = true;
|
|
1126
|
+
0 === prevActScopeDepth ? (ReactSharedInternals.actQueue = queue, enqueueTask(function() {
|
|
1127
|
+
return recursivelyFlushAsyncActWork(
|
|
1128
|
+
returnValue$jscomp$0,
|
|
1129
|
+
resolve,
|
|
1130
|
+
reject
|
|
1131
|
+
);
|
|
1132
|
+
})) : resolve(returnValue$jscomp$0);
|
|
1133
|
+
}
|
|
1134
|
+
};
|
|
1135
|
+
};
|
|
1136
|
+
exports.cache = function(fn) {
|
|
1137
|
+
return function() {
|
|
1138
|
+
return fn.apply(null, arguments);
|
|
1139
|
+
};
|
|
1140
|
+
};
|
|
1141
|
+
exports.captureOwnerStack = function() {
|
|
1142
|
+
var getCurrentStack = ReactSharedInternals.getCurrentStack;
|
|
1143
|
+
return null === getCurrentStack ? null : getCurrentStack();
|
|
1144
|
+
};
|
|
1145
|
+
exports.cloneElement = function(element, config, children) {
|
|
1146
|
+
if (null === element || void 0 === element)
|
|
1147
|
+
throw Error(
|
|
1148
|
+
"The argument must be a React element, but you passed " + element + "."
|
|
1149
|
+
);
|
|
1150
|
+
var props = assign({}, element.props), key = element.key, owner = element._owner;
|
|
1151
|
+
if (null != config) {
|
|
1152
|
+
var JSCompiler_inline_result;
|
|
1153
|
+
a: {
|
|
1154
|
+
if (hasOwnProperty.call(config, "ref") && (JSCompiler_inline_result = Object.getOwnPropertyDescriptor(
|
|
1155
|
+
config,
|
|
1156
|
+
"ref"
|
|
1157
|
+
).get) && JSCompiler_inline_result.isReactWarning) {
|
|
1158
|
+
JSCompiler_inline_result = false;
|
|
1159
|
+
break a;
|
|
1160
|
+
}
|
|
1161
|
+
JSCompiler_inline_result = void 0 !== config.ref;
|
|
1162
|
+
}
|
|
1163
|
+
JSCompiler_inline_result && (owner = getOwner());
|
|
1164
|
+
hasValidKey(config) && (checkKeyStringCoercion(config.key), key = "" + config.key);
|
|
1165
|
+
for (propName in config)
|
|
1166
|
+
!hasOwnProperty.call(config, propName) || "key" === propName || "__self" === propName || "__source" === propName || "ref" === propName && void 0 === config.ref || (props[propName] = config[propName]);
|
|
1167
|
+
}
|
|
1168
|
+
var propName = arguments.length - 2;
|
|
1169
|
+
if (1 === propName) props.children = children;
|
|
1170
|
+
else if (1 < propName) {
|
|
1171
|
+
JSCompiler_inline_result = Array(propName);
|
|
1172
|
+
for (var i = 0; i < propName; i++)
|
|
1173
|
+
JSCompiler_inline_result[i] = arguments[i + 2];
|
|
1174
|
+
props.children = JSCompiler_inline_result;
|
|
1175
|
+
}
|
|
1176
|
+
props = ReactElement(
|
|
1177
|
+
element.type,
|
|
1178
|
+
key,
|
|
1179
|
+
void 0,
|
|
1180
|
+
void 0,
|
|
1181
|
+
owner,
|
|
1182
|
+
props,
|
|
1183
|
+
element._debugStack,
|
|
1184
|
+
element._debugTask
|
|
1185
|
+
);
|
|
1186
|
+
for (key = 2; key < arguments.length; key++)
|
|
1187
|
+
owner = arguments[key], isValidElement(owner) && owner._store && (owner._store.validated = 1);
|
|
1188
|
+
return props;
|
|
1189
|
+
};
|
|
1190
|
+
exports.createContext = function(defaultValue) {
|
|
1191
|
+
defaultValue = {
|
|
1192
|
+
$$typeof: REACT_CONTEXT_TYPE,
|
|
1193
|
+
_currentValue: defaultValue,
|
|
1194
|
+
_currentValue2: defaultValue,
|
|
1195
|
+
_threadCount: 0,
|
|
1196
|
+
Provider: null,
|
|
1197
|
+
Consumer: null
|
|
1198
|
+
};
|
|
1199
|
+
defaultValue.Provider = defaultValue;
|
|
1200
|
+
defaultValue.Consumer = {
|
|
1201
|
+
$$typeof: REACT_CONSUMER_TYPE,
|
|
1202
|
+
_context: defaultValue
|
|
1203
|
+
};
|
|
1204
|
+
defaultValue._currentRenderer = null;
|
|
1205
|
+
defaultValue._currentRenderer2 = null;
|
|
1206
|
+
return defaultValue;
|
|
1207
|
+
};
|
|
1208
|
+
exports.createElement = function(type, config, children) {
|
|
1209
|
+
for (var i = 2; i < arguments.length; i++) {
|
|
1210
|
+
var node = arguments[i];
|
|
1211
|
+
isValidElement(node) && node._store && (node._store.validated = 1);
|
|
1212
|
+
}
|
|
1213
|
+
i = {};
|
|
1214
|
+
node = null;
|
|
1215
|
+
if (null != config)
|
|
1216
|
+
for (propName in didWarnAboutOldJSXRuntime || !("__self" in config) || "key" in config || (didWarnAboutOldJSXRuntime = true, console.warn(
|
|
1217
|
+
"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"
|
|
1218
|
+
)), hasValidKey(config) && (checkKeyStringCoercion(config.key), node = "" + config.key), config)
|
|
1219
|
+
hasOwnProperty.call(config, propName) && "key" !== propName && "__self" !== propName && "__source" !== propName && (i[propName] = config[propName]);
|
|
1220
|
+
var childrenLength = arguments.length - 2;
|
|
1221
|
+
if (1 === childrenLength) i.children = children;
|
|
1222
|
+
else if (1 < childrenLength) {
|
|
1223
|
+
for (var childArray = Array(childrenLength), _i = 0; _i < childrenLength; _i++)
|
|
1224
|
+
childArray[_i] = arguments[_i + 2];
|
|
1225
|
+
Object.freeze && Object.freeze(childArray);
|
|
1226
|
+
i.children = childArray;
|
|
1227
|
+
}
|
|
1228
|
+
if (type && type.defaultProps)
|
|
1229
|
+
for (propName in childrenLength = type.defaultProps, childrenLength)
|
|
1230
|
+
void 0 === i[propName] && (i[propName] = childrenLength[propName]);
|
|
1231
|
+
node && defineKeyPropWarningGetter(
|
|
1232
|
+
i,
|
|
1233
|
+
"function" === typeof type ? type.displayName || type.name || "Unknown" : type
|
|
1234
|
+
);
|
|
1235
|
+
var propName = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
|
1236
|
+
return ReactElement(
|
|
1237
|
+
type,
|
|
1238
|
+
node,
|
|
1239
|
+
void 0,
|
|
1240
|
+
void 0,
|
|
1241
|
+
getOwner(),
|
|
1242
|
+
i,
|
|
1243
|
+
propName ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
|
|
1244
|
+
propName ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
|
1245
|
+
);
|
|
1246
|
+
};
|
|
1247
|
+
exports.createRef = function() {
|
|
1248
|
+
var refObject = { current: null };
|
|
1249
|
+
Object.seal(refObject);
|
|
1250
|
+
return refObject;
|
|
1251
|
+
};
|
|
1252
|
+
exports.forwardRef = function(render) {
|
|
1253
|
+
null != render && render.$$typeof === REACT_MEMO_TYPE ? console.error(
|
|
1254
|
+
"forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."
|
|
1255
|
+
) : "function" !== typeof render ? console.error(
|
|
1256
|
+
"forwardRef requires a render function but was given %s.",
|
|
1257
|
+
null === render ? "null" : typeof render
|
|
1258
|
+
) : 0 !== render.length && 2 !== render.length && console.error(
|
|
1259
|
+
"forwardRef render functions accept exactly two parameters: props and ref. %s",
|
|
1260
|
+
1 === render.length ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined."
|
|
1261
|
+
);
|
|
1262
|
+
null != render && null != render.defaultProps && console.error(
|
|
1263
|
+
"forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?"
|
|
1264
|
+
);
|
|
1265
|
+
var elementType = { $$typeof: REACT_FORWARD_REF_TYPE, render }, ownName;
|
|
1266
|
+
Object.defineProperty(elementType, "displayName", {
|
|
1267
|
+
enumerable: false,
|
|
1268
|
+
configurable: true,
|
|
1269
|
+
get: function() {
|
|
1270
|
+
return ownName;
|
|
1271
|
+
},
|
|
1272
|
+
set: function(name) {
|
|
1273
|
+
ownName = name;
|
|
1274
|
+
render.name || render.displayName || (Object.defineProperty(render, "name", { value: name }), render.displayName = name);
|
|
1275
|
+
}
|
|
1276
|
+
});
|
|
1277
|
+
return elementType;
|
|
1278
|
+
};
|
|
1279
|
+
exports.isValidElement = isValidElement;
|
|
1280
|
+
exports.lazy = function(ctor) {
|
|
1281
|
+
return {
|
|
1282
|
+
$$typeof: REACT_LAZY_TYPE,
|
|
1283
|
+
_payload: { _status: -1, _result: ctor },
|
|
1284
|
+
_init: lazyInitializer
|
|
1285
|
+
};
|
|
1286
|
+
};
|
|
1287
|
+
exports.memo = function(type, compare) {
|
|
1288
|
+
null == type && console.error(
|
|
1289
|
+
"memo: The first argument must be a component. Instead received: %s",
|
|
1290
|
+
null === type ? "null" : typeof type
|
|
1291
|
+
);
|
|
1292
|
+
compare = {
|
|
1293
|
+
$$typeof: REACT_MEMO_TYPE,
|
|
1294
|
+
type,
|
|
1295
|
+
compare: void 0 === compare ? null : compare
|
|
1296
|
+
};
|
|
1297
|
+
var ownName;
|
|
1298
|
+
Object.defineProperty(compare, "displayName", {
|
|
1299
|
+
enumerable: false,
|
|
1300
|
+
configurable: true,
|
|
1301
|
+
get: function() {
|
|
1302
|
+
return ownName;
|
|
1303
|
+
},
|
|
1304
|
+
set: function(name) {
|
|
1305
|
+
ownName = name;
|
|
1306
|
+
type.name || type.displayName || (Object.defineProperty(type, "name", { value: name }), type.displayName = name);
|
|
1307
|
+
}
|
|
1308
|
+
});
|
|
1309
|
+
return compare;
|
|
1310
|
+
};
|
|
1311
|
+
exports.startTransition = function(scope) {
|
|
1312
|
+
var prevTransition = ReactSharedInternals.T, currentTransition = {};
|
|
1313
|
+
ReactSharedInternals.T = currentTransition;
|
|
1314
|
+
currentTransition._updatedFibers = /* @__PURE__ */ new Set();
|
|
1315
|
+
try {
|
|
1316
|
+
var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S;
|
|
1317
|
+
null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
|
|
1318
|
+
"object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && returnValue.then(noop, reportGlobalError);
|
|
1319
|
+
} catch (error) {
|
|
1320
|
+
reportGlobalError(error);
|
|
1321
|
+
} finally {
|
|
1322
|
+
null === prevTransition && currentTransition._updatedFibers && (scope = currentTransition._updatedFibers.size, currentTransition._updatedFibers.clear(), 10 < scope && console.warn(
|
|
1323
|
+
"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."
|
|
1324
|
+
)), ReactSharedInternals.T = prevTransition;
|
|
1325
|
+
}
|
|
1326
|
+
};
|
|
1327
|
+
exports.unstable_useCacheRefresh = function() {
|
|
1328
|
+
return resolveDispatcher().useCacheRefresh();
|
|
1329
|
+
};
|
|
1330
|
+
exports.use = function(usable) {
|
|
1331
|
+
return resolveDispatcher().use(usable);
|
|
1332
|
+
};
|
|
1333
|
+
exports.useActionState = function(action, initialState, permalink) {
|
|
1334
|
+
return resolveDispatcher().useActionState(
|
|
1335
|
+
action,
|
|
1336
|
+
initialState,
|
|
1337
|
+
permalink
|
|
1338
|
+
);
|
|
1339
|
+
};
|
|
1340
|
+
exports.useCallback = function(callback, deps) {
|
|
1341
|
+
return resolveDispatcher().useCallback(callback, deps);
|
|
1342
|
+
};
|
|
1343
|
+
exports.useContext = function(Context) {
|
|
1344
|
+
var dispatcher = resolveDispatcher();
|
|
1345
|
+
Context.$$typeof === REACT_CONSUMER_TYPE && console.error(
|
|
1346
|
+
"Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"
|
|
1347
|
+
);
|
|
1348
|
+
return dispatcher.useContext(Context);
|
|
1349
|
+
};
|
|
1350
|
+
exports.useDebugValue = function(value, formatterFn) {
|
|
1351
|
+
return resolveDispatcher().useDebugValue(value, formatterFn);
|
|
1352
|
+
};
|
|
1353
|
+
exports.useDeferredValue = function(value, initialValue) {
|
|
1354
|
+
return resolveDispatcher().useDeferredValue(value, initialValue);
|
|
1355
|
+
};
|
|
1356
|
+
exports.useEffect = function(create, createDeps, update) {
|
|
1357
|
+
null == create && console.warn(
|
|
1358
|
+
"React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"
|
|
1359
|
+
);
|
|
1360
|
+
var dispatcher = resolveDispatcher();
|
|
1361
|
+
if ("function" === typeof update)
|
|
1362
|
+
throw Error(
|
|
1363
|
+
"useEffect CRUD overload is not enabled in this build of React."
|
|
1364
|
+
);
|
|
1365
|
+
return dispatcher.useEffect(create, createDeps);
|
|
1366
|
+
};
|
|
1367
|
+
exports.useId = function() {
|
|
1368
|
+
return resolveDispatcher().useId();
|
|
1369
|
+
};
|
|
1370
|
+
exports.useImperativeHandle = function(ref, create, deps) {
|
|
1371
|
+
return resolveDispatcher().useImperativeHandle(ref, create, deps);
|
|
1372
|
+
};
|
|
1373
|
+
exports.useInsertionEffect = function(create, deps) {
|
|
1374
|
+
null == create && console.warn(
|
|
1375
|
+
"React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"
|
|
1376
|
+
);
|
|
1377
|
+
return resolveDispatcher().useInsertionEffect(create, deps);
|
|
1378
|
+
};
|
|
1379
|
+
exports.useLayoutEffect = function(create, deps) {
|
|
1380
|
+
null == create && console.warn(
|
|
1381
|
+
"React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"
|
|
1382
|
+
);
|
|
1383
|
+
return resolveDispatcher().useLayoutEffect(create, deps);
|
|
1384
|
+
};
|
|
1385
|
+
exports.useMemo = function(create, deps) {
|
|
1386
|
+
return resolveDispatcher().useMemo(create, deps);
|
|
1387
|
+
};
|
|
1388
|
+
exports.useOptimistic = function(passthrough, reducer) {
|
|
1389
|
+
return resolveDispatcher().useOptimistic(passthrough, reducer);
|
|
1390
|
+
};
|
|
1391
|
+
exports.useReducer = function(reducer, initialArg, init) {
|
|
1392
|
+
return resolveDispatcher().useReducer(reducer, initialArg, init);
|
|
1393
|
+
};
|
|
1394
|
+
exports.useRef = function(initialValue) {
|
|
1395
|
+
return resolveDispatcher().useRef(initialValue);
|
|
1396
|
+
};
|
|
1397
|
+
exports.useState = function(initialState) {
|
|
1398
|
+
return resolveDispatcher().useState(initialState);
|
|
1399
|
+
};
|
|
1400
|
+
exports.useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) {
|
|
1401
|
+
return resolveDispatcher().useSyncExternalStore(
|
|
1402
|
+
subscribe,
|
|
1403
|
+
getSnapshot,
|
|
1404
|
+
getServerSnapshot
|
|
1405
|
+
);
|
|
1406
|
+
};
|
|
1407
|
+
exports.useTransition = function() {
|
|
1408
|
+
return resolveDispatcher().useTransition();
|
|
1409
|
+
};
|
|
1410
|
+
exports.version = "19.1.0";
|
|
1411
|
+
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
1412
|
+
}();
|
|
1413
|
+
}
|
|
1414
|
+
});
|
|
1415
|
+
|
|
1416
|
+
// ../../node_modules/.pnpm/react@19.1.0/node_modules/react/index.js
|
|
1417
|
+
var require_react = __commonJS({
|
|
1418
|
+
"../../node_modules/.pnpm/react@19.1.0/node_modules/react/index.js"(exports, module) {
|
|
1419
|
+
if (process.env.NODE_ENV === "production") {
|
|
1420
|
+
module.exports = require_react_production();
|
|
1421
|
+
} else {
|
|
1422
|
+
module.exports = require_react_development();
|
|
1423
|
+
}
|
|
1424
|
+
}
|
|
1425
|
+
});
|
|
1426
|
+
|
|
1427
|
+
// src/common/common-bridge.ts
|
|
1428
|
+
var CommonBridge = class {
|
|
1429
|
+
commonHello() {
|
|
1430
|
+
console.log("commonHello");
|
|
11
1431
|
}
|
|
1432
|
+
};
|
|
1433
|
+
|
|
1434
|
+
// src/common/common-bridge-core.ts
|
|
1435
|
+
var CommonBridgeCore = class {
|
|
12
1436
|
/**
|
|
13
|
-
*
|
|
1437
|
+
* 코어에서 사용할 프로미스 ID 생성 함수
|
|
14
1438
|
* @returns
|
|
15
1439
|
*/
|
|
16
1440
|
generatePromiseId() {
|
|
@@ -18,6 +1442,143 @@ var Core = class {
|
|
|
18
1442
|
const random = Math.random().toString(36).slice(2, 11);
|
|
19
1443
|
return `${timestamp}_${random}`;
|
|
20
1444
|
}
|
|
1445
|
+
};
|
|
1446
|
+
|
|
1447
|
+
// src/iframe/core/iframe-bridge-core.ts
|
|
1448
|
+
var IframeBridgeCore = class extends CommonBridgeCore {
|
|
1449
|
+
constructor() {
|
|
1450
|
+
super();
|
|
1451
|
+
__publicField(this, "pendingPromises", /* @__PURE__ */ new Map());
|
|
1452
|
+
__publicField(this, "responseHandler");
|
|
1453
|
+
this.initializeIframeBridge();
|
|
1454
|
+
}
|
|
1455
|
+
/**
|
|
1456
|
+
* 사용하는 쪽에서 응답핸들러를 사용할 수 있도록 필요시, 응답 처리 핸들러 설정
|
|
1457
|
+
*/
|
|
1458
|
+
setResponseHandler(handler) {
|
|
1459
|
+
this.responseHandler = handler;
|
|
1460
|
+
}
|
|
1461
|
+
handleIframeBridgePromise(response) {
|
|
1462
|
+
const { promiseId, isSuccess, data } = response;
|
|
1463
|
+
const promise = this.pendingPromises.get(promiseId);
|
|
1464
|
+
if (promise) {
|
|
1465
|
+
this.pendingPromises.delete(promiseId);
|
|
1466
|
+
if (isSuccess) {
|
|
1467
|
+
promise.resolve(data);
|
|
1468
|
+
} else {
|
|
1469
|
+
promise.reject(new Error(data));
|
|
1470
|
+
}
|
|
1471
|
+
return true;
|
|
1472
|
+
}
|
|
1473
|
+
return false;
|
|
1474
|
+
}
|
|
1475
|
+
/**
|
|
1476
|
+
* 특정 Promise 존재 여부 확인
|
|
1477
|
+
*/
|
|
1478
|
+
hasPromise(promiseId) {
|
|
1479
|
+
return this.pendingPromises.has(promiseId);
|
|
1480
|
+
}
|
|
1481
|
+
/**
|
|
1482
|
+
* 네이티브 통신을 위해 window.n2bridge 객체 초기화
|
|
1483
|
+
*/
|
|
1484
|
+
initializeIframeBridge() {
|
|
1485
|
+
console.log("[IframeBridgeCore] initialized Iframe Bridge");
|
|
1486
|
+
salesFrontendUtils.MessageEventManager.getInstance().registerHandler("iframe-bridge", this.handleMessageEventResponse.bind(this));
|
|
1487
|
+
}
|
|
1488
|
+
/**
|
|
1489
|
+
* 브릿지 메시지 이벤트 핸들러
|
|
1490
|
+
* @param event
|
|
1491
|
+
*/
|
|
1492
|
+
handleMessageEventResponse(event) {
|
|
1493
|
+
const { promiseId, isSuccess, data } = event.data;
|
|
1494
|
+
if (this.responseHandler) {
|
|
1495
|
+
this.responseHandler({ promiseId, isSuccess, data });
|
|
1496
|
+
}
|
|
1497
|
+
if (this.pendingPromises.has(promiseId)) {
|
|
1498
|
+
this.handleIframeBridgePromise({ promiseId, isSuccess, data });
|
|
1499
|
+
}
|
|
1500
|
+
}
|
|
1501
|
+
/**
|
|
1502
|
+
* Iframe 통신
|
|
1503
|
+
* @param eventName
|
|
1504
|
+
* @param option
|
|
1505
|
+
* @returns
|
|
1506
|
+
*/
|
|
1507
|
+
async callToTarget(eventName, option) {
|
|
1508
|
+
return new Promise((resolve, reject) => {
|
|
1509
|
+
const promiseId = `${eventName}_${this.generatePromiseId()}`;
|
|
1510
|
+
this.pendingPromises.set(promiseId, { resolve, reject });
|
|
1511
|
+
try {
|
|
1512
|
+
const command = {
|
|
1513
|
+
eventName,
|
|
1514
|
+
promiseId,
|
|
1515
|
+
option
|
|
1516
|
+
};
|
|
1517
|
+
console.log("[IframeBridgeCore callToIframe] command::", command);
|
|
1518
|
+
const platform = salesFrontendUtils.getDspExecutionEnvironment();
|
|
1519
|
+
if (platform === "iframe") {
|
|
1520
|
+
window.parent.postMessage(command, "*");
|
|
1521
|
+
const promise = this.pendingPromises.get(promiseId);
|
|
1522
|
+
if (promise) {
|
|
1523
|
+
this.pendingPromises.delete(promiseId);
|
|
1524
|
+
promise.resolve(true);
|
|
1525
|
+
}
|
|
1526
|
+
return;
|
|
1527
|
+
}
|
|
1528
|
+
console.warn(
|
|
1529
|
+
`[IframeBridgeCore callToIframe] \uD604\uC7AC \uD50C\uB7AB\uD3FC(${platform})\uC5D0\uC11C\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 \uC11C\uBE44\uC2A4(${eventName})\uC785\uB2C8\uB2E4.`
|
|
1530
|
+
);
|
|
1531
|
+
this.pendingPromises.delete(promiseId);
|
|
1532
|
+
reject(new Error(`[IframeBridgeCore callToIframe] Unsupported platform: ${platform}`));
|
|
1533
|
+
} catch (error) {
|
|
1534
|
+
console.error("[IframeBridgeCore callToIframe] error::", error);
|
|
1535
|
+
this.pendingPromises.delete(promiseId);
|
|
1536
|
+
reject(error);
|
|
1537
|
+
}
|
|
1538
|
+
});
|
|
1539
|
+
}
|
|
1540
|
+
};
|
|
1541
|
+
|
|
1542
|
+
// src/iframe/bridge/iframe-bridge.ts
|
|
1543
|
+
var IframeBridge = class extends CommonBridge {
|
|
1544
|
+
constructor() {
|
|
1545
|
+
super();
|
|
1546
|
+
__publicField(this, "core");
|
|
1547
|
+
this.core = new IframeBridgeCore();
|
|
1548
|
+
}
|
|
1549
|
+
// 응답 핸들러 설정
|
|
1550
|
+
setResponseHandler(handler) {
|
|
1551
|
+
this.core.setResponseHandler(handler);
|
|
1552
|
+
}
|
|
1553
|
+
// Promise 직접 제어 메서드들 추가
|
|
1554
|
+
handleIframeBridgePromise(response) {
|
|
1555
|
+
return this.core.handleIframeBridgePromise(response);
|
|
1556
|
+
}
|
|
1557
|
+
// 유틸리티 메서드들도 추가
|
|
1558
|
+
hasPromise(promiseId) {
|
|
1559
|
+
return this.core.hasPromise(promiseId);
|
|
1560
|
+
}
|
|
1561
|
+
/**
|
|
1562
|
+
* Iframe, App 공통으로 구현해야할 함수(test)
|
|
1563
|
+
*/
|
|
1564
|
+
hello() {
|
|
1565
|
+
console.log("[IframeBridge] hello");
|
|
1566
|
+
}
|
|
1567
|
+
/**
|
|
1568
|
+
* 영업포탈 tab open
|
|
1569
|
+
* @param options
|
|
1570
|
+
* @returns
|
|
1571
|
+
*/
|
|
1572
|
+
async openMdi(options) {
|
|
1573
|
+
return this.core.callToTarget("openMdi", options);
|
|
1574
|
+
}
|
|
1575
|
+
// TODO: 필요 플러그인들 추가
|
|
1576
|
+
};
|
|
1577
|
+
var NativeBridgeCore = class extends CommonBridgeCore {
|
|
1578
|
+
constructor() {
|
|
1579
|
+
super();
|
|
1580
|
+
this.initializeWindowBridge();
|
|
1581
|
+
}
|
|
21
1582
|
/**
|
|
22
1583
|
* 네이티브 통신을 위해 window.n2bridge 객체 초기화
|
|
23
1584
|
*/
|
|
@@ -50,10 +1611,10 @@ var Core = class {
|
|
|
50
1611
|
*/
|
|
51
1612
|
createResolvePromiseHandler() {
|
|
52
1613
|
return (promiseId, data, error) => {
|
|
53
|
-
console.log("[resolvePromise]::", promiseId, data, error);
|
|
1614
|
+
console.log("[NativeBridgeCore resolvePromise]::", promiseId, data, error);
|
|
54
1615
|
const promise = window.n2bridge.promises[promiseId];
|
|
55
1616
|
if (!promise) {
|
|
56
|
-
console.error("[resolvePromise] Promise not found::", promiseId);
|
|
1617
|
+
console.error("[NativeBridgeCore resolvePromise] Promise not found::", promiseId);
|
|
57
1618
|
return;
|
|
58
1619
|
}
|
|
59
1620
|
try {
|
|
@@ -69,7 +1630,7 @@ var Core = class {
|
|
|
69
1630
|
promise.resolve(data);
|
|
70
1631
|
this.cleanupPromise(promiseId);
|
|
71
1632
|
} catch (err) {
|
|
72
|
-
console.error("[resolvePromise] Error handling promise::", err);
|
|
1633
|
+
console.error("[NativeBridgeCore resolvePromise] Error handling promise::", err);
|
|
73
1634
|
this.cleanupPromise(promiseId);
|
|
74
1635
|
}
|
|
75
1636
|
};
|
|
@@ -82,7 +1643,7 @@ var Core = class {
|
|
|
82
1643
|
return (promiseId, data, error) => {
|
|
83
1644
|
const promise = window.n2bridge.promises[promiseId];
|
|
84
1645
|
if (!promise) {
|
|
85
|
-
console.error("[resolvePromise] Promise not found::", promiseId);
|
|
1646
|
+
console.error("[NativeBridgeCore resolvePromise] Promise not found::", promiseId);
|
|
86
1647
|
return;
|
|
87
1648
|
}
|
|
88
1649
|
try {
|
|
@@ -98,7 +1659,7 @@ var Core = class {
|
|
|
98
1659
|
promise.resolve(data);
|
|
99
1660
|
this.cleanupPromise(promiseId);
|
|
100
1661
|
} catch (err) {
|
|
101
|
-
console.error("[resolvePromise] Error handling promise::", err);
|
|
1662
|
+
console.error("[NativeBridgeCore resolvePromise] Error handling promise::", err);
|
|
102
1663
|
this.cleanupPromise(promiseId);
|
|
103
1664
|
}
|
|
104
1665
|
};
|
|
@@ -112,24 +1673,23 @@ var Core = class {
|
|
|
112
1673
|
return (jsonStr) => {
|
|
113
1674
|
try {
|
|
114
1675
|
const command = JSON.parse(jsonStr);
|
|
115
|
-
console.log("[callFromNative]::", command);
|
|
1676
|
+
console.log("[NativeBridgeCore callFromNative]::", command);
|
|
116
1677
|
} catch (error) {
|
|
117
|
-
console.error("[callFromNative] parse error::", error);
|
|
1678
|
+
console.error("[NativeBridgeCore callFromNative] parse error::", error);
|
|
118
1679
|
}
|
|
119
1680
|
};
|
|
120
1681
|
}
|
|
121
1682
|
/**
|
|
122
1683
|
* 네이티브 통신
|
|
123
|
-
* @param service
|
|
124
1684
|
* @param action
|
|
125
|
-
* @param
|
|
1685
|
+
* @param options
|
|
126
1686
|
* @returns
|
|
127
1687
|
*/
|
|
128
|
-
async
|
|
1688
|
+
async callToTarget(action, options) {
|
|
129
1689
|
const { retainCallback: retain, ...commandOptions } = options || {};
|
|
130
1690
|
return new Promise((resolve, reject) => {
|
|
131
1691
|
const promiseId = `${action}_${this.generatePromiseId()}`;
|
|
132
|
-
console.log("[callToNative] promiseId::", promiseId);
|
|
1692
|
+
console.log("[NativeBridgeCore callToNative] promiseId::", promiseId);
|
|
133
1693
|
window.n2bridge.promises[promiseId] = {
|
|
134
1694
|
resolve: (value) => {
|
|
135
1695
|
resolve(value);
|
|
@@ -145,7 +1705,7 @@ var Core = class {
|
|
|
145
1705
|
promiseId,
|
|
146
1706
|
option: commandOptions
|
|
147
1707
|
};
|
|
148
|
-
console.log("[callToNative] command::", command);
|
|
1708
|
+
console.log("[NativeBridgeCore callToNative] command::", command);
|
|
149
1709
|
const platform = salesFrontendUtils.getDspExecutionEnvironment();
|
|
150
1710
|
if (platform === "android-webview") {
|
|
151
1711
|
window.n2Bridge?.callFromWeb?.(JSON.stringify(command));
|
|
@@ -155,53 +1715,13 @@ var Core = class {
|
|
|
155
1715
|
window.webkit?.messageHandlers?.n2Bridge?.postMessage(JSON.stringify(command));
|
|
156
1716
|
return;
|
|
157
1717
|
}
|
|
158
|
-
console.warn(
|
|
1718
|
+
console.warn(
|
|
1719
|
+
`[NativeBridgeCore callToNative] \uD604\uC7AC \uD50C\uB7AB\uD3FC(${platform})\uC5D0\uC11C\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 \uC11C\uBE44\uC2A4(${action})\uC785\uB2C8\uB2E4.`
|
|
1720
|
+
);
|
|
159
1721
|
this.cleanupPromise(promiseId);
|
|
160
|
-
reject(new Error(`Unsupported platform: ${platform}`));
|
|
1722
|
+
reject(new Error(`[NativeBridgeCore callToNative] Unsupported platform: ${platform}`));
|
|
161
1723
|
} catch (error) {
|
|
162
|
-
console.error("[callToNative] error::", error);
|
|
163
|
-
this.cleanupPromise(promiseId);
|
|
164
|
-
reject(error);
|
|
165
|
-
}
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* iframe 통신(영업포털)
|
|
170
|
-
* @param eventName
|
|
171
|
-
* @param options
|
|
172
|
-
* @returns
|
|
173
|
-
*/
|
|
174
|
-
async callToIframeParent(eventName, options) {
|
|
175
|
-
const { retainCallback: retain, ...commandOptions } = options || {};
|
|
176
|
-
return new Promise((resolve, reject) => {
|
|
177
|
-
const promiseId = `${eventName}_${this.generatePromiseId()}`;
|
|
178
|
-
console.log("[callToIframe] promiseId::", promiseId);
|
|
179
|
-
window.n2bridge.promises[promiseId] = {
|
|
180
|
-
resolve: (value) => {
|
|
181
|
-
resolve(value);
|
|
182
|
-
},
|
|
183
|
-
reject: (reason) => {
|
|
184
|
-
reject(reason);
|
|
185
|
-
},
|
|
186
|
-
retain
|
|
187
|
-
};
|
|
188
|
-
try {
|
|
189
|
-
const command = {
|
|
190
|
-
eventName,
|
|
191
|
-
promiseId,
|
|
192
|
-
option: commandOptions
|
|
193
|
-
};
|
|
194
|
-
console.log("[callToIframe] command::", command);
|
|
195
|
-
const platform = salesFrontendUtils.getDspExecutionEnvironment();
|
|
196
|
-
if (platform === "iframe") {
|
|
197
|
-
window.parent.postMessage(command, "*");
|
|
198
|
-
return;
|
|
199
|
-
}
|
|
200
|
-
console.warn(`[callToIframe] \uD604\uC7AC \uD50C\uB7AB\uD3FC(${platform})\uC5D0\uC11C\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 \uC11C\uBE44\uC2A4(${eventName})\uC785\uB2C8\uB2E4.`);
|
|
201
|
-
this.cleanupPromise(promiseId);
|
|
202
|
-
reject(new Error(`Unsupported platform: ${platform}`));
|
|
203
|
-
} catch (error) {
|
|
204
|
-
console.error("[callToIframe] error::", error);
|
|
1724
|
+
console.error("[NativeBridgeCore callToNative] error::", error);
|
|
205
1725
|
this.cleanupPromise(promiseId);
|
|
206
1726
|
reject(error);
|
|
207
1727
|
}
|
|
@@ -216,38 +1736,28 @@ var Core = class {
|
|
|
216
1736
|
}
|
|
217
1737
|
};
|
|
218
1738
|
|
|
219
|
-
// src/bridge/
|
|
220
|
-
var
|
|
1739
|
+
// src/native/bridge/native-bridge.ts
|
|
1740
|
+
var NativeBridge = class extends CommonBridge {
|
|
221
1741
|
constructor() {
|
|
1742
|
+
super();
|
|
222
1743
|
__publicField(this, "core");
|
|
223
|
-
this.core = new
|
|
1744
|
+
this.core = new NativeBridgeCore();
|
|
224
1745
|
}
|
|
225
|
-
};
|
|
226
|
-
|
|
227
|
-
// src/bridge/iframe-bridge.ts
|
|
228
|
-
var IframeBridge = class extends CommonBridge {
|
|
229
1746
|
/**
|
|
230
|
-
*
|
|
231
|
-
* @param options
|
|
232
|
-
* @returns
|
|
1747
|
+
* Iframe, App 공통으로 구현해야할 함수
|
|
233
1748
|
*/
|
|
234
|
-
|
|
235
|
-
|
|
1749
|
+
hello() {
|
|
1750
|
+
console.log("[NativeBridge] hello");
|
|
236
1751
|
}
|
|
237
|
-
// TODO: 필요 플러그인들 추가
|
|
238
|
-
};
|
|
239
|
-
|
|
240
|
-
// src/bridge/native-bridge.ts
|
|
241
|
-
var NativeBridge = class extends CommonBridge {
|
|
242
1752
|
/**
|
|
243
1753
|
* getParameterMap
|
|
244
1754
|
* @returns
|
|
245
1755
|
*/
|
|
246
1756
|
async getParameterMap() {
|
|
247
|
-
return this.core.
|
|
1757
|
+
return this.core.callToTarget("getParameterMap");
|
|
248
1758
|
}
|
|
249
1759
|
async dismissPopup(options) {
|
|
250
|
-
return this.core.
|
|
1760
|
+
return this.core.callToTarget("dismissPopup", options);
|
|
251
1761
|
}
|
|
252
1762
|
/**
|
|
253
1763
|
*
|
|
@@ -255,7 +1765,7 @@ var NativeBridge = class extends CommonBridge {
|
|
|
255
1765
|
* @returns
|
|
256
1766
|
*/
|
|
257
1767
|
async showWebPopup(options) {
|
|
258
|
-
return this.core.
|
|
1768
|
+
return this.core.callToTarget("showWebPopup", options);
|
|
259
1769
|
}
|
|
260
1770
|
/**
|
|
261
1771
|
*
|
|
@@ -263,7 +1773,7 @@ var NativeBridge = class extends CommonBridge {
|
|
|
263
1773
|
* @returns
|
|
264
1774
|
*/
|
|
265
1775
|
async jumpSafari(options) {
|
|
266
|
-
return this.core.
|
|
1776
|
+
return this.core.callToTarget("jumpSafari", options);
|
|
267
1777
|
}
|
|
268
1778
|
/**
|
|
269
1779
|
* ### Bridge for Oz
|
|
@@ -275,7 +1785,7 @@ var NativeBridge = class extends CommonBridge {
|
|
|
275
1785
|
* ```
|
|
276
1786
|
*/
|
|
277
1787
|
createReportEx(options) {
|
|
278
|
-
return this.core.
|
|
1788
|
+
return this.core.callToTarget(
|
|
279
1789
|
"createReportEx",
|
|
280
1790
|
Object.assign({ delimiter: "\n" }, options)
|
|
281
1791
|
);
|
|
@@ -290,7 +1800,7 @@ var NativeBridge = class extends CommonBridge {
|
|
|
290
1800
|
* ```
|
|
291
1801
|
*/
|
|
292
1802
|
hideViewer() {
|
|
293
|
-
return this.core.
|
|
1803
|
+
return this.core.callToTarget("hideViewer");
|
|
294
1804
|
}
|
|
295
1805
|
/**
|
|
296
1806
|
* ### Bridge for Oz
|
|
@@ -302,7 +1812,7 @@ var NativeBridge = class extends CommonBridge {
|
|
|
302
1812
|
* ```
|
|
303
1813
|
*/
|
|
304
1814
|
async getInformation(options) {
|
|
305
|
-
return this.core.
|
|
1815
|
+
return this.core.callToTarget("getInformation", options);
|
|
306
1816
|
}
|
|
307
1817
|
/**
|
|
308
1818
|
* ### Bridge for Oz
|
|
@@ -314,7 +1824,7 @@ var NativeBridge = class extends CommonBridge {
|
|
|
314
1824
|
* ```
|
|
315
1825
|
*/
|
|
316
1826
|
async getGlobal(options) {
|
|
317
|
-
return this.core.
|
|
1827
|
+
return this.core.callToTarget("getGlobal", Object.assign({ docIndex: 0 }, options));
|
|
318
1828
|
}
|
|
319
1829
|
/**
|
|
320
1830
|
* ### Bridge for Oz
|
|
@@ -326,7 +1836,7 @@ var NativeBridge = class extends CommonBridge {
|
|
|
326
1836
|
* ```
|
|
327
1837
|
*/
|
|
328
1838
|
setGlobal(options) {
|
|
329
|
-
return this.core.
|
|
1839
|
+
return this.core.callToTarget("setGlobal", Object.assign({ docIndex: 0 }, options));
|
|
330
1840
|
}
|
|
331
1841
|
/**
|
|
332
1842
|
* ### Bridge for Oz
|
|
@@ -339,7 +1849,7 @@ var NativeBridge = class extends CommonBridge {
|
|
|
339
1849
|
* ```
|
|
340
1850
|
*/
|
|
341
1851
|
script(options) {
|
|
342
|
-
return this.core.
|
|
1852
|
+
return this.core.callToTarget("script", options);
|
|
343
1853
|
}
|
|
344
1854
|
/**
|
|
345
1855
|
* ### Bridge for Oz
|
|
@@ -357,7 +1867,7 @@ var NativeBridge = class extends CommonBridge {
|
|
|
357
1867
|
* ```
|
|
358
1868
|
*/
|
|
359
1869
|
scriptEx(options) {
|
|
360
|
-
return this.core.
|
|
1870
|
+
return this.core.callToTarget(
|
|
361
1871
|
"scriptEx",
|
|
362
1872
|
Object.assign({ delimiter: "\n" }, options)
|
|
363
1873
|
);
|
|
@@ -372,7 +1882,7 @@ var NativeBridge = class extends CommonBridge {
|
|
|
372
1882
|
* ```
|
|
373
1883
|
*/
|
|
374
1884
|
async triggerExternalEvent(options) {
|
|
375
|
-
return this.core.
|
|
1885
|
+
return this.core.callToTarget(
|
|
376
1886
|
"triggerExternalEvent",
|
|
377
1887
|
Object.assign({ param1: "", param2: "", param3: "", param4: "" }, options)
|
|
378
1888
|
);
|
|
@@ -387,7 +1897,7 @@ var NativeBridge = class extends CommonBridge {
|
|
|
387
1897
|
* ```
|
|
388
1898
|
*/
|
|
389
1899
|
async triggerExternalEventByDocIndex(options) {
|
|
390
|
-
return this.core.
|
|
1900
|
+
return this.core.callToTarget(
|
|
391
1901
|
"triggerExternalEventByDocIndex",
|
|
392
1902
|
Object.assign({ param1: "", param2: "", param3: "", param4: "" }, options)
|
|
393
1903
|
);
|
|
@@ -402,7 +1912,7 @@ var NativeBridge = class extends CommonBridge {
|
|
|
402
1912
|
* ```
|
|
403
1913
|
*/
|
|
404
1914
|
async getOzFontParam() {
|
|
405
|
-
return this.core.
|
|
1915
|
+
return this.core.callToTarget("getOzFontParam");
|
|
406
1916
|
}
|
|
407
1917
|
/**
|
|
408
1918
|
* ### Bridge for Oz
|
|
@@ -440,14 +1950,14 @@ var NativeBridge = class extends CommonBridge {
|
|
|
440
1950
|
* ```
|
|
441
1951
|
*/
|
|
442
1952
|
async downloadDocument(options) {
|
|
443
|
-
return this.core.
|
|
1953
|
+
return this.core.callToTarget("downloadDocument", options);
|
|
444
1954
|
}
|
|
445
1955
|
/**
|
|
446
1956
|
* ### Bridge for Oz
|
|
447
1957
|
* 서식의 진행중/완료 상태를 업데이트하는 브릿지
|
|
448
1958
|
*/
|
|
449
1959
|
async updateOzDocumentStatus(options) {
|
|
450
|
-
return this.core.
|
|
1960
|
+
return this.core.callToTarget("updateOzDocumentStatus", options);
|
|
451
1961
|
}
|
|
452
1962
|
/**
|
|
453
1963
|
* ### Bridge for Oz
|
|
@@ -459,7 +1969,7 @@ var NativeBridge = class extends CommonBridge {
|
|
|
459
1969
|
* ```
|
|
460
1970
|
*/
|
|
461
1971
|
async savePdf(options) {
|
|
462
|
-
return this.core.
|
|
1972
|
+
return this.core.callToTarget(
|
|
463
1973
|
"savePdf",
|
|
464
1974
|
Object.assign({ delimiter: "\n" }, options)
|
|
465
1975
|
);
|
|
@@ -474,7 +1984,7 @@ var NativeBridge = class extends CommonBridge {
|
|
|
474
1984
|
* ```
|
|
475
1985
|
*/
|
|
476
1986
|
async saveSignImg(options) {
|
|
477
|
-
return this.core.
|
|
1987
|
+
return this.core.callToTarget("saveSignImg", options);
|
|
478
1988
|
}
|
|
479
1989
|
/**
|
|
480
1990
|
* ### Bridge for Oz
|
|
@@ -486,10 +1996,7 @@ var NativeBridge = class extends CommonBridge {
|
|
|
486
1996
|
* ```
|
|
487
1997
|
*/
|
|
488
1998
|
async createOzPdfViewer(options) {
|
|
489
|
-
return this.core.
|
|
490
|
-
"createOzPdfViewer",
|
|
491
|
-
Object.assign({ password: "" }, options)
|
|
492
|
-
);
|
|
1999
|
+
return this.core.callToTarget("createOzPdfViewer", options);
|
|
493
2000
|
}
|
|
494
2001
|
/**
|
|
495
2002
|
* ### Bridge for Oz
|
|
@@ -501,19 +2008,29 @@ var NativeBridge = class extends CommonBridge {
|
|
|
501
2008
|
* ```
|
|
502
2009
|
*/
|
|
503
2010
|
async hideOzPdfViewer() {
|
|
504
|
-
return this.core.
|
|
2011
|
+
return this.core.callToTarget("hideOzPdfViewer");
|
|
2012
|
+
}
|
|
2013
|
+
/**
|
|
2014
|
+
* 기능명: 본인인증 결과 정보 넘기기
|
|
2015
|
+
* 목적: NXL One 에서 본인인증 결과 값을 네이티브로 넘기기 위함
|
|
2016
|
+
* @param options
|
|
2017
|
+
* @returns
|
|
2018
|
+
*/
|
|
2019
|
+
async onAuthenticationResult(options) {
|
|
2020
|
+
return this.core.callToTarget("onAuthenticationResult", options);
|
|
505
2021
|
}
|
|
506
2022
|
// TODO: 필요 플러그인들 추가
|
|
507
2023
|
};
|
|
508
2024
|
|
|
509
|
-
// src/bridge
|
|
2025
|
+
// src/bridge.ts
|
|
510
2026
|
var Bridge = {
|
|
511
2027
|
native: new NativeBridge(),
|
|
512
2028
|
iframe: new IframeBridge(),
|
|
513
|
-
|
|
2029
|
+
nativeCore: new NativeBridgeCore(),
|
|
2030
|
+
iframeCore: new IframeBridgeCore()
|
|
514
2031
|
};
|
|
515
2032
|
|
|
516
|
-
// src/
|
|
2033
|
+
// src/oz/oz-event.types.ts
|
|
517
2034
|
var OZViewerEvent = /* @__PURE__ */ ((OZViewerEvent2) => {
|
|
518
2035
|
OZViewerEvent2["OZProgressCommand"] = "OZProgressCommand";
|
|
519
2036
|
OZViewerEvent2["OZErrorCommand"] = "OZErrorCommand";
|
|
@@ -527,7 +2044,245 @@ var OZViewerEvent = /* @__PURE__ */ ((OZViewerEvent2) => {
|
|
|
527
2044
|
return OZViewerEvent2;
|
|
528
2045
|
})(OZViewerEvent || {});
|
|
529
2046
|
|
|
2047
|
+
// src/oz/constant.ts
|
|
2048
|
+
var commonOzParam = [
|
|
2049
|
+
`information.debug = true`,
|
|
2050
|
+
`global.inheritparameter=true`,
|
|
2051
|
+
`global.concatpage=true`,
|
|
2052
|
+
`global.eachpagenumberatconcatpage=true`,
|
|
2053
|
+
`eform.signpad_type=embedded`,
|
|
2054
|
+
// `eform.signpad_type=keypad`,
|
|
2055
|
+
`eform.show_prev_next_input=true`,
|
|
2056
|
+
`eform.signpad_prev_next_iconposition=sign_top_left`,
|
|
2057
|
+
`eform.signpad_show_draw_erase_button=false`,
|
|
2058
|
+
`eform.radiobutton_type=ensurevisible_at_prev_next`,
|
|
2059
|
+
`eform.checkbox_type=ensurevisible_at_prev_next`,
|
|
2060
|
+
`eform.imagepicker_id_info=${JSON.stringify({
|
|
2061
|
+
ids: [
|
|
2062
|
+
{
|
|
2063
|
+
id: "1",
|
|
2064
|
+
name: "\uC6B4\uC804\uBA74\uD5C8\uC99D_\uCD5C\uC2E0",
|
|
2065
|
+
size: "86x54",
|
|
2066
|
+
margin: "3",
|
|
2067
|
+
mask: [
|
|
2068
|
+
{ name: "\uC8FC\uBBFC\uBC88\uD638", area: "0,0,0,0" },
|
|
2069
|
+
{ name: "\uC6B4\uC804\uBA74\uD5C8\uBC88\uD638", area: "0,0,0,0" },
|
|
2070
|
+
{ name: "\uBC1C\uAE09\uBC88\uD638", area: "0,0,0,0" },
|
|
2071
|
+
{ name: "\uBC1C\uAE09\uB0A0\uC9DC", area: "0,0,0,0" }
|
|
2072
|
+
]
|
|
2073
|
+
},
|
|
2074
|
+
{
|
|
2075
|
+
id: "2",
|
|
2076
|
+
name: "\uC6B4\uC804\uBA74\uD5C8\uC99D_\uAD6C\uD615",
|
|
2077
|
+
size: "86x54",
|
|
2078
|
+
margin: "3",
|
|
2079
|
+
mask: [
|
|
2080
|
+
{ name: "\uC8FC\uBBFC\uBC88\uD638", area: "0,0,0,0" },
|
|
2081
|
+
{ name: "\uC6B4\uC804\uBA74\uD5C8\uBC88\uD638", area: "0,0,0,0" },
|
|
2082
|
+
{ name: "\uBC1C\uAE09\uBC88\uD638", area: "0,0,0,0" },
|
|
2083
|
+
{ name: "\uBC1C\uAE09\uB0A0\uC9DC", area: "0,0,0,0" }
|
|
2084
|
+
]
|
|
2085
|
+
},
|
|
2086
|
+
{
|
|
2087
|
+
id: "3",
|
|
2088
|
+
name: "\uC8FC\uBBFC\uB4F1\uB85D\uC99D",
|
|
2089
|
+
size: "86x54",
|
|
2090
|
+
margin: "3",
|
|
2091
|
+
mask: [
|
|
2092
|
+
{ name: "\uC8FC\uBBFC\uBC88\uD638", area: "0,0,0,0" },
|
|
2093
|
+
{ name: "\uBC1C\uAE09\uB0A0\uC9DC", area: "0,0,0,0" }
|
|
2094
|
+
]
|
|
2095
|
+
},
|
|
2096
|
+
{
|
|
2097
|
+
id: "4",
|
|
2098
|
+
name: "\uC678\uAD6D\uC778\uB4F1\uB85D\uC99D \uC55E\uBA74",
|
|
2099
|
+
size: "86x54",
|
|
2100
|
+
margin: "3",
|
|
2101
|
+
mask: [
|
|
2102
|
+
{ name: "\uC678\uAD6D\uC778\uB4F1\uB85D\uBC88\uD6381", area: "0,0,0,0" },
|
|
2103
|
+
{ name: "\uC678\uAD6D\uC778\uB4F1\uB85D\uBC88\uD6382", area: "0,0,0,0" },
|
|
2104
|
+
{ name: "\uC131\uBA85", area: "0,0,0,0" },
|
|
2105
|
+
{ name: "\uC131\uBCC4", area: "0,0,0,0" },
|
|
2106
|
+
{ name: "\uAD6D\uAC00\uC9C0\uC5ED", area: "0,0,0,0" },
|
|
2107
|
+
{ name: "\uCCB4\uB958\uC790\uACA9", area: "0,0,0,0" },
|
|
2108
|
+
{ name: "\uBC1C\uAE09\uC77C\uC790", area: "0,0,0,0" }
|
|
2109
|
+
]
|
|
2110
|
+
},
|
|
2111
|
+
{ id: "5", name: "\uC678\uAD6D\uC778\uB4F1\uB85D\uC99D \uB4B7\uBA74", size: "86x54", margin: "3", mask: [{ name: "\uC678\uAD6D\uC778", area: "0,0,0,0" }] }
|
|
2112
|
+
],
|
|
2113
|
+
choice: { title: "\uC2E0\uBD84\uC99D\uC744 \uC120\uD0DD\uD558\uC138\uC694.", items: "1,2,3,4,5" }
|
|
2114
|
+
})}`,
|
|
2115
|
+
`eform.imagepicker_camera_iconposition = camera_top`,
|
|
2116
|
+
`eform.inputeventcommand=true`,
|
|
2117
|
+
// `viewer.zoombymouse=false`,
|
|
2118
|
+
`viewer.pagedisplay=singlepagecontinuous`,
|
|
2119
|
+
`viewer.usetoolbar=false`,
|
|
2120
|
+
`viewer.usestatusbar=false`,
|
|
2121
|
+
`viewer.useprogressbar=false`,
|
|
2122
|
+
`viewer.zoom=137`,
|
|
2123
|
+
`viewer.viewmode=fittowidth`,
|
|
2124
|
+
`viewer.hidehorizontalscroll=false`,
|
|
2125
|
+
`viewer.progresscommand=true`,
|
|
2126
|
+
`viewer.pagechangecommand=true`,
|
|
2127
|
+
`viewer.exportcommand=true`,
|
|
2128
|
+
`viewer.errorcommand=true`,
|
|
2129
|
+
`viewer.reportchangecommand=true`,
|
|
2130
|
+
`viewer.pagebindcommandinterval=500`
|
|
2131
|
+
];
|
|
2132
|
+
var commonPdfExportParam = [
|
|
2133
|
+
// `pdf.filename=${"test.pdf"}`,
|
|
2134
|
+
// `export.pages=${i.startPage}-${i.endPage}`,
|
|
2135
|
+
// "pdf.userpassword=$pdfPassword",G
|
|
2136
|
+
"export.pagerange=range",
|
|
2137
|
+
"export.confirmsave=false",
|
|
2138
|
+
"export.mode=silent",
|
|
2139
|
+
// pdf에 폰트를 포함시킨다
|
|
2140
|
+
`pdf.fontembedding=true`,
|
|
2141
|
+
// 폰트를 포함시킬때 사용하는 글자만 포함시킨다
|
|
2142
|
+
`pdf.fontembedding_subset=true`
|
|
2143
|
+
];
|
|
2144
|
+
var wrapperStyle = { display: "flex", flexFlow: "column", gap: "10px" };
|
|
2145
|
+
var btnStyle = { border: "1px solid red", minHeight: "40px" };
|
|
2146
|
+
|
|
2147
|
+
// src/oz/use-create-report.ts
|
|
2148
|
+
var import_react = __toESM(require_react());
|
|
2149
|
+
|
|
2150
|
+
// src/oz/util.ts
|
|
2151
|
+
async function fetchDocument(options) {
|
|
2152
|
+
const { data } = await Bridge.native.downloadDocument({ data: options });
|
|
2153
|
+
return data.map((i) => ({ ...i, startPage: 0, endPage: 0 }));
|
|
2154
|
+
}
|
|
2155
|
+
async function fetchFont() {
|
|
2156
|
+
const { data: fontMap } = await Bridge.native.getOzFontParam();
|
|
2157
|
+
const fontParms = Object.keys(fontMap).map((i) => `font.${i}=${fontMap[i]}`);
|
|
2158
|
+
return fontParms;
|
|
2159
|
+
}
|
|
2160
|
+
function categorizeByPageRange(data, pageCounts) {
|
|
2161
|
+
let pageStart = 1;
|
|
2162
|
+
const result = [];
|
|
2163
|
+
let pageIndex = 0;
|
|
2164
|
+
data.forEach((item) => {
|
|
2165
|
+
const startPage = pageStart;
|
|
2166
|
+
let endPage = pageStart;
|
|
2167
|
+
item.file.forEach(() => {
|
|
2168
|
+
const pageCount = pageCounts[pageIndex];
|
|
2169
|
+
const pageEnd = pageStart + pageCount - 1;
|
|
2170
|
+
pageStart = pageEnd + 1;
|
|
2171
|
+
pageIndex++;
|
|
2172
|
+
endPage = pageEnd;
|
|
2173
|
+
});
|
|
2174
|
+
result.push({
|
|
2175
|
+
...item,
|
|
2176
|
+
startPage,
|
|
2177
|
+
endPage
|
|
2178
|
+
});
|
|
2179
|
+
});
|
|
2180
|
+
return result;
|
|
2181
|
+
}
|
|
2182
|
+
function extractFileName(filePath) {
|
|
2183
|
+
if (!filePath || typeof filePath !== "string") {
|
|
2184
|
+
throw new Error("\uC720\uD6A8\uD55C \uD30C\uC77C \uACBD\uB85C\uB97C \uC785\uB825\uD574\uC8FC\uC138\uC694.");
|
|
2185
|
+
}
|
|
2186
|
+
const fileName = filePath.replace(/^.*\/|(\.[^/.]+)$/g, "");
|
|
2187
|
+
if (!fileName) {
|
|
2188
|
+
throw new Error("\uD30C\uC77C \uACBD\uB85C\uC5D0\uC11C \uD30C\uC77C \uC774\uB984\uC744 \uCD94\uCD9C\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.");
|
|
2189
|
+
}
|
|
2190
|
+
return fileName;
|
|
2191
|
+
}
|
|
2192
|
+
|
|
2193
|
+
// src/oz/use-create-report.ts
|
|
2194
|
+
function useCreateReport({ documentInfo, extraData = {} }) {
|
|
2195
|
+
const documentList = (0, import_react.useMemo)(() => documentInfo.map((i) => i.file).flat(1), [documentInfo]);
|
|
2196
|
+
const CreateReport = (0, import_react.useCallback)(async () => {
|
|
2197
|
+
if (documentList.length === 0) {
|
|
2198
|
+
throw new Error("\uBB38\uC11C\uBAA9\uB85D\uC774 \uBE44\uC5B4\uC788\uC2B5\uB2C8\uB2E4");
|
|
2199
|
+
}
|
|
2200
|
+
const fontParms = await fetchFont();
|
|
2201
|
+
const connectionParams = documentList.map(
|
|
2202
|
+
(file, idx) => idx === 0 ? `connection.openfile=${file}` : `child${idx}.connection.openfile=${file}`
|
|
2203
|
+
);
|
|
2204
|
+
const childCount = documentList.length - 1;
|
|
2205
|
+
const extraParams = documentList.map((file, idx) => {
|
|
2206
|
+
const result = [];
|
|
2207
|
+
const docCode = file.replace(/^.*[\\/]|(\.[^/.]+)$/g, "");
|
|
2208
|
+
const prefix = idx === 0 ? "" : `child${idx}.`;
|
|
2209
|
+
const data = extraData[docCode] || {};
|
|
2210
|
+
if (data.inputJson) {
|
|
2211
|
+
result.push(`${prefix}connection.inputjson=${JSON.stringify(data.inputJson)}`);
|
|
2212
|
+
}
|
|
2213
|
+
if (data.extraParam) {
|
|
2214
|
+
result.push(data.extraParam.map((param) => `${prefix}${param}`).join("\n"));
|
|
2215
|
+
}
|
|
2216
|
+
return result;
|
|
2217
|
+
});
|
|
2218
|
+
const params = [
|
|
2219
|
+
...childCount > 0 ? [`viewer.childcount=${childCount}`] : [],
|
|
2220
|
+
...connectionParams,
|
|
2221
|
+
...commonOzParam,
|
|
2222
|
+
...fontParms,
|
|
2223
|
+
...extraParams.flat(1)
|
|
2224
|
+
];
|
|
2225
|
+
Bridge.native.createReportEx({ param: params.join("\n") });
|
|
2226
|
+
}, [documentList, extraData]);
|
|
2227
|
+
return {
|
|
2228
|
+
documentList,
|
|
2229
|
+
CreateReport
|
|
2230
|
+
};
|
|
2231
|
+
}
|
|
2232
|
+
|
|
2233
|
+
// src/oz/use-oz-event-listener.tsx
|
|
2234
|
+
var import_react2 = __toESM(require_react());
|
|
2235
|
+
function useOzEventListener({ event, handler }) {
|
|
2236
|
+
const handleEvent = (0, import_react2.useCallback)(
|
|
2237
|
+
async (e) => {
|
|
2238
|
+
const customEvent = e;
|
|
2239
|
+
return await handler(customEvent);
|
|
2240
|
+
},
|
|
2241
|
+
[handler]
|
|
2242
|
+
);
|
|
2243
|
+
(0, import_react2.useEffect)(() => {
|
|
2244
|
+
window.addEventListener(event, handleEvent);
|
|
2245
|
+
return () => {
|
|
2246
|
+
window.removeEventListener(event, handleEvent);
|
|
2247
|
+
};
|
|
2248
|
+
}, [handleEvent, event]);
|
|
2249
|
+
}
|
|
2250
|
+
/*! Bundled license information:
|
|
2251
|
+
|
|
2252
|
+
react/cjs/react.production.js:
|
|
2253
|
+
(**
|
|
2254
|
+
* @license React
|
|
2255
|
+
* react.production.js
|
|
2256
|
+
*
|
|
2257
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2258
|
+
*
|
|
2259
|
+
* This source code is licensed under the MIT license found in the
|
|
2260
|
+
* LICENSE file in the root directory of this source tree.
|
|
2261
|
+
*)
|
|
2262
|
+
|
|
2263
|
+
react/cjs/react.development.js:
|
|
2264
|
+
(**
|
|
2265
|
+
* @license React
|
|
2266
|
+
* react.development.js
|
|
2267
|
+
*
|
|
2268
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2269
|
+
*
|
|
2270
|
+
* This source code is licensed under the MIT license found in the
|
|
2271
|
+
* LICENSE file in the root directory of this source tree.
|
|
2272
|
+
*)
|
|
2273
|
+
*/
|
|
2274
|
+
|
|
530
2275
|
exports.Bridge = Bridge;
|
|
531
2276
|
exports.OZViewerEvent = OZViewerEvent;
|
|
2277
|
+
exports.btnStyle = btnStyle;
|
|
2278
|
+
exports.categorizeByPageRange = categorizeByPageRange;
|
|
2279
|
+
exports.commonOzParam = commonOzParam;
|
|
2280
|
+
exports.commonPdfExportParam = commonPdfExportParam;
|
|
2281
|
+
exports.extractFileName = extractFileName;
|
|
2282
|
+
exports.fetchDocument = fetchDocument;
|
|
2283
|
+
exports.fetchFont = fetchFont;
|
|
2284
|
+
exports.useCreateReport = useCreateReport;
|
|
2285
|
+
exports.useOzEventListener = useOzEventListener;
|
|
2286
|
+
exports.wrapperStyle = wrapperStyle;
|
|
532
2287
|
//# sourceMappingURL=index.cjs.map
|
|
533
2288
|
//# sourceMappingURL=index.cjs.map
|