@kenkaiiii/gg-boss 4.4.0 → 4.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1454,8 +1454,8 @@ var require_applicability = __commonJS({
|
|
|
1454
1454
|
init_esm_shims();
|
|
1455
1455
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1456
1456
|
exports.shouldUseRule = exports.shouldUseGroup = exports.schemaHasRulesForType = void 0;
|
|
1457
|
-
function schemaHasRulesForType({ schema, self },
|
|
1458
|
-
const group = self.RULES.types[
|
|
1457
|
+
function schemaHasRulesForType({ schema, self }, type2) {
|
|
1458
|
+
const group = self.RULES.types[type2];
|
|
1459
1459
|
return group && group !== true && shouldUseGroup(schema, group);
|
|
1460
1460
|
}
|
|
1461
1461
|
exports.schemaHasRulesForType = schemaHasRulesForType;
|
|
@@ -2565,9 +2565,9 @@ var require_validate = __commonJS({
|
|
|
2565
2565
|
for (const keyword in rules) {
|
|
2566
2566
|
const rule = rules[keyword];
|
|
2567
2567
|
if (typeof rule == "object" && (0, applicability_1.shouldUseRule)(it.schema, rule)) {
|
|
2568
|
-
const { type } = rule.definition;
|
|
2569
|
-
if (
|
|
2570
|
-
strictTypesError(it, `missing type "${
|
|
2568
|
+
const { type: type2 } = rule.definition;
|
|
2569
|
+
if (type2.length && !type2.some((t) => hasApplicableType(ts, t))) {
|
|
2570
|
+
strictTypesError(it, `missing type "${type2.join(",")}" for keyword "${keyword}"`);
|
|
2571
2571
|
}
|
|
2572
2572
|
}
|
|
2573
2573
|
}
|
|
@@ -3225,8 +3225,8 @@ var require_utils = __commonJS({
|
|
|
3225
3225
|
}
|
|
3226
3226
|
return ind;
|
|
3227
3227
|
}
|
|
3228
|
-
function removeDotSegments(
|
|
3229
|
-
let input =
|
|
3228
|
+
function removeDotSegments(path43) {
|
|
3229
|
+
let input = path43;
|
|
3230
3230
|
const output = [];
|
|
3231
3231
|
let nextSlash = -1;
|
|
3232
3232
|
let len = 0;
|
|
@@ -3426,8 +3426,8 @@ var require_schemes = __commonJS({
|
|
|
3426
3426
|
wsComponent.secure = void 0;
|
|
3427
3427
|
}
|
|
3428
3428
|
if (wsComponent.resourceName) {
|
|
3429
|
-
const [
|
|
3430
|
-
wsComponent.path =
|
|
3429
|
+
const [path43, query] = wsComponent.resourceName.split("?");
|
|
3430
|
+
wsComponent.path = path43 && path43 !== "/" ? path43 : void 0;
|
|
3431
3431
|
wsComponent.query = query;
|
|
3432
3432
|
wsComponent.resourceName = void 0;
|
|
3433
3433
|
}
|
|
@@ -6856,7 +6856,7 @@ var require_windows = __commonJS({
|
|
|
6856
6856
|
module.exports = isexe;
|
|
6857
6857
|
isexe.sync = sync;
|
|
6858
6858
|
var fs36 = __require("fs");
|
|
6859
|
-
function checkPathExt(
|
|
6859
|
+
function checkPathExt(path43, options) {
|
|
6860
6860
|
var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
|
|
6861
6861
|
if (!pathext) {
|
|
6862
6862
|
return true;
|
|
@@ -6867,25 +6867,25 @@ var require_windows = __commonJS({
|
|
|
6867
6867
|
}
|
|
6868
6868
|
for (var i = 0; i < pathext.length; i++) {
|
|
6869
6869
|
var p = pathext[i].toLowerCase();
|
|
6870
|
-
if (p &&
|
|
6870
|
+
if (p && path43.substr(-p.length).toLowerCase() === p) {
|
|
6871
6871
|
return true;
|
|
6872
6872
|
}
|
|
6873
6873
|
}
|
|
6874
6874
|
return false;
|
|
6875
6875
|
}
|
|
6876
|
-
function checkStat(stat,
|
|
6876
|
+
function checkStat(stat, path43, options) {
|
|
6877
6877
|
if (!stat.isSymbolicLink() && !stat.isFile()) {
|
|
6878
6878
|
return false;
|
|
6879
6879
|
}
|
|
6880
|
-
return checkPathExt(
|
|
6880
|
+
return checkPathExt(path43, options);
|
|
6881
6881
|
}
|
|
6882
|
-
function isexe(
|
|
6883
|
-
fs36.stat(
|
|
6884
|
-
cb(er, er ? false : checkStat(stat,
|
|
6882
|
+
function isexe(path43, options, cb) {
|
|
6883
|
+
fs36.stat(path43, function(er, stat) {
|
|
6884
|
+
cb(er, er ? false : checkStat(stat, path43, options));
|
|
6885
6885
|
});
|
|
6886
6886
|
}
|
|
6887
|
-
function sync(
|
|
6888
|
-
return checkStat(fs36.statSync(
|
|
6887
|
+
function sync(path43, options) {
|
|
6888
|
+
return checkStat(fs36.statSync(path43), path43, options);
|
|
6889
6889
|
}
|
|
6890
6890
|
}
|
|
6891
6891
|
});
|
|
@@ -6898,13 +6898,13 @@ var require_mode = __commonJS({
|
|
|
6898
6898
|
module.exports = isexe;
|
|
6899
6899
|
isexe.sync = sync;
|
|
6900
6900
|
var fs36 = __require("fs");
|
|
6901
|
-
function isexe(
|
|
6902
|
-
fs36.stat(
|
|
6901
|
+
function isexe(path43, options, cb) {
|
|
6902
|
+
fs36.stat(path43, function(er, stat) {
|
|
6903
6903
|
cb(er, er ? false : checkStat(stat, options));
|
|
6904
6904
|
});
|
|
6905
6905
|
}
|
|
6906
|
-
function sync(
|
|
6907
|
-
return checkStat(fs36.statSync(
|
|
6906
|
+
function sync(path43, options) {
|
|
6907
|
+
return checkStat(fs36.statSync(path43), options);
|
|
6908
6908
|
}
|
|
6909
6909
|
function checkStat(stat, options) {
|
|
6910
6910
|
return stat.isFile() && checkMode(stat, options);
|
|
@@ -6939,7 +6939,7 @@ var require_isexe = __commonJS({
|
|
|
6939
6939
|
}
|
|
6940
6940
|
module.exports = isexe;
|
|
6941
6941
|
isexe.sync = sync;
|
|
6942
|
-
function isexe(
|
|
6942
|
+
function isexe(path43, options, cb) {
|
|
6943
6943
|
if (typeof options === "function") {
|
|
6944
6944
|
cb = options;
|
|
6945
6945
|
options = {};
|
|
@@ -6949,7 +6949,7 @@ var require_isexe = __commonJS({
|
|
|
6949
6949
|
throw new TypeError("callback not provided");
|
|
6950
6950
|
}
|
|
6951
6951
|
return new Promise(function(resolve2, reject) {
|
|
6952
|
-
isexe(
|
|
6952
|
+
isexe(path43, options || {}, function(er, is) {
|
|
6953
6953
|
if (er) {
|
|
6954
6954
|
reject(er);
|
|
6955
6955
|
} else {
|
|
@@ -6958,7 +6958,7 @@ var require_isexe = __commonJS({
|
|
|
6958
6958
|
});
|
|
6959
6959
|
});
|
|
6960
6960
|
}
|
|
6961
|
-
core(
|
|
6961
|
+
core(path43, options || {}, function(er, is) {
|
|
6962
6962
|
if (er) {
|
|
6963
6963
|
if (er.code === "EACCES" || options && options.ignoreErrors) {
|
|
6964
6964
|
er = null;
|
|
@@ -6968,9 +6968,9 @@ var require_isexe = __commonJS({
|
|
|
6968
6968
|
cb(er, is);
|
|
6969
6969
|
});
|
|
6970
6970
|
}
|
|
6971
|
-
function sync(
|
|
6971
|
+
function sync(path43, options) {
|
|
6972
6972
|
try {
|
|
6973
|
-
return core.sync(
|
|
6973
|
+
return core.sync(path43, options || {});
|
|
6974
6974
|
} catch (er) {
|
|
6975
6975
|
if (options && options.ignoreErrors || er.code === "EACCES") {
|
|
6976
6976
|
return false;
|
|
@@ -6988,7 +6988,7 @@ var require_which = __commonJS({
|
|
|
6988
6988
|
"use strict";
|
|
6989
6989
|
init_esm_shims();
|
|
6990
6990
|
var isWindows3 = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
6991
|
-
var
|
|
6991
|
+
var path43 = __require("path");
|
|
6992
6992
|
var COLON = isWindows3 ? ";" : ":";
|
|
6993
6993
|
var isexe = require_isexe();
|
|
6994
6994
|
var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
@@ -7026,7 +7026,7 @@ var require_which = __commonJS({
|
|
|
7026
7026
|
return opt.all && found.length ? resolve2(found) : reject(getNotFoundError(cmd));
|
|
7027
7027
|
const ppRaw = pathEnv[i];
|
|
7028
7028
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
7029
|
-
const pCmd =
|
|
7029
|
+
const pCmd = path43.join(pathPart, cmd);
|
|
7030
7030
|
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
7031
7031
|
resolve2(subStep(p, i, 0));
|
|
7032
7032
|
});
|
|
@@ -7053,7 +7053,7 @@ var require_which = __commonJS({
|
|
|
7053
7053
|
for (let i = 0; i < pathEnv.length; i++) {
|
|
7054
7054
|
const ppRaw = pathEnv[i];
|
|
7055
7055
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
7056
|
-
const pCmd =
|
|
7056
|
+
const pCmd = path43.join(pathPart, cmd);
|
|
7057
7057
|
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
7058
7058
|
for (let j = 0; j < pathExt.length; j++) {
|
|
7059
7059
|
const cur = p + pathExt[j];
|
|
@@ -7103,7 +7103,7 @@ var require_resolveCommand = __commonJS({
|
|
|
7103
7103
|
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module) {
|
|
7104
7104
|
"use strict";
|
|
7105
7105
|
init_esm_shims();
|
|
7106
|
-
var
|
|
7106
|
+
var path43 = __require("path");
|
|
7107
7107
|
var which = require_which();
|
|
7108
7108
|
var getPathKey = require_path_key();
|
|
7109
7109
|
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
@@ -7121,7 +7121,7 @@ var require_resolveCommand = __commonJS({
|
|
|
7121
7121
|
try {
|
|
7122
7122
|
resolved = which.sync(parsed.command, {
|
|
7123
7123
|
path: env2[getPathKey({ env: env2 })],
|
|
7124
|
-
pathExt: withoutPathExt ?
|
|
7124
|
+
pathExt: withoutPathExt ? path43.delimiter : void 0
|
|
7125
7125
|
});
|
|
7126
7126
|
} catch (e) {
|
|
7127
7127
|
} finally {
|
|
@@ -7130,7 +7130,7 @@ var require_resolveCommand = __commonJS({
|
|
|
7130
7130
|
}
|
|
7131
7131
|
}
|
|
7132
7132
|
if (resolved) {
|
|
7133
|
-
resolved =
|
|
7133
|
+
resolved = path43.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
|
|
7134
7134
|
}
|
|
7135
7135
|
return resolved;
|
|
7136
7136
|
}
|
|
@@ -7187,8 +7187,8 @@ var require_shebang_command = __commonJS({
|
|
|
7187
7187
|
if (!match) {
|
|
7188
7188
|
return null;
|
|
7189
7189
|
}
|
|
7190
|
-
const [
|
|
7191
|
-
const binary =
|
|
7190
|
+
const [path43, argument] = match[0].replace(/#! ?/, "").split(" ");
|
|
7191
|
+
const binary = path43.split("/").pop();
|
|
7192
7192
|
if (binary === "env") {
|
|
7193
7193
|
return argument;
|
|
7194
7194
|
}
|
|
@@ -7225,7 +7225,7 @@ var require_parse = __commonJS({
|
|
|
7225
7225
|
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js"(exports, module) {
|
|
7226
7226
|
"use strict";
|
|
7227
7227
|
init_esm_shims();
|
|
7228
|
-
var
|
|
7228
|
+
var path43 = __require("path");
|
|
7229
7229
|
var resolveCommand = require_resolveCommand();
|
|
7230
7230
|
var escape4 = require_escape();
|
|
7231
7231
|
var readShebang = require_readShebang();
|
|
@@ -7250,7 +7250,7 @@ var require_parse = __commonJS({
|
|
|
7250
7250
|
const needsShell = !isExecutableRegExp.test(commandFile);
|
|
7251
7251
|
if (parsed.options.forceShell || needsShell) {
|
|
7252
7252
|
const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
|
|
7253
|
-
parsed.command =
|
|
7253
|
+
parsed.command = path43.normalize(parsed.command);
|
|
7254
7254
|
parsed.command = escape4.command(parsed.command);
|
|
7255
7255
|
parsed.args = parsed.args.map((arg) => escape4.argument(arg, needsDoubleEscapeMetaChars));
|
|
7256
7256
|
const shellCommand = [parsed.command].concat(parsed.args).join(" ");
|
|
@@ -7433,11 +7433,11 @@ var require_react_production = __commonJS({
|
|
|
7433
7433
|
}
|
|
7434
7434
|
var ReactSharedInternals = { H: null, A: null, T: null, S: null };
|
|
7435
7435
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
7436
|
-
function ReactElement(
|
|
7436
|
+
function ReactElement(type2, key, props) {
|
|
7437
7437
|
var refProp = props.ref;
|
|
7438
7438
|
return {
|
|
7439
7439
|
$$typeof: REACT_ELEMENT_TYPE,
|
|
7440
|
-
type,
|
|
7440
|
+
type: type2,
|
|
7441
7441
|
key,
|
|
7442
7442
|
ref: void 0 !== refProp ? refProp : null,
|
|
7443
7443
|
props
|
|
@@ -7483,12 +7483,12 @@ var require_react_production = __commonJS({
|
|
|
7483
7483
|
throw thenable;
|
|
7484
7484
|
}
|
|
7485
7485
|
function mapIntoArray(children, array2, escapedPrefix, nameSoFar, callback) {
|
|
7486
|
-
var
|
|
7487
|
-
if ("undefined" ===
|
|
7486
|
+
var type2 = typeof children;
|
|
7487
|
+
if ("undefined" === type2 || "boolean" === type2) children = null;
|
|
7488
7488
|
var invokeCallback = false;
|
|
7489
7489
|
if (null === children) invokeCallback = true;
|
|
7490
7490
|
else
|
|
7491
|
-
switch (
|
|
7491
|
+
switch (type2) {
|
|
7492
7492
|
case "bigint":
|
|
7493
7493
|
case "string":
|
|
7494
7494
|
case "number":
|
|
@@ -7524,23 +7524,23 @@ var require_react_production = __commonJS({
|
|
|
7524
7524
|
var nextNamePrefix = "" === nameSoFar ? "." : nameSoFar + ":";
|
|
7525
7525
|
if (isArrayImpl(children))
|
|
7526
7526
|
for (var i = 0; i < children.length; i++)
|
|
7527
|
-
nameSoFar = children[i],
|
|
7527
|
+
nameSoFar = children[i], type2 = nextNamePrefix + getElementKey(nameSoFar, i), invokeCallback += mapIntoArray(
|
|
7528
7528
|
nameSoFar,
|
|
7529
7529
|
array2,
|
|
7530
7530
|
escapedPrefix,
|
|
7531
|
-
|
|
7531
|
+
type2,
|
|
7532
7532
|
callback
|
|
7533
7533
|
);
|
|
7534
7534
|
else if (i = getIteratorFn(children), "function" === typeof i)
|
|
7535
7535
|
for (children = i.call(children), i = 0; !(nameSoFar = children.next()).done; )
|
|
7536
|
-
nameSoFar = nameSoFar.value,
|
|
7536
|
+
nameSoFar = nameSoFar.value, type2 = nextNamePrefix + getElementKey(nameSoFar, i++), invokeCallback += mapIntoArray(
|
|
7537
7537
|
nameSoFar,
|
|
7538
7538
|
array2,
|
|
7539
7539
|
escapedPrefix,
|
|
7540
|
-
|
|
7540
|
+
type2,
|
|
7541
7541
|
callback
|
|
7542
7542
|
);
|
|
7543
|
-
else if ("object" ===
|
|
7543
|
+
else if ("object" === type2) {
|
|
7544
7544
|
if ("function" === typeof children.then)
|
|
7545
7545
|
return mapIntoArray(
|
|
7546
7546
|
resolveThenable(children),
|
|
@@ -7686,7 +7686,7 @@ var require_react_production = __commonJS({
|
|
|
7686
7686
|
};
|
|
7687
7687
|
return defaultValue;
|
|
7688
7688
|
};
|
|
7689
|
-
exports.createElement = function(
|
|
7689
|
+
exports.createElement = function(type2, config2, children) {
|
|
7690
7690
|
var propName, props = {}, key = null;
|
|
7691
7691
|
if (null != config2)
|
|
7692
7692
|
for (propName in void 0 !== config2.key && (key = "" + config2.key), config2)
|
|
@@ -7698,10 +7698,10 @@ var require_react_production = __commonJS({
|
|
|
7698
7698
|
childArray[i] = arguments[i + 2];
|
|
7699
7699
|
props.children = childArray;
|
|
7700
7700
|
}
|
|
7701
|
-
if (
|
|
7702
|
-
for (propName in childrenLength =
|
|
7701
|
+
if (type2 && type2.defaultProps)
|
|
7702
|
+
for (propName in childrenLength = type2.defaultProps, childrenLength)
|
|
7703
7703
|
void 0 === props[propName] && (props[propName] = childrenLength[propName]);
|
|
7704
|
-
return ReactElement(
|
|
7704
|
+
return ReactElement(type2, key, props);
|
|
7705
7705
|
};
|
|
7706
7706
|
exports.createRef = function() {
|
|
7707
7707
|
return { current: null };
|
|
@@ -7717,10 +7717,10 @@ var require_react_production = __commonJS({
|
|
|
7717
7717
|
_init: lazyInitializer
|
|
7718
7718
|
};
|
|
7719
7719
|
};
|
|
7720
|
-
exports.memo = function(
|
|
7720
|
+
exports.memo = function(type2, compare) {
|
|
7721
7721
|
return {
|
|
7722
7722
|
$$typeof: REACT_MEMO_TYPE,
|
|
7723
|
-
type,
|
|
7723
|
+
type: type2,
|
|
7724
7724
|
compare: void 0 === compare ? null : compare
|
|
7725
7725
|
};
|
|
7726
7726
|
};
|
|
@@ -7874,12 +7874,12 @@ var require_react_development = __commonJS({
|
|
|
7874
7874
|
return testStringCoercion(value);
|
|
7875
7875
|
}
|
|
7876
7876
|
}
|
|
7877
|
-
function getComponentNameFromType(
|
|
7878
|
-
if (null ==
|
|
7879
|
-
if ("function" === typeof
|
|
7880
|
-
return
|
|
7881
|
-
if ("string" === typeof
|
|
7882
|
-
switch (
|
|
7877
|
+
function getComponentNameFromType(type2) {
|
|
7878
|
+
if (null == type2) return null;
|
|
7879
|
+
if ("function" === typeof type2)
|
|
7880
|
+
return type2.$$typeof === REACT_CLIENT_REFERENCE ? null : type2.displayName || type2.name || null;
|
|
7881
|
+
if ("string" === typeof type2) return type2;
|
|
7882
|
+
switch (type2) {
|
|
7883
7883
|
case REACT_FRAGMENT_TYPE:
|
|
7884
7884
|
return "Fragment";
|
|
7885
7885
|
case REACT_PROFILER_TYPE:
|
|
@@ -7893,39 +7893,39 @@ var require_react_development = __commonJS({
|
|
|
7893
7893
|
case REACT_ACTIVITY_TYPE:
|
|
7894
7894
|
return "Activity";
|
|
7895
7895
|
}
|
|
7896
|
-
if ("object" === typeof
|
|
7897
|
-
switch ("number" === typeof
|
|
7896
|
+
if ("object" === typeof type2)
|
|
7897
|
+
switch ("number" === typeof type2.tag && console.error(
|
|
7898
7898
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
7899
|
-
),
|
|
7899
|
+
), type2.$$typeof) {
|
|
7900
7900
|
case REACT_PORTAL_TYPE:
|
|
7901
7901
|
return "Portal";
|
|
7902
7902
|
case REACT_CONTEXT_TYPE:
|
|
7903
|
-
return
|
|
7903
|
+
return type2.displayName || "Context";
|
|
7904
7904
|
case REACT_CONSUMER_TYPE:
|
|
7905
|
-
return (
|
|
7905
|
+
return (type2._context.displayName || "Context") + ".Consumer";
|
|
7906
7906
|
case REACT_FORWARD_REF_TYPE:
|
|
7907
|
-
var innerType =
|
|
7908
|
-
|
|
7909
|
-
|
|
7910
|
-
return
|
|
7907
|
+
var innerType = type2.render;
|
|
7908
|
+
type2 = type2.displayName;
|
|
7909
|
+
type2 || (type2 = innerType.displayName || innerType.name || "", type2 = "" !== type2 ? "ForwardRef(" + type2 + ")" : "ForwardRef");
|
|
7910
|
+
return type2;
|
|
7911
7911
|
case REACT_MEMO_TYPE:
|
|
7912
|
-
return innerType =
|
|
7912
|
+
return innerType = type2.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type2.type) || "Memo";
|
|
7913
7913
|
case REACT_LAZY_TYPE:
|
|
7914
|
-
innerType =
|
|
7915
|
-
|
|
7914
|
+
innerType = type2._payload;
|
|
7915
|
+
type2 = type2._init;
|
|
7916
7916
|
try {
|
|
7917
|
-
return getComponentNameFromType(
|
|
7917
|
+
return getComponentNameFromType(type2(innerType));
|
|
7918
7918
|
} catch (x) {
|
|
7919
7919
|
}
|
|
7920
7920
|
}
|
|
7921
7921
|
return null;
|
|
7922
7922
|
}
|
|
7923
|
-
function getTaskName(
|
|
7924
|
-
if (
|
|
7925
|
-
if ("object" === typeof
|
|
7923
|
+
function getTaskName(type2) {
|
|
7924
|
+
if (type2 === REACT_FRAGMENT_TYPE) return "<>";
|
|
7925
|
+
if ("object" === typeof type2 && null !== type2 && type2.$$typeof === REACT_LAZY_TYPE)
|
|
7926
7926
|
return "<...>";
|
|
7927
7927
|
try {
|
|
7928
|
-
var name = getComponentNameFromType(
|
|
7928
|
+
var name = getComponentNameFromType(type2);
|
|
7929
7929
|
return name ? "<" + name + ">" : "<...>";
|
|
7930
7930
|
} catch (x) {
|
|
7931
7931
|
return "<...>";
|
|
@@ -7966,46 +7966,46 @@ var require_react_development = __commonJS({
|
|
|
7966
7966
|
componentName = this.props.ref;
|
|
7967
7967
|
return void 0 !== componentName ? componentName : null;
|
|
7968
7968
|
}
|
|
7969
|
-
function ReactElement(
|
|
7969
|
+
function ReactElement(type2, key, props, owner, debugStack, debugTask) {
|
|
7970
7970
|
var refProp = props.ref;
|
|
7971
|
-
|
|
7971
|
+
type2 = {
|
|
7972
7972
|
$$typeof: REACT_ELEMENT_TYPE,
|
|
7973
|
-
type,
|
|
7973
|
+
type: type2,
|
|
7974
7974
|
key,
|
|
7975
7975
|
props,
|
|
7976
7976
|
_owner: owner
|
|
7977
7977
|
};
|
|
7978
|
-
null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(
|
|
7978
|
+
null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type2, "ref", {
|
|
7979
7979
|
enumerable: false,
|
|
7980
7980
|
get: elementRefGetterWithDeprecationWarning
|
|
7981
|
-
}) : Object.defineProperty(
|
|
7982
|
-
|
|
7983
|
-
Object.defineProperty(
|
|
7981
|
+
}) : Object.defineProperty(type2, "ref", { enumerable: false, value: null });
|
|
7982
|
+
type2._store = {};
|
|
7983
|
+
Object.defineProperty(type2._store, "validated", {
|
|
7984
7984
|
configurable: false,
|
|
7985
7985
|
enumerable: false,
|
|
7986
7986
|
writable: true,
|
|
7987
7987
|
value: 0
|
|
7988
7988
|
});
|
|
7989
|
-
Object.defineProperty(
|
|
7989
|
+
Object.defineProperty(type2, "_debugInfo", {
|
|
7990
7990
|
configurable: false,
|
|
7991
7991
|
enumerable: false,
|
|
7992
7992
|
writable: true,
|
|
7993
7993
|
value: null
|
|
7994
7994
|
});
|
|
7995
|
-
Object.defineProperty(
|
|
7995
|
+
Object.defineProperty(type2, "_debugStack", {
|
|
7996
7996
|
configurable: false,
|
|
7997
7997
|
enumerable: false,
|
|
7998
7998
|
writable: true,
|
|
7999
7999
|
value: debugStack
|
|
8000
8000
|
});
|
|
8001
|
-
Object.defineProperty(
|
|
8001
|
+
Object.defineProperty(type2, "_debugTask", {
|
|
8002
8002
|
configurable: false,
|
|
8003
8003
|
enumerable: false,
|
|
8004
8004
|
writable: true,
|
|
8005
8005
|
value: debugTask
|
|
8006
8006
|
});
|
|
8007
|
-
Object.freeze && (Object.freeze(
|
|
8008
|
-
return
|
|
8007
|
+
Object.freeze && (Object.freeze(type2.props), Object.freeze(type2));
|
|
8008
|
+
return type2;
|
|
8009
8009
|
}
|
|
8010
8010
|
function cloneAndReplaceKey(oldElement, newKey) {
|
|
8011
8011
|
newKey = ReactElement(
|
|
@@ -8058,12 +8058,12 @@ var require_react_development = __commonJS({
|
|
|
8058
8058
|
throw thenable;
|
|
8059
8059
|
}
|
|
8060
8060
|
function mapIntoArray(children, array2, escapedPrefix, nameSoFar, callback) {
|
|
8061
|
-
var
|
|
8062
|
-
if ("undefined" ===
|
|
8061
|
+
var type2 = typeof children;
|
|
8062
|
+
if ("undefined" === type2 || "boolean" === type2) children = null;
|
|
8063
8063
|
var invokeCallback = false;
|
|
8064
8064
|
if (null === children) invokeCallback = true;
|
|
8065
8065
|
else
|
|
8066
|
-
switch (
|
|
8066
|
+
switch (type2) {
|
|
8067
8067
|
case "bigint":
|
|
8068
8068
|
case "string":
|
|
8069
8069
|
case "number":
|
|
@@ -8104,25 +8104,25 @@ var require_react_development = __commonJS({
|
|
|
8104
8104
|
childKey = "" === nameSoFar ? "." : nameSoFar + ":";
|
|
8105
8105
|
if (isArrayImpl(children))
|
|
8106
8106
|
for (var i = 0; i < children.length; i++)
|
|
8107
|
-
nameSoFar = children[i],
|
|
8107
|
+
nameSoFar = children[i], type2 = childKey + getElementKey(nameSoFar, i), invokeCallback += mapIntoArray(
|
|
8108
8108
|
nameSoFar,
|
|
8109
8109
|
array2,
|
|
8110
8110
|
escapedPrefix,
|
|
8111
|
-
|
|
8111
|
+
type2,
|
|
8112
8112
|
callback
|
|
8113
8113
|
);
|
|
8114
8114
|
else if (i = getIteratorFn(children), "function" === typeof i)
|
|
8115
8115
|
for (i === children.entries && (didWarnAboutMaps || console.warn(
|
|
8116
8116
|
"Using Maps as children is not supported. Use an array of keyed ReactElements instead."
|
|
8117
8117
|
), didWarnAboutMaps = true), children = i.call(children), i = 0; !(nameSoFar = children.next()).done; )
|
|
8118
|
-
nameSoFar = nameSoFar.value,
|
|
8118
|
+
nameSoFar = nameSoFar.value, type2 = childKey + getElementKey(nameSoFar, i++), invokeCallback += mapIntoArray(
|
|
8119
8119
|
nameSoFar,
|
|
8120
8120
|
array2,
|
|
8121
8121
|
escapedPrefix,
|
|
8122
|
-
|
|
8122
|
+
type2,
|
|
8123
8123
|
callback
|
|
8124
8124
|
);
|
|
8125
|
-
else if ("object" ===
|
|
8125
|
+
else if ("object" === type2) {
|
|
8126
8126
|
if ("function" === typeof children.then)
|
|
8127
8127
|
return mapIntoArray(
|
|
8128
8128
|
resolveThenable(children),
|
|
@@ -8561,7 +8561,7 @@ var require_react_development = __commonJS({
|
|
|
8561
8561
|
defaultValue._currentRenderer2 = null;
|
|
8562
8562
|
return defaultValue;
|
|
8563
8563
|
};
|
|
8564
|
-
exports.createElement = function(
|
|
8564
|
+
exports.createElement = function(type2, config2, children) {
|
|
8565
8565
|
for (var i = 2; i < arguments.length; i++)
|
|
8566
8566
|
validateChildKeys(arguments[i]);
|
|
8567
8567
|
i = {};
|
|
@@ -8579,21 +8579,21 @@ var require_react_development = __commonJS({
|
|
|
8579
8579
|
Object.freeze && Object.freeze(childArray);
|
|
8580
8580
|
i.children = childArray;
|
|
8581
8581
|
}
|
|
8582
|
-
if (
|
|
8583
|
-
for (propName in childrenLength =
|
|
8582
|
+
if (type2 && type2.defaultProps)
|
|
8583
|
+
for (propName in childrenLength = type2.defaultProps, childrenLength)
|
|
8584
8584
|
void 0 === i[propName] && (i[propName] = childrenLength[propName]);
|
|
8585
8585
|
key && defineKeyPropWarningGetter(
|
|
8586
8586
|
i,
|
|
8587
|
-
"function" === typeof
|
|
8587
|
+
"function" === typeof type2 ? type2.displayName || type2.name || "Unknown" : type2
|
|
8588
8588
|
);
|
|
8589
8589
|
var propName = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
|
8590
8590
|
return ReactElement(
|
|
8591
|
-
|
|
8591
|
+
type2,
|
|
8592
8592
|
key,
|
|
8593
8593
|
i,
|
|
8594
8594
|
getOwner(),
|
|
8595
8595
|
propName ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
|
|
8596
|
-
propName ? createTask(getTaskName(
|
|
8596
|
+
propName ? createTask(getTaskName(type2)) : unknownOwnerDebugTask
|
|
8597
8597
|
);
|
|
8598
8598
|
};
|
|
8599
8599
|
exports.createRef = function() {
|
|
@@ -8648,14 +8648,14 @@ var require_react_development = __commonJS({
|
|
|
8648
8648
|
lazyType._debugInfo = [{ awaited: ioInfo }];
|
|
8649
8649
|
return lazyType;
|
|
8650
8650
|
};
|
|
8651
|
-
exports.memo = function(
|
|
8652
|
-
null ==
|
|
8651
|
+
exports.memo = function(type2, compare) {
|
|
8652
|
+
null == type2 && console.error(
|
|
8653
8653
|
"memo: The first argument must be a component. Instead received: %s",
|
|
8654
|
-
null ===
|
|
8654
|
+
null === type2 ? "null" : typeof type2
|
|
8655
8655
|
);
|
|
8656
8656
|
compare = {
|
|
8657
8657
|
$$typeof: REACT_MEMO_TYPE,
|
|
8658
|
-
type,
|
|
8658
|
+
type: type2,
|
|
8659
8659
|
compare: void 0 === compare ? null : compare
|
|
8660
8660
|
};
|
|
8661
8661
|
var ownName;
|
|
@@ -8667,7 +8667,7 @@ var require_react_development = __commonJS({
|
|
|
8667
8667
|
},
|
|
8668
8668
|
set: function(name) {
|
|
8669
8669
|
ownName = name;
|
|
8670
|
-
|
|
8670
|
+
type2.name || type2.displayName || (Object.defineProperty(type2, "name", { value: name }), type2.displayName = name);
|
|
8671
8671
|
}
|
|
8672
8672
|
});
|
|
8673
8673
|
return compare;
|
|
@@ -9703,12 +9703,12 @@ var require_react_reconciler_production = __commonJS({
|
|
|
9703
9703
|
maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
|
|
9704
9704
|
return "function" === typeof maybeIterable ? maybeIterable : null;
|
|
9705
9705
|
}
|
|
9706
|
-
function getComponentNameFromType(
|
|
9707
|
-
if (null ==
|
|
9708
|
-
if ("function" === typeof
|
|
9709
|
-
return
|
|
9710
|
-
if ("string" === typeof
|
|
9711
|
-
switch (
|
|
9706
|
+
function getComponentNameFromType(type2) {
|
|
9707
|
+
if (null == type2) return null;
|
|
9708
|
+
if ("function" === typeof type2)
|
|
9709
|
+
return type2.$$typeof === REACT_CLIENT_REFERENCE ? null : type2.displayName || type2.name || null;
|
|
9710
|
+
if ("string" === typeof type2) return type2;
|
|
9711
|
+
switch (type2) {
|
|
9712
9712
|
case REACT_FRAGMENT_TYPE:
|
|
9713
9713
|
return "Fragment";
|
|
9714
9714
|
case REACT_PROFILER_TYPE:
|
|
@@ -9722,26 +9722,26 @@ var require_react_reconciler_production = __commonJS({
|
|
|
9722
9722
|
case REACT_ACTIVITY_TYPE:
|
|
9723
9723
|
return "Activity";
|
|
9724
9724
|
}
|
|
9725
|
-
if ("object" === typeof
|
|
9726
|
-
switch (
|
|
9725
|
+
if ("object" === typeof type2)
|
|
9726
|
+
switch (type2.$$typeof) {
|
|
9727
9727
|
case REACT_PORTAL_TYPE:
|
|
9728
9728
|
return "Portal";
|
|
9729
9729
|
case REACT_CONTEXT_TYPE:
|
|
9730
|
-
return
|
|
9730
|
+
return type2.displayName || "Context";
|
|
9731
9731
|
case REACT_CONSUMER_TYPE:
|
|
9732
|
-
return (
|
|
9732
|
+
return (type2._context.displayName || "Context") + ".Consumer";
|
|
9733
9733
|
case REACT_FORWARD_REF_TYPE:
|
|
9734
|
-
var innerType =
|
|
9735
|
-
|
|
9736
|
-
|
|
9737
|
-
return
|
|
9734
|
+
var innerType = type2.render;
|
|
9735
|
+
type2 = type2.displayName;
|
|
9736
|
+
type2 || (type2 = innerType.displayName || innerType.name || "", type2 = "" !== type2 ? "ForwardRef(" + type2 + ")" : "ForwardRef");
|
|
9737
|
+
return type2;
|
|
9738
9738
|
case REACT_MEMO_TYPE:
|
|
9739
|
-
return innerType =
|
|
9739
|
+
return innerType = type2.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type2.type) || "Memo";
|
|
9740
9740
|
case REACT_LAZY_TYPE:
|
|
9741
|
-
innerType =
|
|
9742
|
-
|
|
9741
|
+
innerType = type2._payload;
|
|
9742
|
+
type2 = type2._init;
|
|
9743
9743
|
try {
|
|
9744
|
-
return getComponentNameFromType(
|
|
9744
|
+
return getComponentNameFromType(type2(innerType));
|
|
9745
9745
|
} catch (x) {
|
|
9746
9746
|
}
|
|
9747
9747
|
}
|
|
@@ -12549,12 +12549,12 @@ var require_react_reconciler_production = __commonJS({
|
|
|
12549
12549
|
}
|
|
12550
12550
|
function updateMemoComponent(current, workInProgress2, Component, nextProps, renderLanes2) {
|
|
12551
12551
|
if (null === current) {
|
|
12552
|
-
var
|
|
12553
|
-
if ("function" === typeof
|
|
12554
|
-
return workInProgress2.tag = 15, workInProgress2.type =
|
|
12552
|
+
var type2 = Component.type;
|
|
12553
|
+
if ("function" === typeof type2 && !shouldConstruct(type2) && void 0 === type2.defaultProps && null === Component.compare)
|
|
12554
|
+
return workInProgress2.tag = 15, workInProgress2.type = type2, updateSimpleMemoComponent(
|
|
12555
12555
|
current,
|
|
12556
12556
|
workInProgress2,
|
|
12557
|
-
|
|
12557
|
+
type2,
|
|
12558
12558
|
nextProps,
|
|
12559
12559
|
renderLanes2
|
|
12560
12560
|
);
|
|
@@ -12570,9 +12570,9 @@ var require_react_reconciler_production = __commonJS({
|
|
|
12570
12570
|
current.return = workInProgress2;
|
|
12571
12571
|
return workInProgress2.child = current;
|
|
12572
12572
|
}
|
|
12573
|
-
|
|
12573
|
+
type2 = current.child;
|
|
12574
12574
|
if (!checkScheduledUpdateOrContext(current, renderLanes2)) {
|
|
12575
|
-
var prevProps =
|
|
12575
|
+
var prevProps = type2.memoizedProps;
|
|
12576
12576
|
Component = Component.compare;
|
|
12577
12577
|
Component = null !== Component ? Component : shallowEqual;
|
|
12578
12578
|
if (Component(prevProps, nextProps) && current.ref === workInProgress2.ref)
|
|
@@ -12583,7 +12583,7 @@ var require_react_reconciler_production = __commonJS({
|
|
|
12583
12583
|
);
|
|
12584
12584
|
}
|
|
12585
12585
|
workInProgress2.flags |= 1;
|
|
12586
|
-
current = createWorkInProgress(
|
|
12586
|
+
current = createWorkInProgress(type2, nextProps);
|
|
12587
12587
|
current.ref = workInProgress2.ref;
|
|
12588
12588
|
current.return = workInProgress2;
|
|
12589
12589
|
return workInProgress2.child = current;
|
|
@@ -13786,7 +13786,7 @@ var require_react_reconciler_production = __commonJS({
|
|
|
13786
13786
|
finalizeContainerChildren(container, newChildSet);
|
|
13787
13787
|
}
|
|
13788
13788
|
}
|
|
13789
|
-
function updateHostComponent(current, workInProgress2,
|
|
13789
|
+
function updateHostComponent(current, workInProgress2, type2, newProps) {
|
|
13790
13790
|
if (supportsMutation)
|
|
13791
13791
|
current.memoizedProps !== newProps && markUpdate(workInProgress2);
|
|
13792
13792
|
else if (supportsPersistence) {
|
|
@@ -13795,7 +13795,7 @@ var require_react_reconciler_production = __commonJS({
|
|
|
13795
13795
|
var currentHostContext = contextStackCursor.current;
|
|
13796
13796
|
oldProps$88 = cloneInstance(
|
|
13797
13797
|
currentInstance,
|
|
13798
|
-
|
|
13798
|
+
type2,
|
|
13799
13799
|
oldProps$88,
|
|
13800
13800
|
newProps,
|
|
13801
13801
|
!current,
|
|
@@ -13803,17 +13803,17 @@ var require_react_reconciler_production = __commonJS({
|
|
|
13803
13803
|
);
|
|
13804
13804
|
oldProps$88 === currentInstance ? workInProgress2.stateNode = currentInstance : (markCloned(workInProgress2), finalizeInitialChildren(
|
|
13805
13805
|
oldProps$88,
|
|
13806
|
-
|
|
13806
|
+
type2,
|
|
13807
13807
|
newProps,
|
|
13808
13808
|
currentHostContext
|
|
13809
13809
|
) && markUpdate(workInProgress2), workInProgress2.stateNode = oldProps$88, current && appendAllChildren(oldProps$88, workInProgress2, false, false));
|
|
13810
13810
|
} else workInProgress2.stateNode = currentInstance;
|
|
13811
13811
|
}
|
|
13812
13812
|
}
|
|
13813
|
-
function preloadInstanceAndSuspendIfNeeded(workInProgress2,
|
|
13814
|
-
if (0 !== (workInProgress2.mode & 32) && (null === oldProps ? maySuspendCommit(
|
|
13815
|
-
if (workInProgress2.flags |= 16777216, (renderLanes2 & 335544128) === renderLanes2 || maySuspendCommitInSyncRender(
|
|
13816
|
-
if (preloadInstance(workInProgress2.stateNode,
|
|
13813
|
+
function preloadInstanceAndSuspendIfNeeded(workInProgress2, type2, oldProps, newProps, renderLanes2) {
|
|
13814
|
+
if (0 !== (workInProgress2.mode & 32) && (null === oldProps ? maySuspendCommit(type2, newProps) : maySuspendCommitOnUpdate(type2, oldProps, newProps))) {
|
|
13815
|
+
if (workInProgress2.flags |= 16777216, (renderLanes2 & 335544128) === renderLanes2 || maySuspendCommitInSyncRender(type2, newProps))
|
|
13816
|
+
if (preloadInstance(workInProgress2.stateNode, type2, newProps))
|
|
13817
13817
|
workInProgress2.flags |= 8192;
|
|
13818
13818
|
else if (shouldRemainOnPreviousScreen()) workInProgress2.flags |= 8192;
|
|
13819
13819
|
else
|
|
@@ -13891,13 +13891,13 @@ var require_react_reconciler_production = __commonJS({
|
|
|
13891
13891
|
return null;
|
|
13892
13892
|
case 26:
|
|
13893
13893
|
if (supportsResources) {
|
|
13894
|
-
var
|
|
13894
|
+
var type2 = workInProgress2.type, nextResource = workInProgress2.memoizedState;
|
|
13895
13895
|
null === current ? (markUpdate(workInProgress2), null !== nextResource ? (bubbleProperties(workInProgress2), preloadResourceAndSuspendIfNeeded(
|
|
13896
13896
|
workInProgress2,
|
|
13897
13897
|
nextResource
|
|
13898
13898
|
)) : (bubbleProperties(workInProgress2), preloadInstanceAndSuspendIfNeeded(
|
|
13899
13899
|
workInProgress2,
|
|
13900
|
-
|
|
13900
|
+
type2,
|
|
13901
13901
|
null,
|
|
13902
13902
|
newProps,
|
|
13903
13903
|
renderLanes2
|
|
@@ -13907,11 +13907,11 @@ var require_react_reconciler_production = __commonJS({
|
|
|
13907
13907
|
)) : (bubbleProperties(workInProgress2), workInProgress2.flags &= -16777217) : (nextResource = current.memoizedProps, supportsMutation ? nextResource !== newProps && markUpdate(workInProgress2) : updateHostComponent(
|
|
13908
13908
|
current,
|
|
13909
13909
|
workInProgress2,
|
|
13910
|
-
|
|
13910
|
+
type2,
|
|
13911
13911
|
newProps
|
|
13912
13912
|
), bubbleProperties(workInProgress2), preloadInstanceAndSuspendIfNeeded(
|
|
13913
13913
|
workInProgress2,
|
|
13914
|
-
|
|
13914
|
+
type2,
|
|
13915
13915
|
nextResource,
|
|
13916
13916
|
newProps,
|
|
13917
13917
|
renderLanes2
|
|
@@ -13922,9 +13922,9 @@ var require_react_reconciler_production = __commonJS({
|
|
|
13922
13922
|
if (supportsSingletons) {
|
|
13923
13923
|
popHostContext(workInProgress2);
|
|
13924
13924
|
renderLanes2 = rootInstanceStackCursor.current;
|
|
13925
|
-
|
|
13925
|
+
type2 = workInProgress2.type;
|
|
13926
13926
|
if (null !== current && null != workInProgress2.stateNode)
|
|
13927
|
-
supportsMutation ? current.memoizedProps !== newProps && markUpdate(workInProgress2) : updateHostComponent(current, workInProgress2,
|
|
13927
|
+
supportsMutation ? current.memoizedProps !== newProps && markUpdate(workInProgress2) : updateHostComponent(current, workInProgress2, type2, newProps);
|
|
13928
13928
|
else {
|
|
13929
13929
|
if (!newProps) {
|
|
13930
13930
|
if (null === workInProgress2.stateNode)
|
|
@@ -13934,7 +13934,7 @@ var require_react_reconciler_production = __commonJS({
|
|
|
13934
13934
|
}
|
|
13935
13935
|
current = contextStackCursor.current;
|
|
13936
13936
|
popHydrationState(workInProgress2) ? prepareToHydrateHostInstance(workInProgress2, current) : (current = resolveSingletonInstance(
|
|
13937
|
-
|
|
13937
|
+
type2,
|
|
13938
13938
|
newProps,
|
|
13939
13939
|
renderLanes2,
|
|
13940
13940
|
current,
|
|
@@ -13946,9 +13946,9 @@ var require_react_reconciler_production = __commonJS({
|
|
|
13946
13946
|
}
|
|
13947
13947
|
case 5:
|
|
13948
13948
|
popHostContext(workInProgress2);
|
|
13949
|
-
|
|
13949
|
+
type2 = workInProgress2.type;
|
|
13950
13950
|
if (null !== current && null != workInProgress2.stateNode)
|
|
13951
|
-
updateHostComponent(current, workInProgress2,
|
|
13951
|
+
updateHostComponent(current, workInProgress2, type2, newProps);
|
|
13952
13952
|
else {
|
|
13953
13953
|
if (!newProps) {
|
|
13954
13954
|
if (null === workInProgress2.stateNode)
|
|
@@ -13960,13 +13960,13 @@ var require_react_reconciler_production = __commonJS({
|
|
|
13960
13960
|
if (popHydrationState(workInProgress2))
|
|
13961
13961
|
prepareToHydrateHostInstance(workInProgress2, nextResource), finalizeHydratedChildren(
|
|
13962
13962
|
workInProgress2.stateNode,
|
|
13963
|
-
|
|
13963
|
+
type2,
|
|
13964
13964
|
newProps,
|
|
13965
13965
|
nextResource
|
|
13966
13966
|
) && (workInProgress2.flags |= 64);
|
|
13967
13967
|
else {
|
|
13968
13968
|
var instance$101 = createInstance(
|
|
13969
|
-
|
|
13969
|
+
type2,
|
|
13970
13970
|
newProps,
|
|
13971
13971
|
rootInstanceStackCursor.current,
|
|
13972
13972
|
nextResource,
|
|
@@ -13977,7 +13977,7 @@ var require_react_reconciler_production = __commonJS({
|
|
|
13977
13977
|
workInProgress2.stateNode = instance$101;
|
|
13978
13978
|
finalizeInitialChildren(
|
|
13979
13979
|
instance$101,
|
|
13980
|
-
|
|
13980
|
+
type2,
|
|
13981
13981
|
newProps,
|
|
13982
13982
|
nextResource
|
|
13983
13983
|
) && markUpdate(workInProgress2);
|
|
@@ -14010,12 +14010,12 @@ var require_react_reconciler_production = __commonJS({
|
|
|
14010
14010
|
current = workInProgress2.stateNode;
|
|
14011
14011
|
renderLanes2 = workInProgress2.memoizedProps;
|
|
14012
14012
|
newProps = null;
|
|
14013
|
-
|
|
14014
|
-
if (null !==
|
|
14015
|
-
switch (
|
|
14013
|
+
type2 = hydrationParentFiber;
|
|
14014
|
+
if (null !== type2)
|
|
14015
|
+
switch (type2.tag) {
|
|
14016
14016
|
case 27:
|
|
14017
14017
|
case 5:
|
|
14018
|
-
newProps =
|
|
14018
|
+
newProps = type2.memoizedProps;
|
|
14019
14019
|
}
|
|
14020
14020
|
hydrateTextInstance(
|
|
14021
14021
|
current,
|
|
@@ -14065,22 +14065,22 @@ var require_react_reconciler_production = __commonJS({
|
|
|
14065
14065
|
case 13:
|
|
14066
14066
|
newProps = workInProgress2.memoizedState;
|
|
14067
14067
|
if (null === current || null !== current.memoizedState && null !== current.memoizedState.dehydrated) {
|
|
14068
|
-
|
|
14068
|
+
type2 = popHydrationState(workInProgress2);
|
|
14069
14069
|
if (null !== newProps && null !== newProps.dehydrated) {
|
|
14070
14070
|
if (null === current) {
|
|
14071
|
-
if (!
|
|
14071
|
+
if (!type2) throw Error(formatProdErrorMessage(318));
|
|
14072
14072
|
if (!supportsHydration) throw Error(formatProdErrorMessage(344));
|
|
14073
|
-
|
|
14074
|
-
|
|
14075
|
-
if (!
|
|
14076
|
-
hydrateSuspenseInstance(
|
|
14073
|
+
type2 = workInProgress2.memoizedState;
|
|
14074
|
+
type2 = null !== type2 ? type2.dehydrated : null;
|
|
14075
|
+
if (!type2) throw Error(formatProdErrorMessage(317));
|
|
14076
|
+
hydrateSuspenseInstance(type2, workInProgress2);
|
|
14077
14077
|
} else
|
|
14078
14078
|
resetHydrationState(), 0 === (workInProgress2.flags & 128) && (workInProgress2.memoizedState = null), workInProgress2.flags |= 4;
|
|
14079
14079
|
bubbleProperties(workInProgress2);
|
|
14080
|
-
|
|
14080
|
+
type2 = false;
|
|
14081
14081
|
} else
|
|
14082
|
-
|
|
14083
|
-
if (!
|
|
14082
|
+
type2 = upgradeHydrationErrorsToRecoverable(), null !== current && null !== current.memoizedState && (current.memoizedState.hydrationErrors = type2), type2 = true;
|
|
14083
|
+
if (!type2) {
|
|
14084
14084
|
if (workInProgress2.flags & 256)
|
|
14085
14085
|
return popSuspenseHandler(workInProgress2), workInProgress2;
|
|
14086
14086
|
popSuspenseHandler(workInProgress2);
|
|
@@ -14092,7 +14092,7 @@ var require_react_reconciler_production = __commonJS({
|
|
|
14092
14092
|
return workInProgress2.lanes = renderLanes2, workInProgress2;
|
|
14093
14093
|
renderLanes2 = null !== newProps;
|
|
14094
14094
|
current = null !== current && null !== current.memoizedState;
|
|
14095
|
-
renderLanes2 && (newProps = workInProgress2.child,
|
|
14095
|
+
renderLanes2 && (newProps = workInProgress2.child, type2 = null, null !== newProps.alternate && null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (type2 = newProps.alternate.memoizedState.cachePool.pool), nextResource = null, null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && (nextResource = newProps.memoizedState.cachePool.pool), nextResource !== type2 && (newProps.flags |= 2048));
|
|
14096
14096
|
renderLanes2 !== current && renderLanes2 && (workInProgress2.child.flags |= 8192);
|
|
14097
14097
|
scheduleRetryEffect(workInProgress2, workInProgress2.updateQueue);
|
|
14098
14098
|
bubbleProperties(workInProgress2);
|
|
@@ -14105,10 +14105,10 @@ var require_react_reconciler_production = __commonJS({
|
|
|
14105
14105
|
pop(suspenseStackCursor);
|
|
14106
14106
|
newProps = workInProgress2.memoizedState;
|
|
14107
14107
|
if (null === newProps) return bubbleProperties(workInProgress2), null;
|
|
14108
|
-
|
|
14108
|
+
type2 = 0 !== (workInProgress2.flags & 128);
|
|
14109
14109
|
nextResource = newProps.rendering;
|
|
14110
14110
|
if (null === nextResource)
|
|
14111
|
-
if (
|
|
14111
|
+
if (type2) cutOffTailIfNeeded(newProps, false);
|
|
14112
14112
|
else {
|
|
14113
14113
|
if (0 !== workInProgressRootExitStatus || null !== current && 0 !== (current.flags & 128))
|
|
14114
14114
|
for (current = workInProgress2.child; null !== current; ) {
|
|
@@ -14132,21 +14132,21 @@ var require_react_reconciler_production = __commonJS({
|
|
|
14132
14132
|
}
|
|
14133
14133
|
current = current.sibling;
|
|
14134
14134
|
}
|
|
14135
|
-
null !== newProps.tail && now2() > workInProgressRootRenderTargetTime && (workInProgress2.flags |= 128,
|
|
14135
|
+
null !== newProps.tail && now2() > workInProgressRootRenderTargetTime && (workInProgress2.flags |= 128, type2 = true, cutOffTailIfNeeded(newProps, false), workInProgress2.lanes = 4194304);
|
|
14136
14136
|
}
|
|
14137
14137
|
else {
|
|
14138
|
-
if (!
|
|
14138
|
+
if (!type2)
|
|
14139
14139
|
if (current = findFirstSuspended(nextResource), null !== current) {
|
|
14140
|
-
if (workInProgress2.flags |= 128,
|
|
14140
|
+
if (workInProgress2.flags |= 128, type2 = true, current = current.updateQueue, workInProgress2.updateQueue = current, scheduleRetryEffect(workInProgress2, current), cutOffTailIfNeeded(newProps, true), null === newProps.tail && "hidden" === newProps.tailMode && !nextResource.alternate && !isHydrating)
|
|
14141
14141
|
return bubbleProperties(workInProgress2), null;
|
|
14142
14142
|
} else
|
|
14143
|
-
2 * now2() - newProps.renderingStartTime > workInProgressRootRenderTargetTime && 536870912 !== renderLanes2 && (workInProgress2.flags |= 128,
|
|
14143
|
+
2 * now2() - newProps.renderingStartTime > workInProgressRootRenderTargetTime && 536870912 !== renderLanes2 && (workInProgress2.flags |= 128, type2 = true, cutOffTailIfNeeded(newProps, false), workInProgress2.lanes = 4194304);
|
|
14144
14144
|
newProps.isBackwards ? (nextResource.sibling = workInProgress2.child, workInProgress2.child = nextResource) : (current = newProps.last, null !== current ? current.sibling = nextResource : workInProgress2.child = nextResource, newProps.last = nextResource);
|
|
14145
14145
|
}
|
|
14146
14146
|
if (null !== newProps.tail)
|
|
14147
14147
|
return current = newProps.tail, newProps.rendering = current, newProps.tail = current.sibling, newProps.renderingStartTime = now2(), current.sibling = null, renderLanes2 = suspenseStackCursor.current, push(
|
|
14148
14148
|
suspenseStackCursor,
|
|
14149
|
-
|
|
14149
|
+
type2 ? renderLanes2 & 1 | 2 : renderLanes2 & 1
|
|
14150
14150
|
), isHydrating && pushTreeFork(workInProgress2, newProps.treeForkCount), current;
|
|
14151
14151
|
bubbleProperties(workInProgress2);
|
|
14152
14152
|
return null;
|
|
@@ -14362,9 +14362,9 @@ var require_react_reconciler_production = __commonJS({
|
|
|
14362
14362
|
else ref.current = null;
|
|
14363
14363
|
}
|
|
14364
14364
|
function commitHostMount(finishedWork) {
|
|
14365
|
-
var
|
|
14365
|
+
var type2 = finishedWork.type, props = finishedWork.memoizedProps, instance = finishedWork.stateNode;
|
|
14366
14366
|
try {
|
|
14367
|
-
commitMount(instance,
|
|
14367
|
+
commitMount(instance, type2, props, finishedWork);
|
|
14368
14368
|
} catch (error51) {
|
|
14369
14369
|
captureCommitPhaseError(finishedWork, finishedWork.return, error51);
|
|
14370
14370
|
}
|
|
@@ -15561,9 +15561,9 @@ var require_react_reconciler_production = __commonJS({
|
|
|
15561
15561
|
fiber.memoizedProps
|
|
15562
15562
|
);
|
|
15563
15563
|
else {
|
|
15564
|
-
var instance = fiber.stateNode,
|
|
15564
|
+
var instance = fiber.stateNode, type2 = fiber.type;
|
|
15565
15565
|
fiber = fiber.memoizedProps;
|
|
15566
|
-
((committedLanes & 335544128) === committedLanes || maySuspendCommitInSyncRender(
|
|
15566
|
+
((committedLanes & 335544128) === committedLanes || maySuspendCommitInSyncRender(type2, fiber)) && suspendInstance(suspendedState, instance, type2, fiber);
|
|
15567
15567
|
}
|
|
15568
15568
|
break;
|
|
15569
15569
|
case 5:
|
|
@@ -15572,7 +15572,7 @@ var require_react_reconciler_production = __commonJS({
|
|
|
15572
15572
|
committedLanes,
|
|
15573
15573
|
suspendedState
|
|
15574
15574
|
);
|
|
15575
|
-
fiber.flags & suspenseyCommitFlag && (instance = fiber.stateNode,
|
|
15575
|
+
fiber.flags & suspenseyCommitFlag && (instance = fiber.stateNode, type2 = fiber.type, fiber = fiber.memoizedProps, ((committedLanes & 335544128) === committedLanes || maySuspendCommitInSyncRender(type2, fiber)) && suspendInstance(suspendedState, instance, type2, fiber));
|
|
15576
15576
|
break;
|
|
15577
15577
|
case 3:
|
|
15578
15578
|
case 4:
|
|
@@ -16276,8 +16276,8 @@ var require_react_reconciler_production = __commonJS({
|
|
|
16276
16276
|
resource = workInProgress.memoizedState;
|
|
16277
16277
|
case 5:
|
|
16278
16278
|
case 27:
|
|
16279
|
-
var hostFiber = workInProgress,
|
|
16280
|
-
if (resource ? preloadResource(resource) : preloadInstance(hostFiber.stateNode,
|
|
16279
|
+
var hostFiber = workInProgress, type2 = hostFiber.type, props = hostFiber.pendingProps;
|
|
16280
|
+
if (resource ? preloadResource(resource) : preloadInstance(hostFiber.stateNode, type2, props)) {
|
|
16281
16281
|
workInProgressSuspendedReason = 0;
|
|
16282
16282
|
workInProgressThrownValue = null;
|
|
16283
16283
|
var sibling = hostFiber.sibling;
|
|
@@ -16781,20 +16781,20 @@ var require_react_reconciler_production = __commonJS({
|
|
|
16781
16781
|
});
|
|
16782
16782
|
return workInProgress2;
|
|
16783
16783
|
}
|
|
16784
|
-
function createFiberFromTypeAndProps(
|
|
16784
|
+
function createFiberFromTypeAndProps(type2, key, pendingProps, owner, mode, lanes) {
|
|
16785
16785
|
var fiberTag = 0;
|
|
16786
|
-
owner =
|
|
16787
|
-
if ("function" === typeof
|
|
16788
|
-
else if ("string" === typeof
|
|
16789
|
-
fiberTag = supportsResources && supportsSingletons ? isHostHoistableType(
|
|
16790
|
-
|
|
16786
|
+
owner = type2;
|
|
16787
|
+
if ("function" === typeof type2) shouldConstruct(type2) && (fiberTag = 1);
|
|
16788
|
+
else if ("string" === typeof type2)
|
|
16789
|
+
fiberTag = supportsResources && supportsSingletons ? isHostHoistableType(type2, pendingProps, contextStackCursor.current) ? 26 : isHostSingletonType(type2) ? 27 : 5 : supportsResources ? isHostHoistableType(
|
|
16790
|
+
type2,
|
|
16791
16791
|
pendingProps,
|
|
16792
16792
|
contextStackCursor.current
|
|
16793
|
-
) ? 26 : 5 : supportsSingletons ? isHostSingletonType(
|
|
16793
|
+
) ? 26 : 5 : supportsSingletons ? isHostSingletonType(type2) ? 27 : 5 : 5;
|
|
16794
16794
|
else
|
|
16795
|
-
a: switch (
|
|
16795
|
+
a: switch (type2) {
|
|
16796
16796
|
case REACT_ACTIVITY_TYPE:
|
|
16797
|
-
return
|
|
16797
|
+
return type2 = createFiber(31, pendingProps, key, mode), type2.elementType = REACT_ACTIVITY_TYPE, type2.lanes = lanes, type2;
|
|
16798
16798
|
case REACT_FRAGMENT_TYPE:
|
|
16799
16799
|
return createFiberFromFragment(
|
|
16800
16800
|
pendingProps.children,
|
|
@@ -16807,14 +16807,14 @@ var require_react_reconciler_production = __commonJS({
|
|
|
16807
16807
|
mode |= 24;
|
|
16808
16808
|
break;
|
|
16809
16809
|
case REACT_PROFILER_TYPE:
|
|
16810
|
-
return
|
|
16810
|
+
return type2 = createFiber(12, pendingProps, key, mode | 2), type2.elementType = REACT_PROFILER_TYPE, type2.lanes = lanes, type2;
|
|
16811
16811
|
case REACT_SUSPENSE_TYPE:
|
|
16812
|
-
return
|
|
16812
|
+
return type2 = createFiber(13, pendingProps, key, mode), type2.elementType = REACT_SUSPENSE_TYPE, type2.lanes = lanes, type2;
|
|
16813
16813
|
case REACT_SUSPENSE_LIST_TYPE:
|
|
16814
|
-
return
|
|
16814
|
+
return type2 = createFiber(19, pendingProps, key, mode), type2.elementType = REACT_SUSPENSE_LIST_TYPE, type2.lanes = lanes, type2;
|
|
16815
16815
|
default:
|
|
16816
|
-
if ("object" === typeof
|
|
16817
|
-
switch (
|
|
16816
|
+
if ("object" === typeof type2 && null !== type2)
|
|
16817
|
+
switch (type2.$$typeof) {
|
|
16818
16818
|
case REACT_CONTEXT_TYPE:
|
|
16819
16819
|
fiberTag = 10;
|
|
16820
16820
|
break a;
|
|
@@ -16836,14 +16836,14 @@ var require_react_reconciler_production = __commonJS({
|
|
|
16836
16836
|
pendingProps = Error(
|
|
16837
16837
|
formatProdErrorMessage(
|
|
16838
16838
|
130,
|
|
16839
|
-
null ===
|
|
16839
|
+
null === type2 ? "null" : typeof type2,
|
|
16840
16840
|
""
|
|
16841
16841
|
)
|
|
16842
16842
|
);
|
|
16843
16843
|
owner = null;
|
|
16844
16844
|
}
|
|
16845
16845
|
key = createFiber(fiberTag, pendingProps, key, mode);
|
|
16846
|
-
key.elementType =
|
|
16846
|
+
key.elementType = type2;
|
|
16847
16847
|
key.type = owner;
|
|
16848
16848
|
key.lanes = lanes;
|
|
16849
16849
|
return key;
|
|
@@ -17041,7 +17041,7 @@ var require_react_reconciler_production = __commonJS({
|
|
|
17041
17041
|
}, hasOwnProperty = Object.prototype.hasOwnProperty, prefix, suffix, reentry = false, CapturedStacks = /* @__PURE__ */ new WeakMap(), forkStack = [], forkStackIndex = 0, treeForkProvider = null, treeForkCount = 0, idStack = [], idStackIndex = 0, treeContextProvider = null, treeContextId = 1, treeContextOverflow = "", contextStackCursor = createCursor(null), contextFiberStackCursor = createCursor(null), rootInstanceStackCursor = createCursor(null), hostTransitionProviderCursor = createCursor(null), hydrationParentFiber = null, nextHydratableInstance = null, isHydrating = false, hydrationErrors = null, rootOrSingletonContext = false, HydrationMismatchException = Error(formatProdErrorMessage(519)), valueCursor = createCursor(null), currentlyRenderingFiber$1 = null, lastContextDependency = null, AbortControllerLocal = "undefined" !== typeof AbortController ? AbortController : function() {
|
|
17042
17042
|
var listeners3 = [], signal = this.signal = {
|
|
17043
17043
|
aborted: false,
|
|
17044
|
-
addEventListener: function(
|
|
17044
|
+
addEventListener: function(type2, listener) {
|
|
17045
17045
|
listeners3.push(listener);
|
|
17046
17046
|
}
|
|
17047
17047
|
};
|
|
@@ -17765,10 +17765,10 @@ var require_react_reconciler_development = __commonJS({
|
|
|
17765
17765
|
fiber = fiber.next, id2--;
|
|
17766
17766
|
return fiber;
|
|
17767
17767
|
}
|
|
17768
|
-
function copyWithSetImpl(obj,
|
|
17769
|
-
if (index >=
|
|
17770
|
-
var key =
|
|
17771
|
-
updated[key] = copyWithSetImpl(obj[key],
|
|
17768
|
+
function copyWithSetImpl(obj, path43, index, value) {
|
|
17769
|
+
if (index >= path43.length) return value;
|
|
17770
|
+
var key = path43[index], updated = isArrayImpl(obj) ? obj.slice() : assign({}, obj);
|
|
17771
|
+
updated[key] = copyWithSetImpl(obj[key], path43, index + 1, value);
|
|
17772
17772
|
return updated;
|
|
17773
17773
|
}
|
|
17774
17774
|
function copyWithRename(obj, oldPath, newPath) {
|
|
@@ -17795,11 +17795,11 @@ var require_react_reconciler_development = __commonJS({
|
|
|
17795
17795
|
);
|
|
17796
17796
|
return updated;
|
|
17797
17797
|
}
|
|
17798
|
-
function copyWithDeleteImpl(obj,
|
|
17799
|
-
var key =
|
|
17800
|
-
if (index + 1 ===
|
|
17798
|
+
function copyWithDeleteImpl(obj, path43, index) {
|
|
17799
|
+
var key = path43[index], updated = isArrayImpl(obj) ? obj.slice() : assign({}, obj);
|
|
17800
|
+
if (index + 1 === path43.length)
|
|
17801
17801
|
return isArrayImpl(updated) ? updated.splice(key, 1) : delete updated[key], updated;
|
|
17802
|
-
updated[key] = copyWithDeleteImpl(obj[key],
|
|
17802
|
+
updated[key] = copyWithDeleteImpl(obj[key], path43, index + 1);
|
|
17803
17803
|
return updated;
|
|
17804
17804
|
}
|
|
17805
17805
|
function shouldSuspendImpl() {
|
|
@@ -17972,12 +17972,12 @@ var require_react_reconciler_development = __commonJS({
|
|
|
17972
17972
|
maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
|
|
17973
17973
|
return "function" === typeof maybeIterable ? maybeIterable : null;
|
|
17974
17974
|
}
|
|
17975
|
-
function getComponentNameFromType(
|
|
17976
|
-
if (null ==
|
|
17977
|
-
if ("function" === typeof
|
|
17978
|
-
return
|
|
17979
|
-
if ("string" === typeof
|
|
17980
|
-
switch (
|
|
17975
|
+
function getComponentNameFromType(type2) {
|
|
17976
|
+
if (null == type2) return null;
|
|
17977
|
+
if ("function" === typeof type2)
|
|
17978
|
+
return type2.$$typeof === REACT_CLIENT_REFERENCE ? null : type2.displayName || type2.name || null;
|
|
17979
|
+
if ("string" === typeof type2) return type2;
|
|
17980
|
+
switch (type2) {
|
|
17981
17981
|
case REACT_FRAGMENT_TYPE:
|
|
17982
17982
|
return "Fragment";
|
|
17983
17983
|
case REACT_PROFILER_TYPE:
|
|
@@ -17991,54 +17991,54 @@ var require_react_reconciler_development = __commonJS({
|
|
|
17991
17991
|
case REACT_ACTIVITY_TYPE:
|
|
17992
17992
|
return "Activity";
|
|
17993
17993
|
}
|
|
17994
|
-
if ("object" === typeof
|
|
17995
|
-
switch ("number" === typeof
|
|
17994
|
+
if ("object" === typeof type2)
|
|
17995
|
+
switch ("number" === typeof type2.tag && console.error(
|
|
17996
17996
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
17997
|
-
),
|
|
17997
|
+
), type2.$$typeof) {
|
|
17998
17998
|
case REACT_PORTAL_TYPE:
|
|
17999
17999
|
return "Portal";
|
|
18000
18000
|
case REACT_CONTEXT_TYPE:
|
|
18001
|
-
return
|
|
18001
|
+
return type2.displayName || "Context";
|
|
18002
18002
|
case REACT_CONSUMER_TYPE:
|
|
18003
|
-
return (
|
|
18003
|
+
return (type2._context.displayName || "Context") + ".Consumer";
|
|
18004
18004
|
case REACT_FORWARD_REF_TYPE:
|
|
18005
|
-
var innerType =
|
|
18006
|
-
|
|
18007
|
-
|
|
18008
|
-
return
|
|
18005
|
+
var innerType = type2.render;
|
|
18006
|
+
type2 = type2.displayName;
|
|
18007
|
+
type2 || (type2 = innerType.displayName || innerType.name || "", type2 = "" !== type2 ? "ForwardRef(" + type2 + ")" : "ForwardRef");
|
|
18008
|
+
return type2;
|
|
18009
18009
|
case REACT_MEMO_TYPE:
|
|
18010
|
-
return innerType =
|
|
18010
|
+
return innerType = type2.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type2.type) || "Memo";
|
|
18011
18011
|
case REACT_LAZY_TYPE:
|
|
18012
|
-
innerType =
|
|
18013
|
-
|
|
18012
|
+
innerType = type2._payload;
|
|
18013
|
+
type2 = type2._init;
|
|
18014
18014
|
try {
|
|
18015
|
-
return getComponentNameFromType(
|
|
18015
|
+
return getComponentNameFromType(type2(innerType));
|
|
18016
18016
|
} catch (x) {
|
|
18017
18017
|
}
|
|
18018
18018
|
}
|
|
18019
18019
|
return null;
|
|
18020
18020
|
}
|
|
18021
18021
|
function getComponentNameFromFiber(fiber) {
|
|
18022
|
-
var
|
|
18022
|
+
var type2 = fiber.type;
|
|
18023
18023
|
switch (fiber.tag) {
|
|
18024
18024
|
case 31:
|
|
18025
18025
|
return "Activity";
|
|
18026
18026
|
case 24:
|
|
18027
18027
|
return "Cache";
|
|
18028
18028
|
case 9:
|
|
18029
|
-
return (
|
|
18029
|
+
return (type2._context.displayName || "Context") + ".Consumer";
|
|
18030
18030
|
case 10:
|
|
18031
|
-
return
|
|
18031
|
+
return type2.displayName || "Context";
|
|
18032
18032
|
case 18:
|
|
18033
18033
|
return "DehydratedFragment";
|
|
18034
18034
|
case 11:
|
|
18035
|
-
return fiber =
|
|
18035
|
+
return fiber = type2.render, fiber = fiber.displayName || fiber.name || "", type2.displayName || ("" !== fiber ? "ForwardRef(" + fiber + ")" : "ForwardRef");
|
|
18036
18036
|
case 7:
|
|
18037
18037
|
return "Fragment";
|
|
18038
18038
|
case 26:
|
|
18039
18039
|
case 27:
|
|
18040
18040
|
case 5:
|
|
18041
|
-
return
|
|
18041
|
+
return type2;
|
|
18042
18042
|
case 4:
|
|
18043
18043
|
return "Portal";
|
|
18044
18044
|
case 3:
|
|
@@ -18046,9 +18046,9 @@ var require_react_reconciler_development = __commonJS({
|
|
|
18046
18046
|
case 6:
|
|
18047
18047
|
return "Text";
|
|
18048
18048
|
case 16:
|
|
18049
|
-
return getComponentNameFromType(
|
|
18049
|
+
return getComponentNameFromType(type2);
|
|
18050
18050
|
case 8:
|
|
18051
|
-
return
|
|
18051
|
+
return type2 === REACT_STRICT_MODE_TYPE ? "StrictMode" : "Mode";
|
|
18052
18052
|
case 22:
|
|
18053
18053
|
return "Offscreen";
|
|
18054
18054
|
case 12:
|
|
@@ -18065,15 +18065,15 @@ var require_react_reconciler_development = __commonJS({
|
|
|
18065
18065
|
case 0:
|
|
18066
18066
|
case 14:
|
|
18067
18067
|
case 15:
|
|
18068
|
-
if ("function" === typeof
|
|
18069
|
-
return
|
|
18070
|
-
if ("string" === typeof
|
|
18068
|
+
if ("function" === typeof type2)
|
|
18069
|
+
return type2.displayName || type2.name || null;
|
|
18070
|
+
if ("string" === typeof type2) return type2;
|
|
18071
18071
|
break;
|
|
18072
18072
|
case 29:
|
|
18073
|
-
|
|
18074
|
-
if (null !=
|
|
18075
|
-
for (var i =
|
|
18076
|
-
if ("string" === typeof
|
|
18073
|
+
type2 = fiber._debugInfo;
|
|
18074
|
+
if (null != type2) {
|
|
18075
|
+
for (var i = type2.length - 1; 0 <= i; i--)
|
|
18076
|
+
if ("string" === typeof type2[i].name) return type2[i].name;
|
|
18077
18077
|
}
|
|
18078
18078
|
if (null !== fiber.return)
|
|
18079
18079
|
return getComponentNameFromFiber(fiber.return);
|
|
@@ -19344,8 +19344,8 @@ var require_react_reconciler_development = __commonJS({
|
|
|
19344
19344
|
function describePropValue(value, maxLength) {
|
|
19345
19345
|
return "string" !== typeof value || needsEscaping.test(value) ? "{" + describeValue(value, maxLength - 2) + "}" : value.length > maxLength - 2 ? 5 > maxLength ? '"..."' : '"' + value.slice(0, maxLength - 5) + '..."' : '"' + value + '"';
|
|
19346
19346
|
}
|
|
19347
|
-
function describeExpandedElement(
|
|
19348
|
-
var remainingRowLength = 120 - rowPrefix.length -
|
|
19347
|
+
function describeExpandedElement(type2, props, rowPrefix) {
|
|
19348
|
+
var remainingRowLength = 120 - rowPrefix.length - type2.length, properties = [], propName;
|
|
19349
19349
|
for (propName in props)
|
|
19350
19350
|
if (props.hasOwnProperty(propName) && "children" !== propName) {
|
|
19351
19351
|
var propValue = describePropValue(
|
|
@@ -19355,7 +19355,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
19355
19355
|
remainingRowLength -= propName.length + propValue.length + 2;
|
|
19356
19356
|
properties.push(propName + "=" + propValue);
|
|
19357
19357
|
}
|
|
19358
|
-
return 0 === properties.length ? rowPrefix + "<" +
|
|
19358
|
+
return 0 === properties.length ? rowPrefix + "<" + type2 + ">\n" : 0 < remainingRowLength ? rowPrefix + "<" + type2 + " " + properties.join(" ") + ">\n" : rowPrefix + "<" + type2 + "\n" + rowPrefix + " " + properties.join("\n" + rowPrefix + " ") + "\n" + rowPrefix + ">\n";
|
|
19359
19359
|
}
|
|
19360
19360
|
function describePropertiesDiff(clientObject, serverObject, indent2) {
|
|
19361
19361
|
var properties = "", remainingServerProperties = assign({}, serverObject), propName;
|
|
@@ -19372,7 +19372,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
19372
19372
|
), properties += removed(indent2) + _propName + ": " + clientObject + "\n");
|
|
19373
19373
|
return properties;
|
|
19374
19374
|
}
|
|
19375
|
-
function describeElementDiff(
|
|
19375
|
+
function describeElementDiff(type2, clientProps, serverProps, indent2) {
|
|
19376
19376
|
var content = "", serverPropNames = /* @__PURE__ */ new Map();
|
|
19377
19377
|
for (propName$jscomp$0 in serverProps)
|
|
19378
19378
|
serverProps.hasOwnProperty(propName$jscomp$0) && serverPropNames.set(
|
|
@@ -19381,7 +19381,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
19381
19381
|
);
|
|
19382
19382
|
if (1 === serverPropNames.size && serverPropNames.has("children"))
|
|
19383
19383
|
content += describeExpandedElement(
|
|
19384
|
-
|
|
19384
|
+
type2,
|
|
19385
19385
|
clientProps,
|
|
19386
19386
|
indentation(indent2)
|
|
19387
19387
|
);
|
|
@@ -19415,28 +19415,28 @@ var require_react_reconciler_development = __commonJS({
|
|
|
19415
19415
|
content += removed(indent2 + 1) + propName + "=" + describePropValue(serverProps[propName], maxLength) + "\n";
|
|
19416
19416
|
}
|
|
19417
19417
|
});
|
|
19418
|
-
content = "" === content ? indentation(indent2) + "<" +
|
|
19418
|
+
content = "" === content ? indentation(indent2) + "<" + type2 + ">\n" : indentation(indent2) + "<" + type2 + "\n" + content + indentation(indent2) + ">\n";
|
|
19419
19419
|
}
|
|
19420
|
-
|
|
19420
|
+
type2 = serverProps.children;
|
|
19421
19421
|
clientProps = clientProps.children;
|
|
19422
|
-
if ("string" === typeof
|
|
19422
|
+
if ("string" === typeof type2 || "number" === typeof type2 || "bigint" === typeof type2) {
|
|
19423
19423
|
serverPropNames = "";
|
|
19424
19424
|
if ("string" === typeof clientProps || "number" === typeof clientProps || "bigint" === typeof clientProps)
|
|
19425
19425
|
serverPropNames = "" + clientProps;
|
|
19426
|
-
content += describeTextDiff(serverPropNames, "" +
|
|
19426
|
+
content += describeTextDiff(serverPropNames, "" + type2, indent2 + 1);
|
|
19427
19427
|
} else if ("string" === typeof clientProps || "number" === typeof clientProps || "bigint" === typeof clientProps)
|
|
19428
|
-
content = null ==
|
|
19428
|
+
content = null == type2 ? content + describeTextDiff("" + clientProps, null, indent2 + 1) : content + describeTextDiff("" + clientProps, void 0, indent2 + 1);
|
|
19429
19429
|
return content;
|
|
19430
19430
|
}
|
|
19431
19431
|
function describeSiblingFiber(fiber, indent2) {
|
|
19432
|
-
var
|
|
19433
|
-
if (null ===
|
|
19434
|
-
|
|
19432
|
+
var type2 = describeFiberType(fiber);
|
|
19433
|
+
if (null === type2) {
|
|
19434
|
+
type2 = "";
|
|
19435
19435
|
for (fiber = fiber.child; fiber; )
|
|
19436
|
-
|
|
19437
|
-
return
|
|
19436
|
+
type2 += describeSiblingFiber(fiber, indent2), fiber = fiber.sibling;
|
|
19437
|
+
return type2;
|
|
19438
19438
|
}
|
|
19439
|
-
return indentation(indent2) + "<" +
|
|
19439
|
+
return indentation(indent2) + "<" + type2 + ">\n";
|
|
19440
19440
|
}
|
|
19441
19441
|
function describeNode(node, indent2) {
|
|
19442
19442
|
var skipToNode = findNotableNode(node, indent2);
|
|
@@ -23004,9 +23004,9 @@ var require_react_reconciler_development = __commonJS({
|
|
|
23004
23004
|
}
|
|
23005
23005
|
function updateMemoComponent(current2, workInProgress2, Component, nextProps, renderLanes2) {
|
|
23006
23006
|
if (null === current2) {
|
|
23007
|
-
var
|
|
23008
|
-
if ("function" === typeof
|
|
23009
|
-
return Component = resolveFunctionForHotReloading(
|
|
23007
|
+
var type2 = Component.type;
|
|
23008
|
+
if ("function" === typeof type2 && !shouldConstruct(type2) && void 0 === type2.defaultProps && null === Component.compare)
|
|
23009
|
+
return Component = resolveFunctionForHotReloading(type2), workInProgress2.tag = 15, workInProgress2.type = Component, validateFunctionComponentInDev(workInProgress2, type2), updateSimpleMemoComponent(
|
|
23010
23010
|
current2,
|
|
23011
23011
|
workInProgress2,
|
|
23012
23012
|
Component,
|
|
@@ -23025,9 +23025,9 @@ var require_react_reconciler_development = __commonJS({
|
|
|
23025
23025
|
current2.return = workInProgress2;
|
|
23026
23026
|
return workInProgress2.child = current2;
|
|
23027
23027
|
}
|
|
23028
|
-
|
|
23028
|
+
type2 = current2.child;
|
|
23029
23029
|
if (!checkScheduledUpdateOrContext(current2, renderLanes2)) {
|
|
23030
|
-
var prevProps =
|
|
23030
|
+
var prevProps = type2.memoizedProps;
|
|
23031
23031
|
Component = Component.compare;
|
|
23032
23032
|
Component = null !== Component ? Component : shallowEqual;
|
|
23033
23033
|
if (Component(prevProps, nextProps) && current2.ref === workInProgress2.ref)
|
|
@@ -23038,7 +23038,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
23038
23038
|
);
|
|
23039
23039
|
}
|
|
23040
23040
|
workInProgress2.flags |= 1;
|
|
23041
|
-
current2 = createWorkInProgress(
|
|
23041
|
+
current2 = createWorkInProgress(type2, nextProps);
|
|
23042
23042
|
current2.ref = workInProgress2.ref;
|
|
23043
23043
|
current2.return = workInProgress2;
|
|
23044
23044
|
return workInProgress2.child = current2;
|
|
@@ -24663,7 +24663,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
24663
24663
|
finalizeContainerChildren(container, newChildSet);
|
|
24664
24664
|
}
|
|
24665
24665
|
}
|
|
24666
|
-
function updateHostComponent(current2, workInProgress2,
|
|
24666
|
+
function updateHostComponent(current2, workInProgress2, type2, newProps) {
|
|
24667
24667
|
if (supportsMutation)
|
|
24668
24668
|
current2.memoizedProps !== newProps && markUpdate(workInProgress2);
|
|
24669
24669
|
else if (supportsPersistence) {
|
|
@@ -24672,7 +24672,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
24672
24672
|
var currentHostContext = getHostContext();
|
|
24673
24673
|
_oldProps = cloneInstance(
|
|
24674
24674
|
currentInstance,
|
|
24675
|
-
|
|
24675
|
+
type2,
|
|
24676
24676
|
_oldProps,
|
|
24677
24677
|
newProps,
|
|
24678
24678
|
!current2,
|
|
@@ -24680,17 +24680,17 @@ var require_react_reconciler_development = __commonJS({
|
|
|
24680
24680
|
);
|
|
24681
24681
|
_oldProps === currentInstance ? workInProgress2.stateNode = currentInstance : (markCloned(workInProgress2), finalizeInitialChildren(
|
|
24682
24682
|
_oldProps,
|
|
24683
|
-
|
|
24683
|
+
type2,
|
|
24684
24684
|
newProps,
|
|
24685
24685
|
currentHostContext
|
|
24686
24686
|
) && markUpdate(workInProgress2), workInProgress2.stateNode = _oldProps, current2 && appendAllChildren(_oldProps, workInProgress2, false, false));
|
|
24687
24687
|
} else workInProgress2.stateNode = currentInstance;
|
|
24688
24688
|
}
|
|
24689
24689
|
}
|
|
24690
|
-
function preloadInstanceAndSuspendIfNeeded(workInProgress2,
|
|
24691
|
-
if ((workInProgress2.mode & 32) !== NoMode && (null === oldProps ? maySuspendCommit(
|
|
24692
|
-
if (workInProgress2.flags |= 16777216, (renderLanes2 & 335544128) === renderLanes2 || maySuspendCommitInSyncRender(
|
|
24693
|
-
if (preloadInstance(workInProgress2.stateNode,
|
|
24690
|
+
function preloadInstanceAndSuspendIfNeeded(workInProgress2, type2, oldProps, newProps, renderLanes2) {
|
|
24691
|
+
if ((workInProgress2.mode & 32) !== NoMode && (null === oldProps ? maySuspendCommit(type2, newProps) : maySuspendCommitOnUpdate(type2, oldProps, newProps))) {
|
|
24692
|
+
if (workInProgress2.flags |= 16777216, (renderLanes2 & 335544128) === renderLanes2 || maySuspendCommitInSyncRender(type2, newProps))
|
|
24693
|
+
if (preloadInstance(workInProgress2.stateNode, type2, newProps))
|
|
24694
24694
|
workInProgress2.flags |= 8192;
|
|
24695
24695
|
else if (shouldRemainOnPreviousScreen()) workInProgress2.flags |= 8192;
|
|
24696
24696
|
else
|
|
@@ -24780,13 +24780,13 @@ var require_react_reconciler_development = __commonJS({
|
|
|
24780
24780
|
return null;
|
|
24781
24781
|
case 26:
|
|
24782
24782
|
if (supportsResources) {
|
|
24783
|
-
var
|
|
24783
|
+
var type2 = workInProgress2.type, nextResource = workInProgress2.memoizedState;
|
|
24784
24784
|
null === current2 ? (markUpdate(workInProgress2), null !== nextResource ? (bubbleProperties(workInProgress2), preloadResourceAndSuspendIfNeeded(
|
|
24785
24785
|
workInProgress2,
|
|
24786
24786
|
nextResource
|
|
24787
24787
|
)) : (bubbleProperties(workInProgress2), preloadInstanceAndSuspendIfNeeded(
|
|
24788
24788
|
workInProgress2,
|
|
24789
|
-
|
|
24789
|
+
type2,
|
|
24790
24790
|
null,
|
|
24791
24791
|
newProps,
|
|
24792
24792
|
renderLanes2
|
|
@@ -24796,11 +24796,11 @@ var require_react_reconciler_development = __commonJS({
|
|
|
24796
24796
|
)) : (bubbleProperties(workInProgress2), workInProgress2.flags &= -16777217) : (nextResource = current2.memoizedProps, supportsMutation ? nextResource !== newProps && markUpdate(workInProgress2) : updateHostComponent(
|
|
24797
24797
|
current2,
|
|
24798
24798
|
workInProgress2,
|
|
24799
|
-
|
|
24799
|
+
type2,
|
|
24800
24800
|
newProps
|
|
24801
24801
|
), bubbleProperties(workInProgress2), preloadInstanceAndSuspendIfNeeded(
|
|
24802
24802
|
workInProgress2,
|
|
24803
|
-
|
|
24803
|
+
type2,
|
|
24804
24804
|
nextResource,
|
|
24805
24805
|
newProps,
|
|
24806
24806
|
renderLanes2
|
|
@@ -24811,9 +24811,9 @@ var require_react_reconciler_development = __commonJS({
|
|
|
24811
24811
|
if (supportsSingletons) {
|
|
24812
24812
|
popHostContext(workInProgress2);
|
|
24813
24813
|
renderLanes2 = requiredContext(rootInstanceStackCursor.current);
|
|
24814
|
-
|
|
24814
|
+
type2 = workInProgress2.type;
|
|
24815
24815
|
if (null !== current2 && null != workInProgress2.stateNode)
|
|
24816
|
-
supportsMutation ? current2.memoizedProps !== newProps && markUpdate(workInProgress2) : updateHostComponent(current2, workInProgress2,
|
|
24816
|
+
supportsMutation ? current2.memoizedProps !== newProps && markUpdate(workInProgress2) : updateHostComponent(current2, workInProgress2, type2, newProps);
|
|
24817
24817
|
else {
|
|
24818
24818
|
if (!newProps) {
|
|
24819
24819
|
if (null === workInProgress2.stateNode)
|
|
@@ -24825,7 +24825,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
24825
24825
|
}
|
|
24826
24826
|
current2 = getHostContext();
|
|
24827
24827
|
popHydrationState(workInProgress2) ? prepareToHydrateHostInstance(workInProgress2, current2) : (current2 = resolveSingletonInstance(
|
|
24828
|
-
|
|
24828
|
+
type2,
|
|
24829
24829
|
newProps,
|
|
24830
24830
|
renderLanes2,
|
|
24831
24831
|
current2,
|
|
@@ -24837,9 +24837,9 @@ var require_react_reconciler_development = __commonJS({
|
|
|
24837
24837
|
}
|
|
24838
24838
|
case 5:
|
|
24839
24839
|
popHostContext(workInProgress2);
|
|
24840
|
-
|
|
24840
|
+
type2 = workInProgress2.type;
|
|
24841
24841
|
if (null !== current2 && null != workInProgress2.stateNode)
|
|
24842
|
-
updateHostComponent(current2, workInProgress2,
|
|
24842
|
+
updateHostComponent(current2, workInProgress2, type2, newProps);
|
|
24843
24843
|
else {
|
|
24844
24844
|
if (!newProps) {
|
|
24845
24845
|
if (null === workInProgress2.stateNode)
|
|
@@ -24853,7 +24853,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
24853
24853
|
if (popHydrationState(workInProgress2))
|
|
24854
24854
|
prepareToHydrateHostInstance(workInProgress2, nextResource), finalizeHydratedChildren(
|
|
24855
24855
|
workInProgress2.stateNode,
|
|
24856
|
-
|
|
24856
|
+
type2,
|
|
24857
24857
|
newProps,
|
|
24858
24858
|
nextResource
|
|
24859
24859
|
) && (workInProgress2.flags |= 64);
|
|
@@ -24862,7 +24862,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
24862
24862
|
rootInstanceStackCursor.current
|
|
24863
24863
|
);
|
|
24864
24864
|
_rootContainerInstance = createInstance(
|
|
24865
|
-
|
|
24865
|
+
type2,
|
|
24866
24866
|
newProps,
|
|
24867
24867
|
_rootContainerInstance,
|
|
24868
24868
|
nextResource,
|
|
@@ -24873,7 +24873,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
24873
24873
|
workInProgress2.stateNode = _rootContainerInstance;
|
|
24874
24874
|
finalizeInitialChildren(
|
|
24875
24875
|
_rootContainerInstance,
|
|
24876
|
-
|
|
24876
|
+
type2,
|
|
24877
24877
|
newProps,
|
|
24878
24878
|
nextResource
|
|
24879
24879
|
) && markUpdate(workInProgress2);
|
|
@@ -24912,28 +24912,28 @@ var require_react_reconciler_development = __commonJS({
|
|
|
24912
24912
|
);
|
|
24913
24913
|
current2 = workInProgress2.stateNode;
|
|
24914
24914
|
renderLanes2 = workInProgress2.memoizedProps;
|
|
24915
|
-
|
|
24915
|
+
type2 = !didSuspendOrErrorDEV;
|
|
24916
24916
|
newProps = null;
|
|
24917
24917
|
nextResource = hydrationParentFiber;
|
|
24918
24918
|
if (null !== nextResource)
|
|
24919
24919
|
switch (nextResource.tag) {
|
|
24920
24920
|
case 3:
|
|
24921
|
-
|
|
24921
|
+
type2 && (type2 = diffHydratedTextForDevWarnings(
|
|
24922
24922
|
current2,
|
|
24923
24923
|
renderLanes2,
|
|
24924
24924
|
newProps
|
|
24925
|
-
), null !==
|
|
24925
|
+
), null !== type2 && (buildHydrationDiffNode(workInProgress2, 0).serverProps = type2));
|
|
24926
24926
|
break;
|
|
24927
24927
|
case 27:
|
|
24928
24928
|
case 5:
|
|
24929
|
-
newProps = nextResource.memoizedProps,
|
|
24929
|
+
newProps = nextResource.memoizedProps, type2 && (type2 = diffHydratedTextForDevWarnings(
|
|
24930
24930
|
current2,
|
|
24931
24931
|
renderLanes2,
|
|
24932
24932
|
newProps
|
|
24933
|
-
), null !==
|
|
24933
|
+
), null !== type2 && (buildHydrationDiffNode(
|
|
24934
24934
|
workInProgress2,
|
|
24935
24935
|
0
|
|
24936
|
-
).serverProps =
|
|
24936
|
+
).serverProps = type2));
|
|
24937
24937
|
}
|
|
24938
24938
|
hydrateTextInstance(
|
|
24939
24939
|
current2,
|
|
@@ -24995,9 +24995,9 @@ var require_react_reconciler_development = __commonJS({
|
|
|
24995
24995
|
case 13:
|
|
24996
24996
|
newProps = workInProgress2.memoizedState;
|
|
24997
24997
|
if (null === current2 || null !== current2.memoizedState && null !== current2.memoizedState.dehydrated) {
|
|
24998
|
-
|
|
24998
|
+
type2 = newProps;
|
|
24999
24999
|
nextResource = popHydrationState(workInProgress2);
|
|
25000
|
-
if (null !==
|
|
25000
|
+
if (null !== type2 && null !== type2.dehydrated) {
|
|
25001
25001
|
if (null === current2) {
|
|
25002
25002
|
if (!nextResource)
|
|
25003
25003
|
throw Error(
|
|
@@ -25015,13 +25015,13 @@ var require_react_reconciler_development = __commonJS({
|
|
|
25015
25015
|
);
|
|
25016
25016
|
hydrateSuspenseInstance(nextResource, workInProgress2);
|
|
25017
25017
|
bubbleProperties(workInProgress2);
|
|
25018
|
-
(workInProgress2.mode & 2) !== NoMode && null !==
|
|
25018
|
+
(workInProgress2.mode & 2) !== NoMode && null !== type2 && (type2 = workInProgress2.child, null !== type2 && (workInProgress2.treeBaseDuration -= type2.treeBaseDuration));
|
|
25019
25019
|
} else
|
|
25020
|
-
emitPendingHydrationWarnings(), resetHydrationState(), 0 === (workInProgress2.flags & 128) && (
|
|
25021
|
-
|
|
25020
|
+
emitPendingHydrationWarnings(), resetHydrationState(), 0 === (workInProgress2.flags & 128) && (type2 = workInProgress2.memoizedState = null), workInProgress2.flags |= 4, bubbleProperties(workInProgress2), (workInProgress2.mode & 2) !== NoMode && null !== type2 && (type2 = workInProgress2.child, null !== type2 && (workInProgress2.treeBaseDuration -= type2.treeBaseDuration));
|
|
25021
|
+
type2 = false;
|
|
25022
25022
|
} else
|
|
25023
|
-
|
|
25024
|
-
if (!
|
|
25023
|
+
type2 = upgradeHydrationErrorsToRecoverable(), null !== current2 && null !== current2.memoizedState && (current2.memoizedState.hydrationErrors = type2), type2 = true;
|
|
25024
|
+
if (!type2) {
|
|
25025
25025
|
if (workInProgress2.flags & 256)
|
|
25026
25026
|
return popSuspenseHandler(workInProgress2), workInProgress2;
|
|
25027
25027
|
popSuspenseHandler(workInProgress2);
|
|
@@ -25033,7 +25033,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
25033
25033
|
return workInProgress2.lanes = renderLanes2, (workInProgress2.mode & 2) !== NoMode && transferActualDuration(workInProgress2), workInProgress2;
|
|
25034
25034
|
renderLanes2 = null !== newProps;
|
|
25035
25035
|
current2 = null !== current2 && null !== current2.memoizedState;
|
|
25036
|
-
renderLanes2 && (newProps = workInProgress2.child,
|
|
25036
|
+
renderLanes2 && (newProps = workInProgress2.child, type2 = null, null !== newProps.alternate && null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (type2 = newProps.alternate.memoizedState.cachePool.pool), nextResource = null, null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && (nextResource = newProps.memoizedState.cachePool.pool), nextResource !== type2 && (newProps.flags |= 2048));
|
|
25037
25037
|
renderLanes2 !== current2 && renderLanes2 && (workInProgress2.child.flags |= 8192);
|
|
25038
25038
|
scheduleRetryEffect(workInProgress2, workInProgress2.updateQueue);
|
|
25039
25039
|
bubbleProperties(workInProgress2);
|
|
@@ -25047,10 +25047,10 @@ var require_react_reconciler_development = __commonJS({
|
|
|
25047
25047
|
pop(suspenseStackCursor, workInProgress2);
|
|
25048
25048
|
newProps = workInProgress2.memoizedState;
|
|
25049
25049
|
if (null === newProps) return bubbleProperties(workInProgress2), null;
|
|
25050
|
-
|
|
25050
|
+
type2 = 0 !== (workInProgress2.flags & 128);
|
|
25051
25051
|
nextResource = newProps.rendering;
|
|
25052
25052
|
if (null === nextResource)
|
|
25053
|
-
if (
|
|
25053
|
+
if (type2) cutOffTailIfNeeded(newProps, false);
|
|
25054
25054
|
else {
|
|
25055
25055
|
if (workInProgressRootExitStatus !== RootInProgress || null !== current2 && 0 !== (current2.flags & 128))
|
|
25056
25056
|
for (current2 = workInProgress2.child; null !== current2; ) {
|
|
@@ -25075,19 +25075,19 @@ var require_react_reconciler_development = __commonJS({
|
|
|
25075
25075
|
}
|
|
25076
25076
|
current2 = current2.sibling;
|
|
25077
25077
|
}
|
|
25078
|
-
null !== newProps.tail && now$1() > workInProgressRootRenderTargetTime && (workInProgress2.flags |= 128,
|
|
25078
|
+
null !== newProps.tail && now$1() > workInProgressRootRenderTargetTime && (workInProgress2.flags |= 128, type2 = true, cutOffTailIfNeeded(newProps, false), workInProgress2.lanes = 4194304);
|
|
25079
25079
|
}
|
|
25080
25080
|
else {
|
|
25081
|
-
if (!
|
|
25081
|
+
if (!type2)
|
|
25082
25082
|
if (current2 = findFirstSuspended(nextResource), null !== current2) {
|
|
25083
|
-
if (workInProgress2.flags |= 128,
|
|
25083
|
+
if (workInProgress2.flags |= 128, type2 = true, current2 = current2.updateQueue, workInProgress2.updateQueue = current2, scheduleRetryEffect(workInProgress2, current2), cutOffTailIfNeeded(newProps, true), null === newProps.tail && "hidden" === newProps.tailMode && !nextResource.alternate && !isHydrating)
|
|
25084
25084
|
return bubbleProperties(workInProgress2), null;
|
|
25085
25085
|
} else
|
|
25086
|
-
2 * now$1() - newProps.renderingStartTime > workInProgressRootRenderTargetTime && 536870912 !== renderLanes2 && (workInProgress2.flags |= 128,
|
|
25086
|
+
2 * now$1() - newProps.renderingStartTime > workInProgressRootRenderTargetTime && 536870912 !== renderLanes2 && (workInProgress2.flags |= 128, type2 = true, cutOffTailIfNeeded(newProps, false), workInProgress2.lanes = 4194304);
|
|
25087
25087
|
newProps.isBackwards ? (nextResource.sibling = workInProgress2.child, workInProgress2.child = nextResource) : (current2 = newProps.last, null !== current2 ? current2.sibling = nextResource : workInProgress2.child = nextResource, newProps.last = nextResource);
|
|
25088
25088
|
}
|
|
25089
25089
|
if (null !== newProps.tail)
|
|
25090
|
-
return current2 = newProps.tail, newProps.rendering = current2, newProps.tail = current2.sibling, newProps.renderingStartTime = now$1(), current2.sibling = null, renderLanes2 = suspenseStackCursor.current, renderLanes2 =
|
|
25090
|
+
return current2 = newProps.tail, newProps.rendering = current2, newProps.tail = current2.sibling, newProps.renderingStartTime = now$1(), current2.sibling = null, renderLanes2 = suspenseStackCursor.current, renderLanes2 = type2 ? renderLanes2 & SubtreeSuspenseContextMask | ForceSuspenseFallback : renderLanes2 & SubtreeSuspenseContextMask, push(suspenseStackCursor, renderLanes2, workInProgress2), isHydrating && pushTreeFork(workInProgress2, newProps.treeForkCount), current2;
|
|
25091
25091
|
bubbleProperties(workInProgress2);
|
|
25092
25092
|
return null;
|
|
25093
25093
|
case 22:
|
|
@@ -25460,13 +25460,13 @@ var require_react_reconciler_development = __commonJS({
|
|
|
25460
25460
|
);
|
|
25461
25461
|
}
|
|
25462
25462
|
function commitHostMount(finishedWork) {
|
|
25463
|
-
var
|
|
25463
|
+
var type2 = finishedWork.type, props = finishedWork.memoizedProps, instance = finishedWork.stateNode;
|
|
25464
25464
|
try {
|
|
25465
25465
|
runWithFiberInDEV(
|
|
25466
25466
|
finishedWork,
|
|
25467
25467
|
commitMount,
|
|
25468
25468
|
instance,
|
|
25469
|
-
|
|
25469
|
+
type2,
|
|
25470
25470
|
props,
|
|
25471
25471
|
finishedWork
|
|
25472
25472
|
);
|
|
@@ -27148,9 +27148,9 @@ var require_react_reconciler_development = __commonJS({
|
|
|
27148
27148
|
fiber.memoizedProps
|
|
27149
27149
|
);
|
|
27150
27150
|
else {
|
|
27151
|
-
var instance = fiber.stateNode,
|
|
27151
|
+
var instance = fiber.stateNode, type2 = fiber.type;
|
|
27152
27152
|
fiber = fiber.memoizedProps;
|
|
27153
|
-
((committedLanes & 335544128) === committedLanes || maySuspendCommitInSyncRender(
|
|
27153
|
+
((committedLanes & 335544128) === committedLanes || maySuspendCommitInSyncRender(type2, fiber)) && suspendInstance(suspendedState, instance, type2, fiber);
|
|
27154
27154
|
}
|
|
27155
27155
|
break;
|
|
27156
27156
|
case 5:
|
|
@@ -27159,7 +27159,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
27159
27159
|
committedLanes,
|
|
27160
27160
|
suspendedState
|
|
27161
27161
|
);
|
|
27162
|
-
fiber.flags & suspenseyCommitFlag && (instance = fiber.stateNode,
|
|
27162
|
+
fiber.flags & suspenseyCommitFlag && (instance = fiber.stateNode, type2 = fiber.type, fiber = fiber.memoizedProps, ((committedLanes & 335544128) === committedLanes || maySuspendCommitInSyncRender(type2, fiber)) && suspendInstance(suspendedState, instance, type2, fiber));
|
|
27163
27163
|
break;
|
|
27164
27164
|
case 3:
|
|
27165
27165
|
case 4:
|
|
@@ -28340,8 +28340,8 @@ var require_react_reconciler_development = __commonJS({
|
|
|
28340
28340
|
resource = workInProgress.memoizedState;
|
|
28341
28341
|
case 5:
|
|
28342
28342
|
case 27:
|
|
28343
|
-
var hostFiber = workInProgress,
|
|
28344
|
-
if (resource ? preloadResource(resource) : preloadInstance(hostFiber.stateNode,
|
|
28343
|
+
var hostFiber = workInProgress, type2 = hostFiber.type, props = hostFiber.pendingProps;
|
|
28344
|
+
if (resource ? preloadResource(resource) : preloadInstance(hostFiber.stateNode, type2, props)) {
|
|
28345
28345
|
workInProgressSuspendedReason = NotSuspended;
|
|
28346
28346
|
workInProgressThrownValue = null;
|
|
28347
28347
|
var sibling = hostFiber.sibling;
|
|
@@ -29193,15 +29193,15 @@ var require_react_reconciler_development = __commonJS({
|
|
|
29193
29193
|
);
|
|
29194
29194
|
});
|
|
29195
29195
|
}
|
|
29196
|
-
function resolveFunctionForHotReloading(
|
|
29197
|
-
if (null === resolveFamily) return
|
|
29198
|
-
var family = resolveFamily(
|
|
29199
|
-
return void 0 === family ?
|
|
29196
|
+
function resolveFunctionForHotReloading(type2) {
|
|
29197
|
+
if (null === resolveFamily) return type2;
|
|
29198
|
+
var family = resolveFamily(type2);
|
|
29199
|
+
return void 0 === family ? type2 : family.current;
|
|
29200
29200
|
}
|
|
29201
|
-
function resolveForwardRefForHotReloading(
|
|
29202
|
-
if (null === resolveFamily) return
|
|
29203
|
-
var family = resolveFamily(
|
|
29204
|
-
return void 0 === family ? null !==
|
|
29201
|
+
function resolveForwardRefForHotReloading(type2) {
|
|
29202
|
+
if (null === resolveFamily) return type2;
|
|
29203
|
+
var family = resolveFamily(type2);
|
|
29204
|
+
return void 0 === family ? null !== type2 && void 0 !== type2 && "function" === typeof type2.render && (family = resolveFunctionForHotReloading(type2.render), type2.render !== family) ? (family = { $$typeof: REACT_FORWARD_REF_TYPE, render: family }, void 0 !== type2.displayName && (family.displayName = type2.displayName), family) : type2 : family.current;
|
|
29205
29205
|
}
|
|
29206
29206
|
function isCompatibleFamilyForHotReloading(fiber, element) {
|
|
29207
29207
|
if (null === resolveFamily) return false;
|
|
@@ -29339,14 +29339,14 @@ var require_react_reconciler_development = __commonJS({
|
|
|
29339
29339
|
}, workInProgress2.selfBaseDuration = current2.selfBaseDuration, workInProgress2.treeBaseDuration = current2.treeBaseDuration);
|
|
29340
29340
|
return workInProgress2;
|
|
29341
29341
|
}
|
|
29342
|
-
function createFiberFromTypeAndProps(
|
|
29343
|
-
var fiberTag = 0, resolvedType =
|
|
29344
|
-
if ("function" === typeof
|
|
29345
|
-
shouldConstruct(
|
|
29346
|
-
else if ("string" === typeof
|
|
29347
|
-
supportsResources && supportsSingletons ? (fiberTag = getHostContext(), fiberTag = isHostHoistableType(
|
|
29342
|
+
function createFiberFromTypeAndProps(type2, key, pendingProps, owner, mode, lanes) {
|
|
29343
|
+
var fiberTag = 0, resolvedType = type2;
|
|
29344
|
+
if ("function" === typeof type2)
|
|
29345
|
+
shouldConstruct(type2) && (fiberTag = 1), resolvedType = resolveFunctionForHotReloading(resolvedType);
|
|
29346
|
+
else if ("string" === typeof type2)
|
|
29347
|
+
supportsResources && supportsSingletons ? (fiberTag = getHostContext(), fiberTag = isHostHoistableType(type2, pendingProps, fiberTag) ? 26 : isHostSingletonType(type2) ? 27 : 5) : supportsResources ? (fiberTag = getHostContext(), fiberTag = isHostHoistableType(type2, pendingProps, fiberTag) ? 26 : 5) : fiberTag = supportsSingletons ? isHostSingletonType(type2) ? 27 : 5 : 5;
|
|
29348
29348
|
else
|
|
29349
|
-
a: switch (
|
|
29349
|
+
a: switch (type2) {
|
|
29350
29350
|
case REACT_ACTIVITY_TYPE:
|
|
29351
29351
|
return key = createFiber(31, pendingProps, key, mode), key.elementType = REACT_ACTIVITY_TYPE, key.lanes = lanes, key;
|
|
29352
29352
|
case REACT_FRAGMENT_TYPE:
|
|
@@ -29361,17 +29361,17 @@ var require_react_reconciler_development = __commonJS({
|
|
|
29361
29361
|
mode |= 24;
|
|
29362
29362
|
break;
|
|
29363
29363
|
case REACT_PROFILER_TYPE:
|
|
29364
|
-
return
|
|
29364
|
+
return type2 = pendingProps, owner = mode, "string" !== typeof type2.id && console.error(
|
|
29365
29365
|
'Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.',
|
|
29366
|
-
typeof
|
|
29367
|
-
), key = createFiber(12,
|
|
29366
|
+
typeof type2.id
|
|
29367
|
+
), key = createFiber(12, type2, key, owner | 2), key.elementType = REACT_PROFILER_TYPE, key.lanes = lanes, key.stateNode = { effectDuration: 0, passiveEffectDuration: 0 }, key;
|
|
29368
29368
|
case REACT_SUSPENSE_TYPE:
|
|
29369
29369
|
return key = createFiber(13, pendingProps, key, mode), key.elementType = REACT_SUSPENSE_TYPE, key.lanes = lanes, key;
|
|
29370
29370
|
case REACT_SUSPENSE_LIST_TYPE:
|
|
29371
29371
|
return key = createFiber(19, pendingProps, key, mode), key.elementType = REACT_SUSPENSE_LIST_TYPE, key.lanes = lanes, key;
|
|
29372
29372
|
default:
|
|
29373
|
-
if ("object" === typeof
|
|
29374
|
-
switch (
|
|
29373
|
+
if ("object" === typeof type2 && null !== type2)
|
|
29374
|
+
switch (type2.$$typeof) {
|
|
29375
29375
|
case REACT_CONTEXT_TYPE:
|
|
29376
29376
|
fiberTag = 10;
|
|
29377
29377
|
break a;
|
|
@@ -29391,9 +29391,9 @@ var require_react_reconciler_development = __commonJS({
|
|
|
29391
29391
|
break a;
|
|
29392
29392
|
}
|
|
29393
29393
|
resolvedType = "";
|
|
29394
|
-
if (void 0 ===
|
|
29394
|
+
if (void 0 === type2 || "object" === typeof type2 && null !== type2 && 0 === Object.keys(type2).length)
|
|
29395
29395
|
resolvedType += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
|
|
29396
|
-
null ===
|
|
29396
|
+
null === type2 ? pendingProps = "null" : isArrayImpl(type2) ? pendingProps = "array" : void 0 !== type2 && type2.$$typeof === REACT_ELEMENT_TYPE ? (pendingProps = "<" + (getComponentNameFromType(type2.type) || "Unknown") + " />", resolvedType = " Did you accidentally export a JSX literal instead of a component?") : pendingProps = typeof type2;
|
|
29397
29397
|
fiberTag = owner ? "number" === typeof owner.tag ? getComponentNameFromFiber(owner) : "string" === typeof owner.name ? owner.name : null : null;
|
|
29398
29398
|
fiberTag && (resolvedType += "\n\nCheck the render method of `" + fiberTag + "`.");
|
|
29399
29399
|
fiberTag = 29;
|
|
@@ -29403,7 +29403,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
29403
29403
|
resolvedType = null;
|
|
29404
29404
|
}
|
|
29405
29405
|
key = createFiber(fiberTag, pendingProps, key, mode);
|
|
29406
|
-
key.elementType =
|
|
29406
|
+
key.elementType = type2;
|
|
29407
29407
|
key.type = resolvedType;
|
|
29408
29408
|
key.lanes = lanes;
|
|
29409
29409
|
key._debugOwner = owner;
|
|
@@ -29668,7 +29668,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
29668
29668
|
var currentlyRenderingFiber$1 = null, lastContextDependency = null, isDisallowedContextReadInDEV = false, AbortControllerLocal = "undefined" !== typeof AbortController ? AbortController : function() {
|
|
29669
29669
|
var listeners3 = [], signal = this.signal = {
|
|
29670
29670
|
aborted: false,
|
|
29671
|
-
addEventListener: function(
|
|
29671
|
+
addEventListener: function(type2, listener) {
|
|
29672
29672
|
listeners3.push(listener);
|
|
29673
29673
|
}
|
|
29674
29674
|
};
|
|
@@ -31076,29 +31076,29 @@ var require_react_reconciler_development = __commonJS({
|
|
|
31076
31076
|
var didWarnAboutNestedUpdates = false;
|
|
31077
31077
|
var didWarnAboutFindNodeInStrictMode = {};
|
|
31078
31078
|
var overrideHookState = null, overrideHookStateDeletePath = null, overrideHookStateRenamePath = null, overrideProps = null, overridePropsDeletePath = null, overridePropsRenamePath = null, scheduleUpdate = null, scheduleRetry = null, setErrorHandler = null, setSuspenseHandler = null;
|
|
31079
|
-
overrideHookState = function(fiber, id2,
|
|
31079
|
+
overrideHookState = function(fiber, id2, path43, value) {
|
|
31080
31080
|
id2 = findHook(fiber, id2);
|
|
31081
|
-
null !== id2 && (
|
|
31081
|
+
null !== id2 && (path43 = copyWithSetImpl(id2.memoizedState, path43, 0, value), id2.memoizedState = path43, id2.baseState = path43, fiber.memoizedProps = assign({}, fiber.memoizedProps), path43 = enqueueConcurrentRenderForLane(fiber, 2), null !== path43 && scheduleUpdateOnFiber(path43, fiber, 2));
|
|
31082
31082
|
};
|
|
31083
|
-
overrideHookStateDeletePath = function(fiber, id2,
|
|
31083
|
+
overrideHookStateDeletePath = function(fiber, id2, path43) {
|
|
31084
31084
|
id2 = findHook(fiber, id2);
|
|
31085
|
-
null !== id2 && (
|
|
31085
|
+
null !== id2 && (path43 = copyWithDeleteImpl(id2.memoizedState, path43, 0), id2.memoizedState = path43, id2.baseState = path43, fiber.memoizedProps = assign({}, fiber.memoizedProps), path43 = enqueueConcurrentRenderForLane(fiber, 2), null !== path43 && scheduleUpdateOnFiber(path43, fiber, 2));
|
|
31086
31086
|
};
|
|
31087
31087
|
overrideHookStateRenamePath = function(fiber, id2, oldPath, newPath) {
|
|
31088
31088
|
id2 = findHook(fiber, id2);
|
|
31089
31089
|
null !== id2 && (oldPath = copyWithRename(id2.memoizedState, oldPath, newPath), id2.memoizedState = oldPath, id2.baseState = oldPath, fiber.memoizedProps = assign({}, fiber.memoizedProps), oldPath = enqueueConcurrentRenderForLane(fiber, 2), null !== oldPath && scheduleUpdateOnFiber(oldPath, fiber, 2));
|
|
31090
31090
|
};
|
|
31091
|
-
overrideProps = function(fiber,
|
|
31092
|
-
fiber.pendingProps = copyWithSetImpl(fiber.memoizedProps,
|
|
31091
|
+
overrideProps = function(fiber, path43, value) {
|
|
31092
|
+
fiber.pendingProps = copyWithSetImpl(fiber.memoizedProps, path43, 0, value);
|
|
31093
31093
|
fiber.alternate && (fiber.alternate.pendingProps = fiber.pendingProps);
|
|
31094
|
-
|
|
31095
|
-
null !==
|
|
31094
|
+
path43 = enqueueConcurrentRenderForLane(fiber, 2);
|
|
31095
|
+
null !== path43 && scheduleUpdateOnFiber(path43, fiber, 2);
|
|
31096
31096
|
};
|
|
31097
|
-
overridePropsDeletePath = function(fiber,
|
|
31098
|
-
fiber.pendingProps = copyWithDeleteImpl(fiber.memoizedProps,
|
|
31097
|
+
overridePropsDeletePath = function(fiber, path43) {
|
|
31098
|
+
fiber.pendingProps = copyWithDeleteImpl(fiber.memoizedProps, path43, 0);
|
|
31099
31099
|
fiber.alternate && (fiber.alternate.pendingProps = fiber.pendingProps);
|
|
31100
|
-
|
|
31101
|
-
null !==
|
|
31100
|
+
path43 = enqueueConcurrentRenderForLane(fiber, 2);
|
|
31101
|
+
null !== path43 && scheduleUpdateOnFiber(path43, fiber, 2);
|
|
31102
31102
|
};
|
|
31103
31103
|
overridePropsRenamePath = function(fiber, oldPath, newPath) {
|
|
31104
31104
|
fiber.pendingProps = copyWithRename(
|
|
@@ -31971,7 +31971,7 @@ var require_react_jsx_runtime_production = __commonJS({
|
|
|
31971
31971
|
init_esm_shims();
|
|
31972
31972
|
var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element");
|
|
31973
31973
|
var REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
31974
|
-
function jsxProd(
|
|
31974
|
+
function jsxProd(type2, config2, maybeKey) {
|
|
31975
31975
|
var key = null;
|
|
31976
31976
|
void 0 !== maybeKey && (key = "" + maybeKey);
|
|
31977
31977
|
void 0 !== config2.key && (key = "" + config2.key);
|
|
@@ -31983,7 +31983,7 @@ var require_react_jsx_runtime_production = __commonJS({
|
|
|
31983
31983
|
config2 = maybeKey.ref;
|
|
31984
31984
|
return {
|
|
31985
31985
|
$$typeof: REACT_ELEMENT_TYPE,
|
|
31986
|
-
type,
|
|
31986
|
+
type: type2,
|
|
31987
31987
|
key,
|
|
31988
31988
|
ref: void 0 !== config2 ? config2 : null,
|
|
31989
31989
|
props: maybeKey
|
|
@@ -32001,12 +32001,12 @@ var require_react_jsx_runtime_development = __commonJS({
|
|
|
32001
32001
|
"use strict";
|
|
32002
32002
|
init_esm_shims();
|
|
32003
32003
|
"production" !== process.env.NODE_ENV && (function() {
|
|
32004
|
-
function getComponentNameFromType(
|
|
32005
|
-
if (null ==
|
|
32006
|
-
if ("function" === typeof
|
|
32007
|
-
return
|
|
32008
|
-
if ("string" === typeof
|
|
32009
|
-
switch (
|
|
32004
|
+
function getComponentNameFromType(type2) {
|
|
32005
|
+
if (null == type2) return null;
|
|
32006
|
+
if ("function" === typeof type2)
|
|
32007
|
+
return type2.$$typeof === REACT_CLIENT_REFERENCE ? null : type2.displayName || type2.name || null;
|
|
32008
|
+
if ("string" === typeof type2) return type2;
|
|
32009
|
+
switch (type2) {
|
|
32010
32010
|
case REACT_FRAGMENT_TYPE:
|
|
32011
32011
|
return "Fragment";
|
|
32012
32012
|
case REACT_PROFILER_TYPE:
|
|
@@ -32020,28 +32020,28 @@ var require_react_jsx_runtime_development = __commonJS({
|
|
|
32020
32020
|
case REACT_ACTIVITY_TYPE:
|
|
32021
32021
|
return "Activity";
|
|
32022
32022
|
}
|
|
32023
|
-
if ("object" === typeof
|
|
32024
|
-
switch ("number" === typeof
|
|
32023
|
+
if ("object" === typeof type2)
|
|
32024
|
+
switch ("number" === typeof type2.tag && console.error(
|
|
32025
32025
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
32026
|
-
),
|
|
32026
|
+
), type2.$$typeof) {
|
|
32027
32027
|
case REACT_PORTAL_TYPE:
|
|
32028
32028
|
return "Portal";
|
|
32029
32029
|
case REACT_CONTEXT_TYPE:
|
|
32030
|
-
return
|
|
32030
|
+
return type2.displayName || "Context";
|
|
32031
32031
|
case REACT_CONSUMER_TYPE:
|
|
32032
|
-
return (
|
|
32032
|
+
return (type2._context.displayName || "Context") + ".Consumer";
|
|
32033
32033
|
case REACT_FORWARD_REF_TYPE:
|
|
32034
|
-
var innerType =
|
|
32035
|
-
|
|
32036
|
-
|
|
32037
|
-
return
|
|
32034
|
+
var innerType = type2.render;
|
|
32035
|
+
type2 = type2.displayName;
|
|
32036
|
+
type2 || (type2 = innerType.displayName || innerType.name || "", type2 = "" !== type2 ? "ForwardRef(" + type2 + ")" : "ForwardRef");
|
|
32037
|
+
return type2;
|
|
32038
32038
|
case REACT_MEMO_TYPE:
|
|
32039
|
-
return innerType =
|
|
32039
|
+
return innerType = type2.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type2.type) || "Memo";
|
|
32040
32040
|
case REACT_LAZY_TYPE:
|
|
32041
|
-
innerType =
|
|
32042
|
-
|
|
32041
|
+
innerType = type2._payload;
|
|
32042
|
+
type2 = type2._init;
|
|
32043
32043
|
try {
|
|
32044
|
-
return getComponentNameFromType(
|
|
32044
|
+
return getComponentNameFromType(type2(innerType));
|
|
32045
32045
|
} catch (x) {
|
|
32046
32046
|
}
|
|
32047
32047
|
}
|
|
@@ -32069,12 +32069,12 @@ var require_react_jsx_runtime_development = __commonJS({
|
|
|
32069
32069
|
return testStringCoercion(value);
|
|
32070
32070
|
}
|
|
32071
32071
|
}
|
|
32072
|
-
function getTaskName(
|
|
32073
|
-
if (
|
|
32074
|
-
if ("object" === typeof
|
|
32072
|
+
function getTaskName(type2) {
|
|
32073
|
+
if (type2 === REACT_FRAGMENT_TYPE) return "<>";
|
|
32074
|
+
if ("object" === typeof type2 && null !== type2 && type2.$$typeof === REACT_LAZY_TYPE)
|
|
32075
32075
|
return "<...>";
|
|
32076
32076
|
try {
|
|
32077
|
-
var name = getComponentNameFromType(
|
|
32077
|
+
var name = getComponentNameFromType(type2);
|
|
32078
32078
|
return name ? "<" + name + ">" : "<...>";
|
|
32079
32079
|
} catch (x) {
|
|
32080
32080
|
return "<...>";
|
|
@@ -32115,48 +32115,48 @@ var require_react_jsx_runtime_development = __commonJS({
|
|
|
32115
32115
|
componentName = this.props.ref;
|
|
32116
32116
|
return void 0 !== componentName ? componentName : null;
|
|
32117
32117
|
}
|
|
32118
|
-
function ReactElement(
|
|
32118
|
+
function ReactElement(type2, key, props, owner, debugStack, debugTask) {
|
|
32119
32119
|
var refProp = props.ref;
|
|
32120
|
-
|
|
32120
|
+
type2 = {
|
|
32121
32121
|
$$typeof: REACT_ELEMENT_TYPE,
|
|
32122
|
-
type,
|
|
32122
|
+
type: type2,
|
|
32123
32123
|
key,
|
|
32124
32124
|
props,
|
|
32125
32125
|
_owner: owner
|
|
32126
32126
|
};
|
|
32127
|
-
null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(
|
|
32127
|
+
null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type2, "ref", {
|
|
32128
32128
|
enumerable: false,
|
|
32129
32129
|
get: elementRefGetterWithDeprecationWarning
|
|
32130
|
-
}) : Object.defineProperty(
|
|
32131
|
-
|
|
32132
|
-
Object.defineProperty(
|
|
32130
|
+
}) : Object.defineProperty(type2, "ref", { enumerable: false, value: null });
|
|
32131
|
+
type2._store = {};
|
|
32132
|
+
Object.defineProperty(type2._store, "validated", {
|
|
32133
32133
|
configurable: false,
|
|
32134
32134
|
enumerable: false,
|
|
32135
32135
|
writable: true,
|
|
32136
32136
|
value: 0
|
|
32137
32137
|
});
|
|
32138
|
-
Object.defineProperty(
|
|
32138
|
+
Object.defineProperty(type2, "_debugInfo", {
|
|
32139
32139
|
configurable: false,
|
|
32140
32140
|
enumerable: false,
|
|
32141
32141
|
writable: true,
|
|
32142
32142
|
value: null
|
|
32143
32143
|
});
|
|
32144
|
-
Object.defineProperty(
|
|
32144
|
+
Object.defineProperty(type2, "_debugStack", {
|
|
32145
32145
|
configurable: false,
|
|
32146
32146
|
enumerable: false,
|
|
32147
32147
|
writable: true,
|
|
32148
32148
|
value: debugStack
|
|
32149
32149
|
});
|
|
32150
|
-
Object.defineProperty(
|
|
32150
|
+
Object.defineProperty(type2, "_debugTask", {
|
|
32151
32151
|
configurable: false,
|
|
32152
32152
|
enumerable: false,
|
|
32153
32153
|
writable: true,
|
|
32154
32154
|
value: debugTask
|
|
32155
32155
|
});
|
|
32156
|
-
Object.freeze && (Object.freeze(
|
|
32157
|
-
return
|
|
32156
|
+
Object.freeze && (Object.freeze(type2.props), Object.freeze(type2));
|
|
32157
|
+
return type2;
|
|
32158
32158
|
}
|
|
32159
|
-
function jsxDEVImpl(
|
|
32159
|
+
function jsxDEVImpl(type2, config2, maybeKey, isStaticChildren, debugStack, debugTask) {
|
|
32160
32160
|
var children = config2.children;
|
|
32161
32161
|
if (void 0 !== children)
|
|
32162
32162
|
if (isStaticChildren)
|
|
@@ -32170,7 +32170,7 @@ var require_react_jsx_runtime_development = __commonJS({
|
|
|
32170
32170
|
);
|
|
32171
32171
|
else validateChildKeys(children);
|
|
32172
32172
|
if (hasOwnProperty.call(config2, "key")) {
|
|
32173
|
-
children = getComponentNameFromType(
|
|
32173
|
+
children = getComponentNameFromType(type2);
|
|
32174
32174
|
var keys = Object.keys(config2).filter(function(k) {
|
|
32175
32175
|
return "key" !== k;
|
|
32176
32176
|
});
|
|
@@ -32193,10 +32193,10 @@ var require_react_jsx_runtime_development = __commonJS({
|
|
|
32193
32193
|
} else maybeKey = config2;
|
|
32194
32194
|
children && defineKeyPropWarningGetter(
|
|
32195
32195
|
maybeKey,
|
|
32196
|
-
"function" === typeof
|
|
32196
|
+
"function" === typeof type2 ? type2.displayName || type2.name || "Unknown" : type2
|
|
32197
32197
|
);
|
|
32198
32198
|
return ReactElement(
|
|
32199
|
-
|
|
32199
|
+
type2,
|
|
32200
32200
|
children,
|
|
32201
32201
|
maybeKey,
|
|
32202
32202
|
getOwner(),
|
|
@@ -32227,26 +32227,26 @@ var require_react_jsx_runtime_development = __commonJS({
|
|
|
32227
32227
|
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
|
32228
32228
|
var didWarnAboutKeySpread = {};
|
|
32229
32229
|
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
32230
|
-
exports.jsx = function(
|
|
32230
|
+
exports.jsx = function(type2, config2, maybeKey) {
|
|
32231
32231
|
var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
|
32232
32232
|
return jsxDEVImpl(
|
|
32233
|
-
|
|
32233
|
+
type2,
|
|
32234
32234
|
config2,
|
|
32235
32235
|
maybeKey,
|
|
32236
32236
|
false,
|
|
32237
32237
|
trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
|
|
32238
|
-
trackActualOwner ? createTask(getTaskName(
|
|
32238
|
+
trackActualOwner ? createTask(getTaskName(type2)) : unknownOwnerDebugTask
|
|
32239
32239
|
);
|
|
32240
32240
|
};
|
|
32241
|
-
exports.jsxs = function(
|
|
32241
|
+
exports.jsxs = function(type2, config2, maybeKey) {
|
|
32242
32242
|
var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
|
32243
32243
|
return jsxDEVImpl(
|
|
32244
|
-
|
|
32244
|
+
type2,
|
|
32245
32245
|
config2,
|
|
32246
32246
|
maybeKey,
|
|
32247
32247
|
true,
|
|
32248
32248
|
trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
|
|
32249
|
-
trackActualOwner ? createTask(getTaskName(
|
|
32249
|
+
trackActualOwner ? createTask(getTaskName(type2)) : unknownOwnerDebugTask
|
|
32250
32250
|
);
|
|
32251
32251
|
};
|
|
32252
32252
|
})();
|
|
@@ -32284,8 +32284,8 @@ var require_core3 = __commonJS({
|
|
|
32284
32284
|
Object.freeze(obj);
|
|
32285
32285
|
Object.getOwnPropertyNames(obj).forEach((name) => {
|
|
32286
32286
|
const prop = obj[name];
|
|
32287
|
-
const
|
|
32288
|
-
if ((
|
|
32287
|
+
const type2 = typeof prop;
|
|
32288
|
+
if ((type2 === "object" || type2 === "function") && !Object.isFrozen(prop)) {
|
|
32289
32289
|
deepFreeze(prop);
|
|
32290
32290
|
}
|
|
32291
32291
|
});
|
|
@@ -33892,13 +33892,13 @@ var castToError = (err) => {
|
|
|
33892
33892
|
var AnthropicError = class extends Error {
|
|
33893
33893
|
};
|
|
33894
33894
|
var APIError = class _APIError extends AnthropicError {
|
|
33895
|
-
constructor(status, error51, message, headers,
|
|
33895
|
+
constructor(status, error51, message, headers, type2) {
|
|
33896
33896
|
super(`${_APIError.makeMessage(status, error51, message)}`);
|
|
33897
33897
|
this.status = status;
|
|
33898
33898
|
this.headers = headers;
|
|
33899
33899
|
this.requestID = headers?.get("request-id");
|
|
33900
33900
|
this.error = error51;
|
|
33901
|
-
this.type =
|
|
33901
|
+
this.type = type2 ?? null;
|
|
33902
33902
|
}
|
|
33903
33903
|
static makeMessage(status, error51, message) {
|
|
33904
33904
|
const msg = error51?.message ? typeof error51.message === "string" ? error51.message : JSON.stringify(error51.message) : error51 ? JSON.stringify(error51) : message;
|
|
@@ -33918,32 +33918,32 @@ var APIError = class _APIError extends AnthropicError {
|
|
|
33918
33918
|
return new APIConnectionError({ message, cause: castToError(errorResponse) });
|
|
33919
33919
|
}
|
|
33920
33920
|
const error51 = errorResponse;
|
|
33921
|
-
const
|
|
33921
|
+
const type2 = error51?.["error"]?.["type"];
|
|
33922
33922
|
if (status === 400) {
|
|
33923
|
-
return new BadRequestError(status, error51, message, headers,
|
|
33923
|
+
return new BadRequestError(status, error51, message, headers, type2);
|
|
33924
33924
|
}
|
|
33925
33925
|
if (status === 401) {
|
|
33926
|
-
return new AuthenticationError(status, error51, message, headers,
|
|
33926
|
+
return new AuthenticationError(status, error51, message, headers, type2);
|
|
33927
33927
|
}
|
|
33928
33928
|
if (status === 403) {
|
|
33929
|
-
return new PermissionDeniedError(status, error51, message, headers,
|
|
33929
|
+
return new PermissionDeniedError(status, error51, message, headers, type2);
|
|
33930
33930
|
}
|
|
33931
33931
|
if (status === 404) {
|
|
33932
|
-
return new NotFoundError(status, error51, message, headers,
|
|
33932
|
+
return new NotFoundError(status, error51, message, headers, type2);
|
|
33933
33933
|
}
|
|
33934
33934
|
if (status === 409) {
|
|
33935
|
-
return new ConflictError(status, error51, message, headers,
|
|
33935
|
+
return new ConflictError(status, error51, message, headers, type2);
|
|
33936
33936
|
}
|
|
33937
33937
|
if (status === 422) {
|
|
33938
|
-
return new UnprocessableEntityError(status, error51, message, headers,
|
|
33938
|
+
return new UnprocessableEntityError(status, error51, message, headers, type2);
|
|
33939
33939
|
}
|
|
33940
33940
|
if (status === 429) {
|
|
33941
|
-
return new RateLimitError(status, error51, message, headers,
|
|
33941
|
+
return new RateLimitError(status, error51, message, headers, type2);
|
|
33942
33942
|
}
|
|
33943
33943
|
if (status >= 500) {
|
|
33944
|
-
return new InternalServerError(status, error51, message, headers,
|
|
33944
|
+
return new InternalServerError(status, error51, message, headers, type2);
|
|
33945
33945
|
}
|
|
33946
|
-
return new _APIError(status, error51, message, headers,
|
|
33946
|
+
return new _APIError(status, error51, message, headers, type2);
|
|
33947
33947
|
}
|
|
33948
33948
|
};
|
|
33949
33949
|
var APIUserAbortError = class extends APIError {
|
|
@@ -34127,17 +34127,17 @@ function getBrowserInfo() {
|
|
|
34127
34127
|
}
|
|
34128
34128
|
return null;
|
|
34129
34129
|
}
|
|
34130
|
-
var normalizeArch = (
|
|
34131
|
-
if (
|
|
34130
|
+
var normalizeArch = (arch2) => {
|
|
34131
|
+
if (arch2 === "x32")
|
|
34132
34132
|
return "x32";
|
|
34133
|
-
if (
|
|
34133
|
+
if (arch2 === "x86_64" || arch2 === "x64")
|
|
34134
34134
|
return "x64";
|
|
34135
|
-
if (
|
|
34135
|
+
if (arch2 === "arm")
|
|
34136
34136
|
return "arm";
|
|
34137
|
-
if (
|
|
34137
|
+
if (arch2 === "aarch64" || arch2 === "arm64")
|
|
34138
34138
|
return "arm64";
|
|
34139
|
-
if (
|
|
34140
|
-
return `other:${
|
|
34139
|
+
if (arch2)
|
|
34140
|
+
return `other:${arch2}`;
|
|
34141
34141
|
return "unknown";
|
|
34142
34142
|
};
|
|
34143
34143
|
var normalizePlatform = (platform2) => {
|
|
@@ -34333,14 +34333,14 @@ function redactSensitive(body) {
|
|
|
34333
34333
|
}
|
|
34334
34334
|
return null;
|
|
34335
34335
|
}
|
|
34336
|
-
async function checkCredentialsFileSafety(
|
|
34336
|
+
async function checkCredentialsFileSafety(path43, onWarn = (m) => console.warn(`anthropic-sdk: ${m}`)) {
|
|
34337
34337
|
if (typeof process === "undefined" || process.platform === "win32")
|
|
34338
34338
|
return;
|
|
34339
34339
|
const fs36 = await import("fs");
|
|
34340
|
-
let resolved =
|
|
34340
|
+
let resolved = path43;
|
|
34341
34341
|
let st;
|
|
34342
34342
|
try {
|
|
34343
|
-
resolved = await fs36.promises.realpath(
|
|
34343
|
+
resolved = await fs36.promises.realpath(path43);
|
|
34344
34344
|
st = await fs36.promises.stat(resolved);
|
|
34345
34345
|
} catch {
|
|
34346
34346
|
return;
|
|
@@ -34358,8 +34358,8 @@ async function checkCredentialsFileSafety(path42, onWarn = (m) => console.warn(`
|
|
|
34358
34358
|
}
|
|
34359
34359
|
async function writeCredentialsFileAtomic(targetPath, data) {
|
|
34360
34360
|
const fs36 = await import("fs");
|
|
34361
|
-
const
|
|
34362
|
-
const dir =
|
|
34361
|
+
const path43 = await import("path");
|
|
34362
|
+
const dir = path43.dirname(targetPath);
|
|
34363
34363
|
await fs36.promises.mkdir(dir, { recursive: true, mode: 448 });
|
|
34364
34364
|
const tmpPath = `${targetPath}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;
|
|
34365
34365
|
try {
|
|
@@ -34680,8 +34680,8 @@ var loadConfigWithSource = async (profile) => {
|
|
|
34680
34680
|
}
|
|
34681
34681
|
validateProfileName(profileName);
|
|
34682
34682
|
const fs36 = await import("fs");
|
|
34683
|
-
const
|
|
34684
|
-
const configPath =
|
|
34683
|
+
const path43 = await import("path");
|
|
34684
|
+
const configPath = path43.join(rootConfigPath, "configs", `${profileName}.json`);
|
|
34685
34685
|
let configRaw;
|
|
34686
34686
|
try {
|
|
34687
34687
|
configRaw = await fs36.promises.readFile(configPath, "utf-8");
|
|
@@ -34765,37 +34765,37 @@ var getCredentialsPath = async (config2, profile) => {
|
|
|
34765
34765
|
return null;
|
|
34766
34766
|
}
|
|
34767
34767
|
validateProfileName(profileName);
|
|
34768
|
-
const
|
|
34769
|
-
return
|
|
34768
|
+
const path43 = await import("path");
|
|
34769
|
+
return path43.join(rootConfigPath, "credentials", `${profileName}.json`);
|
|
34770
34770
|
};
|
|
34771
34771
|
var getRootConfigPath = async () => {
|
|
34772
34772
|
if (!supportsLocalConfigFiles()) {
|
|
34773
34773
|
return null;
|
|
34774
34774
|
}
|
|
34775
|
-
const
|
|
34775
|
+
const path43 = await import("path");
|
|
34776
34776
|
const configDir = readEnv("ANTHROPIC_CONFIG_DIR");
|
|
34777
34777
|
if (configDir) {
|
|
34778
34778
|
return configDir;
|
|
34779
34779
|
}
|
|
34780
|
-
const
|
|
34781
|
-
if (
|
|
34780
|
+
const os12 = getPlatformHeaders()["X-Stainless-OS"];
|
|
34781
|
+
if (os12 === "Windows") {
|
|
34782
34782
|
const appData = readEnv("APPDATA");
|
|
34783
34783
|
if (appData) {
|
|
34784
|
-
return
|
|
34784
|
+
return path43.join(appData, "Anthropic");
|
|
34785
34785
|
}
|
|
34786
34786
|
const userProfile = readEnv("USERPROFILE");
|
|
34787
34787
|
if (userProfile) {
|
|
34788
|
-
return
|
|
34788
|
+
return path43.join(userProfile, "AppData", "Roaming", "Anthropic");
|
|
34789
34789
|
}
|
|
34790
34790
|
return null;
|
|
34791
34791
|
}
|
|
34792
34792
|
const xdgConfigHome = readEnv("XDG_CONFIG_HOME");
|
|
34793
34793
|
if (xdgConfigHome) {
|
|
34794
|
-
return
|
|
34794
|
+
return path43.join(xdgConfigHome, "anthropic");
|
|
34795
34795
|
}
|
|
34796
34796
|
const home = readEnv("HOME");
|
|
34797
34797
|
if (home) {
|
|
34798
|
-
return
|
|
34798
|
+
return path43.join(home, ".config", "anthropic");
|
|
34799
34799
|
}
|
|
34800
34800
|
return null;
|
|
34801
34801
|
};
|
|
@@ -34813,8 +34813,8 @@ var getActiveProfileName = async () => {
|
|
|
34813
34813
|
return profileName;
|
|
34814
34814
|
}
|
|
34815
34815
|
const fs36 = await import("fs");
|
|
34816
|
-
const
|
|
34817
|
-
const filePath =
|
|
34816
|
+
const path43 = await import("path");
|
|
34817
|
+
const filePath = path43.join(rootConfigPath, "active_config");
|
|
34818
34818
|
try {
|
|
34819
34819
|
return (await fs36.promises.readFile(filePath, "utf-8")).trim() || "default";
|
|
34820
34820
|
} catch (err) {
|
|
@@ -34827,21 +34827,21 @@ var getActiveProfileName = async () => {
|
|
|
34827
34827
|
|
|
34828
34828
|
// ../../node_modules/.pnpm/@anthropic-ai+sdk@0.94.0_zod@4.4.3/node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.mjs
|
|
34829
34829
|
init_esm_shims();
|
|
34830
|
-
function identityTokenFromFile(
|
|
34831
|
-
if (!
|
|
34830
|
+
function identityTokenFromFile(path43) {
|
|
34831
|
+
if (!path43) {
|
|
34832
34832
|
throw new AnthropicError("Identity token file path is empty");
|
|
34833
34833
|
}
|
|
34834
34834
|
return async () => {
|
|
34835
34835
|
const fs36 = await import("fs");
|
|
34836
34836
|
let content;
|
|
34837
34837
|
try {
|
|
34838
|
-
content = await fs36.promises.readFile(
|
|
34838
|
+
content = await fs36.promises.readFile(path43, "utf-8");
|
|
34839
34839
|
} catch (err) {
|
|
34840
|
-
throw new AnthropicError(`Failed to read identity token file at ${
|
|
34840
|
+
throw new AnthropicError(`Failed to read identity token file at ${path43}: ${err}`);
|
|
34841
34841
|
}
|
|
34842
34842
|
const token = content.trim();
|
|
34843
34843
|
if (!token) {
|
|
34844
|
-
throw new AnthropicError(`Identity token file at ${
|
|
34844
|
+
throw new AnthropicError(`Identity token file at ${path43} is empty`);
|
|
34845
34845
|
}
|
|
34846
34846
|
return token;
|
|
34847
34847
|
};
|
|
@@ -35249,8 +35249,8 @@ var Stream = class _Stream {
|
|
|
35249
35249
|
}
|
|
35250
35250
|
if (sse.event === "error") {
|
|
35251
35251
|
const body = safeJSON(sse.data) ?? sse.data;
|
|
35252
|
-
const
|
|
35253
|
-
throw new APIError(void 0, body, void 0, response.headers,
|
|
35252
|
+
const type2 = body?.error?.type;
|
|
35253
|
+
throw new APIError(void 0, body, void 0, response.headers, type2);
|
|
35254
35254
|
}
|
|
35255
35255
|
}
|
|
35256
35256
|
done = true;
|
|
@@ -35806,9 +35806,9 @@ async function toFile(value, name, options) {
|
|
|
35806
35806
|
}
|
|
35807
35807
|
const parts = await getBytes(value);
|
|
35808
35808
|
if (!options?.type) {
|
|
35809
|
-
const
|
|
35810
|
-
if (typeof
|
|
35811
|
-
options = { ...options, type };
|
|
35809
|
+
const type2 = parts.find((part) => typeof part === "object" && "type" in part && part.type);
|
|
35810
|
+
if (typeof type2 === "string") {
|
|
35811
|
+
options = { ...options, type: type2 };
|
|
35812
35812
|
}
|
|
35813
35813
|
}
|
|
35814
35814
|
return makeFile(parts, name, options);
|
|
@@ -35927,12 +35927,12 @@ function encodeURIPath(str2) {
|
|
|
35927
35927
|
return str2.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent);
|
|
35928
35928
|
}
|
|
35929
35929
|
var EMPTY = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null));
|
|
35930
|
-
var createPathTagFunction = (pathEncoder = encodeURIPath) => function
|
|
35930
|
+
var createPathTagFunction = (pathEncoder = encodeURIPath) => function path43(statics, ...params) {
|
|
35931
35931
|
if (statics.length === 1)
|
|
35932
35932
|
return statics[0];
|
|
35933
35933
|
let postPath = false;
|
|
35934
35934
|
const invalidSegments = [];
|
|
35935
|
-
const
|
|
35935
|
+
const path44 = statics.reduce((previousValue, currentValue, index) => {
|
|
35936
35936
|
if (/[?#]/.test(currentValue)) {
|
|
35937
35937
|
postPath = true;
|
|
35938
35938
|
}
|
|
@@ -35949,7 +35949,7 @@ var createPathTagFunction = (pathEncoder = encodeURIPath) => function path42(sta
|
|
|
35949
35949
|
}
|
|
35950
35950
|
return previousValue + currentValue + (index === params.length ? "" : encoded);
|
|
35951
35951
|
}, "");
|
|
35952
|
-
const pathOnly =
|
|
35952
|
+
const pathOnly = path44.split(/[?#]/, 1)[0];
|
|
35953
35953
|
const invalidSegmentPattern = /(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;
|
|
35954
35954
|
let match;
|
|
35955
35955
|
while ((match = invalidSegmentPattern.exec(pathOnly)) !== null) {
|
|
@@ -35970,10 +35970,10 @@ var createPathTagFunction = (pathEncoder = encodeURIPath) => function path42(sta
|
|
|
35970
35970
|
}, "");
|
|
35971
35971
|
throw new AnthropicError(`Path parameters result in path with invalid segments:
|
|
35972
35972
|
${invalidSegments.map((e) => e.error).join("\n")}
|
|
35973
|
-
${
|
|
35973
|
+
${path44}
|
|
35974
35974
|
${underline}`);
|
|
35975
35975
|
}
|
|
35976
|
-
return
|
|
35976
|
+
return path44;
|
|
35977
35977
|
};
|
|
35978
35978
|
var path = /* @__PURE__ */ createPathTagFunction(encodeURIPath);
|
|
35979
35979
|
|
|
@@ -40734,9 +40734,9 @@ var BaseAnthropic = class {
|
|
|
40734
40734
|
makeStatusError(status, error51, message, headers) {
|
|
40735
40735
|
return APIError.generate(status, error51, message, headers);
|
|
40736
40736
|
}
|
|
40737
|
-
buildURL(
|
|
40737
|
+
buildURL(path43, query, defaultBaseURL) {
|
|
40738
40738
|
const baseURL = !__classPrivateFieldGet(this, _BaseAnthropic_instances, "m", _BaseAnthropic_baseURLOverridden).call(this) && defaultBaseURL || this.baseURL;
|
|
40739
|
-
const url2 = isAbsoluteURL(
|
|
40739
|
+
const url2 = isAbsoluteURL(path43) ? new URL(path43) : new URL(baseURL + (baseURL.endsWith("/") && path43.startsWith("/") ? path43.slice(1) : path43));
|
|
40740
40740
|
const defaultQuery = this.defaultQuery();
|
|
40741
40741
|
const pathQuery = Object.fromEntries(url2.searchParams);
|
|
40742
40742
|
if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) {
|
|
@@ -40780,24 +40780,24 @@ var BaseAnthropic = class {
|
|
|
40780
40780
|
request.headers = headers;
|
|
40781
40781
|
}
|
|
40782
40782
|
}
|
|
40783
|
-
get(
|
|
40784
|
-
return this.methodRequest("get",
|
|
40783
|
+
get(path43, opts) {
|
|
40784
|
+
return this.methodRequest("get", path43, opts);
|
|
40785
40785
|
}
|
|
40786
|
-
post(
|
|
40787
|
-
return this.methodRequest("post",
|
|
40786
|
+
post(path43, opts) {
|
|
40787
|
+
return this.methodRequest("post", path43, opts);
|
|
40788
40788
|
}
|
|
40789
|
-
patch(
|
|
40790
|
-
return this.methodRequest("patch",
|
|
40789
|
+
patch(path43, opts) {
|
|
40790
|
+
return this.methodRequest("patch", path43, opts);
|
|
40791
40791
|
}
|
|
40792
|
-
put(
|
|
40793
|
-
return this.methodRequest("put",
|
|
40792
|
+
put(path43, opts) {
|
|
40793
|
+
return this.methodRequest("put", path43, opts);
|
|
40794
40794
|
}
|
|
40795
|
-
delete(
|
|
40796
|
-
return this.methodRequest("delete",
|
|
40795
|
+
delete(path43, opts) {
|
|
40796
|
+
return this.methodRequest("delete", path43, opts);
|
|
40797
40797
|
}
|
|
40798
|
-
methodRequest(method,
|
|
40798
|
+
methodRequest(method, path43, opts) {
|
|
40799
40799
|
return this.request(Promise.resolve(opts).then((opts2) => {
|
|
40800
|
-
return { method, path:
|
|
40800
|
+
return { method, path: path43, ...opts2 };
|
|
40801
40801
|
}));
|
|
40802
40802
|
}
|
|
40803
40803
|
request(options, remainingRetries = null) {
|
|
@@ -40902,8 +40902,8 @@ var BaseAnthropic = class {
|
|
|
40902
40902
|
}));
|
|
40903
40903
|
return { response, options, controller, requestLogID, retryOfRequestLogID, startTime };
|
|
40904
40904
|
}
|
|
40905
|
-
getAPIList(
|
|
40906
|
-
return this.requestAPIList(Page3, opts && "then" in opts ? opts.then((opts2) => ({ method: "get", path:
|
|
40905
|
+
getAPIList(path43, Page3, opts) {
|
|
40906
|
+
return this.requestAPIList(Page3, opts && "then" in opts ? opts.then((opts2) => ({ method: "get", path: path43, ...opts2 })) : { method: "get", path: path43, ...opts });
|
|
40907
40907
|
}
|
|
40908
40908
|
requestAPIList(Page3, options) {
|
|
40909
40909
|
const request = this.makeRequest(options, null, void 0);
|
|
@@ -40997,14 +40997,14 @@ var BaseAnthropic = class {
|
|
|
40997
40997
|
}
|
|
40998
40998
|
async buildRequest(inputOptions, { retryCount = 0 } = {}) {
|
|
40999
40999
|
const options = { ...inputOptions };
|
|
41000
|
-
const { method, path:
|
|
41000
|
+
const { method, path: path43, query, defaultBaseURL } = options;
|
|
41001
41001
|
if (this._authState.resolution) {
|
|
41002
41002
|
await this._authState.resolution;
|
|
41003
41003
|
}
|
|
41004
41004
|
if (!this._baseURLIsExplicit && this._authState.baseURL && this.baseURL !== this._authState.baseURL) {
|
|
41005
41005
|
this.baseURL = this._authState.baseURL;
|
|
41006
41006
|
}
|
|
41007
|
-
const url2 = this.buildURL(
|
|
41007
|
+
const url2 = this.buildURL(path43, query, defaultBaseURL);
|
|
41008
41008
|
if ("timeout" in options)
|
|
41009
41009
|
validatePositiveInteger("timeout", options.timeout);
|
|
41010
41010
|
options.timeout = options.timeout ?? this.timeout;
|
|
@@ -41891,10 +41891,10 @@ function mergeDefs(...defs) {
|
|
|
41891
41891
|
function cloneDef(schema) {
|
|
41892
41892
|
return mergeDefs(schema._zod.def);
|
|
41893
41893
|
}
|
|
41894
|
-
function getElementAtPath(obj,
|
|
41895
|
-
if (!
|
|
41894
|
+
function getElementAtPath(obj, path43) {
|
|
41895
|
+
if (!path43)
|
|
41896
41896
|
return obj;
|
|
41897
|
-
return
|
|
41897
|
+
return path43.reduce((acc, key) => acc?.[key], obj);
|
|
41898
41898
|
}
|
|
41899
41899
|
function promiseAllObject(promisesObj) {
|
|
41900
41900
|
const keys = Object.keys(promisesObj);
|
|
@@ -42303,11 +42303,11 @@ function explicitlyAborted(x, startIndex = 0) {
|
|
|
42303
42303
|
}
|
|
42304
42304
|
return false;
|
|
42305
42305
|
}
|
|
42306
|
-
function prefixIssues(
|
|
42306
|
+
function prefixIssues(path43, issues) {
|
|
42307
42307
|
return issues.map((iss) => {
|
|
42308
42308
|
var _a6;
|
|
42309
42309
|
(_a6 = iss).path ?? (_a6.path = []);
|
|
42310
|
-
iss.path.unshift(
|
|
42310
|
+
iss.path.unshift(path43);
|
|
42311
42311
|
return iss;
|
|
42312
42312
|
});
|
|
42313
42313
|
}
|
|
@@ -42454,16 +42454,16 @@ function flattenError(error51, mapper = (issue2) => issue2.message) {
|
|
|
42454
42454
|
}
|
|
42455
42455
|
function formatError(error51, mapper = (issue2) => issue2.message) {
|
|
42456
42456
|
const fieldErrors = { _errors: [] };
|
|
42457
|
-
const processError = (error52,
|
|
42457
|
+
const processError = (error52, path43 = []) => {
|
|
42458
42458
|
for (const issue2 of error52.issues) {
|
|
42459
42459
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
42460
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
42460
|
+
issue2.errors.map((issues) => processError({ issues }, [...path43, ...issue2.path]));
|
|
42461
42461
|
} else if (issue2.code === "invalid_key") {
|
|
42462
|
-
processError({ issues: issue2.issues }, [...
|
|
42462
|
+
processError({ issues: issue2.issues }, [...path43, ...issue2.path]);
|
|
42463
42463
|
} else if (issue2.code === "invalid_element") {
|
|
42464
|
-
processError({ issues: issue2.issues }, [...
|
|
42464
|
+
processError({ issues: issue2.issues }, [...path43, ...issue2.path]);
|
|
42465
42465
|
} else {
|
|
42466
|
-
const fullpath = [...
|
|
42466
|
+
const fullpath = [...path43, ...issue2.path];
|
|
42467
42467
|
if (fullpath.length === 0) {
|
|
42468
42468
|
fieldErrors._errors.push(mapper(issue2));
|
|
42469
42469
|
} else {
|
|
@@ -42490,17 +42490,17 @@ function formatError(error51, mapper = (issue2) => issue2.message) {
|
|
|
42490
42490
|
}
|
|
42491
42491
|
function treeifyError(error51, mapper = (issue2) => issue2.message) {
|
|
42492
42492
|
const result = { errors: [] };
|
|
42493
|
-
const processError = (error52,
|
|
42493
|
+
const processError = (error52, path43 = []) => {
|
|
42494
42494
|
var _a6, _b;
|
|
42495
42495
|
for (const issue2 of error52.issues) {
|
|
42496
42496
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
42497
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
42497
|
+
issue2.errors.map((issues) => processError({ issues }, [...path43, ...issue2.path]));
|
|
42498
42498
|
} else if (issue2.code === "invalid_key") {
|
|
42499
|
-
processError({ issues: issue2.issues }, [...
|
|
42499
|
+
processError({ issues: issue2.issues }, [...path43, ...issue2.path]);
|
|
42500
42500
|
} else if (issue2.code === "invalid_element") {
|
|
42501
|
-
processError({ issues: issue2.issues }, [...
|
|
42501
|
+
processError({ issues: issue2.issues }, [...path43, ...issue2.path]);
|
|
42502
42502
|
} else {
|
|
42503
|
-
const fullpath = [...
|
|
42503
|
+
const fullpath = [...path43, ...issue2.path];
|
|
42504
42504
|
if (fullpath.length === 0) {
|
|
42505
42505
|
result.errors.push(mapper(issue2));
|
|
42506
42506
|
continue;
|
|
@@ -42532,8 +42532,8 @@ function treeifyError(error51, mapper = (issue2) => issue2.message) {
|
|
|
42532
42532
|
}
|
|
42533
42533
|
function toDotPath(_path) {
|
|
42534
42534
|
const segs = [];
|
|
42535
|
-
const
|
|
42536
|
-
for (const seg of
|
|
42535
|
+
const path43 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
42536
|
+
for (const seg of path43) {
|
|
42537
42537
|
if (typeof seg === "number")
|
|
42538
42538
|
segs.push(`[${seg}]`);
|
|
42539
42539
|
else if (typeof seg === "symbol")
|
|
@@ -55306,13 +55306,13 @@ function resolveRef(ref, ctx) {
|
|
|
55306
55306
|
if (!ref.startsWith("#")) {
|
|
55307
55307
|
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
55308
55308
|
}
|
|
55309
|
-
const
|
|
55310
|
-
if (
|
|
55309
|
+
const path43 = ref.slice(1).split("/").filter(Boolean);
|
|
55310
|
+
if (path43.length === 0) {
|
|
55311
55311
|
return ctx.rootSchema;
|
|
55312
55312
|
}
|
|
55313
55313
|
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
55314
|
-
if (
|
|
55315
|
-
const key =
|
|
55314
|
+
if (path43[0] === defsKey) {
|
|
55315
|
+
const key = path43[1];
|
|
55316
55316
|
if (!key || !ctx.defs[key]) {
|
|
55317
55317
|
throw new Error(`Reference not found: ${ref}`);
|
|
55318
55318
|
}
|
|
@@ -55382,9 +55382,9 @@ function convertBaseSchema(schema, ctx) {
|
|
|
55382
55382
|
if (schema.const !== void 0) {
|
|
55383
55383
|
return z.literal(schema.const);
|
|
55384
55384
|
}
|
|
55385
|
-
const
|
|
55386
|
-
if (Array.isArray(
|
|
55387
|
-
const typeSchemas =
|
|
55385
|
+
const type2 = schema.type;
|
|
55386
|
+
if (Array.isArray(type2)) {
|
|
55387
|
+
const typeSchemas = type2.map((t) => {
|
|
55388
55388
|
const typeSchema = { ...schema, type: t };
|
|
55389
55389
|
return convertBaseSchema(typeSchema, ctx);
|
|
55390
55390
|
});
|
|
@@ -55396,11 +55396,11 @@ function convertBaseSchema(schema, ctx) {
|
|
|
55396
55396
|
}
|
|
55397
55397
|
return z.union(typeSchemas);
|
|
55398
55398
|
}
|
|
55399
|
-
if (!
|
|
55399
|
+
if (!type2) {
|
|
55400
55400
|
return z.any();
|
|
55401
55401
|
}
|
|
55402
55402
|
let zodSchema;
|
|
55403
|
-
switch (
|
|
55403
|
+
switch (type2) {
|
|
55404
55404
|
case "string": {
|
|
55405
55405
|
let stringSchema = z.string();
|
|
55406
55406
|
if (schema.format) {
|
|
@@ -55467,7 +55467,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
55467
55467
|
}
|
|
55468
55468
|
case "number":
|
|
55469
55469
|
case "integer": {
|
|
55470
|
-
let numberSchema =
|
|
55470
|
+
let numberSchema = type2 === "integer" ? z.number().int() : z.number();
|
|
55471
55471
|
if (typeof schema.minimum === "number") {
|
|
55472
55472
|
numberSchema = numberSchema.min(schema.minimum);
|
|
55473
55473
|
}
|
|
@@ -55602,7 +55602,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
55602
55602
|
break;
|
|
55603
55603
|
}
|
|
55604
55604
|
default:
|
|
55605
|
-
throw new Error(`Unsupported type: ${
|
|
55605
|
+
throw new Error(`Unsupported type: ${type2}`);
|
|
55606
55606
|
}
|
|
55607
55607
|
return zodSchema;
|
|
55608
55608
|
}
|
|
@@ -56081,17 +56081,17 @@ function getBrowserInfo2() {
|
|
|
56081
56081
|
}
|
|
56082
56082
|
return null;
|
|
56083
56083
|
}
|
|
56084
|
-
var normalizeArch2 = (
|
|
56085
|
-
if (
|
|
56084
|
+
var normalizeArch2 = (arch2) => {
|
|
56085
|
+
if (arch2 === "x32")
|
|
56086
56086
|
return "x32";
|
|
56087
|
-
if (
|
|
56087
|
+
if (arch2 === "x86_64" || arch2 === "x64")
|
|
56088
56088
|
return "x64";
|
|
56089
|
-
if (
|
|
56089
|
+
if (arch2 === "arm")
|
|
56090
56090
|
return "arm";
|
|
56091
|
-
if (
|
|
56091
|
+
if (arch2 === "aarch64" || arch2 === "arm64")
|
|
56092
56092
|
return "arm64";
|
|
56093
|
-
if (
|
|
56094
|
-
return `other:${
|
|
56093
|
+
if (arch2)
|
|
56094
|
+
return `other:${arch2}`;
|
|
56095
56095
|
return "unknown";
|
|
56096
56096
|
};
|
|
56097
56097
|
var normalizePlatform2 = (platform2) => {
|
|
@@ -57481,9 +57481,9 @@ async function toFile2(value, name, options) {
|
|
|
57481
57481
|
const parts = await getBytes2(value);
|
|
57482
57482
|
name || (name = getName2(value));
|
|
57483
57483
|
if (!options?.type) {
|
|
57484
|
-
const
|
|
57485
|
-
if (typeof
|
|
57486
|
-
options = { ...options, type };
|
|
57484
|
+
const type2 = parts.find((part) => typeof part === "object" && "type" in part && part.type);
|
|
57485
|
+
if (typeof type2 === "string") {
|
|
57486
|
+
options = { ...options, type: type2 };
|
|
57487
57487
|
}
|
|
57488
57488
|
}
|
|
57489
57489
|
return makeFile2(parts, name, options);
|
|
@@ -57541,12 +57541,12 @@ function encodeURIPath2(str2) {
|
|
|
57541
57541
|
return str2.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent);
|
|
57542
57542
|
}
|
|
57543
57543
|
var EMPTY2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null));
|
|
57544
|
-
var createPathTagFunction2 = (pathEncoder = encodeURIPath2) => function
|
|
57544
|
+
var createPathTagFunction2 = (pathEncoder = encodeURIPath2) => function path43(statics, ...params) {
|
|
57545
57545
|
if (statics.length === 1)
|
|
57546
57546
|
return statics[0];
|
|
57547
57547
|
let postPath = false;
|
|
57548
57548
|
const invalidSegments = [];
|
|
57549
|
-
const
|
|
57549
|
+
const path44 = statics.reduce((previousValue, currentValue, index) => {
|
|
57550
57550
|
if (/[?#]/.test(currentValue)) {
|
|
57551
57551
|
postPath = true;
|
|
57552
57552
|
}
|
|
@@ -57563,7 +57563,7 @@ var createPathTagFunction2 = (pathEncoder = encodeURIPath2) => function path42(s
|
|
|
57563
57563
|
}
|
|
57564
57564
|
return previousValue + currentValue + (index === params.length ? "" : encoded);
|
|
57565
57565
|
}, "");
|
|
57566
|
-
const pathOnly =
|
|
57566
|
+
const pathOnly = path44.split(/[?#]/, 1)[0];
|
|
57567
57567
|
const invalidSegmentPattern = /(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;
|
|
57568
57568
|
let match;
|
|
57569
57569
|
while ((match = invalidSegmentPattern.exec(pathOnly)) !== null) {
|
|
@@ -57584,10 +57584,10 @@ var createPathTagFunction2 = (pathEncoder = encodeURIPath2) => function path42(s
|
|
|
57584
57584
|
}, "");
|
|
57585
57585
|
throw new OpenAIError(`Path parameters result in path with invalid segments:
|
|
57586
57586
|
${invalidSegments.map((e) => e.error).join("\n")}
|
|
57587
|
-
${
|
|
57587
|
+
${path44}
|
|
57588
57588
|
${underline}`);
|
|
57589
57589
|
}
|
|
57590
|
-
return
|
|
57590
|
+
return path44;
|
|
57591
57591
|
};
|
|
57592
57592
|
var path2 = /* @__PURE__ */ createPathTagFunction2(encodeURIPath2);
|
|
57593
57593
|
|
|
@@ -58755,13 +58755,13 @@ var ChatCompletionStream = class _ChatCompletionStream extends AbstractChatCompl
|
|
|
58755
58755
|
if (tool_calls) {
|
|
58756
58756
|
if (!choice.message.tool_calls)
|
|
58757
58757
|
choice.message.tool_calls = [];
|
|
58758
|
-
for (const { index: index2, id: id2, type, function: fn, ...rest3 } of tool_calls) {
|
|
58758
|
+
for (const { index: index2, id: id2, type: type2, function: fn, ...rest3 } of tool_calls) {
|
|
58759
58759
|
const tool_call = (_d = choice.message.tool_calls)[index2] ?? (_d[index2] = {});
|
|
58760
58760
|
Object.assign(tool_call, rest3);
|
|
58761
58761
|
if (id2)
|
|
58762
58762
|
tool_call.id = id2;
|
|
58763
|
-
if (
|
|
58764
|
-
tool_call.type =
|
|
58763
|
+
if (type2)
|
|
58764
|
+
tool_call.type = type2;
|
|
58765
58765
|
if (fn)
|
|
58766
58766
|
tool_call.function ?? (tool_call.function = { name: fn.name ?? "", arguments: "" });
|
|
58767
58767
|
if (fn?.name)
|
|
@@ -58878,13 +58878,13 @@ function finalizeChatCompletion(snapshot, params) {
|
|
|
58878
58878
|
content,
|
|
58879
58879
|
refusal: message.refusal ?? null,
|
|
58880
58880
|
tool_calls: tool_calls.map((tool_call, i) => {
|
|
58881
|
-
const { function: fn, type, id: id3, ...toolRest } = tool_call;
|
|
58881
|
+
const { function: fn, type: type2, id: id3, ...toolRest } = tool_call;
|
|
58882
58882
|
const { arguments: args, name, ...fnRest } = fn || {};
|
|
58883
58883
|
if (id3 == null) {
|
|
58884
58884
|
throw new OpenAIError(`missing choices[${index}].tool_calls[${i}].id
|
|
58885
58885
|
${str(snapshot)}`);
|
|
58886
58886
|
}
|
|
58887
|
-
if (
|
|
58887
|
+
if (type2 == null) {
|
|
58888
58888
|
throw new OpenAIError(`missing choices[${index}].tool_calls[${i}].type
|
|
58889
58889
|
${str(snapshot)}`);
|
|
58890
58890
|
}
|
|
@@ -58896,7 +58896,7 @@ ${str(snapshot)}`);
|
|
|
58896
58896
|
throw new OpenAIError(`missing choices[${index}].tool_calls[${i}].function.arguments
|
|
58897
58897
|
${str(snapshot)}`);
|
|
58898
58898
|
}
|
|
58899
|
-
return { ...toolRest, id: id3, type, function: { ...fnRest, name, arguments: args } };
|
|
58899
|
+
return { ...toolRest, id: id3, type: type2, function: { ...fnRest, name, arguments: args } };
|
|
58900
58900
|
})
|
|
58901
58901
|
}
|
|
58902
58902
|
};
|
|
@@ -61595,11 +61595,11 @@ var ResponseStream = class _ResponseStream extends EventStream {
|
|
|
61595
61595
|
if (!output) {
|
|
61596
61596
|
throw new OpenAIError(`missing output at index ${event.output_index}`);
|
|
61597
61597
|
}
|
|
61598
|
-
const
|
|
61598
|
+
const type2 = output.type;
|
|
61599
61599
|
const part = event.part;
|
|
61600
|
-
if (
|
|
61600
|
+
if (type2 === "message" && part.type !== "reasoning_text") {
|
|
61601
61601
|
output.content.push(part);
|
|
61602
|
-
} else if (
|
|
61602
|
+
} else if (type2 === "reasoning" && part.type === "reasoning_text") {
|
|
61603
61603
|
if (!output.content) {
|
|
61604
61604
|
output.content = [];
|
|
61605
61605
|
}
|
|
@@ -62713,9 +62713,9 @@ var OpenAI = class {
|
|
|
62713
62713
|
this.apiKey = token;
|
|
62714
62714
|
return true;
|
|
62715
62715
|
}
|
|
62716
|
-
buildURL(
|
|
62716
|
+
buildURL(path43, query, defaultBaseURL) {
|
|
62717
62717
|
const baseURL = !__classPrivateFieldGet2(this, _OpenAI_instances, "m", _OpenAI_baseURLOverridden).call(this) && defaultBaseURL || this.baseURL;
|
|
62718
|
-
const url2 = isAbsoluteURL2(
|
|
62718
|
+
const url2 = isAbsoluteURL2(path43) ? new URL(path43) : new URL(baseURL + (baseURL.endsWith("/") && path43.startsWith("/") ? path43.slice(1) : path43));
|
|
62719
62719
|
const defaultQuery = this.defaultQuery();
|
|
62720
62720
|
const pathQuery = Object.fromEntries(url2.searchParams);
|
|
62721
62721
|
if (!isEmptyObj2(defaultQuery) || !isEmptyObj2(pathQuery)) {
|
|
@@ -62740,24 +62740,24 @@ var OpenAI = class {
|
|
|
62740
62740
|
*/
|
|
62741
62741
|
async prepareRequest(request, { url: url2, options }) {
|
|
62742
62742
|
}
|
|
62743
|
-
get(
|
|
62744
|
-
return this.methodRequest("get",
|
|
62743
|
+
get(path43, opts) {
|
|
62744
|
+
return this.methodRequest("get", path43, opts);
|
|
62745
62745
|
}
|
|
62746
|
-
post(
|
|
62747
|
-
return this.methodRequest("post",
|
|
62746
|
+
post(path43, opts) {
|
|
62747
|
+
return this.methodRequest("post", path43, opts);
|
|
62748
62748
|
}
|
|
62749
|
-
patch(
|
|
62750
|
-
return this.methodRequest("patch",
|
|
62749
|
+
patch(path43, opts) {
|
|
62750
|
+
return this.methodRequest("patch", path43, opts);
|
|
62751
62751
|
}
|
|
62752
|
-
put(
|
|
62753
|
-
return this.methodRequest("put",
|
|
62752
|
+
put(path43, opts) {
|
|
62753
|
+
return this.methodRequest("put", path43, opts);
|
|
62754
62754
|
}
|
|
62755
|
-
delete(
|
|
62756
|
-
return this.methodRequest("delete",
|
|
62755
|
+
delete(path43, opts) {
|
|
62756
|
+
return this.methodRequest("delete", path43, opts);
|
|
62757
62757
|
}
|
|
62758
|
-
methodRequest(method,
|
|
62758
|
+
methodRequest(method, path43, opts) {
|
|
62759
62759
|
return this.request(Promise.resolve(opts).then((opts2) => {
|
|
62760
|
-
return { method, path:
|
|
62760
|
+
return { method, path: path43, ...opts2 };
|
|
62761
62761
|
}));
|
|
62762
62762
|
}
|
|
62763
62763
|
request(options, remainingRetries = null) {
|
|
@@ -62875,8 +62875,8 @@ var OpenAI = class {
|
|
|
62875
62875
|
}));
|
|
62876
62876
|
return { response, options, controller, requestLogID, retryOfRequestLogID, startTime };
|
|
62877
62877
|
}
|
|
62878
|
-
getAPIList(
|
|
62879
|
-
return this.requestAPIList(Page3, opts && "then" in opts ? opts.then((opts2) => ({ method: "get", path:
|
|
62878
|
+
getAPIList(path43, Page3, opts) {
|
|
62879
|
+
return this.requestAPIList(Page3, opts && "then" in opts ? opts.then((opts2) => ({ method: "get", path: path43, ...opts2 })) : { method: "get", path: path43, ...opts });
|
|
62880
62880
|
}
|
|
62881
62881
|
requestAPIList(Page3, options) {
|
|
62882
62882
|
const request = this.makeRequest(options, null, void 0);
|
|
@@ -62967,8 +62967,8 @@ var OpenAI = class {
|
|
|
62967
62967
|
}
|
|
62968
62968
|
async buildRequest(inputOptions, { retryCount = 0 } = {}) {
|
|
62969
62969
|
const options = { ...inputOptions };
|
|
62970
|
-
const { method, path:
|
|
62971
|
-
const url2 = this.buildURL(
|
|
62970
|
+
const { method, path: path43, query, defaultBaseURL } = options;
|
|
62971
|
+
const url2 = this.buildURL(path43, query, defaultBaseURL);
|
|
62972
62972
|
if ("timeout" in options)
|
|
62973
62973
|
validatePositiveInteger2("timeout", options.timeout);
|
|
62974
62974
|
options.timeout = options.timeout ?? this.timeout;
|
|
@@ -63128,6 +63128,12 @@ var GGAIError = class extends Error {
|
|
|
63128
63128
|
this.hint = options?.hint;
|
|
63129
63129
|
}
|
|
63130
63130
|
};
|
|
63131
|
+
var VideoUnsupportedError = class extends GGAIError {
|
|
63132
|
+
constructor() {
|
|
63133
|
+
super("This model can't analyze video.", { source: "capability" });
|
|
63134
|
+
this.name = "VideoUnsupportedError";
|
|
63135
|
+
}
|
|
63136
|
+
};
|
|
63131
63137
|
var ProviderError = class extends GGAIError {
|
|
63132
63138
|
provider;
|
|
63133
63139
|
statusCode;
|
|
@@ -63243,6 +63249,14 @@ function finaliseBySource(source2, message, requestId, hint) {
|
|
|
63243
63249
|
guidance: hint ?? providerGuidance(void 0, message, void 0),
|
|
63244
63250
|
...requestId ? { requestId } : {}
|
|
63245
63251
|
};
|
|
63252
|
+
case "capability":
|
|
63253
|
+
return {
|
|
63254
|
+
headline: message,
|
|
63255
|
+
source: source2,
|
|
63256
|
+
message: "",
|
|
63257
|
+
guidance: hint ?? "Only Kimi, Gemini, MiniMax, and MiMo-V2.5 can analyze video. Switch with /model.",
|
|
63258
|
+
...requestId ? { requestId } : {}
|
|
63259
|
+
};
|
|
63246
63260
|
case "ggcoder":
|
|
63247
63261
|
return {
|
|
63248
63262
|
headline: "ggcoder hit an unexpected error.",
|
|
@@ -63586,6 +63600,10 @@ function toolResultImages(content) {
|
|
|
63586
63600
|
if (typeof content === "string") return [];
|
|
63587
63601
|
return content.filter((b) => b.type === "image");
|
|
63588
63602
|
}
|
|
63603
|
+
function toolResultVideos(content) {
|
|
63604
|
+
if (typeof content === "string") return [];
|
|
63605
|
+
return content.filter((b) => b.type === "video");
|
|
63606
|
+
}
|
|
63589
63607
|
function toAnthropicCacheControl(retention, baseUrl) {
|
|
63590
63608
|
const resolved = retention ?? "short";
|
|
63591
63609
|
if (resolved === "none") return void 0;
|
|
@@ -63596,6 +63614,12 @@ function toAnthropicToolResultContent(content) {
|
|
|
63596
63614
|
if (typeof content === "string") return content;
|
|
63597
63615
|
return content.map((block2) => {
|
|
63598
63616
|
if (block2.type === "text") return { type: "text", text: block2.text };
|
|
63617
|
+
if (block2.type === "video") {
|
|
63618
|
+
return {
|
|
63619
|
+
type: "video",
|
|
63620
|
+
source: { type: "base64", media_type: block2.mediaType, data: block2.data }
|
|
63621
|
+
};
|
|
63622
|
+
}
|
|
63599
63623
|
return {
|
|
63600
63624
|
type: "image",
|
|
63601
63625
|
source: {
|
|
@@ -63665,6 +63689,8 @@ function toAnthropicMessages(messages, cacheControl) {
|
|
|
63665
63689
|
if (msg.role === "tool") {
|
|
63666
63690
|
out.push({
|
|
63667
63691
|
role: "user",
|
|
63692
|
+
// Cast covers the video block (used by the Anthropic-compatible MiniMax
|
|
63693
|
+
// API), which isn't in the first-party Anthropic tool_result types.
|
|
63668
63694
|
content: msg.content.map((result) => ({
|
|
63669
63695
|
type: "tool_result",
|
|
63670
63696
|
tool_use_id: remapAnthropicToolCallId(result.toolCallId, idMap),
|
|
@@ -63805,11 +63831,10 @@ function toOpenAIMessages(messages, options) {
|
|
|
63805
63831
|
(part) => {
|
|
63806
63832
|
if (part.type === "text") return { type: "text", text: part.text };
|
|
63807
63833
|
if (part.type === "video") {
|
|
63834
|
+
const videoUrl = part.fileId ? { url: `ms://${part.fileId}`, id: part.fileId } : { url: `data:${part.mediaType};base64,${part.data}` };
|
|
63808
63835
|
return {
|
|
63809
63836
|
type: "video_url",
|
|
63810
|
-
video_url:
|
|
63811
|
-
url: `data:${part.mediaType};base64,${part.data}`
|
|
63812
|
-
}
|
|
63837
|
+
video_url: videoUrl
|
|
63813
63838
|
};
|
|
63814
63839
|
}
|
|
63815
63840
|
return {
|
|
@@ -63854,29 +63879,56 @@ function toOpenAIMessages(messages, options) {
|
|
|
63854
63879
|
continue;
|
|
63855
63880
|
}
|
|
63856
63881
|
if (msg.role === "tool") {
|
|
63857
|
-
const
|
|
63882
|
+
const isMoonshot = options?.provider === "moonshot";
|
|
63883
|
+
const followUpMediaBlocks = [];
|
|
63884
|
+
let followUpHasVideo = false;
|
|
63858
63885
|
for (const result of msg.content) {
|
|
63859
63886
|
const text = toolResultText(result.content);
|
|
63860
63887
|
const images = toolResultImages(result.content);
|
|
63888
|
+
const videos = toolResultVideos(result.content);
|
|
63861
63889
|
const hasText = text.length > 0;
|
|
63890
|
+
if (isMoonshot && videos.length > 0) {
|
|
63891
|
+
const parts = [];
|
|
63892
|
+
if (hasText) parts.push({ type: "text", text });
|
|
63893
|
+
const videoParts = videos.map((v) => {
|
|
63894
|
+
const videoUrl = v.fileId ? { url: `ms://${v.fileId}`, id: v.fileId } : { url: `data:${v.mediaType};base64,${v.data}` };
|
|
63895
|
+
return { type: "video_url", video_url: videoUrl };
|
|
63896
|
+
});
|
|
63897
|
+
out.push({
|
|
63898
|
+
role: "tool",
|
|
63899
|
+
tool_call_id: remapToolCallId(result.toolCallId, idMap),
|
|
63900
|
+
content: [...parts, ...videoParts]
|
|
63901
|
+
});
|
|
63902
|
+
continue;
|
|
63903
|
+
}
|
|
63862
63904
|
out.push({
|
|
63863
63905
|
role: "tool",
|
|
63864
63906
|
tool_call_id: remapToolCallId(result.toolCallId, idMap),
|
|
63865
|
-
content: hasText ? text : "(see attached
|
|
63907
|
+
content: hasText ? text : "(see attached media)"
|
|
63866
63908
|
});
|
|
63867
63909
|
if (images.length > 0 && options?.supportsImages !== false) {
|
|
63868
63910
|
for (const img of images) {
|
|
63869
|
-
|
|
63911
|
+
followUpMediaBlocks.push({
|
|
63870
63912
|
type: "image_url",
|
|
63871
63913
|
image_url: { url: `data:${img.mediaType};base64,${img.data}` }
|
|
63872
63914
|
});
|
|
63873
63915
|
}
|
|
63874
63916
|
}
|
|
63917
|
+
if (!isMoonshot && videos.length > 0) {
|
|
63918
|
+
for (const v of videos) {
|
|
63919
|
+
followUpMediaBlocks.push({
|
|
63920
|
+
type: "video_url",
|
|
63921
|
+
video_url: { url: `data:${v.mediaType};base64,${v.data}` }
|
|
63922
|
+
});
|
|
63923
|
+
followUpHasVideo = true;
|
|
63924
|
+
}
|
|
63925
|
+
}
|
|
63875
63926
|
}
|
|
63876
|
-
if (
|
|
63927
|
+
if (followUpMediaBlocks.length > 0) {
|
|
63928
|
+
const label = followUpHasVideo ? "Attached media from tool result:" : "Attached image(s) from tool result:";
|
|
63877
63929
|
out.push({
|
|
63878
63930
|
role: "user",
|
|
63879
|
-
content: [{ type: "text", text:
|
|
63931
|
+
content: [{ type: "text", text: label }, ...followUpMediaBlocks]
|
|
63880
63932
|
});
|
|
63881
63933
|
}
|
|
63882
63934
|
}
|
|
@@ -64271,14 +64323,14 @@ async function* runStream(options) {
|
|
|
64271
64323
|
function* synthesizeEventsFromMessage(message) {
|
|
64272
64324
|
for (const block2 of message.content) {
|
|
64273
64325
|
const blk = block2;
|
|
64274
|
-
const
|
|
64275
|
-
if (
|
|
64326
|
+
const type2 = blk.type;
|
|
64327
|
+
if (type2 === "text") {
|
|
64276
64328
|
const text = blk.text;
|
|
64277
64329
|
if (text) yield { type: "text_delta", text };
|
|
64278
|
-
} else if (
|
|
64330
|
+
} else if (type2 === "thinking") {
|
|
64279
64331
|
const text = blk.thinking;
|
|
64280
64332
|
if (text) yield { type: "thinking_delta", text };
|
|
64281
|
-
} else if (
|
|
64333
|
+
} else if (type2 === "tool_use") {
|
|
64282
64334
|
const argsJson = JSON.stringify(blk.input ?? {});
|
|
64283
64335
|
yield {
|
|
64284
64336
|
type: "toolcall_delta",
|
|
@@ -64292,18 +64344,18 @@ function* synthesizeEventsFromMessage(message) {
|
|
|
64292
64344
|
name: blk.name,
|
|
64293
64345
|
args: blk.input ?? {}
|
|
64294
64346
|
};
|
|
64295
|
-
} else if (
|
|
64347
|
+
} else if (type2 === "server_tool_use") {
|
|
64296
64348
|
yield {
|
|
64297
64349
|
type: "server_toolcall",
|
|
64298
64350
|
id: blk.id,
|
|
64299
64351
|
name: blk.name,
|
|
64300
64352
|
input: blk.input
|
|
64301
64353
|
};
|
|
64302
|
-
} else if (
|
|
64354
|
+
} else if (type2 === "web_search_tool_result") {
|
|
64303
64355
|
yield {
|
|
64304
64356
|
type: "server_toolresult",
|
|
64305
64357
|
toolUseId: blk.tool_use_id,
|
|
64306
|
-
resultType:
|
|
64358
|
+
resultType: type2,
|
|
64307
64359
|
data: blk
|
|
64308
64360
|
};
|
|
64309
64361
|
}
|
|
@@ -64314,34 +64366,34 @@ function messageToResponse(message) {
|
|
|
64314
64366
|
const contentParts = [];
|
|
64315
64367
|
for (const block2 of message.content) {
|
|
64316
64368
|
const blk = block2;
|
|
64317
|
-
const
|
|
64318
|
-
if (
|
|
64369
|
+
const type2 = blk.type;
|
|
64370
|
+
if (type2 === "text") {
|
|
64319
64371
|
contentParts.push({ type: "text", text: blk.text });
|
|
64320
|
-
} else if (
|
|
64372
|
+
} else if (type2 === "thinking") {
|
|
64321
64373
|
contentParts.push({
|
|
64322
64374
|
type: "thinking",
|
|
64323
64375
|
text: blk.thinking,
|
|
64324
64376
|
signature: blk.signature ?? ""
|
|
64325
64377
|
});
|
|
64326
|
-
} else if (
|
|
64378
|
+
} else if (type2 === "tool_use") {
|
|
64327
64379
|
contentParts.push({
|
|
64328
64380
|
type: "tool_call",
|
|
64329
64381
|
id: blk.id,
|
|
64330
64382
|
name: blk.name,
|
|
64331
64383
|
args: blk.input ?? {}
|
|
64332
64384
|
});
|
|
64333
|
-
} else if (
|
|
64385
|
+
} else if (type2 === "server_tool_use") {
|
|
64334
64386
|
contentParts.push({
|
|
64335
64387
|
type: "server_tool_call",
|
|
64336
64388
|
id: blk.id,
|
|
64337
64389
|
name: blk.name,
|
|
64338
64390
|
input: blk.input
|
|
64339
64391
|
});
|
|
64340
|
-
} else if (
|
|
64392
|
+
} else if (type2 === "web_search_tool_result") {
|
|
64341
64393
|
contentParts.push({
|
|
64342
64394
|
type: "server_tool_result",
|
|
64343
64395
|
toolUseId: blk.tool_use_id,
|
|
64344
|
-
resultType:
|
|
64396
|
+
resultType: type2,
|
|
64345
64397
|
data: blk
|
|
64346
64398
|
});
|
|
64347
64399
|
} else {
|
|
@@ -64433,6 +64485,68 @@ function fnv1aHash(value) {
|
|
|
64433
64485
|
}
|
|
64434
64486
|
return (hash2 >>> 0).toString(16).padStart(8, "0");
|
|
64435
64487
|
}
|
|
64488
|
+
var _diagFn = null;
|
|
64489
|
+
function providerDiag(phase, data) {
|
|
64490
|
+
_diagFn?.(phase, data);
|
|
64491
|
+
}
|
|
64492
|
+
async function uploadMoonshotVideos(client, messages, signal) {
|
|
64493
|
+
for (const msg of messages) {
|
|
64494
|
+
if (typeof msg.content === "string") continue;
|
|
64495
|
+
for (const part of msg.content) {
|
|
64496
|
+
if (part.type === "video") {
|
|
64497
|
+
await ensureUploaded(client, part, signal);
|
|
64498
|
+
continue;
|
|
64499
|
+
}
|
|
64500
|
+
if (part.type === "tool_result" && Array.isArray(part.content)) {
|
|
64501
|
+
for (const inner of part.content) {
|
|
64502
|
+
if (inner.type === "video") {
|
|
64503
|
+
await ensureUploaded(client, inner, signal);
|
|
64504
|
+
}
|
|
64505
|
+
}
|
|
64506
|
+
}
|
|
64507
|
+
}
|
|
64508
|
+
}
|
|
64509
|
+
}
|
|
64510
|
+
async function ensureUploaded(client, video, signal) {
|
|
64511
|
+
if (video.fileId) {
|
|
64512
|
+
providerDiag("moonshot_video_cached", { fileId: video.fileId });
|
|
64513
|
+
return;
|
|
64514
|
+
}
|
|
64515
|
+
if (!video.data) {
|
|
64516
|
+
providerDiag("moonshot_video_skipped_no_data", {});
|
|
64517
|
+
return;
|
|
64518
|
+
}
|
|
64519
|
+
providerDiag("moonshot_video_upload_start", {
|
|
64520
|
+
mediaType: video.mediaType,
|
|
64521
|
+
bytes: Math.floor(video.data.length * 3 / 4)
|
|
64522
|
+
});
|
|
64523
|
+
video.fileId = await uploadOne(client, video, signal);
|
|
64524
|
+
providerDiag("moonshot_video_upload_done", { fileId: video.fileId });
|
|
64525
|
+
}
|
|
64526
|
+
async function uploadOne(client, video, signal) {
|
|
64527
|
+
const bytes = Buffer.from(video.data, "base64");
|
|
64528
|
+
const mediaType = video.mediaType || "video/mp4";
|
|
64529
|
+
const filename = `upload.${extForMime(mediaType)}`;
|
|
64530
|
+
const file2 = new File([new Uint8Array(bytes)], filename, { type: mediaType });
|
|
64531
|
+
const uploaded = await client.files.create(
|
|
64532
|
+
{ file: file2, purpose: "video" },
|
|
64533
|
+
signal ? { signal } : void 0
|
|
64534
|
+
);
|
|
64535
|
+
return uploaded.id;
|
|
64536
|
+
}
|
|
64537
|
+
var MIME_TO_EXT = {
|
|
64538
|
+
"video/mp4": "mp4",
|
|
64539
|
+
"video/mpeg": "mpeg",
|
|
64540
|
+
"video/quicktime": "mov",
|
|
64541
|
+
"video/webm": "webm",
|
|
64542
|
+
"video/x-matroska": "mkv",
|
|
64543
|
+
"video/x-msvideo": "avi",
|
|
64544
|
+
"video/x-flv": "flv",
|
|
64545
|
+
"video/3gpp": "3gp"
|
|
64546
|
+
};
|
|
64547
|
+
function extForMime(mediaType) {
|
|
64548
|
+
return MIME_TO_EXT[mediaType.toLowerCase()] ?? "mp4";
|
|
64549
|
+
}
|
|
64436
64550
|
function getEnvironment() {
|
|
64437
64551
|
return globalThis.process?.env;
|
|
64438
64552
|
}
|
|
@@ -64459,7 +64573,8 @@ function createClient2(options) {
|
|
|
64459
64573
|
return new OpenAI({
|
|
64460
64574
|
apiKey: options.apiKey,
|
|
64461
64575
|
...options.baseUrl ? { baseURL: options.baseUrl } : {},
|
|
64462
|
-
...options.fetch ? { fetch: options.fetch } : {}
|
|
64576
|
+
...options.fetch ? { fetch: options.fetch } : {},
|
|
64577
|
+
...options.defaultHeaders ? { defaultHeaders: options.defaultHeaders } : {}
|
|
64463
64578
|
});
|
|
64464
64579
|
}
|
|
64465
64580
|
function streamOpenAI(options) {
|
|
@@ -64472,6 +64587,13 @@ async function* runStream2(options) {
|
|
|
64472
64587
|
const usesThinkingParam = options.provider === "glm" || options.provider === "moonshot" || options.provider === "xiaomi";
|
|
64473
64588
|
const downgradedImages = downgradeUnsupportedImages(options.messages, options.supportsImages);
|
|
64474
64589
|
const downgradedMessages = downgradeUnsupportedVideos(downgradedImages, options.supportsVideo);
|
|
64590
|
+
if (options.provider === "moonshot") {
|
|
64591
|
+
try {
|
|
64592
|
+
await uploadMoonshotVideos(client, downgradedMessages, options.signal);
|
|
64593
|
+
} catch (err) {
|
|
64594
|
+
throw toError2(err, providerName);
|
|
64595
|
+
}
|
|
64596
|
+
}
|
|
64475
64597
|
const messages = toOpenAIMessages(downgradedMessages, {
|
|
64476
64598
|
provider: options.provider,
|
|
64477
64599
|
thinking: !!options.thinking,
|
|
@@ -64710,8 +64832,8 @@ function completionToResponse(completion) {
|
|
|
64710
64832
|
};
|
|
64711
64833
|
}
|
|
64712
64834
|
function classifyOpenAICompatLimit(args) {
|
|
64713
|
-
const { status, code, type, message } = args;
|
|
64714
|
-
const codeType = `${code ?? ""} ${
|
|
64835
|
+
const { status, code, type: type2, message } = args;
|
|
64836
|
+
const codeType = `${code ?? ""} ${type2 ?? ""}`.toLowerCase();
|
|
64715
64837
|
const isHard = status === 402 || codeType.includes("insufficient_quota") || isHardBillingMessage(message);
|
|
64716
64838
|
if (isHard) return "hard";
|
|
64717
64839
|
if (status === 429 || codeType.includes("rate_limit_exceeded") || codeType.includes("too_many_requests")) {
|
|
@@ -64731,11 +64853,11 @@ function toError2(err, provider = "openai") {
|
|
|
64731
64853
|
}
|
|
64732
64854
|
const requestId = err.request_id ?? (typeof body?.request_id === "string" ? body.request_id : void 0);
|
|
64733
64855
|
const code = typeof err.code === "string" ? err.code : void 0;
|
|
64734
|
-
const
|
|
64856
|
+
const type2 = typeof err.type === "string" ? err.type : void 0;
|
|
64735
64857
|
const limit2 = classifyOpenAICompatLimit({
|
|
64736
64858
|
status: err.status,
|
|
64737
64859
|
code,
|
|
64738
|
-
type,
|
|
64860
|
+
type: type2,
|
|
64739
64861
|
message: cleanMessage
|
|
64740
64862
|
});
|
|
64741
64863
|
if (limit2 === "hard") {
|
|
@@ -64771,10 +64893,6 @@ function toError2(err, provider = "openai") {
|
|
|
64771
64893
|
}
|
|
64772
64894
|
return new ProviderError(provider, String(err));
|
|
64773
64895
|
}
|
|
64774
|
-
var _diagFn = null;
|
|
64775
|
-
function providerDiag(phase, data) {
|
|
64776
|
-
_diagFn?.(phase, data);
|
|
64777
|
-
}
|
|
64778
64896
|
function parseSseBuffer(buffer) {
|
|
64779
64897
|
const events = [];
|
|
64780
64898
|
let cursor = 0;
|
|
@@ -64923,13 +65041,13 @@ async function* runStream3(options) {
|
|
|
64923
65041
|
const diagStart = Date.now();
|
|
64924
65042
|
const diagSeen = /* @__PURE__ */ new Set();
|
|
64925
65043
|
for await (const event of parseSSE(response.body)) {
|
|
64926
|
-
const
|
|
64927
|
-
if (!
|
|
64928
|
-
if (!diagSeen.has(
|
|
64929
|
-
diagSeen.add(
|
|
64930
|
-
providerDiag("codex_event_first", { type, sinceStartMs: Date.now() - diagStart });
|
|
65044
|
+
const type2 = event.type;
|
|
65045
|
+
if (!type2) continue;
|
|
65046
|
+
if (!diagSeen.has(type2)) {
|
|
65047
|
+
diagSeen.add(type2);
|
|
65048
|
+
providerDiag("codex_event_first", { type: type2, sinceStartMs: Date.now() - diagStart });
|
|
64931
65049
|
}
|
|
64932
|
-
if (
|
|
65050
|
+
if (type2 === "error") {
|
|
64933
65051
|
const nested = event.error ?? void 0;
|
|
64934
65052
|
const message = nested?.message ?? event.message ?? "Codex stream emitted an error chunk without a message.";
|
|
64935
65053
|
const code = nested?.code ?? nested?.type ?? event.code ?? "server_error";
|
|
@@ -64945,7 +65063,7 @@ async function* runStream3(options) {
|
|
|
64945
65063
|
...code === "server_error" ? { statusCode: 500 } : {}
|
|
64946
65064
|
});
|
|
64947
65065
|
}
|
|
64948
|
-
if (
|
|
65066
|
+
if (type2 === "response.failed") {
|
|
64949
65067
|
const nested = event.error;
|
|
64950
65068
|
const message = nested?.message ?? "Codex response failed.";
|
|
64951
65069
|
const requestId = extractRequestIdFromMessage(message) ?? event.request_id;
|
|
@@ -64953,7 +65071,7 @@ async function* runStream3(options) {
|
|
|
64953
65071
|
...requestId != null ? { requestId } : {}
|
|
64954
65072
|
});
|
|
64955
65073
|
}
|
|
64956
|
-
if (
|
|
65074
|
+
if (type2 === "response.output_text.delta") {
|
|
64957
65075
|
const delta = event.delta;
|
|
64958
65076
|
const itemId = event.item_id;
|
|
64959
65077
|
const contentIndex = event.content_index;
|
|
@@ -64972,7 +65090,7 @@ async function* runStream3(options) {
|
|
|
64972
65090
|
});
|
|
64973
65091
|
}
|
|
64974
65092
|
}
|
|
64975
|
-
if (
|
|
65093
|
+
if (type2 === "response.output_text.done") {
|
|
64976
65094
|
const fullText = event.text;
|
|
64977
65095
|
if (fullText) {
|
|
64978
65096
|
const itemId = event.item_id;
|
|
@@ -64997,11 +65115,11 @@ async function* runStream3(options) {
|
|
|
64997
65115
|
}
|
|
64998
65116
|
}
|
|
64999
65117
|
}
|
|
65000
|
-
if (
|
|
65118
|
+
if (type2 === "response.reasoning_summary_text.delta" || type2 === "response.reasoning_summary.delta" || type2 === "response.reasoning_text.delta" || type2 === "response.reasoning.delta") {
|
|
65001
65119
|
const delta = event.delta;
|
|
65002
65120
|
if (options.thinking) yield { type: "thinking_delta", text: delta };
|
|
65003
65121
|
}
|
|
65004
|
-
if (
|
|
65122
|
+
if (type2 === "response.output_item.added") {
|
|
65005
65123
|
const item = event.item;
|
|
65006
65124
|
const itemId = item?.id;
|
|
65007
65125
|
const itemType = item?.type;
|
|
@@ -65023,7 +65141,7 @@ async function* runStream3(options) {
|
|
|
65023
65141
|
}
|
|
65024
65142
|
}
|
|
65025
65143
|
}
|
|
65026
|
-
if (
|
|
65144
|
+
if (type2 === "response.output_item.added") {
|
|
65027
65145
|
const item = event.item;
|
|
65028
65146
|
if (item?.type === "function_call") {
|
|
65029
65147
|
const callId = item.call_id;
|
|
@@ -65033,7 +65151,7 @@ async function* runStream3(options) {
|
|
|
65033
65151
|
toolCalls.set(id2, { id: id2, name, argsJson: item.arguments || "" });
|
|
65034
65152
|
}
|
|
65035
65153
|
}
|
|
65036
|
-
if (
|
|
65154
|
+
if (type2 === "response.function_call_arguments.delta") {
|
|
65037
65155
|
const delta = event.delta;
|
|
65038
65156
|
const itemId = event.item_id;
|
|
65039
65157
|
for (const [key, tc] of toolCalls) {
|
|
@@ -65049,7 +65167,7 @@ async function* runStream3(options) {
|
|
|
65049
65167
|
}
|
|
65050
65168
|
}
|
|
65051
65169
|
}
|
|
65052
|
-
if (
|
|
65170
|
+
if (type2 === "response.function_call_arguments.done") {
|
|
65053
65171
|
const itemId = event.item_id;
|
|
65054
65172
|
const argsStr = event.arguments;
|
|
65055
65173
|
for (const [key, tc] of toolCalls) {
|
|
@@ -65059,7 +65177,7 @@ async function* runStream3(options) {
|
|
|
65059
65177
|
}
|
|
65060
65178
|
}
|
|
65061
65179
|
}
|
|
65062
|
-
if (
|
|
65180
|
+
if (type2 === "response.output_item.done") {
|
|
65063
65181
|
const item = event.item;
|
|
65064
65182
|
if (item?.type === "reasoning") {
|
|
65065
65183
|
const encrypted = item.encrypted_content;
|
|
@@ -65091,7 +65209,7 @@ async function* runStream3(options) {
|
|
|
65091
65209
|
}
|
|
65092
65210
|
}
|
|
65093
65211
|
}
|
|
65094
|
-
if (
|
|
65212
|
+
if (type2 === "response.completed" || type2 === "response.done") {
|
|
65095
65213
|
const resp = event.response;
|
|
65096
65214
|
const usage = resp?.usage;
|
|
65097
65215
|
if (usage) {
|
|
@@ -65416,6 +65534,13 @@ ${msg.content}` : msg.content;
|
|
|
65416
65534
|
}
|
|
65417
65535
|
}
|
|
65418
65536
|
});
|
|
65537
|
+
if (typeof result.content !== "string") {
|
|
65538
|
+
for (const block2 of result.content) {
|
|
65539
|
+
if (block2.type === "video") {
|
|
65540
|
+
parts.push({ inlineData: { mimeType: block2.mediaType, data: block2.data } });
|
|
65541
|
+
}
|
|
65542
|
+
}
|
|
65543
|
+
}
|
|
65419
65544
|
}
|
|
65420
65545
|
if (parts.length > 0) contents.push({ role: "user", parts });
|
|
65421
65546
|
}
|
|
@@ -65809,6 +65934,7 @@ var ProviderRegistryImpl = class {
|
|
|
65809
65934
|
};
|
|
65810
65935
|
var providerRegistry = new ProviderRegistryImpl();
|
|
65811
65936
|
var GLM_CODING_BASE_URL = "https://api.z.ai/api/coding/paas/v4";
|
|
65937
|
+
var KIMI_CODE_USER_AGENT = `kimi-code-cli/${process.env.KIMI_CODE_VERSION ?? "1.0.11"}`;
|
|
65812
65938
|
providerRegistry.register("anthropic", {
|
|
65813
65939
|
stream: (options) => streamAnthropic(options)
|
|
65814
65940
|
});
|
|
@@ -65837,10 +65963,11 @@ providerRegistry.register("glm", {
|
|
|
65837
65963
|
})
|
|
65838
65964
|
});
|
|
65839
65965
|
providerRegistry.register("moonshot", {
|
|
65840
|
-
stream: (options) =>
|
|
65841
|
-
|
|
65842
|
-
baseUrl: options.
|
|
65843
|
-
|
|
65966
|
+
stream: (options) => {
|
|
65967
|
+
const baseUrl = options.baseUrl ?? "https://api.moonshot.ai/v1";
|
|
65968
|
+
const defaultHeaders = baseUrl.includes("api.kimi.com") ? { "User-Agent": KIMI_CODE_USER_AGENT, ...options.defaultHeaders } : options.defaultHeaders;
|
|
65969
|
+
return streamOpenAI({ ...options, baseUrl, defaultHeaders });
|
|
65970
|
+
}
|
|
65844
65971
|
});
|
|
65845
65972
|
providerRegistry.register("deepseek", {
|
|
65846
65973
|
stream: (options) => streamOpenAI({
|
|
@@ -65873,8 +66000,23 @@ function stream(options) {
|
|
|
65873
66000
|
`Unknown provider: "${options.provider}". Registered: ${providerRegistry.list().join(", ")}`
|
|
65874
66001
|
);
|
|
65875
66002
|
}
|
|
66003
|
+
if (options.supportsVideo !== true && messagesContainVideo(options.messages)) {
|
|
66004
|
+
throw new VideoUnsupportedError();
|
|
66005
|
+
}
|
|
65876
66006
|
return entry.stream(options);
|
|
65877
66007
|
}
|
|
66008
|
+
function messagesContainVideo(messages) {
|
|
66009
|
+
for (const msg of messages) {
|
|
66010
|
+
if (typeof msg.content === "string" || !Array.isArray(msg.content)) continue;
|
|
66011
|
+
for (const part of msg.content) {
|
|
66012
|
+
if (part.type === "video") return true;
|
|
66013
|
+
if (part.type === "tool_result" && Array.isArray(part.content)) {
|
|
66014
|
+
if (part.content.some((block2) => block2.type === "video")) return true;
|
|
66015
|
+
}
|
|
66016
|
+
}
|
|
66017
|
+
}
|
|
66018
|
+
return false;
|
|
66019
|
+
}
|
|
65878
66020
|
var CONTEXT_OVERFLOW_PATTERNS = [
|
|
65879
66021
|
/context_length_exceeded/i,
|
|
65880
66022
|
/context length exceeded/i,
|
|
@@ -66289,6 +66431,7 @@ async function* agentLoop(messages, options) {
|
|
|
66289
66431
|
compaction: options.compaction,
|
|
66290
66432
|
clearToolUses: options.clearToolUses,
|
|
66291
66433
|
userAgent: options.userAgent,
|
|
66434
|
+
defaultHeaders: options.defaultHeaders,
|
|
66292
66435
|
// Flip to non-streaming fallback after repeated stream stalls.
|
|
66293
66436
|
...useNonStreamingFallback ? { streaming: false } : {}
|
|
66294
66437
|
});
|
|
@@ -67218,7 +67361,7 @@ var Agent = class {
|
|
|
67218
67361
|
}
|
|
67219
67362
|
};
|
|
67220
67363
|
|
|
67221
|
-
// ../gg-core/dist/chunk-
|
|
67364
|
+
// ../gg-core/dist/chunk-74Z6I5V7.js
|
|
67222
67365
|
init_esm_shims();
|
|
67223
67366
|
var MODELS = [
|
|
67224
67367
|
// ── Anthropic ──────────────────────────────────────────
|
|
@@ -67319,6 +67462,7 @@ var MODELS = [
|
|
|
67319
67462
|
supportsThinking: true,
|
|
67320
67463
|
supportsImages: true,
|
|
67321
67464
|
supportsVideo: true,
|
|
67465
|
+
maxVideoBytes: 20 * 1024 * 1024,
|
|
67322
67466
|
costTier: "low",
|
|
67323
67467
|
maxThinkingLevel: "high"
|
|
67324
67468
|
},
|
|
@@ -67331,6 +67475,7 @@ var MODELS = [
|
|
|
67331
67475
|
supportsThinking: true,
|
|
67332
67476
|
supportsImages: true,
|
|
67333
67477
|
supportsVideo: true,
|
|
67478
|
+
maxVideoBytes: 20 * 1024 * 1024,
|
|
67334
67479
|
costTier: "low",
|
|
67335
67480
|
maxThinkingLevel: "high"
|
|
67336
67481
|
},
|
|
@@ -67344,6 +67489,7 @@ var MODELS = [
|
|
|
67344
67489
|
supportsThinking: true,
|
|
67345
67490
|
supportsImages: true,
|
|
67346
67491
|
supportsVideo: true,
|
|
67492
|
+
maxVideoBytes: 100 * 1024 * 1024,
|
|
67347
67493
|
costTier: "medium",
|
|
67348
67494
|
maxThinkingLevel: "high"
|
|
67349
67495
|
},
|
|
@@ -67394,13 +67540,16 @@ var MODELS = [
|
|
|
67394
67540
|
supportsThinking: true,
|
|
67395
67541
|
supportsImages: true,
|
|
67396
67542
|
supportsVideo: true,
|
|
67543
|
+
maxVideoBytes: 50 * 1024 * 1024,
|
|
67397
67544
|
costTier: "medium",
|
|
67398
67545
|
maxThinkingLevel: "high"
|
|
67399
67546
|
},
|
|
67400
67547
|
// ── Xiaomi (MiMo) ──────────────────────────────────────
|
|
67548
|
+
// Pro series: text-only coding/agentic flagship. The legacy mimo-v2-pro
|
|
67549
|
+
// auto-routes to v2.5 on 2026-06-01 and is fully deprecated by 2026-06-30.
|
|
67401
67550
|
{
|
|
67402
|
-
id: "mimo-v2-pro",
|
|
67403
|
-
name: "MiMo-V2-Pro",
|
|
67551
|
+
id: "mimo-v2.5-pro",
|
|
67552
|
+
name: "MiMo-V2.5-Pro",
|
|
67404
67553
|
provider: "xiaomi",
|
|
67405
67554
|
contextWindow: 1e6,
|
|
67406
67555
|
maxOutputTokens: 131072,
|
|
@@ -67410,6 +67559,22 @@ var MODELS = [
|
|
|
67410
67559
|
costTier: "medium",
|
|
67411
67560
|
maxThinkingLevel: "high"
|
|
67412
67561
|
},
|
|
67562
|
+
// Omni series: native full-modal understanding (image + audio + video).
|
|
67563
|
+
// Video/image ride the OpenAI-compatible transport as base64 data URLs
|
|
67564
|
+
// (`video_url`/`image_url`), which the shared transform already emits.
|
|
67565
|
+
{
|
|
67566
|
+
id: "mimo-v2.5",
|
|
67567
|
+
name: "MiMo-V2.5",
|
|
67568
|
+
provider: "xiaomi",
|
|
67569
|
+
contextWindow: 1e6,
|
|
67570
|
+
maxOutputTokens: 131072,
|
|
67571
|
+
supportsThinking: true,
|
|
67572
|
+
supportsImages: true,
|
|
67573
|
+
supportsVideo: true,
|
|
67574
|
+
maxVideoBytes: 36 * 1024 * 1024,
|
|
67575
|
+
costTier: "medium",
|
|
67576
|
+
maxThinkingLevel: "high"
|
|
67577
|
+
},
|
|
67413
67578
|
// ── DeepSeek ───────────────────────────────────────────
|
|
67414
67579
|
{
|
|
67415
67580
|
id: "deepseek-v4-pro",
|
|
@@ -67456,8 +67621,14 @@ function getModel(id2) {
|
|
|
67456
67621
|
function getModelsForProvider(provider) {
|
|
67457
67622
|
return MODELS.filter((m) => m.provider === provider);
|
|
67458
67623
|
}
|
|
67624
|
+
var DEFAULT_MAX_VIDEO_BYTES = 20 * 1024 * 1024;
|
|
67625
|
+
function getVideoByteLimit(modelId) {
|
|
67626
|
+
const model = getModel(modelId);
|
|
67627
|
+
if (!model?.supportsVideo) return void 0;
|
|
67628
|
+
return model.maxVideoBytes ?? DEFAULT_MAX_VIDEO_BYTES;
|
|
67629
|
+
}
|
|
67459
67630
|
function getDefaultModel(provider) {
|
|
67460
|
-
if (provider === "xiaomi") return MODELS.find((m) => m.id === "mimo-v2-pro");
|
|
67631
|
+
if (provider === "xiaomi") return MODELS.find((m) => m.id === "mimo-v2.5-pro");
|
|
67461
67632
|
if (provider === "openai") return MODELS.find((m) => m.id === "gpt-5.5");
|
|
67462
67633
|
if (provider === "gemini") return MODELS.find((m) => m.id === "gemini-3.1-flash-lite-preview");
|
|
67463
67634
|
if (provider === "glm") return MODELS.find((m) => m.id === "glm-5.1");
|
|
@@ -67526,9 +67697,14 @@ import fs3 from "fs/promises";
|
|
|
67526
67697
|
import path22 from "path";
|
|
67527
67698
|
import fs4 from "fs/promises";
|
|
67528
67699
|
import crypto5 from "crypto";
|
|
67700
|
+
import { execFileSync } from "child_process";
|
|
67701
|
+
import { randomUUID } from "crypto";
|
|
67702
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
67703
|
+
import { arch, hostname as hostname3, release, type } from "os";
|
|
67704
|
+
import path32 from "path";
|
|
67529
67705
|
import { spawn } from "child_process";
|
|
67530
67706
|
import fs5 from "fs";
|
|
67531
|
-
import
|
|
67707
|
+
import path42 from "path";
|
|
67532
67708
|
var OPENAI_GPT_THINKING_LEVELS = ["medium", "high", "xhigh"];
|
|
67533
67709
|
var ANTHROPIC_OPUS_48_47_THINKING_LEVELS = [
|
|
67534
67710
|
"low",
|
|
@@ -67923,6 +68099,147 @@ async function postTokenRequest2(body) {
|
|
|
67923
68099
|
}
|
|
67924
68100
|
return await response.json();
|
|
67925
68101
|
}
|
|
68102
|
+
var CLIENT_ID3 = "17e5f671-d194-4dfb-9706-5516cb48c098";
|
|
68103
|
+
var DEFAULT_OAUTH_HOST = "https://auth.kimi.com";
|
|
68104
|
+
var DEFAULT_CODING_BASE_URL = "https://api.kimi.com/coding/v1";
|
|
68105
|
+
var KIMI_PLATFORM = "kimi_code_cli";
|
|
68106
|
+
var DEFAULT_KIMI_VERSION = "1.0.11";
|
|
68107
|
+
var DEVICE_TIMEOUT_MS = 15 * 60 * 1e3;
|
|
68108
|
+
function oauthHost() {
|
|
68109
|
+
const host = process.env.KIMI_CODE_OAUTH_HOST ?? process.env.KIMI_OAUTH_HOST ?? DEFAULT_OAUTH_HOST;
|
|
68110
|
+
return host.replace(/\/+$/, "");
|
|
68111
|
+
}
|
|
68112
|
+
function kimiCodeBaseUrl() {
|
|
68113
|
+
return (process.env.KIMI_CODE_BASE_URL ?? DEFAULT_CODING_BASE_URL).replace(/\/+$/, "");
|
|
68114
|
+
}
|
|
68115
|
+
function kimiVersion() {
|
|
68116
|
+
const v = process.env.KIMI_CODE_VERSION ?? DEFAULT_KIMI_VERSION;
|
|
68117
|
+
return asciiHeader(v, DEFAULT_KIMI_VERSION);
|
|
68118
|
+
}
|
|
68119
|
+
function asciiHeader(value, fallback = "unknown") {
|
|
68120
|
+
const cleaned = value.replace(/[^\u0020-\u007E]/g, "").trim();
|
|
68121
|
+
return cleaned.length > 0 ? cleaned : fallback;
|
|
68122
|
+
}
|
|
68123
|
+
function macOsProductVersion() {
|
|
68124
|
+
try {
|
|
68125
|
+
const version2 = execFileSync("/usr/bin/sw_vers", ["-productVersion"], {
|
|
68126
|
+
encoding: "utf-8",
|
|
68127
|
+
timeout: 1e3
|
|
68128
|
+
}).trim();
|
|
68129
|
+
return version2.length > 0 ? version2 : void 0;
|
|
68130
|
+
} catch {
|
|
68131
|
+
return void 0;
|
|
68132
|
+
}
|
|
68133
|
+
}
|
|
68134
|
+
function deviceModel() {
|
|
68135
|
+
const os12 = type();
|
|
68136
|
+
const version2 = release();
|
|
68137
|
+
const osArch = arch();
|
|
68138
|
+
if (os12 === "Darwin") return `macOS ${macOsProductVersion() ?? version2} ${osArch}`;
|
|
68139
|
+
if (os12 === "Windows_NT") return `Windows ${version2} ${osArch}`;
|
|
68140
|
+
return `${os12} ${version2} ${osArch}`.trim();
|
|
68141
|
+
}
|
|
68142
|
+
function deviceId() {
|
|
68143
|
+
const idPath = path32.join(getAppPaths().agentDir, "kimi_device_id");
|
|
68144
|
+
if (existsSync(idPath)) {
|
|
68145
|
+
try {
|
|
68146
|
+
const text = readFileSync(idPath, "utf-8").trim();
|
|
68147
|
+
if (text.length > 0) return text;
|
|
68148
|
+
} catch {
|
|
68149
|
+
}
|
|
68150
|
+
}
|
|
68151
|
+
const id2 = randomUUID();
|
|
68152
|
+
try {
|
|
68153
|
+
mkdirSync(getAppPaths().agentDir, { recursive: true, mode: 448 });
|
|
68154
|
+
writeFileSync(idPath, id2, { encoding: "utf-8", mode: 384 });
|
|
68155
|
+
} catch {
|
|
68156
|
+
}
|
|
68157
|
+
return id2;
|
|
68158
|
+
}
|
|
68159
|
+
function deviceHeaders() {
|
|
68160
|
+
return {
|
|
68161
|
+
"X-Msh-Platform": KIMI_PLATFORM,
|
|
68162
|
+
"X-Msh-Version": kimiVersion(),
|
|
68163
|
+
"X-Msh-Device-Name": asciiHeader(hostname3()),
|
|
68164
|
+
"X-Msh-Device-Model": asciiHeader(deviceModel()),
|
|
68165
|
+
"X-Msh-Os-Version": asciiHeader(release()),
|
|
68166
|
+
"X-Msh-Device-Id": deviceId()
|
|
68167
|
+
};
|
|
68168
|
+
}
|
|
68169
|
+
function kimiCodingHeaders() {
|
|
68170
|
+
return {
|
|
68171
|
+
"User-Agent": `kimi-code-cli/${kimiVersion()}`,
|
|
68172
|
+
...deviceHeaders()
|
|
68173
|
+
};
|
|
68174
|
+
}
|
|
68175
|
+
function isKimiCodingEndpoint(baseUrl) {
|
|
68176
|
+
if (typeof baseUrl !== "string" || baseUrl.length === 0) return false;
|
|
68177
|
+
const normalized = baseUrl.replace(/\/+$/, "");
|
|
68178
|
+
return normalized === kimiCodeBaseUrl() || /(^|\.)kimi\.com/i.test(normalized);
|
|
68179
|
+
}
|
|
68180
|
+
async function postForm(endpoint, params) {
|
|
68181
|
+
const response = await fetch(`${oauthHost()}${endpoint}`, {
|
|
68182
|
+
method: "POST",
|
|
68183
|
+
headers: {
|
|
68184
|
+
...deviceHeaders(),
|
|
68185
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
|
68186
|
+
Accept: "application/json"
|
|
68187
|
+
},
|
|
68188
|
+
body: new URLSearchParams(params).toString()
|
|
68189
|
+
});
|
|
68190
|
+
let data = {};
|
|
68191
|
+
try {
|
|
68192
|
+
const parsed = await response.json();
|
|
68193
|
+
if (parsed && typeof parsed === "object") data = parsed;
|
|
68194
|
+
} catch {
|
|
68195
|
+
}
|
|
68196
|
+
return { status: response.status, data };
|
|
68197
|
+
}
|
|
68198
|
+
function errorDetail(data) {
|
|
68199
|
+
const desc = data.error_description ?? data.message ?? data.error;
|
|
68200
|
+
return typeof desc === "string" && desc.length > 0 ? desc : "unknown error";
|
|
68201
|
+
}
|
|
68202
|
+
function credsFromTokenResponse(data) {
|
|
68203
|
+
const accessToken = data.access_token;
|
|
68204
|
+
const refreshToken = data.refresh_token;
|
|
68205
|
+
const expiresIn = Number(data.expires_in);
|
|
68206
|
+
if (typeof accessToken !== "string" || accessToken.length === 0) {
|
|
68207
|
+
throw new Error("Kimi OAuth response missing access_token.");
|
|
68208
|
+
}
|
|
68209
|
+
if (typeof refreshToken !== "string" || refreshToken.length === 0) {
|
|
68210
|
+
throw new Error("Kimi OAuth response missing refresh_token.");
|
|
68211
|
+
}
|
|
68212
|
+
if (!Number.isFinite(expiresIn) || expiresIn <= 0) {
|
|
68213
|
+
throw new Error("Kimi OAuth response missing or invalid expires_in.");
|
|
68214
|
+
}
|
|
68215
|
+
return {
|
|
68216
|
+
accessToken,
|
|
68217
|
+
refreshToken,
|
|
68218
|
+
expiresAt: Date.now() + expiresIn * 1e3,
|
|
68219
|
+
baseUrl: kimiCodeBaseUrl()
|
|
68220
|
+
};
|
|
68221
|
+
}
|
|
68222
|
+
async function refreshKimiToken(refreshToken) {
|
|
68223
|
+
const { status, data } = await postForm("/api/oauth/token", {
|
|
68224
|
+
client_id: CLIENT_ID3,
|
|
68225
|
+
grant_type: "refresh_token",
|
|
68226
|
+
refresh_token: refreshToken
|
|
68227
|
+
});
|
|
68228
|
+
if (status === 200 && typeof data.access_token === "string") {
|
|
68229
|
+
return credsFromTokenResponse(data);
|
|
68230
|
+
}
|
|
68231
|
+
const errorCode = typeof data.error === "string" ? data.error : "";
|
|
68232
|
+
throw new Error(`Kimi token refresh failed (${status}): ${errorCode || errorDetail(data)}`);
|
|
68233
|
+
}
|
|
68234
|
+
var MOONSHOT_OAUTH_KEY = "moonshot-oauth";
|
|
68235
|
+
var STATIC_API_KEY_PROVIDERS = /* @__PURE__ */ new Set([
|
|
68236
|
+
"glm",
|
|
68237
|
+
"moonshot",
|
|
68238
|
+
"xiaomi",
|
|
68239
|
+
"minimax",
|
|
68240
|
+
"deepseek",
|
|
68241
|
+
"openrouter"
|
|
68242
|
+
]);
|
|
67926
68243
|
var AuthStorage = class {
|
|
67927
68244
|
data = {};
|
|
67928
68245
|
filePath;
|
|
@@ -67946,6 +68263,30 @@ var AuthStorage = class {
|
|
|
67946
68263
|
await this.ensureLoaded();
|
|
67947
68264
|
return Boolean(this.data[provider]);
|
|
67948
68265
|
}
|
|
68266
|
+
/**
|
|
68267
|
+
* True if the user has any usable auth for the logical provider. For
|
|
68268
|
+
* `moonshot` this is satisfied by either the Kimi OAuth credential or the
|
|
68269
|
+
* Moonshot API key.
|
|
68270
|
+
*/
|
|
68271
|
+
async hasProviderAuth(provider) {
|
|
68272
|
+
await this.ensureLoaded();
|
|
68273
|
+
if (provider === "moonshot") {
|
|
68274
|
+
return Boolean(this.data[MOONSHOT_OAUTH_KEY] || this.data["moonshot"]);
|
|
68275
|
+
}
|
|
68276
|
+
return Boolean(this.data[provider]);
|
|
68277
|
+
}
|
|
68278
|
+
/**
|
|
68279
|
+
* True if the active credential for `provider` is a static API key with no
|
|
68280
|
+
* refresh mechanism. For `moonshot` this is only true when the Kimi OAuth
|
|
68281
|
+
* credential is absent (a present OAuth credential is refreshable).
|
|
68282
|
+
*/
|
|
68283
|
+
async isStaticApiKey(provider) {
|
|
68284
|
+
await this.ensureLoaded();
|
|
68285
|
+
if (provider === "moonshot" && this.data[MOONSHOT_OAUTH_KEY]) {
|
|
68286
|
+
return false;
|
|
68287
|
+
}
|
|
68288
|
+
return STATIC_API_KEY_PROVIDERS.has(provider);
|
|
68289
|
+
}
|
|
67949
68290
|
async load() {
|
|
67950
68291
|
await withFileLock(this.filePath, async () => {
|
|
67951
68292
|
try {
|
|
@@ -68000,11 +68341,21 @@ var AuthStorage = class {
|
|
|
68000
68341
|
*/
|
|
68001
68342
|
async resolveCredentials(provider, opts) {
|
|
68002
68343
|
await this.ensureLoaded();
|
|
68344
|
+
if (provider === "moonshot" && this.data[MOONSHOT_OAUTH_KEY]) {
|
|
68345
|
+
try {
|
|
68346
|
+
return await this.resolveCredentials(MOONSHOT_OAUTH_KEY, opts);
|
|
68347
|
+
} catch (err) {
|
|
68348
|
+
if (err instanceof NotLoggedInError && this.data["moonshot"]) {
|
|
68349
|
+
return this.data["moonshot"];
|
|
68350
|
+
}
|
|
68351
|
+
throw err;
|
|
68352
|
+
}
|
|
68353
|
+
}
|
|
68003
68354
|
const creds = this.data[provider];
|
|
68004
68355
|
if (!creds) {
|
|
68005
68356
|
throw new NotLoggedInError(provider);
|
|
68006
68357
|
}
|
|
68007
|
-
if (provider
|
|
68358
|
+
if (STATIC_API_KEY_PROVIDERS.has(provider)) {
|
|
68008
68359
|
return creds;
|
|
68009
68360
|
}
|
|
68010
68361
|
if (!opts?.forceRefresh && Date.now() < creds.expiresAt) {
|
|
@@ -68023,7 +68374,7 @@ var AuthStorage = class {
|
|
|
68023
68374
|
}
|
|
68024
68375
|
} catch {
|
|
68025
68376
|
}
|
|
68026
|
-
const refreshFn = provider === "anthropic" ? refreshAnthropicToken : provider === "gemini" ? refreshGeminiToken : refreshOpenAIToken;
|
|
68377
|
+
const refreshFn = provider === "anthropic" ? refreshAnthropicToken : provider === "gemini" ? refreshGeminiToken : provider === MOONSHOT_OAUTH_KEY ? refreshKimiToken : refreshOpenAIToken;
|
|
68027
68378
|
let refreshed;
|
|
68028
68379
|
try {
|
|
68029
68380
|
refreshed = await refreshFn(creds.refreshToken);
|
|
@@ -68139,7 +68490,7 @@ var TelegramBot = class {
|
|
|
68139
68490
|
} catch (err) {
|
|
68140
68491
|
if (!this.running) break;
|
|
68141
68492
|
console.error(`[telegram] Poll error: ${err instanceof Error ? err.message : err}`);
|
|
68142
|
-
await
|
|
68493
|
+
await sleep22(3e3);
|
|
68143
68494
|
}
|
|
68144
68495
|
}
|
|
68145
68496
|
}
|
|
@@ -68309,7 +68660,7 @@ function splitMessage(text) {
|
|
|
68309
68660
|
}
|
|
68310
68661
|
return chunks;
|
|
68311
68662
|
}
|
|
68312
|
-
function
|
|
68663
|
+
function sleep22(ms) {
|
|
68313
68664
|
return new Promise((r2) => setTimeout(r2, ms));
|
|
68314
68665
|
}
|
|
68315
68666
|
var TARGET_SAMPLE_RATE = 16e3;
|
|
@@ -68431,7 +68782,7 @@ function createAutoUpdater(config2) {
|
|
|
68431
68782
|
function writeState(state3) {
|
|
68432
68783
|
try {
|
|
68433
68784
|
const filePath = stateFilePath();
|
|
68434
|
-
fs5.mkdirSync(
|
|
68785
|
+
fs5.mkdirSync(path42.dirname(filePath), { recursive: true, mode: 448 });
|
|
68435
68786
|
fs5.writeFileSync(filePath, JSON.stringify(state3));
|
|
68436
68787
|
} catch {
|
|
68437
68788
|
}
|
|
@@ -68881,18 +69232,18 @@ import fs9 from "fs/promises";
|
|
|
68881
69232
|
import { spawn as spawn3 } from "child_process";
|
|
68882
69233
|
import { createReadStream } from "fs";
|
|
68883
69234
|
var localOperations = {
|
|
68884
|
-
readFile: (
|
|
68885
|
-
writeFile: async (
|
|
69235
|
+
readFile: (path43) => fs9.readFile(path43, "utf-8"),
|
|
69236
|
+
writeFile: async (path43, content) => {
|
|
68886
69237
|
const { dirname: dirname3 } = await import("path");
|
|
68887
|
-
await fs9.mkdir(dirname3(
|
|
68888
|
-
await fs9.writeFile(
|
|
69238
|
+
await fs9.mkdir(dirname3(path43), { recursive: true });
|
|
69239
|
+
await fs9.writeFile(path43, content, "utf-8");
|
|
68889
69240
|
},
|
|
68890
|
-
stat: (
|
|
68891
|
-
lstat: (
|
|
68892
|
-
readdir: (
|
|
68893
|
-
mkdir: (
|
|
69241
|
+
stat: (path43) => fs9.stat(path43),
|
|
69242
|
+
lstat: (path43) => fs9.lstat(path43),
|
|
69243
|
+
readdir: (path43, options) => fs9.readdir(path43, options),
|
|
69244
|
+
mkdir: (path43) => fs9.mkdir(path43, { recursive: true }).then(() => {
|
|
68894
69245
|
}),
|
|
68895
|
-
createReadStream: (
|
|
69246
|
+
createReadStream: (path43, encoding) => createReadStream(path43, { encoding }),
|
|
68896
69247
|
spawn: (command, args, options) => spawn3(command, args, {
|
|
68897
69248
|
cwd: options.cwd,
|
|
68898
69249
|
env: options.env,
|
|
@@ -68937,8 +69288,11 @@ async function assertFresh(tracker, resolvedPath, ops) {
|
|
|
68937
69288
|
// ../ggcoder/dist/utils/image.js
|
|
68938
69289
|
init_esm_shims();
|
|
68939
69290
|
import fs10 from "fs/promises";
|
|
69291
|
+
import os6 from "os";
|
|
68940
69292
|
import path9 from "path";
|
|
68941
69293
|
import { execFile } from "child_process";
|
|
69294
|
+
import { promisify } from "util";
|
|
69295
|
+
var execFileAsync = promisify(execFile);
|
|
68942
69296
|
var sharpFn = null;
|
|
68943
69297
|
async function loadSharp() {
|
|
68944
69298
|
if (sharpFn)
|
|
@@ -68959,6 +69313,85 @@ var ATTACHABLE_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
|
68959
69313
|
...TEXT_EXTENSIONS
|
|
68960
69314
|
]);
|
|
68961
69315
|
var MAX_VIDEO_BYTES = 50 * 1024 * 1024;
|
|
69316
|
+
var COMPRESS_TARGET_BYTES = 90 * 1024 * 1024;
|
|
69317
|
+
var COMPRESS_MAX_WIDTH = 1280;
|
|
69318
|
+
var COMPRESS_FPS = 5;
|
|
69319
|
+
var COMPRESS_AUDIO_KBPS = 64;
|
|
69320
|
+
var COMPRESS_MIN_VIDEO_KBPS = 100;
|
|
69321
|
+
function isMissingBinary(err) {
|
|
69322
|
+
return err?.code === "ENOENT";
|
|
69323
|
+
}
|
|
69324
|
+
async function compressVideoToFit(inputPath, targetBytes = COMPRESS_TARGET_BYTES, signal) {
|
|
69325
|
+
let durationSec;
|
|
69326
|
+
try {
|
|
69327
|
+
const { stdout } = await execFileAsync("ffprobe", ["-v", "error", "-show_entries", "format=duration", "-of", "default=nw=1:nk=1", inputPath], { signal });
|
|
69328
|
+
durationSec = Number.parseFloat(stdout.trim());
|
|
69329
|
+
} catch (err) {
|
|
69330
|
+
return {
|
|
69331
|
+
ok: false,
|
|
69332
|
+
reason: isMissingBinary(err) ? "ffmpeg/ffprobe is not installed" : `could not probe video: ${err instanceof Error ? err.message : String(err)}`
|
|
69333
|
+
};
|
|
69334
|
+
}
|
|
69335
|
+
if (!Number.isFinite(durationSec) || durationSec <= 0) {
|
|
69336
|
+
return { ok: false, reason: "could not determine video duration" };
|
|
69337
|
+
}
|
|
69338
|
+
const totalKbps = Math.floor(targetBytes * 8 / durationSec / 1e3 * 0.9);
|
|
69339
|
+
const videoKbps = Math.max(COMPRESS_MIN_VIDEO_KBPS, totalKbps - COMPRESS_AUDIO_KBPS);
|
|
69340
|
+
const outPath = path9.join(os6.tmpdir(), `ggcoder-compressed-${Date.now()}.mp4`);
|
|
69341
|
+
try {
|
|
69342
|
+
await execFileAsync("ffmpeg", [
|
|
69343
|
+
"-y",
|
|
69344
|
+
"-nostats",
|
|
69345
|
+
"-loglevel",
|
|
69346
|
+
"error",
|
|
69347
|
+
"-i",
|
|
69348
|
+
inputPath,
|
|
69349
|
+
"-vf",
|
|
69350
|
+
`scale='min(${COMPRESS_MAX_WIDTH},iw)':-2,fps=${COMPRESS_FPS}`,
|
|
69351
|
+
"-c:v",
|
|
69352
|
+
"libx264",
|
|
69353
|
+
"-b:v",
|
|
69354
|
+
`${videoKbps}k`,
|
|
69355
|
+
"-maxrate",
|
|
69356
|
+
`${Math.floor(videoKbps * 1.5)}k`,
|
|
69357
|
+
"-bufsize",
|
|
69358
|
+
`${videoKbps}k`,
|
|
69359
|
+
"-preset",
|
|
69360
|
+
"veryfast",
|
|
69361
|
+
"-c:a",
|
|
69362
|
+
"aac",
|
|
69363
|
+
"-b:a",
|
|
69364
|
+
`${COMPRESS_AUDIO_KBPS}k`,
|
|
69365
|
+
outPath
|
|
69366
|
+
], { signal, maxBuffer: 16 * 1024 * 1024 });
|
|
69367
|
+
} catch (err) {
|
|
69368
|
+
await fs10.unlink(outPath).catch(() => {
|
|
69369
|
+
});
|
|
69370
|
+
return {
|
|
69371
|
+
ok: false,
|
|
69372
|
+
reason: isMissingBinary(err) ? "ffmpeg is not installed" : `ffmpeg compression failed: ${err instanceof Error ? err.message : String(err)}`
|
|
69373
|
+
};
|
|
69374
|
+
}
|
|
69375
|
+
let compressedBytes;
|
|
69376
|
+
let originalBytes;
|
|
69377
|
+
try {
|
|
69378
|
+
compressedBytes = (await fs10.stat(outPath)).size;
|
|
69379
|
+
originalBytes = (await fs10.stat(inputPath)).size;
|
|
69380
|
+
} catch {
|
|
69381
|
+
await fs10.unlink(outPath).catch(() => {
|
|
69382
|
+
});
|
|
69383
|
+
return { ok: false, reason: "compression produced no usable output" };
|
|
69384
|
+
}
|
|
69385
|
+
if (compressedBytes > targetBytes) {
|
|
69386
|
+
await fs10.unlink(outPath).catch(() => {
|
|
69387
|
+
});
|
|
69388
|
+
return {
|
|
69389
|
+
ok: false,
|
|
69390
|
+
reason: `compressed video is still ${(compressedBytes / (1024 * 1024)).toFixed(0)} MB`
|
|
69391
|
+
};
|
|
69392
|
+
}
|
|
69393
|
+
return { ok: true, path: outPath, originalBytes, compressedBytes };
|
|
69394
|
+
}
|
|
68962
69395
|
var IMAGE_MEDIA_TYPES = {
|
|
68963
69396
|
".png": "image/png",
|
|
68964
69397
|
".jpg": "image/jpeg",
|
|
@@ -69109,24 +69542,9 @@ async function readImageFile(filePath) {
|
|
|
69109
69542
|
if (VIDEO_EXTENSIONS.has(ext)) {
|
|
69110
69543
|
try {
|
|
69111
69544
|
const mediaType = VIDEO_MEDIA_TYPES[ext] ?? "video/mp4";
|
|
69112
|
-
const
|
|
69113
|
-
|
|
69114
|
-
|
|
69115
|
-
return {
|
|
69116
|
-
kind: "text",
|
|
69117
|
-
fileName,
|
|
69118
|
-
filePath,
|
|
69119
|
-
mediaType: "text/plain",
|
|
69120
|
-
data: `[video ${fileName} (${mb} MB) exceeds the ${MAX_VIDEO_BYTES / (1024 * 1024)} MB inline cap and is saved at: ${filePath} \u2014 use ffmpeg or your tools to inspect it]`
|
|
69121
|
-
};
|
|
69122
|
-
}
|
|
69123
|
-
return {
|
|
69124
|
-
kind: "video",
|
|
69125
|
-
fileName,
|
|
69126
|
-
filePath,
|
|
69127
|
-
mediaType,
|
|
69128
|
-
data: rawBuffer.toString("base64")
|
|
69129
|
-
};
|
|
69545
|
+
const stat = await fs10.stat(filePath);
|
|
69546
|
+
const data = stat.size <= MAX_VIDEO_BYTES ? (await fs10.readFile(filePath)).toString("base64") : "";
|
|
69547
|
+
return { kind: "video", fileName, filePath, mediaType, data };
|
|
69130
69548
|
} catch (err) {
|
|
69131
69549
|
const reason = err instanceof Error ? err.message : String(err);
|
|
69132
69550
|
return {
|
|
@@ -69276,12 +69694,13 @@ var ReadParams = external_exports.object({
|
|
|
69276
69694
|
offset: external_exports.number().int().min(1).optional().describe("Line number to start reading from (1-based)"),
|
|
69277
69695
|
limit: external_exports.number().int().min(1).optional().describe("Maximum number of lines to read")
|
|
69278
69696
|
});
|
|
69279
|
-
function createReadTool(cwd2, readFiles, ops = localOperations, onFileRead) {
|
|
69697
|
+
function createReadTool(cwd2, readFiles, ops = localOperations, onFileRead, videoByteLimit) {
|
|
69698
|
+
const returnVideoNatively = videoByteLimit !== void 0;
|
|
69280
69699
|
return {
|
|
69281
69700
|
name: "read",
|
|
69282
|
-
description: "Read a file's contents. Returns numbered lines (cat -n style). Output is truncated to 2000 lines or 50KB (whichever is hit first). If truncated, use offset/limit to read remaining sections.
|
|
69701
|
+
description: "Read a file's contents. Returns numbered lines (cat -n style). Output is truncated to 2000 lines or 50KB (whichever is hit first). If truncated, use offset/limit to read remaining sections. Reads images natively. " + (returnVideoNatively ? "Reads video files natively too \u2014 you CAN watch and analyze a video by calling read on its path (.mp4/.mov/.webm/.mkv/.avi); large clips are auto-compressed for you. When a user attaches a video, read it; never claim you cannot watch video. " : "") + "Other binary files return a notice instead of content.",
|
|
69283
69702
|
parameters: ReadParams,
|
|
69284
|
-
async execute({ file_path, offset, limit: limit2 }) {
|
|
69703
|
+
async execute({ file_path, offset, limit: limit2 }, context) {
|
|
69285
69704
|
const resolved = resolvePath(cwd2, file_path);
|
|
69286
69705
|
await rejectSymlink(resolved);
|
|
69287
69706
|
const ext = path10.extname(resolved).toLowerCase();
|
|
@@ -69320,6 +69739,45 @@ function createReadTool(cwd2, readFiles, ops = localOperations, onFileRead) {
|
|
|
69320
69739
|
return `Could not read image ${resolved}: ${reason}`;
|
|
69321
69740
|
}
|
|
69322
69741
|
}
|
|
69742
|
+
if (returnVideoNatively && videoByteLimit !== void 0 && VIDEO_EXTENSIONS.has(ext)) {
|
|
69743
|
+
let compressedPath;
|
|
69744
|
+
try {
|
|
69745
|
+
const limitMb = Math.round(videoByteLimit / (1024 * 1024));
|
|
69746
|
+
const stat2 = await ops.stat(resolved);
|
|
69747
|
+
let videoPath = resolved;
|
|
69748
|
+
let note = "";
|
|
69749
|
+
if (stat2.size > videoByteLimit) {
|
|
69750
|
+
const result2 = await compressVideoToFit(resolved, videoByteLimit, context?.signal);
|
|
69751
|
+
if (!result2.ok) {
|
|
69752
|
+
const mb = (stat2.size / (1024 * 1024)).toFixed(1);
|
|
69753
|
+
return `Video ${resolved} is ${mb} MB, over the ${limitMb} MB limit for native analysis, and auto-compression failed (${result2.reason}). Use ffmpeg to downscale it (lower resolution/fps) under that size, then read the result.`;
|
|
69754
|
+
}
|
|
69755
|
+
compressedPath = result2.path;
|
|
69756
|
+
videoPath = result2.path;
|
|
69757
|
+
note = ` (auto-compressed from ${(result2.originalBytes / (1024 * 1024)).toFixed(0)} MB to ${(result2.compressedBytes / (1024 * 1024)).toFixed(0)} MB for analysis)`;
|
|
69758
|
+
}
|
|
69759
|
+
const rawBuffer = await fs11.readFile(videoPath);
|
|
69760
|
+
const mediaType = VIDEO_MEDIA_TYPES[ext] ?? "video/mp4";
|
|
69761
|
+
return {
|
|
69762
|
+
content: [
|
|
69763
|
+
{ type: "text", text: `Read video file ${resolved} [${mediaType}]${note}` },
|
|
69764
|
+
{ type: "video", mediaType, data: rawBuffer.toString("base64") }
|
|
69765
|
+
]
|
|
69766
|
+
};
|
|
69767
|
+
} catch (err) {
|
|
69768
|
+
const code = err.code;
|
|
69769
|
+
if (code === "ENOENT")
|
|
69770
|
+
return `File not found: ${resolved}`;
|
|
69771
|
+
if (code === "EACCES")
|
|
69772
|
+
return `Permission denied: ${resolved}`;
|
|
69773
|
+
const reason = err instanceof Error ? err.message : String(err);
|
|
69774
|
+
return `Could not read video ${resolved}: ${reason}`;
|
|
69775
|
+
} finally {
|
|
69776
|
+
if (compressedPath)
|
|
69777
|
+
await fs11.unlink(compressedPath).catch(() => {
|
|
69778
|
+
});
|
|
69779
|
+
}
|
|
69780
|
+
}
|
|
69323
69781
|
if (BINARY_EXTENSIONS.has(ext)) {
|
|
69324
69782
|
const stat2 = await ops.stat(resolved);
|
|
69325
69783
|
return `Binary file: ${resolved} (${ext}, ${stat2.size} bytes)`;
|
|
@@ -69363,6 +69821,12 @@ function createReadTool(cwd2, readFiles, ops = localOperations, onFileRead) {
|
|
|
69363
69821
|
};
|
|
69364
69822
|
}
|
|
69365
69823
|
|
|
69824
|
+
// ../ggcoder/dist/core/model-registry.js
|
|
69825
|
+
init_esm_shims();
|
|
69826
|
+
|
|
69827
|
+
// ../gg-core/dist/model-registry.js
|
|
69828
|
+
init_esm_shims();
|
|
69829
|
+
|
|
69366
69830
|
// ../ggcoder/dist/tools/write.js
|
|
69367
69831
|
init_esm_shims();
|
|
69368
69832
|
import fs12 from "fs/promises";
|
|
@@ -69534,16 +69998,16 @@ var Diff = class {
|
|
|
69534
69998
|
}
|
|
69535
69999
|
}
|
|
69536
70000
|
}
|
|
69537
|
-
addToPath(
|
|
69538
|
-
const last =
|
|
70001
|
+
addToPath(path43, added, removed, oldPosInc, options) {
|
|
70002
|
+
const last = path43.lastComponent;
|
|
69539
70003
|
if (last && !options.oneChangePerToken && last.added === added && last.removed === removed) {
|
|
69540
70004
|
return {
|
|
69541
|
-
oldPos:
|
|
70005
|
+
oldPos: path43.oldPos + oldPosInc,
|
|
69542
70006
|
lastComponent: { count: last.count + 1, added, removed, previousComponent: last.previousComponent }
|
|
69543
70007
|
};
|
|
69544
70008
|
} else {
|
|
69545
70009
|
return {
|
|
69546
|
-
oldPos:
|
|
70010
|
+
oldPos: path43.oldPos + oldPosInc,
|
|
69547
70011
|
lastComponent: { count: 1, added, removed, previousComponent: last }
|
|
69548
70012
|
};
|
|
69549
70013
|
}
|
|
@@ -70889,8 +71353,8 @@ function createLsTool(cwd2, ops = localOperations) {
|
|
|
70889
71353
|
try {
|
|
70890
71354
|
const stat = await ops.stat(path15.join(resolved, file2.name));
|
|
70891
71355
|
const size = formatSize(stat.size);
|
|
70892
|
-
const
|
|
70893
|
-
lines.push(`${
|
|
71356
|
+
const type2 = file2.isSymbolicLink() ? "l" : "f";
|
|
71357
|
+
lines.push(`${type2} ${size.padStart(8)} ${file2.name}`);
|
|
70894
71358
|
} catch {
|
|
70895
71359
|
lines.push(`? - ${file2.name}`);
|
|
70896
71360
|
}
|
|
@@ -71018,8 +71482,8 @@ ${agentList}` : "\n\nNo named agents configured.";
|
|
|
71018
71482
|
rl.on("line", (line) => {
|
|
71019
71483
|
try {
|
|
71020
71484
|
const event = JSON.parse(line);
|
|
71021
|
-
const
|
|
71022
|
-
switch (
|
|
71485
|
+
const type2 = event.type;
|
|
71486
|
+
switch (type2) {
|
|
71023
71487
|
case "text_delta":
|
|
71024
71488
|
if (textOutput.length < SUB_AGENT_MAX_OUTPUT_CHARS * 2) {
|
|
71025
71489
|
textOutput += event.text;
|
|
@@ -71327,28 +71791,28 @@ function isBlockedUrl(urlString) {
|
|
|
71327
71791
|
} catch {
|
|
71328
71792
|
return true;
|
|
71329
71793
|
}
|
|
71330
|
-
const
|
|
71794
|
+
const hostname4 = parsed.hostname.toLowerCase();
|
|
71331
71795
|
if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
|
|
71332
71796
|
return true;
|
|
71333
71797
|
}
|
|
71334
|
-
if (
|
|
71798
|
+
if (hostname4 === "localhost" || hostname4 === "127.0.0.1" || hostname4 === "::1") {
|
|
71335
71799
|
return true;
|
|
71336
71800
|
}
|
|
71337
|
-
if (
|
|
71801
|
+
if (hostname4 === "0.0.0.0") {
|
|
71338
71802
|
return true;
|
|
71339
71803
|
}
|
|
71340
|
-
if (/^10\./.test(
|
|
71804
|
+
if (/^10\./.test(hostname4))
|
|
71341
71805
|
return true;
|
|
71342
|
-
if (/^172\.(1[6-9]|2\d|3[01])\./.test(
|
|
71806
|
+
if (/^172\.(1[6-9]|2\d|3[01])\./.test(hostname4))
|
|
71343
71807
|
return true;
|
|
71344
|
-
if (/^192\.168\./.test(
|
|
71808
|
+
if (/^192\.168\./.test(hostname4))
|
|
71345
71809
|
return true;
|
|
71346
|
-
if (/^169\.254\./.test(
|
|
71810
|
+
if (/^169\.254\./.test(hostname4))
|
|
71347
71811
|
return true;
|
|
71348
|
-
if (
|
|
71812
|
+
if (hostname4.startsWith("[fe80:") || hostname4.startsWith("[fd") || hostname4.startsWith("[fc")) {
|
|
71349
71813
|
return true;
|
|
71350
71814
|
}
|
|
71351
|
-
if (
|
|
71815
|
+
if (hostname4 === "metadata.google.internal")
|
|
71352
71816
|
return true;
|
|
71353
71817
|
return false;
|
|
71354
71818
|
}
|
|
@@ -71795,8 +72259,8 @@ function normalizeDomains(domains) {
|
|
|
71795
72259
|
}
|
|
71796
72260
|
return out;
|
|
71797
72261
|
}
|
|
71798
|
-
function hostMatchesDomain(
|
|
71799
|
-
const host =
|
|
72262
|
+
function hostMatchesDomain(hostname4, domain2) {
|
|
72263
|
+
const host = hostname4.toLowerCase();
|
|
71800
72264
|
return host === domain2 || host.endsWith(`.${domain2}`);
|
|
71801
72265
|
}
|
|
71802
72266
|
var AD_URL_PATTERNS = [
|
|
@@ -71927,8 +72391,8 @@ function isAdSearchResultUrl(rawURL) {
|
|
|
71927
72391
|
const parsed = parseHttpUrl(rawURL);
|
|
71928
72392
|
if (!parsed)
|
|
71929
72393
|
return true;
|
|
71930
|
-
const
|
|
71931
|
-
if (AD_URL_PATTERNS.some((pattern) => pattern.test(
|
|
72394
|
+
const hostname4 = parsed.hostname.toLowerCase();
|
|
72395
|
+
if (AD_URL_PATTERNS.some((pattern) => pattern.test(hostname4)))
|
|
71932
72396
|
return true;
|
|
71933
72397
|
if (AD_PATH_PATTERNS.some((pattern) => pattern.test(parsed.pathname)))
|
|
71934
72398
|
return true;
|
|
@@ -72531,9 +72995,9 @@ init_esm_shims();
|
|
|
72531
72995
|
|
|
72532
72996
|
// ../ggcoder/dist/core/tasks-store.js
|
|
72533
72997
|
init_esm_shims();
|
|
72534
|
-
import { createHash, randomUUID } from "crypto";
|
|
72998
|
+
import { createHash, randomUUID as randomUUID2 } from "crypto";
|
|
72535
72999
|
import { mkdir, readFile, writeFile } from "fs/promises";
|
|
72536
|
-
import { readFileSync, writeFileSync } from "fs";
|
|
73000
|
+
import { readFileSync as readFileSync2, writeFileSync as writeFileSync2 } from "fs";
|
|
72537
73001
|
import { homedir } from "os";
|
|
72538
73002
|
import { basename, join } from "path";
|
|
72539
73003
|
var TASKS_BASE = join(homedir(), ".gg-tasks", "projects");
|
|
@@ -72554,7 +73018,7 @@ function migrateTask(task) {
|
|
|
72554
73018
|
}
|
|
72555
73019
|
function createTaskRecord(title, prompt) {
|
|
72556
73020
|
return {
|
|
72557
|
-
id:
|
|
73021
|
+
id: randomUUID2(),
|
|
72558
73022
|
title,
|
|
72559
73023
|
prompt,
|
|
72560
73024
|
status: "pending",
|
|
@@ -72876,8 +73340,9 @@ function createTools(cwd2, opts) {
|
|
|
72876
73340
|
const processManager = new ProcessManager();
|
|
72877
73341
|
const ops = opts?.operations ?? localOperations;
|
|
72878
73342
|
const planModeRef = opts?.planModeRef;
|
|
73343
|
+
const videoByteLimit = opts?.model ? getVideoByteLimit(opts.model) : void 0;
|
|
72879
73344
|
const tools = [
|
|
72880
|
-
createReadTool(cwd2, readFiles, ops, opts?.onFileRead),
|
|
73345
|
+
createReadTool(cwd2, readFiles, ops, opts?.onFileRead, videoByteLimit),
|
|
72881
73346
|
createWriteTool(cwd2, readFiles, ops, planModeRef, opts?.onFileMutated, opts?.onPreFileMutation),
|
|
72882
73347
|
createEditTool(cwd2, readFiles, ops, planModeRef, opts?.onFileMutated, opts?.onPreFileMutation),
|
|
72883
73348
|
createBashTool(cwd2, processManager, ops, planModeRef),
|
|
@@ -72906,7 +73371,8 @@ function createTools(cwd2, opts) {
|
|
|
72906
73371
|
if (opts?.onExitPlan) {
|
|
72907
73372
|
tools.push(createExitPlanTool(cwd2, opts.onExitPlan));
|
|
72908
73373
|
}
|
|
72909
|
-
|
|
73374
|
+
const rebuildReadTool = (model) => createReadTool(cwd2, readFiles, ops, opts?.onFileRead, getVideoByteLimit(model));
|
|
73375
|
+
return { tools, processManager, rebuildReadTool };
|
|
72910
73376
|
}
|
|
72911
73377
|
|
|
72912
73378
|
// ../ggcoder/dist/system-prompt.js
|
|
@@ -73767,9 +74233,9 @@ async function buildSystemPrompt(cwd2, skills, planMode, approvedPlanPath, toolN
|
|
|
73767
74233
|
init_esm_shims();
|
|
73768
74234
|
import fs20 from "fs/promises";
|
|
73769
74235
|
import path25 from "path";
|
|
73770
|
-
import
|
|
74236
|
+
import os7 from "os";
|
|
73771
74237
|
import crypto4 from "crypto";
|
|
73772
|
-
var SESSION_DIR = path25.join(
|
|
74238
|
+
var SESSION_DIR = path25.join(os7.homedir(), ".gg", "sessions");
|
|
73773
74239
|
|
|
73774
74240
|
// ../ggcoder/dist/core/index.js
|
|
73775
74241
|
init_esm_shims();
|
|
@@ -73874,12 +74340,6 @@ var EventBus = class {
|
|
|
73874
74340
|
}
|
|
73875
74341
|
};
|
|
73876
74342
|
|
|
73877
|
-
// ../ggcoder/dist/core/model-registry.js
|
|
73878
|
-
init_esm_shims();
|
|
73879
|
-
|
|
73880
|
-
// ../gg-core/dist/model-registry.js
|
|
73881
|
-
init_esm_shims();
|
|
73882
|
-
|
|
73883
74343
|
// ../ggcoder/dist/core/thinking-level.js
|
|
73884
74344
|
init_esm_shims();
|
|
73885
74345
|
|
|
@@ -75276,6 +75736,9 @@ async function loadCustomCommands(cwd2) {
|
|
|
75276
75736
|
// ../ggcoder/dist/core/claude-code-version.js
|
|
75277
75737
|
init_esm_shims();
|
|
75278
75738
|
|
|
75739
|
+
// ../ggcoder/dist/core/oauth/kimi.js
|
|
75740
|
+
init_esm_shims();
|
|
75741
|
+
|
|
75279
75742
|
// ../ggcoder/dist/core/extensions/loader.js
|
|
75280
75743
|
init_esm_shims();
|
|
75281
75744
|
import fs25 from "fs/promises";
|
|
@@ -75794,6 +76257,7 @@ You MUST preserve all references to this plan and its approval status in the sum
|
|
|
75794
76257
|
accountId: options.accountId,
|
|
75795
76258
|
projectId: options.projectId,
|
|
75796
76259
|
baseUrl: options.baseUrl,
|
|
76260
|
+
defaultHeaders: options.provider === "moonshot" && isKimiCodingEndpoint(options.baseUrl) ? kimiCodingHeaders() : void 0,
|
|
75797
76261
|
signal: options.signal
|
|
75798
76262
|
});
|
|
75799
76263
|
const response = await awaitSummaryResponseWithTimeout(result.response, SUMMARY_ATTEMPT_TIMEOUT_MS, options.signal);
|
|
@@ -79934,8 +80398,8 @@ function extractWWWAuthenticateParams(res) {
|
|
|
79934
80398
|
if (!authenticateHeader) {
|
|
79935
80399
|
return {};
|
|
79936
80400
|
}
|
|
79937
|
-
const [
|
|
79938
|
-
if (
|
|
80401
|
+
const [type2, scheme] = authenticateHeader.split(" ");
|
|
80402
|
+
if (type2.toLowerCase() !== "bearer" || !scheme) {
|
|
79939
80403
|
return {};
|
|
79940
80404
|
}
|
|
79941
80405
|
const resourceMetadataMatch = extractFieldFromWwwAuth(res, "resource_metadata") || void 0;
|
|
@@ -80067,7 +80531,7 @@ async function discoverAuthorizationServerMetadata(authorizationServerUrl, { fet
|
|
|
80067
80531
|
Accept: "application/json"
|
|
80068
80532
|
};
|
|
80069
80533
|
const urlsToTry = buildDiscoveryUrls(authorizationServerUrl);
|
|
80070
|
-
for (const { url: endpointUrl, type } of urlsToTry) {
|
|
80534
|
+
for (const { url: endpointUrl, type: type2 } of urlsToTry) {
|
|
80071
80535
|
const response = await fetchWithCorsRetry(endpointUrl, headers, fetchFn);
|
|
80072
80536
|
if (!response) {
|
|
80073
80537
|
continue;
|
|
@@ -80077,9 +80541,9 @@ async function discoverAuthorizationServerMetadata(authorizationServerUrl, { fet
|
|
|
80077
80541
|
if (response.status >= 400 && response.status < 500) {
|
|
80078
80542
|
continue;
|
|
80079
80543
|
}
|
|
80080
|
-
throw new Error(`HTTP ${response.status} trying to load ${
|
|
80544
|
+
throw new Error(`HTTP ${response.status} trying to load ${type2 === "oauth" ? "OAuth" : "OpenID provider"} metadata from ${endpointUrl}`);
|
|
80081
80545
|
}
|
|
80082
|
-
if (
|
|
80546
|
+
if (type2 === "oauth") {
|
|
80083
80547
|
return OAuthMetadataSchema.parse(await response.json());
|
|
80084
80548
|
} else {
|
|
80085
80549
|
return OpenIdProviderDiscoveryMetadataSchema.parse(await response.json());
|
|
@@ -80845,9 +81309,9 @@ var ErrorEvent = class extends Event {
|
|
|
80845
81309
|
* @param type - The type of the event (should be "error")
|
|
80846
81310
|
* @param errorEventInitDict - Optional properties to include in the error event
|
|
80847
81311
|
*/
|
|
80848
|
-
constructor(
|
|
81312
|
+
constructor(type2, errorEventInitDict) {
|
|
80849
81313
|
var _a6, _b;
|
|
80850
|
-
super(
|
|
81314
|
+
super(type2), this.code = (_a6 = errorEventInitDict == null ? void 0 : errorEventInitDict.code) != null ? _a6 : void 0, this.message = (_b = errorEventInitDict == null ? void 0 : errorEventInitDict.message) != null ? _b : void 0;
|
|
80851
81315
|
}
|
|
80852
81316
|
/**
|
|
80853
81317
|
* Node.js "hides" the `message` and `code` properties of the `ErrorEvent` instance,
|
|
@@ -81042,13 +81506,13 @@ var EventSource = class extends EventTarget {
|
|
|
81042
81506
|
set onopen(value) {
|
|
81043
81507
|
__privateSet(this, _onOpen, value);
|
|
81044
81508
|
}
|
|
81045
|
-
addEventListener(
|
|
81509
|
+
addEventListener(type2, listener, options) {
|
|
81046
81510
|
const listen = listener;
|
|
81047
|
-
super.addEventListener(
|
|
81511
|
+
super.addEventListener(type2, listen, options);
|
|
81048
81512
|
}
|
|
81049
|
-
removeEventListener(
|
|
81513
|
+
removeEventListener(type2, listener, options) {
|
|
81050
81514
|
const listen = listener;
|
|
81051
|
-
super.removeEventListener(
|
|
81515
|
+
super.removeEventListener(type2, listen, options);
|
|
81052
81516
|
}
|
|
81053
81517
|
/**
|
|
81054
81518
|
* Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
|
|
@@ -81525,7 +81989,7 @@ var StdioClientTransport = class {
|
|
|
81525
81989
|
};
|
|
81526
81990
|
|
|
81527
81991
|
// ../ggcoder/dist/core/mcp/client.js
|
|
81528
|
-
import
|
|
81992
|
+
import os8 from "os";
|
|
81529
81993
|
var MCPClientManager = class {
|
|
81530
81994
|
servers = [];
|
|
81531
81995
|
async connectAll(configs) {
|
|
@@ -81587,7 +82051,7 @@ var MCPClientManager = class {
|
|
|
81587
82051
|
command: config2.command,
|
|
81588
82052
|
args: config2.args,
|
|
81589
82053
|
env: { ...process.env, ...config2.env },
|
|
81590
|
-
cwd:
|
|
82054
|
+
cwd: os8.homedir(),
|
|
81591
82055
|
stderr: "pipe"
|
|
81592
82056
|
});
|
|
81593
82057
|
const stderrChunks = [];
|
|
@@ -82192,6 +82656,7 @@ ${parsed.args}` : promptText;
|
|
|
82192
82656
|
const loopMessages = await this.prepareDynamicContext();
|
|
82193
82657
|
const runAgentLoop = async (apiKey, accountId, projectId) => {
|
|
82194
82658
|
const modelInfo = getModel(this.model);
|
|
82659
|
+
const effectiveBaseUrl = this.baseUrl ?? creds.baseUrl;
|
|
82195
82660
|
const generator = agentLoop(loopMessages, {
|
|
82196
82661
|
provider: this.provider,
|
|
82197
82662
|
model: this.model,
|
|
@@ -82200,10 +82665,13 @@ ${parsed.args}` : promptText;
|
|
|
82200
82665
|
maxTokens: this.maxTokens,
|
|
82201
82666
|
thinking: this.thinkingLevel,
|
|
82202
82667
|
apiKey,
|
|
82203
|
-
baseUrl:
|
|
82668
|
+
baseUrl: effectiveBaseUrl,
|
|
82204
82669
|
signal: this.opts.signal,
|
|
82205
82670
|
accountId,
|
|
82206
82671
|
projectId,
|
|
82672
|
+
// Kimi For Coding gates the managed endpoint on coding-agent identity
|
|
82673
|
+
// headers; attach them only when the Kimi OAuth token is in use.
|
|
82674
|
+
defaultHeaders: this.provider === "moonshot" && isKimiCodingEndpoint(effectiveBaseUrl) ? kimiCodingHeaders() : void 0,
|
|
82207
82675
|
cacheRetention: "short",
|
|
82208
82676
|
promptCacheKey: this.getPromptCacheKey(),
|
|
82209
82677
|
supportsImages: modelInfo?.supportsImages,
|
|
@@ -82224,7 +82692,7 @@ ${parsed.args}` : promptText;
|
|
|
82224
82692
|
return;
|
|
82225
82693
|
}
|
|
82226
82694
|
if (err instanceof ProviderError && err.statusCode === 401) {
|
|
82227
|
-
if (
|
|
82695
|
+
if (await this.authStorage.isStaticApiKey(this.provider)) {
|
|
82228
82696
|
log("WARN", "auth", `Got 401 for ${this.provider} \u2014 API key is invalid or revoked`);
|
|
82229
82697
|
await this.authStorage.clearCredentials(this.provider);
|
|
82230
82698
|
throw err;
|
|
@@ -82700,7 +83168,7 @@ __export(base_exports, {
|
|
|
82700
83168
|
});
|
|
82701
83169
|
init_esm_shims();
|
|
82702
83170
|
import process4 from "process";
|
|
82703
|
-
import
|
|
83171
|
+
import os9 from "os";
|
|
82704
83172
|
|
|
82705
83173
|
// ../../node_modules/.pnpm/environment@1.1.0/node_modules/environment/index.js
|
|
82706
83174
|
init_esm_shims();
|
|
@@ -82800,7 +83268,7 @@ var isOldWindows = () => {
|
|
|
82800
83268
|
if (isBrowser || !isWindows2) {
|
|
82801
83269
|
return false;
|
|
82802
83270
|
}
|
|
82803
|
-
const parts =
|
|
83271
|
+
const parts = os9.release().split(".");
|
|
82804
83272
|
const major = Number(parts[0]);
|
|
82805
83273
|
const build = Number(parts[2] ?? 0);
|
|
82806
83274
|
if (major < 10) {
|
|
@@ -85030,12 +85498,12 @@ function wrapAnsi(string4, columns, options) {
|
|
|
85030
85498
|
// ../../node_modules/.pnpm/terminal-size@4.0.1/node_modules/terminal-size/index.js
|
|
85031
85499
|
init_esm_shims();
|
|
85032
85500
|
import process5 from "process";
|
|
85033
|
-
import { execFileSync } from "child_process";
|
|
85501
|
+
import { execFileSync as execFileSync2 } from "child_process";
|
|
85034
85502
|
import fs29 from "fs";
|
|
85035
85503
|
import tty from "tty";
|
|
85036
85504
|
var defaultColumns = 80;
|
|
85037
85505
|
var defaultRows = 24;
|
|
85038
|
-
var exec2 = (command, arguments_, { shell: shell2, env: env2 } = {}) =>
|
|
85506
|
+
var exec2 = (command, arguments_, { shell: shell2, env: env2 } = {}) => execFileSync2(command, arguments_, {
|
|
85039
85507
|
encoding: "utf8",
|
|
85040
85508
|
stdio: ["ignore", "pipe", "ignore"],
|
|
85041
85509
|
timeout: 500,
|
|
@@ -87073,9 +87541,9 @@ var reconciler_default = (0, import_react_reconciler.default)({
|
|
|
87073
87541
|
rootNode.onRender();
|
|
87074
87542
|
}
|
|
87075
87543
|
},
|
|
87076
|
-
getChildHostContext(parentHostContext,
|
|
87544
|
+
getChildHostContext(parentHostContext, type2) {
|
|
87077
87545
|
const previousIsInsideText = parentHostContext.isInsideText;
|
|
87078
|
-
const isInsideText =
|
|
87546
|
+
const isInsideText = type2 === "ink-text" || type2 === "ink-virtual-text";
|
|
87079
87547
|
if (previousIsInsideText === isInsideText) {
|
|
87080
87548
|
return parentHostContext;
|
|
87081
87549
|
}
|
|
@@ -87086,8 +87554,8 @@ var reconciler_default = (0, import_react_reconciler.default)({
|
|
|
87086
87554
|
if (hostContext.isInsideText && originalType === "ink-box") {
|
|
87087
87555
|
throw new Error(`<Box> can\u2019t be nested inside <Text> component`);
|
|
87088
87556
|
}
|
|
87089
|
-
const
|
|
87090
|
-
const node = createNode(
|
|
87557
|
+
const type2 = originalType === "ink-text" && hostContext.isInsideText ? "ink-virtual-text" : originalType;
|
|
87558
|
+
const node = createNode(type2);
|
|
87091
87559
|
for (const [key, value] of Object.entries(newProps)) {
|
|
87092
87560
|
if (key === "children") {
|
|
87093
87561
|
continue;
|
|
@@ -87313,19 +87781,19 @@ var ansiRegex2 = /^ansi256\(\s?(\d+)\s?\)$/;
|
|
|
87313
87781
|
var isNamedColor = (color2) => {
|
|
87314
87782
|
return color2 in source_default;
|
|
87315
87783
|
};
|
|
87316
|
-
var colorize = (str2, color2,
|
|
87784
|
+
var colorize = (str2, color2, type2) => {
|
|
87317
87785
|
if (!color2) {
|
|
87318
87786
|
return str2;
|
|
87319
87787
|
}
|
|
87320
87788
|
if (isNamedColor(color2)) {
|
|
87321
|
-
if (
|
|
87789
|
+
if (type2 === "foreground") {
|
|
87322
87790
|
return source_default[color2](str2);
|
|
87323
87791
|
}
|
|
87324
87792
|
const methodName = `bg${color2[0].toUpperCase() + color2.slice(1)}`;
|
|
87325
87793
|
return source_default[methodName](str2);
|
|
87326
87794
|
}
|
|
87327
87795
|
if (color2.startsWith("#")) {
|
|
87328
|
-
return
|
|
87796
|
+
return type2 === "foreground" ? source_default.hex(color2)(str2) : source_default.bgHex(color2)(str2);
|
|
87329
87797
|
}
|
|
87330
87798
|
if (color2.startsWith("ansi256")) {
|
|
87331
87799
|
const matches = ansiRegex2.exec(color2);
|
|
@@ -87333,7 +87801,7 @@ var colorize = (str2, color2, type) => {
|
|
|
87333
87801
|
return str2;
|
|
87334
87802
|
}
|
|
87335
87803
|
const value = Number(matches[1]);
|
|
87336
|
-
return
|
|
87804
|
+
return type2 === "foreground" ? source_default.ansi256(value)(str2) : source_default.bgAnsi256(value)(str2);
|
|
87337
87805
|
}
|
|
87338
87806
|
if (color2.startsWith("rgb")) {
|
|
87339
87807
|
const matches = rgbRegex.exec(color2);
|
|
@@ -87343,7 +87811,7 @@ var colorize = (str2, color2, type) => {
|
|
|
87343
87811
|
const firstValue = Number(matches[1]);
|
|
87344
87812
|
const secondValue = Number(matches[2]);
|
|
87345
87813
|
const thirdValue = Number(matches[3]);
|
|
87346
|
-
return
|
|
87814
|
+
return type2 === "foreground" ? source_default.rgb(firstValue, secondValue, thirdValue)(str2) : source_default.bgRgb(firstValue, secondValue, thirdValue)(str2);
|
|
87347
87815
|
}
|
|
87348
87816
|
return str2;
|
|
87349
87817
|
};
|
|
@@ -88737,8 +89205,8 @@ function Text({ color: color2, backgroundColor, dimColor = false, bold = false,
|
|
|
88737
89205
|
}
|
|
88738
89206
|
|
|
88739
89207
|
// ../../node_modules/.pnpm/ink@6.8.0_patch_hash=9a162d94e4f23850965d1796871df4d73f193444a9de20260d2d10f9c2b90422_@types+react@19.2.14_react@19.2.5/node_modules/ink/build/components/ErrorOverview.js
|
|
88740
|
-
var cleanupPath = (
|
|
88741
|
-
return
|
|
89208
|
+
var cleanupPath = (path43) => {
|
|
89209
|
+
return path43?.replace(`file://${cwd()}/`, "");
|
|
88742
89210
|
};
|
|
88743
89211
|
var stackUtils = new import_stack_utils.default({
|
|
88744
89212
|
cwd: cwd(),
|
|
@@ -92231,8 +92699,8 @@ function shortenValue(value, maxLength = MAX_DETAIL_LENGTH) {
|
|
|
92231
92699
|
const tailLength = maxLength - 1 - headLength;
|
|
92232
92700
|
return `${normalized.slice(0, headLength)}\u2026${normalized.slice(-tailLength)}`;
|
|
92233
92701
|
}
|
|
92234
|
-
function basename2(
|
|
92235
|
-
const trimmed =
|
|
92702
|
+
function basename2(path43) {
|
|
92703
|
+
const trimmed = path43.replace(/\/+$/u, "");
|
|
92236
92704
|
return trimmed.split("/").filter(Boolean).at(-1) ?? trimmed;
|
|
92237
92705
|
}
|
|
92238
92706
|
function uniqueValues(values) {
|
|
@@ -108209,7 +108677,7 @@ function TaskPickerMenu({ tasks, selectedIndex, width }) {
|
|
|
108209
108677
|
// ../ggcoder/dist/ui/components/InputArea.js
|
|
108210
108678
|
import { homedir as homedir2 } from "os";
|
|
108211
108679
|
import { join as join2 } from "path";
|
|
108212
|
-
import { readFileSync as
|
|
108680
|
+
import { readFileSync as readFileSync4, writeFileSync as writeFileSync3, appendFileSync, mkdirSync as mkdirSync2, renameSync, unlinkSync, existsSync as existsSync3 } from "fs";
|
|
108213
108681
|
var MAX_VISIBLE_LINES = 12;
|
|
108214
108682
|
var PROMPT = "> ";
|
|
108215
108683
|
var PLACEHOLDER = " Type your message or / to run a command";
|
|
@@ -108317,7 +108785,7 @@ var COMPACT_THRESHOLD = MAX_HISTORY + Math.floor(MAX_HISTORY * 0.5);
|
|
|
108317
108785
|
var lineCountEstimate = 0;
|
|
108318
108786
|
function loadHistory() {
|
|
108319
108787
|
try {
|
|
108320
|
-
const data =
|
|
108788
|
+
const data = readFileSync4(HISTORY_FILE, "utf-8");
|
|
108321
108789
|
const lines = data.trim().split("\n").filter(Boolean);
|
|
108322
108790
|
lineCountEstimate = lines.length;
|
|
108323
108791
|
return lines.map((l) => JSON.parse(l)).slice(-MAX_HISTORY);
|
|
@@ -108329,7 +108797,7 @@ function appendHistory(entry, history) {
|
|
|
108329
108797
|
if (history.length > 0 && history[history.length - 1] === entry)
|
|
108330
108798
|
return;
|
|
108331
108799
|
try {
|
|
108332
|
-
|
|
108800
|
+
mkdirSync2(join2(homedir2(), ".gg"), { recursive: true });
|
|
108333
108801
|
appendFileSync(HISTORY_FILE, JSON.stringify(entry) + "\n");
|
|
108334
108802
|
lineCountEstimate++;
|
|
108335
108803
|
if (lineCountEstimate > COMPACT_THRESHOLD) {
|
|
@@ -108341,15 +108809,15 @@ function appendHistory(entry, history) {
|
|
|
108341
108809
|
function compactHistory2() {
|
|
108342
108810
|
const tempPath = `${HISTORY_FILE}.${process.pid}.${Date.now()}.tmp`;
|
|
108343
108811
|
try {
|
|
108344
|
-
const data =
|
|
108812
|
+
const data = readFileSync4(HISTORY_FILE, "utf-8");
|
|
108345
108813
|
const lines = data.trim().split("\n").filter(Boolean);
|
|
108346
108814
|
const trimmed = lines.slice(-MAX_HISTORY);
|
|
108347
|
-
|
|
108815
|
+
writeFileSync3(tempPath, trimmed.map((l) => l + "\n").join(""));
|
|
108348
108816
|
renameSync(tempPath, HISTORY_FILE);
|
|
108349
108817
|
lineCountEstimate = trimmed.length;
|
|
108350
108818
|
} catch {
|
|
108351
108819
|
try {
|
|
108352
|
-
if (
|
|
108820
|
+
if (existsSync3(tempPath))
|
|
108353
108821
|
unlinkSync(tempPath);
|
|
108354
108822
|
} catch {
|
|
108355
108823
|
}
|
|
@@ -109461,21 +109929,21 @@ var import_react67 = __toESM(require_react(), 1);
|
|
|
109461
109929
|
|
|
109462
109930
|
// ../ggcoder/dist/ui/pixel.js
|
|
109463
109931
|
init_esm_shims();
|
|
109464
|
-
import { existsSync as
|
|
109932
|
+
import { existsSync as existsSync4, readFileSync as readFileSync6 } from "fs";
|
|
109465
109933
|
import { homedir as homedir3 } from "os";
|
|
109466
109934
|
import { join as join4 } from "path";
|
|
109467
109935
|
|
|
109468
109936
|
// ../ggcoder/dist/cli/shared.js
|
|
109469
109937
|
init_esm_shims();
|
|
109470
109938
|
import { execFile as execFile3 } from "child_process";
|
|
109471
|
-
import { readFileSync as
|
|
109939
|
+
import { readFileSync as readFileSync5 } from "fs";
|
|
109472
109940
|
import { dirname as dirname2, join as join3 } from "path";
|
|
109473
109941
|
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
109474
109942
|
function resolveCliVersion() {
|
|
109475
109943
|
let dir = dirname2(fileURLToPath3(import.meta.url));
|
|
109476
109944
|
for (let i = 0; i < 6; i++) {
|
|
109477
109945
|
try {
|
|
109478
|
-
const manifest = JSON.parse(
|
|
109946
|
+
const manifest = JSON.parse(readFileSync5(join3(dir, "package.json"), "utf8"));
|
|
109479
109947
|
if (manifest.version)
|
|
109480
109948
|
return manifest.version;
|
|
109481
109949
|
} catch {
|
|
@@ -109539,10 +110007,10 @@ import { execFile as execFile4 } from "child_process";
|
|
|
109539
110007
|
// ../ggcoder/dist/core/auto-update.js
|
|
109540
110008
|
init_esm_shims();
|
|
109541
110009
|
import path35 from "path";
|
|
109542
|
-
import
|
|
110010
|
+
import os10 from "os";
|
|
109543
110011
|
var updater = createAutoUpdater({
|
|
109544
110012
|
packageName: "@kenkaiiii/ggcoder",
|
|
109545
|
-
stateFilePath: () => path35.join(
|
|
110013
|
+
stateFilePath: () => path35.join(os10.homedir(), ".gg", "update-state.json")
|
|
109546
110014
|
});
|
|
109547
110015
|
var checkAndAutoUpdate = updater.checkAndAutoUpdate;
|
|
109548
110016
|
var getPendingUpdate = updater.getPendingUpdate;
|
|
@@ -109556,8 +110024,8 @@ init_esm_shims();
|
|
|
109556
110024
|
init_esm_shims();
|
|
109557
110025
|
import fs31 from "fs";
|
|
109558
110026
|
import path36 from "path";
|
|
109559
|
-
import
|
|
109560
|
-
var HISTORY_PATH = path36.join(
|
|
110027
|
+
import os11 from "os";
|
|
110028
|
+
var HISTORY_PATH = path36.join(os11.homedir(), ".gg", "setup-history.json");
|
|
109561
110029
|
|
|
109562
110030
|
// ../ggcoder/dist/ui/components/RewindOverlay.js
|
|
109563
110031
|
init_esm_shims();
|
|
@@ -109574,7 +110042,7 @@ init_esm_shims();
|
|
|
109574
110042
|
|
|
109575
110043
|
// ../ggcoder/dist/ui/prompt-routing.js
|
|
109576
110044
|
init_esm_shims();
|
|
109577
|
-
import { writeFileSync as
|
|
110045
|
+
import { writeFileSync as writeFileSync4 } from "fs";
|
|
109578
110046
|
|
|
109579
110047
|
// ../ggcoder/dist/ui/submit-prompt-command.js
|
|
109580
110048
|
init_esm_shims();
|
|
@@ -110512,8 +110980,8 @@ var LsLine = (0, import_react89.memo)(function LsLine2({ line }) {
|
|
|
110512
110980
|
const parts = line.match(/^([dfl])\s+(\S+)\s+(.+)$/);
|
|
110513
110981
|
if (!parts)
|
|
110514
110982
|
return (0, import_jsx_runtime46.jsx)(Text, { color: "#9ca3af", children: line });
|
|
110515
|
-
const [,
|
|
110516
|
-
if (
|
|
110983
|
+
const [, type2, size, name] = parts;
|
|
110984
|
+
if (type2 === "d") {
|
|
110517
110985
|
return (0, import_jsx_runtime46.jsxs)(Text, { children: [(0, import_jsx_runtime46.jsx)(Text, { color: "#60a5fa", bold: true, children: name }), (0, import_jsx_runtime46.jsxs)(Text, { color: "#6b7280", children: [" ", size === "-" ? "" : size] })] });
|
|
110518
110986
|
}
|
|
110519
110987
|
return (0, import_jsx_runtime46.jsxs)(Text, { children: [(0, import_jsx_runtime46.jsx)(Text, { color: "#e5e7eb", children: name }), (0, import_jsx_runtime46.jsxs)(Text, { color: "#6b7280", children: [" ", size] })] });
|
|
@@ -110634,7 +111102,7 @@ init_esm_shims();
|
|
|
110634
111102
|
|
|
110635
111103
|
// ../ggcoder/dist/ui/theme/detect-theme.js
|
|
110636
111104
|
init_esm_shims();
|
|
110637
|
-
import { execFileSync as
|
|
111105
|
+
import { execFileSync as execFileSync3 } from "child_process";
|
|
110638
111106
|
var ESC3 = String.fromCharCode(27);
|
|
110639
111107
|
var oscResponsePattern = new RegExp(ESC3 + "\\]11;rgb:([0-9a-fA-F]+)/([0-9a-fA-F]+)/([0-9a-fA-F]+)");
|
|
110640
111108
|
|
|
@@ -112634,7 +113102,7 @@ function createTaskTools(deps) {
|
|
|
112634
113102
|
|
|
112635
113103
|
// src/audio.ts
|
|
112636
113104
|
init_esm_shims();
|
|
112637
|
-
import { spawn as spawn7, execFileSync as
|
|
113105
|
+
import { spawn as spawn7, execFileSync as execFileSync4 } from "child_process";
|
|
112638
113106
|
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
112639
113107
|
import path40 from "path";
|
|
112640
113108
|
import fs34 from "fs";
|
|
@@ -112752,7 +113220,7 @@ async function tryPlayOnWindowsHost(file2) {
|
|
|
112752
113220
|
if (!inDist && !inAssets) {
|
|
112753
113221
|
return false;
|
|
112754
113222
|
}
|
|
112755
|
-
const winPath =
|
|
113223
|
+
const winPath = execFileSync4("wslpath", ["-w", resolved], {
|
|
112756
113224
|
encoding: "utf8",
|
|
112757
113225
|
timeout: 2e3
|
|
112758
113226
|
}).trim();
|
|
@@ -113963,4 +114431,4 @@ react/cjs/react-jsx-runtime.development.js:
|
|
|
113963
114431
|
* LICENSE file in the root directory of this source tree.
|
|
113964
114432
|
*)
|
|
113965
114433
|
*/
|
|
113966
|
-
//# sourceMappingURL=chunk-
|
|
114434
|
+
//# sourceMappingURL=chunk-5VHUIDDX.js.map
|