@rebasepro/server-core 0.0.1-canary.f81da60 → 0.1.2

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.umd.js CHANGED
@@ -1011,13 +1011,30 @@
1011
1011
  }, { buffer: 3, lYpoI2: 11 }] }, {}, [1])(1);
1012
1012
  });
1013
1013
  })(object_hash);
1014
- const snakeCaseRegex = /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g;
1014
+ const tokenizeRegex = /[A-Z]{2,}(?=[A-Z][a-z]|\b)|[A-Z]?[a-z]+|[0-9]+(?:[a-z](?![a-z]))?|[A-Z]/g;
1015
+ const snakeCaseRegex = tokenizeRegex;
1015
1016
  const toSnakeCase = (str) => {
1016
1017
  const regExpMatchArray = str.match(snakeCaseRegex);
1017
1018
  if (!regExpMatchArray) return "";
1018
1019
  return regExpMatchArray.map((x) => x.toLowerCase()).join("_");
1019
1020
  };
1020
- function isObject$a(item) {
1021
+ function deepClone(value) {
1022
+ if (value === null || value === void 0) return value;
1023
+ if (typeof value === "function") return value;
1024
+ if (typeof value !== "object") return value;
1025
+ if (Array.isArray(value)) {
1026
+ return value.map((item) => deepClone(item));
1027
+ }
1028
+ if (Object.getPrototypeOf(value) !== Object.prototype) {
1029
+ return value;
1030
+ }
1031
+ const result = {};
1032
+ for (const key of Object.keys(value)) {
1033
+ result[key] = deepClone(value[key]);
1034
+ }
1035
+ return result;
1036
+ }
1037
+ function isObject$4(item) {
1021
1038
  return !!item && typeof item === "object" && !Array.isArray(item);
1022
1039
  }
1023
1040
  function isPlainObject$3(obj) {
@@ -1028,13 +1045,13 @@
1028
1045
  return proto === Object.prototype;
1029
1046
  }
1030
1047
  function mergeDeep(target, source, ignoreUndefined = false) {
1031
- if (!isObject$a(target)) {
1048
+ if (!isObject$4(target)) {
1032
1049
  return target;
1033
1050
  }
1034
1051
  const output = {
1035
1052
  ...target
1036
1053
  };
1037
- if (!isObject$a(source)) {
1054
+ if (!isObject$4(source)) {
1038
1055
  return output;
1039
1056
  }
1040
1057
  for (const key in source) {
@@ -1075,7 +1092,7 @@
1075
1092
  } else {
1076
1093
  output[key] = sourceValue;
1077
1094
  }
1078
- } else if (isObject$a(sourceValue)) {
1095
+ } else if (isObject$4(sourceValue)) {
1079
1096
  output[key] = sourceValue;
1080
1097
  } else {
1081
1098
  output[key] = sourceValue;
@@ -1345,7 +1362,7 @@
1345
1362
  }
1346
1363
  var logic = { exports: {} };
1347
1364
  (function(module2, exports$1) {
1348
- (function(root2, factory) {
1365
+ (function(root, factory) {
1349
1366
  {
1350
1367
  module2.exports = factory();
1351
1368
  }
@@ -1713,7 +1730,7 @@
1713
1730
  });
1714
1731
  })(logic);
1715
1732
  const { getOwnPropertyNames, getOwnPropertySymbols } = Object;
1716
- const { hasOwnProperty: hasOwnProperty$d } = Object.prototype;
1733
+ const { hasOwnProperty: hasOwnProperty$3 } = Object.prototype;
1717
1734
  function combineComparators(comparatorA, comparatorB) {
1718
1735
  return function isEqual(a2, b, state) {
1719
1736
  return comparatorA(a2, b, state) && comparatorB(a2, b, state);
@@ -1743,12 +1760,12 @@
1743
1760
  }
1744
1761
  const hasOwn$1 = (
1745
1762
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
1746
- Object.hasOwn || ((object, property) => hasOwnProperty$d.call(object, property))
1763
+ Object.hasOwn || ((object, property) => hasOwnProperty$3.call(object, property))
1747
1764
  );
1748
1765
  const PREACT_VNODE = "__v";
1749
1766
  const PREACT_OWNER = "__o";
1750
1767
  const REACT_OWNER = "_owner";
1751
- const { getOwnPropertyDescriptor, keys: keys$5 } = Object;
1768
+ const { getOwnPropertyDescriptor, keys: keys$1 } = Object;
1752
1769
  const sameValueEqual = (
1753
1770
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
1754
1771
  Object.is || function sameValueEqual2(a2, b) {
@@ -1826,9 +1843,9 @@
1826
1843
  return true;
1827
1844
  }
1828
1845
  function areObjectsEqual(a2, b, state) {
1829
- const properties = keys$5(a2);
1846
+ const properties = keys$1(a2);
1830
1847
  let index2 = properties.length;
1831
- if (keys$5(b).length !== index2) {
1848
+ if (keys$1(b).length !== index2) {
1832
1849
  return false;
1833
1850
  }
1834
1851
  while (index2-- > 0) {
@@ -2131,982 +2148,6 @@
2131
2148
  const equals = createCustomInternalComparator ? createCustomInternalComparator(comparator2) : createInternalEqualityComparator(comparator2);
2132
2149
  return createIsEqual({ circular, comparator: comparator2, createState, equals, strict });
2133
2150
  }
2134
- function listCacheClear$1() {
2135
- this.__data__ = [];
2136
- this.size = 0;
2137
- }
2138
- var _listCacheClear = listCacheClear$1;
2139
- function eq$5(value, other) {
2140
- return value === other || value !== value && other !== other;
2141
- }
2142
- var eq_1$1 = eq$5;
2143
- var eq$4 = eq_1$1;
2144
- function assocIndexOf$4(array, key) {
2145
- var length = array.length;
2146
- while (length--) {
2147
- if (eq$4(array[length][0], key)) {
2148
- return length;
2149
- }
2150
- }
2151
- return -1;
2152
- }
2153
- var _assocIndexOf = assocIndexOf$4;
2154
- var assocIndexOf$3 = _assocIndexOf;
2155
- var arrayProto = Array.prototype;
2156
- var splice = arrayProto.splice;
2157
- function listCacheDelete$1(key) {
2158
- var data = this.__data__, index2 = assocIndexOf$3(data, key);
2159
- if (index2 < 0) {
2160
- return false;
2161
- }
2162
- var lastIndex = data.length - 1;
2163
- if (index2 == lastIndex) {
2164
- data.pop();
2165
- } else {
2166
- splice.call(data, index2, 1);
2167
- }
2168
- --this.size;
2169
- return true;
2170
- }
2171
- var _listCacheDelete = listCacheDelete$1;
2172
- var assocIndexOf$2 = _assocIndexOf;
2173
- function listCacheGet$1(key) {
2174
- var data = this.__data__, index2 = assocIndexOf$2(data, key);
2175
- return index2 < 0 ? void 0 : data[index2][1];
2176
- }
2177
- var _listCacheGet = listCacheGet$1;
2178
- var assocIndexOf$1 = _assocIndexOf;
2179
- function listCacheHas$1(key) {
2180
- return assocIndexOf$1(this.__data__, key) > -1;
2181
- }
2182
- var _listCacheHas = listCacheHas$1;
2183
- var assocIndexOf = _assocIndexOf;
2184
- function listCacheSet$1(key, value) {
2185
- var data = this.__data__, index2 = assocIndexOf(data, key);
2186
- if (index2 < 0) {
2187
- ++this.size;
2188
- data.push([key, value]);
2189
- } else {
2190
- data[index2][1] = value;
2191
- }
2192
- return this;
2193
- }
2194
- var _listCacheSet = listCacheSet$1;
2195
- var listCacheClear = _listCacheClear, listCacheDelete = _listCacheDelete, listCacheGet = _listCacheGet, listCacheHas = _listCacheHas, listCacheSet = _listCacheSet;
2196
- function ListCache$4(entries) {
2197
- var index2 = -1, length = entries == null ? 0 : entries.length;
2198
- this.clear();
2199
- while (++index2 < length) {
2200
- var entry = entries[index2];
2201
- this.set(entry[0], entry[1]);
2202
- }
2203
- }
2204
- ListCache$4.prototype.clear = listCacheClear;
2205
- ListCache$4.prototype["delete"] = listCacheDelete;
2206
- ListCache$4.prototype.get = listCacheGet;
2207
- ListCache$4.prototype.has = listCacheHas;
2208
- ListCache$4.prototype.set = listCacheSet;
2209
- var _ListCache = ListCache$4;
2210
- var ListCache$3 = _ListCache;
2211
- function stackClear$1() {
2212
- this.__data__ = new ListCache$3();
2213
- this.size = 0;
2214
- }
2215
- var _stackClear = stackClear$1;
2216
- function stackDelete$1(key) {
2217
- var data = this.__data__, result = data["delete"](key);
2218
- this.size = data.size;
2219
- return result;
2220
- }
2221
- var _stackDelete = stackDelete$1;
2222
- function stackGet$1(key) {
2223
- return this.__data__.get(key);
2224
- }
2225
- var _stackGet = stackGet$1;
2226
- function stackHas$1(key) {
2227
- return this.__data__.has(key);
2228
- }
2229
- var _stackHas = stackHas$1;
2230
- var freeGlobal$1 = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
2231
- var _freeGlobal = freeGlobal$1;
2232
- var freeGlobal = _freeGlobal;
2233
- var freeSelf = typeof self == "object" && self && self.Object === Object && self;
2234
- var root$8 = freeGlobal || freeSelf || Function("return this")();
2235
- var _root = root$8;
2236
- var root$7 = _root;
2237
- var Symbol$4 = root$7.Symbol;
2238
- var _Symbol = Symbol$4;
2239
- var Symbol$3 = _Symbol;
2240
- var objectProto$j = Object.prototype;
2241
- var hasOwnProperty$c = objectProto$j.hasOwnProperty;
2242
- var nativeObjectToString$1 = objectProto$j.toString;
2243
- var symToStringTag$1 = Symbol$3 ? Symbol$3.toStringTag : void 0;
2244
- function getRawTag$1(value) {
2245
- var isOwn = hasOwnProperty$c.call(value, symToStringTag$1), tag = value[symToStringTag$1];
2246
- try {
2247
- value[symToStringTag$1] = void 0;
2248
- var unmasked = true;
2249
- } catch (e) {
2250
- }
2251
- var result = nativeObjectToString$1.call(value);
2252
- if (unmasked) {
2253
- if (isOwn) {
2254
- value[symToStringTag$1] = tag;
2255
- } else {
2256
- delete value[symToStringTag$1];
2257
- }
2258
- }
2259
- return result;
2260
- }
2261
- var _getRawTag = getRawTag$1;
2262
- var objectProto$i = Object.prototype;
2263
- var nativeObjectToString = objectProto$i.toString;
2264
- function objectToString$8(value) {
2265
- return nativeObjectToString.call(value);
2266
- }
2267
- var _objectToString = objectToString$8;
2268
- var Symbol$2 = _Symbol, getRawTag = _getRawTag, objectToString$7 = _objectToString;
2269
- var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
2270
- var symToStringTag = Symbol$2 ? Symbol$2.toStringTag : void 0;
2271
- function baseGetTag$4(value) {
2272
- if (value == null) {
2273
- return value === void 0 ? undefinedTag : nullTag;
2274
- }
2275
- return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString$7(value);
2276
- }
2277
- var _baseGetTag = baseGetTag$4;
2278
- function isObject$9(value) {
2279
- var type = typeof value;
2280
- return value != null && (type == "object" || type == "function");
2281
- }
2282
- var isObject_1 = isObject$9;
2283
- var baseGetTag$3 = _baseGetTag, isObject$8 = isObject_1;
2284
- var asyncTag = "[object AsyncFunction]", funcTag$3 = "[object Function]", genTag$2 = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
2285
- function isFunction$3(value) {
2286
- if (!isObject$8(value)) {
2287
- return false;
2288
- }
2289
- var tag = baseGetTag$3(value);
2290
- return tag == funcTag$3 || tag == genTag$2 || tag == asyncTag || tag == proxyTag;
2291
- }
2292
- var isFunction_1 = isFunction$3;
2293
- var root$6 = _root;
2294
- var coreJsData$1 = root$6["__core-js_shared__"];
2295
- var _coreJsData = coreJsData$1;
2296
- var coreJsData = _coreJsData;
2297
- var maskSrcKey = function() {
2298
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
2299
- return uid ? "Symbol(src)_1." + uid : "";
2300
- }();
2301
- function isMasked$1(func) {
2302
- return !!maskSrcKey && maskSrcKey in func;
2303
- }
2304
- var _isMasked = isMasked$1;
2305
- var funcProto$2 = Function.prototype;
2306
- var funcToString$2 = funcProto$2.toString;
2307
- function toSource$2(func) {
2308
- if (func != null) {
2309
- try {
2310
- return funcToString$2.call(func);
2311
- } catch (e) {
2312
- }
2313
- try {
2314
- return func + "";
2315
- } catch (e) {
2316
- }
2317
- }
2318
- return "";
2319
- }
2320
- var _toSource = toSource$2;
2321
- var isFunction$2 = isFunction_1, isMasked = _isMasked, isObject$7 = isObject_1, toSource$1 = _toSource;
2322
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
2323
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
2324
- var funcProto$1 = Function.prototype, objectProto$h = Object.prototype;
2325
- var funcToString$1 = funcProto$1.toString;
2326
- var hasOwnProperty$b = objectProto$h.hasOwnProperty;
2327
- var reIsNative = RegExp(
2328
- "^" + funcToString$1.call(hasOwnProperty$b).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
2329
- );
2330
- function baseIsNative$1(value) {
2331
- if (!isObject$7(value) || isMasked(value)) {
2332
- return false;
2333
- }
2334
- var pattern = isFunction$2(value) ? reIsNative : reIsHostCtor;
2335
- return pattern.test(toSource$1(value));
2336
- }
2337
- var _baseIsNative = baseIsNative$1;
2338
- function getValue$1(object, key) {
2339
- return object == null ? void 0 : object[key];
2340
- }
2341
- var _getValue = getValue$1;
2342
- var baseIsNative = _baseIsNative, getValue = _getValue;
2343
- function getNative$7(object, key) {
2344
- var value = getValue(object, key);
2345
- return baseIsNative(value) ? value : void 0;
2346
- }
2347
- var _getNative = getNative$7;
2348
- var getNative$6 = _getNative, root$5 = _root;
2349
- var Map$4 = getNative$6(root$5, "Map");
2350
- var _Map = Map$4;
2351
- var getNative$5 = _getNative;
2352
- var nativeCreate$4 = getNative$5(Object, "create");
2353
- var _nativeCreate = nativeCreate$4;
2354
- var nativeCreate$3 = _nativeCreate;
2355
- function hashClear$1() {
2356
- this.__data__ = nativeCreate$3 ? nativeCreate$3(null) : {};
2357
- this.size = 0;
2358
- }
2359
- var _hashClear = hashClear$1;
2360
- function hashDelete$1(key) {
2361
- var result = this.has(key) && delete this.__data__[key];
2362
- this.size -= result ? 1 : 0;
2363
- return result;
2364
- }
2365
- var _hashDelete = hashDelete$1;
2366
- var nativeCreate$2 = _nativeCreate;
2367
- var HASH_UNDEFINED$1 = "__lodash_hash_undefined__";
2368
- var objectProto$g = Object.prototype;
2369
- var hasOwnProperty$a = objectProto$g.hasOwnProperty;
2370
- function hashGet$1(key) {
2371
- var data = this.__data__;
2372
- if (nativeCreate$2) {
2373
- var result = data[key];
2374
- return result === HASH_UNDEFINED$1 ? void 0 : result;
2375
- }
2376
- return hasOwnProperty$a.call(data, key) ? data[key] : void 0;
2377
- }
2378
- var _hashGet = hashGet$1;
2379
- var nativeCreate$1 = _nativeCreate;
2380
- var objectProto$f = Object.prototype;
2381
- var hasOwnProperty$9 = objectProto$f.hasOwnProperty;
2382
- function hashHas$1(key) {
2383
- var data = this.__data__;
2384
- return nativeCreate$1 ? data[key] !== void 0 : hasOwnProperty$9.call(data, key);
2385
- }
2386
- var _hashHas = hashHas$1;
2387
- var nativeCreate = _nativeCreate;
2388
- var HASH_UNDEFINED = "__lodash_hash_undefined__";
2389
- function hashSet$1(key, value) {
2390
- var data = this.__data__;
2391
- this.size += this.has(key) ? 0 : 1;
2392
- data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
2393
- return this;
2394
- }
2395
- var _hashSet = hashSet$1;
2396
- var hashClear = _hashClear, hashDelete = _hashDelete, hashGet = _hashGet, hashHas = _hashHas, hashSet = _hashSet;
2397
- function Hash$1(entries) {
2398
- var index2 = -1, length = entries == null ? 0 : entries.length;
2399
- this.clear();
2400
- while (++index2 < length) {
2401
- var entry = entries[index2];
2402
- this.set(entry[0], entry[1]);
2403
- }
2404
- }
2405
- Hash$1.prototype.clear = hashClear;
2406
- Hash$1.prototype["delete"] = hashDelete;
2407
- Hash$1.prototype.get = hashGet;
2408
- Hash$1.prototype.has = hashHas;
2409
- Hash$1.prototype.set = hashSet;
2410
- var _Hash = Hash$1;
2411
- var Hash = _Hash, ListCache$2 = _ListCache, Map$3 = _Map;
2412
- function mapCacheClear$1() {
2413
- this.size = 0;
2414
- this.__data__ = {
2415
- "hash": new Hash(),
2416
- "map": new (Map$3 || ListCache$2)(),
2417
- "string": new Hash()
2418
- };
2419
- }
2420
- var _mapCacheClear = mapCacheClear$1;
2421
- function isKeyable$1(value) {
2422
- var type = typeof value;
2423
- return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
2424
- }
2425
- var _isKeyable = isKeyable$1;
2426
- var isKeyable = _isKeyable;
2427
- function getMapData$4(map2, key) {
2428
- var data = map2.__data__;
2429
- return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
2430
- }
2431
- var _getMapData = getMapData$4;
2432
- var getMapData$3 = _getMapData;
2433
- function mapCacheDelete$1(key) {
2434
- var result = getMapData$3(this, key)["delete"](key);
2435
- this.size -= result ? 1 : 0;
2436
- return result;
2437
- }
2438
- var _mapCacheDelete = mapCacheDelete$1;
2439
- var getMapData$2 = _getMapData;
2440
- function mapCacheGet$1(key) {
2441
- return getMapData$2(this, key).get(key);
2442
- }
2443
- var _mapCacheGet = mapCacheGet$1;
2444
- var getMapData$1 = _getMapData;
2445
- function mapCacheHas$1(key) {
2446
- return getMapData$1(this, key).has(key);
2447
- }
2448
- var _mapCacheHas = mapCacheHas$1;
2449
- var getMapData = _getMapData;
2450
- function mapCacheSet$1(key, value) {
2451
- var data = getMapData(this, key), size = data.size;
2452
- data.set(key, value);
2453
- this.size += data.size == size ? 0 : 1;
2454
- return this;
2455
- }
2456
- var _mapCacheSet = mapCacheSet$1;
2457
- var mapCacheClear = _mapCacheClear, mapCacheDelete = _mapCacheDelete, mapCacheGet = _mapCacheGet, mapCacheHas = _mapCacheHas, mapCacheSet = _mapCacheSet;
2458
- function MapCache$1(entries) {
2459
- var index2 = -1, length = entries == null ? 0 : entries.length;
2460
- this.clear();
2461
- while (++index2 < length) {
2462
- var entry = entries[index2];
2463
- this.set(entry[0], entry[1]);
2464
- }
2465
- }
2466
- MapCache$1.prototype.clear = mapCacheClear;
2467
- MapCache$1.prototype["delete"] = mapCacheDelete;
2468
- MapCache$1.prototype.get = mapCacheGet;
2469
- MapCache$1.prototype.has = mapCacheHas;
2470
- MapCache$1.prototype.set = mapCacheSet;
2471
- var _MapCache = MapCache$1;
2472
- var ListCache$1 = _ListCache, Map$2 = _Map, MapCache = _MapCache;
2473
- var LARGE_ARRAY_SIZE = 200;
2474
- function stackSet$1(key, value) {
2475
- var data = this.__data__;
2476
- if (data instanceof ListCache$1) {
2477
- var pairs = data.__data__;
2478
- if (!Map$2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
2479
- pairs.push([key, value]);
2480
- this.size = ++data.size;
2481
- return this;
2482
- }
2483
- data = this.__data__ = new MapCache(pairs);
2484
- }
2485
- data.set(key, value);
2486
- this.size = data.size;
2487
- return this;
2488
- }
2489
- var _stackSet = stackSet$1;
2490
- var ListCache = _ListCache, stackClear = _stackClear, stackDelete = _stackDelete, stackGet = _stackGet, stackHas = _stackHas, stackSet = _stackSet;
2491
- function Stack$1(entries) {
2492
- var data = this.__data__ = new ListCache(entries);
2493
- this.size = data.size;
2494
- }
2495
- Stack$1.prototype.clear = stackClear;
2496
- Stack$1.prototype["delete"] = stackDelete;
2497
- Stack$1.prototype.get = stackGet;
2498
- Stack$1.prototype.has = stackHas;
2499
- Stack$1.prototype.set = stackSet;
2500
- var _Stack = Stack$1;
2501
- function arrayEach$1(array, iteratee) {
2502
- var index2 = -1, length = array == null ? 0 : array.length;
2503
- while (++index2 < length) {
2504
- if (iteratee(array[index2], index2, array) === false) {
2505
- break;
2506
- }
2507
- }
2508
- return array;
2509
- }
2510
- var _arrayEach = arrayEach$1;
2511
- var getNative$4 = _getNative;
2512
- var defineProperty$2 = function() {
2513
- try {
2514
- var func = getNative$4(Object, "defineProperty");
2515
- func({}, "", {});
2516
- return func;
2517
- } catch (e) {
2518
- }
2519
- }();
2520
- var _defineProperty = defineProperty$2;
2521
- var defineProperty$1 = _defineProperty;
2522
- function baseAssignValue$2(object, key, value) {
2523
- if (key == "__proto__" && defineProperty$1) {
2524
- defineProperty$1(object, key, {
2525
- "configurable": true,
2526
- "enumerable": true,
2527
- "value": value,
2528
- "writable": true
2529
- });
2530
- } else {
2531
- object[key] = value;
2532
- }
2533
- }
2534
- var _baseAssignValue = baseAssignValue$2;
2535
- var baseAssignValue$1 = _baseAssignValue, eq$3 = eq_1$1;
2536
- var objectProto$e = Object.prototype;
2537
- var hasOwnProperty$8 = objectProto$e.hasOwnProperty;
2538
- function assignValue$2(object, key, value) {
2539
- var objValue = object[key];
2540
- if (!(hasOwnProperty$8.call(object, key) && eq$3(objValue, value)) || value === void 0 && !(key in object)) {
2541
- baseAssignValue$1(object, key, value);
2542
- }
2543
- }
2544
- var _assignValue = assignValue$2;
2545
- var assignValue$1 = _assignValue, baseAssignValue = _baseAssignValue;
2546
- function copyObject$4(source, props, object, customizer) {
2547
- var isNew = !object;
2548
- object || (object = {});
2549
- var index2 = -1, length = props.length;
2550
- while (++index2 < length) {
2551
- var key = props[index2];
2552
- var newValue = customizer ? customizer(object[key], source[key], key, object, source) : void 0;
2553
- if (newValue === void 0) {
2554
- newValue = source[key];
2555
- }
2556
- if (isNew) {
2557
- baseAssignValue(object, key, newValue);
2558
- } else {
2559
- assignValue$1(object, key, newValue);
2560
- }
2561
- }
2562
- return object;
2563
- }
2564
- var _copyObject = copyObject$4;
2565
- function baseTimes$2(n, iteratee) {
2566
- var index2 = -1, result = Array(n);
2567
- while (++index2 < n) {
2568
- result[index2] = iteratee(index2);
2569
- }
2570
- return result;
2571
- }
2572
- var _baseTimes = baseTimes$2;
2573
- function isObjectLike$d(value) {
2574
- return value != null && typeof value == "object";
2575
- }
2576
- var isObjectLike_1 = isObjectLike$d;
2577
- var baseGetTag$2 = _baseGetTag, isObjectLike$c = isObjectLike_1;
2578
- var argsTag$3 = "[object Arguments]";
2579
- function baseIsArguments$1(value) {
2580
- return isObjectLike$c(value) && baseGetTag$2(value) == argsTag$3;
2581
- }
2582
- var _baseIsArguments = baseIsArguments$1;
2583
- var baseIsArguments = _baseIsArguments, isObjectLike$b = isObjectLike_1;
2584
- var objectProto$d = Object.prototype;
2585
- var hasOwnProperty$7 = objectProto$d.hasOwnProperty;
2586
- var propertyIsEnumerable$2 = objectProto$d.propertyIsEnumerable;
2587
- var isArguments$2 = baseIsArguments(/* @__PURE__ */ function() {
2588
- return arguments;
2589
- }()) ? baseIsArguments : function(value) {
2590
- return isObjectLike$b(value) && hasOwnProperty$7.call(value, "callee") && !propertyIsEnumerable$2.call(value, "callee");
2591
- };
2592
- var isArguments_1 = isArguments$2;
2593
- var isArray$6 = Array.isArray;
2594
- var isArray_1 = isArray$6;
2595
- var isBuffer$2 = { exports: {} };
2596
- function stubFalse() {
2597
- return false;
2598
- }
2599
- var stubFalse_1 = stubFalse;
2600
- isBuffer$2.exports;
2601
- (function(module2, exports$1) {
2602
- var root2 = _root, stubFalse2 = stubFalse_1;
2603
- var freeExports = exports$1 && !exports$1.nodeType && exports$1;
2604
- var freeModule = freeExports && true && module2 && !module2.nodeType && module2;
2605
- var moduleExports = freeModule && freeModule.exports === freeExports;
2606
- var Buffer2 = moduleExports ? root2.Buffer : void 0;
2607
- var nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0;
2608
- var isBuffer2 = nativeIsBuffer || stubFalse2;
2609
- module2.exports = isBuffer2;
2610
- })(isBuffer$2, isBuffer$2.exports);
2611
- var isBufferExports = isBuffer$2.exports;
2612
- var MAX_SAFE_INTEGER$4 = 9007199254740991;
2613
- var reIsUint$1 = /^(?:0|[1-9]\d*)$/;
2614
- function isIndex$2(value, length) {
2615
- var type = typeof value;
2616
- length = length == null ? MAX_SAFE_INTEGER$4 : length;
2617
- return !!length && (type == "number" || type != "symbol" && reIsUint$1.test(value)) && (value > -1 && value % 1 == 0 && value < length);
2618
- }
2619
- var _isIndex = isIndex$2;
2620
- var MAX_SAFE_INTEGER$3 = 9007199254740991;
2621
- function isLength$3(value) {
2622
- return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER$3;
2623
- }
2624
- var isLength_1 = isLength$3;
2625
- var baseGetTag$1 = _baseGetTag, isLength$2 = isLength_1, isObjectLike$a = isObjectLike_1;
2626
- var argsTag$2 = "[object Arguments]", arrayTag$1 = "[object Array]", boolTag$3 = "[object Boolean]", dateTag$2 = "[object Date]", errorTag$1 = "[object Error]", funcTag$2 = "[object Function]", mapTag$4 = "[object Map]", numberTag$3 = "[object Number]", objectTag$3 = "[object Object]", regexpTag$2 = "[object RegExp]", setTag$4 = "[object Set]", stringTag$4 = "[object String]", weakMapTag$2 = "[object WeakMap]";
2627
- var arrayBufferTag$2 = "[object ArrayBuffer]", dataViewTag$3 = "[object DataView]", float32Tag$2 = "[object Float32Array]", float64Tag$2 = "[object Float64Array]", int8Tag$2 = "[object Int8Array]", int16Tag$2 = "[object Int16Array]", int32Tag$2 = "[object Int32Array]", uint8Tag$2 = "[object Uint8Array]", uint8ClampedTag$2 = "[object Uint8ClampedArray]", uint16Tag$2 = "[object Uint16Array]", uint32Tag$2 = "[object Uint32Array]";
2628
- var typedArrayTags = {};
2629
- typedArrayTags[float32Tag$2] = typedArrayTags[float64Tag$2] = typedArrayTags[int8Tag$2] = typedArrayTags[int16Tag$2] = typedArrayTags[int32Tag$2] = typedArrayTags[uint8Tag$2] = typedArrayTags[uint8ClampedTag$2] = typedArrayTags[uint16Tag$2] = typedArrayTags[uint32Tag$2] = true;
2630
- typedArrayTags[argsTag$2] = typedArrayTags[arrayTag$1] = typedArrayTags[arrayBufferTag$2] = typedArrayTags[boolTag$3] = typedArrayTags[dataViewTag$3] = typedArrayTags[dateTag$2] = typedArrayTags[errorTag$1] = typedArrayTags[funcTag$2] = typedArrayTags[mapTag$4] = typedArrayTags[numberTag$3] = typedArrayTags[objectTag$3] = typedArrayTags[regexpTag$2] = typedArrayTags[setTag$4] = typedArrayTags[stringTag$4] = typedArrayTags[weakMapTag$2] = false;
2631
- function baseIsTypedArray$1(value) {
2632
- return isObjectLike$a(value) && isLength$2(value.length) && !!typedArrayTags[baseGetTag$1(value)];
2633
- }
2634
- var _baseIsTypedArray = baseIsTypedArray$1;
2635
- function baseUnary$3(func) {
2636
- return function(value) {
2637
- return func(value);
2638
- };
2639
- }
2640
- var _baseUnary = baseUnary$3;
2641
- var _nodeUtil = { exports: {} };
2642
- _nodeUtil.exports;
2643
- (function(module2, exports$1) {
2644
- var freeGlobal2 = _freeGlobal;
2645
- var freeExports = exports$1 && !exports$1.nodeType && exports$1;
2646
- var freeModule = freeExports && true && module2 && !module2.nodeType && module2;
2647
- var moduleExports = freeModule && freeModule.exports === freeExports;
2648
- var freeProcess = moduleExports && freeGlobal2.process;
2649
- var nodeUtil2 = function() {
2650
- try {
2651
- var types2 = freeModule && freeModule.require && freeModule.require("util").types;
2652
- if (types2) {
2653
- return types2;
2654
- }
2655
- return freeProcess && freeProcess.binding && freeProcess.binding("util");
2656
- } catch (e) {
2657
- }
2658
- }();
2659
- module2.exports = nodeUtil2;
2660
- })(_nodeUtil, _nodeUtil.exports);
2661
- var _nodeUtilExports = _nodeUtil.exports;
2662
- var baseIsTypedArray = _baseIsTypedArray, baseUnary$2 = _baseUnary, nodeUtil$2 = _nodeUtilExports;
2663
- var nodeIsTypedArray = nodeUtil$2 && nodeUtil$2.isTypedArray;
2664
- var isTypedArray$1 = nodeIsTypedArray ? baseUnary$2(nodeIsTypedArray) : baseIsTypedArray;
2665
- var isTypedArray_1 = isTypedArray$1;
2666
- var baseTimes$1 = _baseTimes, isArguments$1 = isArguments_1, isArray$5 = isArray_1, isBuffer$1 = isBufferExports, isIndex$1 = _isIndex, isTypedArray = isTypedArray_1;
2667
- var objectProto$c = Object.prototype;
2668
- var hasOwnProperty$6 = objectProto$c.hasOwnProperty;
2669
- function arrayLikeKeys$3(value, inherited) {
2670
- var isArr = isArray$5(value), isArg = !isArr && isArguments$1(value), isBuff = !isArr && !isArg && isBuffer$1(value), isType2 = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType2, result = skipIndexes ? baseTimes$1(value.length, String) : [], length = result.length;
2671
- for (var key in value) {
2672
- if ((inherited || hasOwnProperty$6.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
2673
- (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
2674
- isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
2675
- isType2 && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
2676
- isIndex$1(key, length)))) {
2677
- result.push(key);
2678
- }
2679
- }
2680
- return result;
2681
- }
2682
- var _arrayLikeKeys = arrayLikeKeys$3;
2683
- var objectProto$b = Object.prototype;
2684
- function isPrototype$4(value) {
2685
- var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$b;
2686
- return value === proto;
2687
- }
2688
- var _isPrototype = isPrototype$4;
2689
- function overArg$4(func, transform) {
2690
- return function(arg) {
2691
- return func(transform(arg));
2692
- };
2693
- }
2694
- var _overArg = overArg$4;
2695
- var overArg$3 = _overArg;
2696
- var nativeKeys$2 = overArg$3(Object.keys, Object);
2697
- var _nativeKeys = nativeKeys$2;
2698
- var isPrototype$3 = _isPrototype, nativeKeys$1 = _nativeKeys;
2699
- var objectProto$a = Object.prototype;
2700
- var hasOwnProperty$5 = objectProto$a.hasOwnProperty;
2701
- function baseKeys$2(object) {
2702
- if (!isPrototype$3(object)) {
2703
- return nativeKeys$1(object);
2704
- }
2705
- var result = [];
2706
- for (var key in Object(object)) {
2707
- if (hasOwnProperty$5.call(object, key) && key != "constructor") {
2708
- result.push(key);
2709
- }
2710
- }
2711
- return result;
2712
- }
2713
- var _baseKeys = baseKeys$2;
2714
- var isFunction$1 = isFunction_1, isLength$1 = isLength_1;
2715
- function isArrayLike$3(value) {
2716
- return value != null && isLength$1(value.length) && !isFunction$1(value);
2717
- }
2718
- var isArrayLike_1 = isArrayLike$3;
2719
- var arrayLikeKeys$2 = _arrayLikeKeys, baseKeys$1 = _baseKeys, isArrayLike$2 = isArrayLike_1;
2720
- function keys$4(object) {
2721
- return isArrayLike$2(object) ? arrayLikeKeys$2(object) : baseKeys$1(object);
2722
- }
2723
- var keys_1 = keys$4;
2724
- var copyObject$3 = _copyObject, keys$3 = keys_1;
2725
- function baseAssign$1(object, source) {
2726
- return object && copyObject$3(source, keys$3(source), object);
2727
- }
2728
- var _baseAssign = baseAssign$1;
2729
- function nativeKeysIn$1(object) {
2730
- var result = [];
2731
- if (object != null) {
2732
- for (var key in Object(object)) {
2733
- result.push(key);
2734
- }
2735
- }
2736
- return result;
2737
- }
2738
- var _nativeKeysIn = nativeKeysIn$1;
2739
- var isObject$6 = isObject_1, isPrototype$2 = _isPrototype, nativeKeysIn = _nativeKeysIn;
2740
- var objectProto$9 = Object.prototype;
2741
- var hasOwnProperty$4 = objectProto$9.hasOwnProperty;
2742
- function baseKeysIn$1(object) {
2743
- if (!isObject$6(object)) {
2744
- return nativeKeysIn(object);
2745
- }
2746
- var isProto = isPrototype$2(object), result = [];
2747
- for (var key in object) {
2748
- if (!(key == "constructor" && (isProto || !hasOwnProperty$4.call(object, key)))) {
2749
- result.push(key);
2750
- }
2751
- }
2752
- return result;
2753
- }
2754
- var _baseKeysIn = baseKeysIn$1;
2755
- var arrayLikeKeys$1 = _arrayLikeKeys, baseKeysIn = _baseKeysIn, isArrayLike$1 = isArrayLike_1;
2756
- function keysIn$3(object) {
2757
- return isArrayLike$1(object) ? arrayLikeKeys$1(object, true) : baseKeysIn(object);
2758
- }
2759
- var keysIn_1 = keysIn$3;
2760
- var copyObject$2 = _copyObject, keysIn$2 = keysIn_1;
2761
- function baseAssignIn$1(object, source) {
2762
- return object && copyObject$2(source, keysIn$2(source), object);
2763
- }
2764
- var _baseAssignIn = baseAssignIn$1;
2765
- var _cloneBuffer = { exports: {} };
2766
- _cloneBuffer.exports;
2767
- (function(module2, exports$1) {
2768
- var root2 = _root;
2769
- var freeExports = exports$1 && !exports$1.nodeType && exports$1;
2770
- var freeModule = freeExports && true && module2 && !module2.nodeType && module2;
2771
- var moduleExports = freeModule && freeModule.exports === freeExports;
2772
- var Buffer2 = moduleExports ? root2.Buffer : void 0, allocUnsafe = Buffer2 ? Buffer2.allocUnsafe : void 0;
2773
- function cloneBuffer2(buffer, isDeep) {
2774
- if (isDeep) {
2775
- return buffer.slice();
2776
- }
2777
- var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
2778
- buffer.copy(result);
2779
- return result;
2780
- }
2781
- module2.exports = cloneBuffer2;
2782
- })(_cloneBuffer, _cloneBuffer.exports);
2783
- var _cloneBufferExports = _cloneBuffer.exports;
2784
- function copyArray$1(source, array) {
2785
- var index2 = -1, length = source.length;
2786
- array || (array = Array(length));
2787
- while (++index2 < length) {
2788
- array[index2] = source[index2];
2789
- }
2790
- return array;
2791
- }
2792
- var _copyArray = copyArray$1;
2793
- function arrayFilter$1(array, predicate) {
2794
- var index2 = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
2795
- while (++index2 < length) {
2796
- var value = array[index2];
2797
- if (predicate(value, index2, array)) {
2798
- result[resIndex++] = value;
2799
- }
2800
- }
2801
- return result;
2802
- }
2803
- var _arrayFilter = arrayFilter$1;
2804
- function stubArray$2() {
2805
- return [];
2806
- }
2807
- var stubArray_1 = stubArray$2;
2808
- var arrayFilter = _arrayFilter, stubArray$1 = stubArray_1;
2809
- var objectProto$8 = Object.prototype;
2810
- var propertyIsEnumerable$1 = objectProto$8.propertyIsEnumerable;
2811
- var nativeGetSymbols$1 = Object.getOwnPropertySymbols;
2812
- var getSymbols$3 = !nativeGetSymbols$1 ? stubArray$1 : function(object) {
2813
- if (object == null) {
2814
- return [];
2815
- }
2816
- object = Object(object);
2817
- return arrayFilter(nativeGetSymbols$1(object), function(symbol) {
2818
- return propertyIsEnumerable$1.call(object, symbol);
2819
- });
2820
- };
2821
- var _getSymbols = getSymbols$3;
2822
- var copyObject$1 = _copyObject, getSymbols$2 = _getSymbols;
2823
- function copySymbols$1(source, object) {
2824
- return copyObject$1(source, getSymbols$2(source), object);
2825
- }
2826
- var _copySymbols = copySymbols$1;
2827
- function arrayPush$2(array, values2) {
2828
- var index2 = -1, length = values2.length, offset = array.length;
2829
- while (++index2 < length) {
2830
- array[offset + index2] = values2[index2];
2831
- }
2832
- return array;
2833
- }
2834
- var _arrayPush = arrayPush$2;
2835
- var overArg$2 = _overArg;
2836
- var getPrototype$3 = overArg$2(Object.getPrototypeOf, Object);
2837
- var _getPrototype = getPrototype$3;
2838
- var arrayPush$1 = _arrayPush, getPrototype$2 = _getPrototype, getSymbols$1 = _getSymbols, stubArray = stubArray_1;
2839
- var nativeGetSymbols = Object.getOwnPropertySymbols;
2840
- var getSymbolsIn$2 = !nativeGetSymbols ? stubArray : function(object) {
2841
- var result = [];
2842
- while (object) {
2843
- arrayPush$1(result, getSymbols$1(object));
2844
- object = getPrototype$2(object);
2845
- }
2846
- return result;
2847
- };
2848
- var _getSymbolsIn = getSymbolsIn$2;
2849
- var copyObject = _copyObject, getSymbolsIn$1 = _getSymbolsIn;
2850
- function copySymbolsIn$1(source, object) {
2851
- return copyObject(source, getSymbolsIn$1(source), object);
2852
- }
2853
- var _copySymbolsIn = copySymbolsIn$1;
2854
- var arrayPush = _arrayPush, isArray$4 = isArray_1;
2855
- function baseGetAllKeys$2(object, keysFunc, symbolsFunc) {
2856
- var result = keysFunc(object);
2857
- return isArray$4(object) ? result : arrayPush(result, symbolsFunc(object));
2858
- }
2859
- var _baseGetAllKeys = baseGetAllKeys$2;
2860
- var baseGetAllKeys$1 = _baseGetAllKeys, getSymbols = _getSymbols, keys$2 = keys_1;
2861
- function getAllKeys$1(object) {
2862
- return baseGetAllKeys$1(object, keys$2, getSymbols);
2863
- }
2864
- var _getAllKeys = getAllKeys$1;
2865
- var baseGetAllKeys = _baseGetAllKeys, getSymbolsIn = _getSymbolsIn, keysIn$1 = keysIn_1;
2866
- function getAllKeysIn$1(object) {
2867
- return baseGetAllKeys(object, keysIn$1, getSymbolsIn);
2868
- }
2869
- var _getAllKeysIn = getAllKeysIn$1;
2870
- var getNative$3 = _getNative, root$4 = _root;
2871
- var DataView$1 = getNative$3(root$4, "DataView");
2872
- var _DataView = DataView$1;
2873
- var getNative$2 = _getNative, root$3 = _root;
2874
- var Promise$2 = getNative$2(root$3, "Promise");
2875
- var _Promise = Promise$2;
2876
- var getNative$1 = _getNative, root$2 = _root;
2877
- var Set$2 = getNative$1(root$2, "Set");
2878
- var _Set = Set$2;
2879
- var getNative = _getNative, root$1 = _root;
2880
- var WeakMap$2 = getNative(root$1, "WeakMap");
2881
- var _WeakMap = WeakMap$2;
2882
- var DataView = _DataView, Map$1 = _Map, Promise$1 = _Promise, Set$1 = _Set, WeakMap$1 = _WeakMap, baseGetTag = _baseGetTag, toSource = _toSource;
2883
- var mapTag$3 = "[object Map]", objectTag$2 = "[object Object]", promiseTag = "[object Promise]", setTag$3 = "[object Set]", weakMapTag$1 = "[object WeakMap]";
2884
- var dataViewTag$2 = "[object DataView]";
2885
- var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map$1), promiseCtorString = toSource(Promise$1), setCtorString = toSource(Set$1), weakMapCtorString = toSource(WeakMap$1);
2886
- var getTag$3 = baseGetTag;
2887
- if (DataView && getTag$3(new DataView(new ArrayBuffer(1))) != dataViewTag$2 || Map$1 && getTag$3(new Map$1()) != mapTag$3 || Promise$1 && getTag$3(Promise$1.resolve()) != promiseTag || Set$1 && getTag$3(new Set$1()) != setTag$3 || WeakMap$1 && getTag$3(new WeakMap$1()) != weakMapTag$1) {
2888
- getTag$3 = function(value) {
2889
- var result = baseGetTag(value), Ctor = result == objectTag$2 ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
2890
- if (ctorString) {
2891
- switch (ctorString) {
2892
- case dataViewCtorString:
2893
- return dataViewTag$2;
2894
- case mapCtorString:
2895
- return mapTag$3;
2896
- case promiseCtorString:
2897
- return promiseTag;
2898
- case setCtorString:
2899
- return setTag$3;
2900
- case weakMapCtorString:
2901
- return weakMapTag$1;
2902
- }
2903
- }
2904
- return result;
2905
- };
2906
- }
2907
- var _getTag = getTag$3;
2908
- var objectProto$7 = Object.prototype;
2909
- var hasOwnProperty$3 = objectProto$7.hasOwnProperty;
2910
- function initCloneArray$1(array) {
2911
- var length = array.length, result = new array.constructor(length);
2912
- if (length && typeof array[0] == "string" && hasOwnProperty$3.call(array, "index")) {
2913
- result.index = array.index;
2914
- result.input = array.input;
2915
- }
2916
- return result;
2917
- }
2918
- var _initCloneArray = initCloneArray$1;
2919
- var root = _root;
2920
- var Uint8Array$2 = root.Uint8Array;
2921
- var _Uint8Array = Uint8Array$2;
2922
- var Uint8Array$1 = _Uint8Array;
2923
- function cloneArrayBuffer$3(arrayBuffer) {
2924
- var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
2925
- new Uint8Array$1(result).set(new Uint8Array$1(arrayBuffer));
2926
- return result;
2927
- }
2928
- var _cloneArrayBuffer = cloneArrayBuffer$3;
2929
- var cloneArrayBuffer$2 = _cloneArrayBuffer;
2930
- function cloneDataView$1(dataView, isDeep) {
2931
- var buffer = isDeep ? cloneArrayBuffer$2(dataView.buffer) : dataView.buffer;
2932
- return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
2933
- }
2934
- var _cloneDataView = cloneDataView$1;
2935
- var reFlags = /\w*$/;
2936
- function cloneRegExp$1(regexp) {
2937
- var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
2938
- result.lastIndex = regexp.lastIndex;
2939
- return result;
2940
- }
2941
- var _cloneRegExp = cloneRegExp$1;
2942
- var Symbol$1 = _Symbol;
2943
- var symbolProto = Symbol$1 ? Symbol$1.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
2944
- function cloneSymbol$1(symbol) {
2945
- return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
2946
- }
2947
- var _cloneSymbol = cloneSymbol$1;
2948
- var cloneArrayBuffer$1 = _cloneArrayBuffer;
2949
- function cloneTypedArray$1(typedArray, isDeep) {
2950
- var buffer = isDeep ? cloneArrayBuffer$1(typedArray.buffer) : typedArray.buffer;
2951
- return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
2952
- }
2953
- var _cloneTypedArray = cloneTypedArray$1;
2954
- var cloneArrayBuffer = _cloneArrayBuffer, cloneDataView = _cloneDataView, cloneRegExp = _cloneRegExp, cloneSymbol = _cloneSymbol, cloneTypedArray = _cloneTypedArray;
2955
- var boolTag$2 = "[object Boolean]", dateTag$1 = "[object Date]", mapTag$2 = "[object Map]", numberTag$2 = "[object Number]", regexpTag$1 = "[object RegExp]", setTag$2 = "[object Set]", stringTag$3 = "[object String]", symbolTag$4 = "[object Symbol]";
2956
- var arrayBufferTag$1 = "[object ArrayBuffer]", dataViewTag$1 = "[object DataView]", float32Tag$1 = "[object Float32Array]", float64Tag$1 = "[object Float64Array]", int8Tag$1 = "[object Int8Array]", int16Tag$1 = "[object Int16Array]", int32Tag$1 = "[object Int32Array]", uint8Tag$1 = "[object Uint8Array]", uint8ClampedTag$1 = "[object Uint8ClampedArray]", uint16Tag$1 = "[object Uint16Array]", uint32Tag$1 = "[object Uint32Array]";
2957
- function initCloneByTag$1(object, tag, isDeep) {
2958
- var Ctor = object.constructor;
2959
- switch (tag) {
2960
- case arrayBufferTag$1:
2961
- return cloneArrayBuffer(object);
2962
- case boolTag$2:
2963
- case dateTag$1:
2964
- return new Ctor(+object);
2965
- case dataViewTag$1:
2966
- return cloneDataView(object, isDeep);
2967
- case float32Tag$1:
2968
- case float64Tag$1:
2969
- case int8Tag$1:
2970
- case int16Tag$1:
2971
- case int32Tag$1:
2972
- case uint8Tag$1:
2973
- case uint8ClampedTag$1:
2974
- case uint16Tag$1:
2975
- case uint32Tag$1:
2976
- return cloneTypedArray(object, isDeep);
2977
- case mapTag$2:
2978
- return new Ctor();
2979
- case numberTag$2:
2980
- case stringTag$3:
2981
- return new Ctor(object);
2982
- case regexpTag$1:
2983
- return cloneRegExp(object);
2984
- case setTag$2:
2985
- return new Ctor();
2986
- case symbolTag$4:
2987
- return cloneSymbol(object);
2988
- }
2989
- }
2990
- var _initCloneByTag = initCloneByTag$1;
2991
- var isObject$5 = isObject_1;
2992
- var objectCreate = Object.create;
2993
- var baseCreate$1 = /* @__PURE__ */ function() {
2994
- function object() {
2995
- }
2996
- return function(proto) {
2997
- if (!isObject$5(proto)) {
2998
- return {};
2999
- }
3000
- if (objectCreate) {
3001
- return objectCreate(proto);
3002
- }
3003
- object.prototype = proto;
3004
- var result = new object();
3005
- object.prototype = void 0;
3006
- return result;
3007
- };
3008
- }();
3009
- var _baseCreate = baseCreate$1;
3010
- var baseCreate = _baseCreate, getPrototype$1 = _getPrototype, isPrototype$1 = _isPrototype;
3011
- function initCloneObject$1(object) {
3012
- return typeof object.constructor == "function" && !isPrototype$1(object) ? baseCreate(getPrototype$1(object)) : {};
3013
- }
3014
- var _initCloneObject = initCloneObject$1;
3015
- var getTag$2 = _getTag, isObjectLike$9 = isObjectLike_1;
3016
- var mapTag$1 = "[object Map]";
3017
- function baseIsMap$1(value) {
3018
- return isObjectLike$9(value) && getTag$2(value) == mapTag$1;
3019
- }
3020
- var _baseIsMap = baseIsMap$1;
3021
- var baseIsMap = _baseIsMap, baseUnary$1 = _baseUnary, nodeUtil$1 = _nodeUtilExports;
3022
- var nodeIsMap = nodeUtil$1 && nodeUtil$1.isMap;
3023
- var isMap$1 = nodeIsMap ? baseUnary$1(nodeIsMap) : baseIsMap;
3024
- var isMap_1 = isMap$1;
3025
- var getTag$1 = _getTag, isObjectLike$8 = isObjectLike_1;
3026
- var setTag$1 = "[object Set]";
3027
- function baseIsSet$1(value) {
3028
- return isObjectLike$8(value) && getTag$1(value) == setTag$1;
3029
- }
3030
- var _baseIsSet = baseIsSet$1;
3031
- var baseIsSet = _baseIsSet, baseUnary = _baseUnary, nodeUtil = _nodeUtilExports;
3032
- var nodeIsSet = nodeUtil && nodeUtil.isSet;
3033
- var isSet$1 = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
3034
- var isSet_1 = isSet$1;
3035
- var Stack = _Stack, arrayEach = _arrayEach, assignValue = _assignValue, baseAssign = _baseAssign, baseAssignIn = _baseAssignIn, cloneBuffer = _cloneBufferExports, copyArray = _copyArray, copySymbols = _copySymbols, copySymbolsIn = _copySymbolsIn, getAllKeys = _getAllKeys, getAllKeysIn = _getAllKeysIn, getTag = _getTag, initCloneArray = _initCloneArray, initCloneByTag = _initCloneByTag, initCloneObject = _initCloneObject, isArray$3 = isArray_1, isBuffer = isBufferExports, isMap = isMap_1, isObject$4 = isObject_1, isSet = isSet_1, keys$1 = keys_1, keysIn = keysIn_1;
3036
- var CLONE_DEEP_FLAG$1 = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG$1 = 4;
3037
- var argsTag$1 = "[object Arguments]", arrayTag = "[object Array]", boolTag$1 = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag$1 = "[object Function]", genTag$1 = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag$1 = "[object Number]", objectTag$1 = "[object Object]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag$2 = "[object String]", symbolTag$3 = "[object Symbol]", weakMapTag = "[object WeakMap]";
3038
- var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
3039
- var cloneableTags = {};
3040
- cloneableTags[argsTag$1] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag$1] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag$1] = cloneableTags[objectTag$1] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag$2] = cloneableTags[symbolTag$3] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
3041
- cloneableTags[errorTag] = cloneableTags[funcTag$1] = cloneableTags[weakMapTag] = false;
3042
- function baseClone$1(value, bitmask, customizer, key, object, stack) {
3043
- var result, isDeep = bitmask & CLONE_DEEP_FLAG$1, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG$1;
3044
- if (customizer) {
3045
- result = object ? customizer(value, key, object, stack) : customizer(value);
3046
- }
3047
- if (result !== void 0) {
3048
- return result;
3049
- }
3050
- if (!isObject$4(value)) {
3051
- return value;
3052
- }
3053
- var isArr = isArray$3(value);
3054
- if (isArr) {
3055
- result = initCloneArray(value);
3056
- if (!isDeep) {
3057
- return copyArray(value, result);
3058
- }
3059
- } else {
3060
- var tag = getTag(value), isFunc = tag == funcTag$1 || tag == genTag$1;
3061
- if (isBuffer(value)) {
3062
- return cloneBuffer(value, isDeep);
3063
- }
3064
- if (tag == objectTag$1 || tag == argsTag$1 || isFunc && !object) {
3065
- result = isFlat || isFunc ? {} : initCloneObject(value);
3066
- if (!isDeep) {
3067
- return isFlat ? copySymbolsIn(value, baseAssignIn(result, value)) : copySymbols(value, baseAssign(result, value));
3068
- }
3069
- } else {
3070
- if (!cloneableTags[tag]) {
3071
- return object ? value : {};
3072
- }
3073
- result = initCloneByTag(value, tag, isDeep);
3074
- }
3075
- }
3076
- stack || (stack = new Stack());
3077
- var stacked = stack.get(value);
3078
- if (stacked) {
3079
- return stacked;
3080
- }
3081
- stack.set(value, result);
3082
- if (isSet(value)) {
3083
- value.forEach(function(subValue) {
3084
- result.add(baseClone$1(subValue, bitmask, customizer, subValue, value, stack));
3085
- });
3086
- } else if (isMap(value)) {
3087
- value.forEach(function(subValue, key2) {
3088
- result.set(key2, baseClone$1(subValue, bitmask, customizer, key2, value, stack));
3089
- });
3090
- }
3091
- var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys$1;
3092
- var props = isArr ? void 0 : keysFunc(value);
3093
- arrayEach(props || value, function(subValue, key2) {
3094
- if (props) {
3095
- key2 = subValue;
3096
- subValue = value[key2];
3097
- }
3098
- assignValue(result, key2, baseClone$1(subValue, bitmask, customizer, key2, value, stack));
3099
- });
3100
- return result;
3101
- }
3102
- var _baseClone = baseClone$1;
3103
- var baseClone = _baseClone;
3104
- var CLONE_DEEP_FLAG = 1, CLONE_SYMBOLS_FLAG = 4;
3105
- function cloneDeep$1(value) {
3106
- return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
3107
- }
3108
- var cloneDeep_1 = cloneDeep$1;
3109
- const cloneDeep = /* @__PURE__ */ getDefaultExportFromCjs(cloneDeep_1);
3110
2151
  class CollectionRegistry {
3111
2152
  // Normalized runtime layer (used by Data Grid / UI)
3112
2153
  collectionsByTableName = /* @__PURE__ */ new Map();
@@ -3154,7 +2195,7 @@
3154
2195
  ...c
3155
2196
  }));
3156
2197
  normalizedCollections.forEach((c, index2) => {
3157
- const raw = cloneDeep(collections[index2]);
2198
+ const raw = deepClone(collections[index2]);
3158
2199
  this.rootCollections.push(c);
3159
2200
  this.rawRootCollections.push(raw);
3160
2201
  const normalized2 = this.normalizeCollection(c);
@@ -3174,7 +2215,7 @@
3174
2215
  if (!subCollection) return;
3175
2216
  this._registerRecursively(this.normalizeCollection({
3176
2217
  ...subCollection
3177
- }), cloneDeep(subCollection));
2218
+ }), deepClone(subCollection));
3178
2219
  });
3179
2220
  }
3180
2221
  });
@@ -3182,7 +2223,7 @@
3182
2223
  return true;
3183
2224
  }
3184
2225
  register(collection, rawCollection) {
3185
- const raw = rawCollection ? cloneDeep(rawCollection) : cloneDeep(collection);
2226
+ const raw = rawCollection ? deepClone(rawCollection) : deepClone(collection);
3186
2227
  this.rootCollections.push(collection);
3187
2228
  this.rawRootCollections.push(raw);
3188
2229
  this._registerRecursively(collection, raw);
@@ -3206,7 +2247,7 @@
3206
2247
  if (!subCollection) return;
3207
2248
  this._registerRecursively(this.normalizeCollection({
3208
2249
  ...subCollection
3209
- }), cloneDeep(subCollection));
2250
+ }), deepClone(subCollection));
3210
2251
  });
3211
2252
  }
3212
2253
  }
@@ -3465,8 +2506,7 @@
3465
2506
  const filePath = path__namespace.join(directory, file);
3466
2507
  try {
3467
2508
  const fileUrl = require$$0$2.pathToFileURL(filePath).href;
3468
- const dynamicImport = new Function("url", "return import(url)");
3469
- const module2 = await dynamicImport(fileUrl);
2509
+ const module2 = await import(fileUrl);
3470
2510
  if (module2 && module2.default) {
3471
2511
  collections.push(module2.default);
3472
2512
  } else {
@@ -3624,7 +2664,8 @@
3624
2664
  console.error(`❌ [API] ${c.req.method} ${c.req.path} → ${statusCode} ${code2}: ${logMessage}`);
3625
2665
  const causePg = error2.cause && typeof error2.cause === "object" ? error2.cause : void 0;
3626
2666
  const pgErrorCode = causePg?.code || error2.code;
3627
- if (pgErrorCode !== "42703" && pgErrorCode !== "42P01") {
2667
+ const suppressStack = pgErrorCode === "42703" || pgErrorCode === "42P01" || statusCode < 500 && code2 === "BAD_REQUEST";
2668
+ if (!suppressStack) {
3628
2669
  console.error(error2.stack || error2);
3629
2670
  }
3630
2671
  let clientMessage = "An unexpected error occurred";
@@ -21623,15 +20664,19 @@ ${credentialScope}
21623
20664
  ZodPromise.create;
21624
20665
  ZodOptional.create;
21625
20666
  ZodNullable.create;
21626
- function createGoogleProvider(clientId) {
21627
- const googleClient = new src$4.OAuth2Client(clientId);
20667
+ function createGoogleProvider(config) {
20668
+ const clientId = typeof config === "string" ? config : config.clientId;
20669
+ const clientSecret = typeof config === "string" ? void 0 : config.clientSecret;
20670
+ const googleClient = new src$4.OAuth2Client(clientId, clientSecret);
21628
20671
  return {
21629
20672
  id: "google",
21630
20673
  schema: objectType({
21631
20674
  idToken: stringType().min(1).optional(),
21632
- accessToken: stringType().min(1).optional()
21633
- }).refine((data) => data.idToken || data.accessToken, {
21634
- message: "Either idToken or accessToken is required"
20675
+ accessToken: stringType().min(1).optional(),
20676
+ code: stringType().min(1).optional(),
20677
+ redirectUri: stringType().min(1).optional()
20678
+ }).refine((data) => data.idToken || data.accessToken || data.code && data.redirectUri, {
20679
+ message: "One of idToken, accessToken, or code+redirectUri is required"
21635
20680
  }),
21636
20681
  verify: async (payload) => {
21637
20682
  try {
@@ -21642,7 +20687,7 @@ ${credentialScope}
21642
20687
  });
21643
20688
  const content = ticket.getPayload();
21644
20689
  if (!content) {
21645
- return null;
20690
+ throw new Error("Google ID token payload was empty");
21646
20691
  }
21647
20692
  return {
21648
20693
  providerId: content.sub,
@@ -21658,12 +20703,11 @@ ${credentialScope}
21658
20703
  }
21659
20704
  });
21660
20705
  if (!res.ok) {
21661
- console.error("Google userinfo request failed:", res.status);
21662
- return null;
20706
+ throw new Error(`Google userinfo request failed with status ${res.status}`);
21663
20707
  }
21664
20708
  const info = await res.json();
21665
20709
  if (!info.sub || !info.email) {
21666
- return null;
20710
+ throw new Error("Google userinfo response missing sub or email");
21667
20711
  }
21668
20712
  return {
21669
20713
  providerId: info.sub,
@@ -21672,10 +20716,73 @@ ${credentialScope}
21672
20716
  photoUrl: info.picture || null
21673
20717
  };
21674
20718
  }
21675
- return null;
20719
+ if (payload.code && payload.redirectUri) {
20720
+ if (!clientSecret) {
20721
+ throw new Error("Google authorization code flow requires clientSecret. Configure GOOGLE_CLIENT_SECRET in your environment.");
20722
+ }
20723
+ const tokenResponse = await fetch("https://oauth2.googleapis.com/token", {
20724
+ method: "POST",
20725
+ headers: {
20726
+ "Content-Type": "application/x-www-form-urlencoded"
20727
+ },
20728
+ body: new URLSearchParams({
20729
+ code: payload.code,
20730
+ client_id: clientId,
20731
+ client_secret: clientSecret,
20732
+ redirect_uri: payload.redirectUri,
20733
+ grant_type: "authorization_code"
20734
+ })
20735
+ });
20736
+ if (!tokenResponse.ok) {
20737
+ const errorBody = await tokenResponse.text();
20738
+ throw new Error(`Google token exchange failed (${tokenResponse.status}): ${errorBody}`);
20739
+ }
20740
+ const tokenData = await tokenResponse.json();
20741
+ if (tokenData.error) {
20742
+ throw new Error(`Google token exchange error: ${tokenData.error} – ${tokenData.error_description || "no details"}`);
20743
+ }
20744
+ if (tokenData.id_token) {
20745
+ const ticket = await googleClient.verifyIdToken({
20746
+ idToken: tokenData.id_token,
20747
+ audience: clientId
20748
+ });
20749
+ const content = ticket.getPayload();
20750
+ if (!content) {
20751
+ throw new Error("Google ID token payload was empty after code exchange");
20752
+ }
20753
+ return {
20754
+ providerId: content.sub,
20755
+ email: content.email || "",
20756
+ displayName: content.name || null,
20757
+ photoUrl: content.picture || null
20758
+ };
20759
+ }
20760
+ if (tokenData.access_token) {
20761
+ const userInfoRes = await fetch("https://www.googleapis.com/oauth2/v3/userinfo", {
20762
+ headers: {
20763
+ Authorization: `Bearer ${tokenData.access_token}`
20764
+ }
20765
+ });
20766
+ if (!userInfoRes.ok) {
20767
+ throw new Error(`Google userinfo request failed after code exchange (${userInfoRes.status})`);
20768
+ }
20769
+ const info = await userInfoRes.json();
20770
+ if (!info.sub || !info.email) {
20771
+ return null;
20772
+ }
20773
+ return {
20774
+ providerId: info.sub,
20775
+ email: info.email,
20776
+ displayName: info.name || null,
20777
+ photoUrl: info.picture || null
20778
+ };
20779
+ }
20780
+ throw new Error("Google token exchange returned neither id_token nor access_token");
20781
+ }
20782
+ throw new Error("No valid Google credential provided (expected idToken, accessToken, or code+redirectUri)");
21676
20783
  } catch (error2) {
21677
- console.error("Failed to verify Google token:", error2);
21678
- return null;
20784
+ console.error("Google OAuth verification failed:", error2);
20785
+ throw error2;
21679
20786
  }
21680
20787
  }
21681
20788
  };
@@ -22883,7 +21990,11 @@ Si tienes alguna pregunta, no dudes en contactarnos respondiendo a este correo.
22883
21990
  passwordHash,
22884
21991
  displayName: displayName || void 0
22885
21992
  });
22886
- if (config.defaultRole) {
21993
+ const existingUsers = await authRepo.listUsers();
21994
+ const isFirstUser = existingUsers.length === 1 && existingUsers[0].id === user.id;
21995
+ if (isFirstUser) {
21996
+ await authRepo.setUserRoles(user.id, ["admin"]);
21997
+ } else if (config.defaultRole) {
22887
21998
  await authRepo.assignDefaultRole(user.id, config.defaultRole);
22888
21999
  }
22889
22000
  const {
@@ -22924,7 +22035,13 @@ Si tienes alguna pregunta, no dudes en contactarnos respondiendo a este correo.
22924
22035
  for (const provider of config.oauthProviders) {
22925
22036
  router.post(`/${provider.id}`, defaultAuthLimiter, async (c) => {
22926
22037
  const payload = parseBody2(provider.schema, await c.req.json());
22927
- const externalUser = await provider.verify(payload);
22038
+ let externalUser;
22039
+ try {
22040
+ externalUser = await provider.verify(payload);
22041
+ } catch (err) {
22042
+ const msg = err instanceof Error ? err.message : String(err);
22043
+ throw ApiError.unauthorized(`${provider.id} login failed: ${msg}`, "OAUTH_ERROR");
22044
+ }
22928
22045
  if (!externalUser) {
22929
22046
  throw ApiError.unauthorized(`Invalid ${provider.id} credentials`, "INVALID_TOKEN");
22930
22047
  }
@@ -22948,7 +22065,11 @@ Si tienes alguna pregunta, no dudes en contactarnos respondiendo a este correo.
22948
22065
  await authRepo.linkUserIdentity(user.id, provider.id, externalUser.providerId, {
22949
22066
  email: externalUser.email
22950
22067
  });
22951
- if (config.defaultRole) {
22068
+ const allUsers = await authRepo.listUsers();
22069
+ const isFirstUser = allUsers.length === 1 && allUsers[0].id === user.id;
22070
+ if (isFirstUser) {
22071
+ await authRepo.setUserRoles(user.id, ["admin"]);
22072
+ } else if (config.defaultRole) {
22952
22073
  await authRepo.assignDefaultRole(user.id, config.defaultRole);
22953
22074
  }
22954
22075
  sendWelcomeEmail({
@@ -24976,20 +24097,21 @@ Si tienes alguna pregunta, no dudes en contactarnos respondiendo a este correo.
24976
24097
  refreshToken: session.refreshToken
24977
24098
  };
24978
24099
  }
24979
- async function signInWithGoogle(idToken) {
24100
+ async function signInWithGoogle(tokenOrPayload) {
24980
24101
  const fetchFn = getFetch();
24102
+ const body = typeof tokenOrPayload === "string" ? {
24103
+ idToken: tokenOrPayload
24104
+ } : tokenOrPayload;
24981
24105
  const res = await fetchFn(authUrl("/google"), {
24982
24106
  method: "POST",
24983
24107
  headers: {
24984
24108
  "Content-Type": "application/json"
24985
24109
  },
24986
- body: JSON.stringify({
24987
- idToken
24988
- })
24110
+ body: JSON.stringify(body)
24989
24111
  });
24990
- const body = await res.json().catch(() => ({}));
24991
- if (!res.ok) throwApiError(res.status, body, res.statusText);
24992
- const session = handleAuthResponse(body, "SIGNED_IN");
24112
+ const responseBody = await res.json().catch(() => ({}));
24113
+ if (!res.ok) throwApiError(res.status, responseBody, res.statusText);
24114
+ const session = handleAuthResponse(responseBody, "SIGNED_IN");
24993
24115
  return {
24994
24116
  user: session.user,
24995
24117
  accessToken: session.accessToken,
@@ -25651,6 +24773,25 @@ Si tienes alguna pregunta, no dudes en contactarnos respondiendo a este correo.
25651
24773
  };
25652
24774
  return client;
25653
24775
  }
24776
+ function createFunctionsClient(transport) {
24777
+ return {
24778
+ async invoke(name2, payload, options2) {
24779
+ const method = options2?.method ?? "POST";
24780
+ const subPath = options2?.path ? `/${options2.path.replace(/^\//, "")}` : "";
24781
+ const routePath = `/functions/${encodeURIComponent(name2)}${subPath}`;
24782
+ const init = {
24783
+ method
24784
+ };
24785
+ if (payload !== void 0 && method !== "GET") {
24786
+ init.body = JSON.stringify(payload);
24787
+ }
24788
+ if (options2?.headers) {
24789
+ init.headers = options2.headers;
24790
+ }
24791
+ return transport.request(routePath, init);
24792
+ }
24793
+ };
24794
+ }
25654
24795
  function createStorage(transport) {
25655
24796
  const urlsCache = /* @__PURE__ */ new Map();
25656
24797
  async function putObject({
@@ -25784,6 +24925,7 @@ Si tienes alguna pregunta, no dudes en contactarnos respondiendo a este correo.
25784
24925
  const admin = createAdmin(transport, options2.admin);
25785
24926
  const cron = createCron(transport, options2.cron);
25786
24927
  const storage = createStorage(transport);
24928
+ const functions = createFunctionsClient(transport);
25787
24929
  let ws;
25788
24930
  if (!options2.onUnauthorized) {
25789
24931
  transport.setOnUnauthorized(async () => {
@@ -25822,6 +24964,7 @@ Si tienes alguna pregunta, no dudes en contactarnos respondiendo a este correo.
25822
24964
  auth,
25823
24965
  admin,
25824
24966
  cron,
24967
+ functions,
25825
24968
  storage,
25826
24969
  ws,
25827
24970
  setToken: transport.setToken,
@@ -37149,7 +36292,7 @@ Si tienes alguna pregunta, no dudes en contactarnos respondiendo a este correo.
37149
36292
  const {
37150
36293
  createGoogleProvider: createGoogleProvider2
37151
36294
  } = await Promise.resolve().then(() => index);
37152
- oauthProviders.push(createGoogleProvider2(config.auth.google.clientId));
36295
+ oauthProviders.push(createGoogleProvider2(config.auth.google));
37153
36296
  }
37154
36297
  if (config.auth.linkedin?.clientId && config.auth.linkedin?.clientSecret) {
37155
36298
  const {
@@ -37350,6 +36493,13 @@ Si tienes alguna pregunta, no dudes en contactarnos respondiendo a este correo.
37350
36493
  }
37351
36494
  _initRebase(serverClient);
37352
36495
  logger.info("Rebase singleton initialized");
36496
+ if (defaultDriverResult.internals) {
36497
+ const internals = defaultDriverResult.internals;
36498
+ const driver = internals.driver;
36499
+ if (driver && "client" in driver) {
36500
+ driver.client = serverClient;
36501
+ }
36502
+ }
37353
36503
  if (config.functionsDir) {
37354
36504
  const {
37355
36505
  loadFunctionsFromDirectory: loadFunctionsFromDirectory2
@@ -40405,17 +39555,17 @@ spurious results.`);
40405
39555
  "\\u009F"
40406
39556
  ];
40407
39557
  const BREAK = Object.freeze({});
40408
- function visit(root2, visitor, visitorKeys = QueryDocumentKeys) {
39558
+ function visit(root, visitor, visitorKeys = QueryDocumentKeys) {
40409
39559
  const enterLeaveMap = /* @__PURE__ */ new Map();
40410
39560
  for (const kind of Object.values(Kind)) {
40411
39561
  enterLeaveMap.set(kind, getEnterLeaveForKind(visitor, kind));
40412
39562
  }
40413
39563
  let stack = void 0;
40414
- let inArray = Array.isArray(root2);
40415
- let keys2 = [root2];
39564
+ let inArray = Array.isArray(root);
39565
+ let keys2 = [root];
40416
39566
  let index2 = -1;
40417
39567
  let edits = [];
40418
- let node = root2;
39568
+ let node = root;
40419
39569
  let key = void 0;
40420
39570
  let parent = void 0;
40421
39571
  const path2 = [];
@@ -40514,7 +39664,7 @@ spurious results.`);
40514
39664
  if (edits.length !== 0) {
40515
39665
  return edits[edits.length - 1][1];
40516
39666
  }
40517
- return root2;
39667
+ return root;
40518
39668
  }
40519
39669
  function visitInParallel(visitors) {
40520
39670
  const skipping = new Array(visitors.length).fill(null);
@@ -48228,7 +47378,9 @@ export default ${safeId}Collection;
48228
47378
  * Setup Hono middleware
48229
47379
  */
48230
47380
  setupMiddleware() {
48231
- this.router.use("/*", secureHeaders.secureHeaders());
47381
+ this.router.use("/*", secureHeaders.secureHeaders({
47382
+ crossOriginOpenerPolicy: "same-origin-allow-popups"
47383
+ }));
48232
47384
  if (this.config.cors) {
48233
47385
  const origin = this.config.cors.origin;
48234
47386
  this.router.use("/*", cors.cors({