seeder-st2110-components 2.0.3 → 2.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,21 +1,21 @@
1
1
  'use strict';
2
2
 
3
- var React = require('react');
3
+ var react = require('react');
4
4
  var antd = require('antd');
5
5
  var jsxRuntime = require('react/jsx-runtime');
6
6
  var ahooks = require('ahooks');
7
7
  var icons = require('@ant-design/icons');
8
8
  var axios = require('axios');
9
9
 
10
- function _defineProperty(e, r, t) {
11
- return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
10
+ function _defineProperty$2(e, r, t) {
11
+ return (r = _toPropertyKey$2(r)) in e ? Object.defineProperty(e, r, {
12
12
  value: t,
13
13
  enumerable: !0,
14
14
  configurable: !0,
15
15
  writable: !0
16
16
  }) : e[r] = t, e;
17
17
  }
18
- function ownKeys(e, r) {
18
+ function ownKeys$2(e, r) {
19
19
  var t = Object.keys(e);
20
20
  if (Object.getOwnPropertySymbols) {
21
21
  var o = Object.getOwnPropertySymbols(e);
@@ -25,29 +25,29 @@ function ownKeys(e, r) {
25
25
  }
26
26
  return t;
27
27
  }
28
- function _objectSpread2(e) {
28
+ function _objectSpread2$2(e) {
29
29
  for (var r = 1; r < arguments.length; r++) {
30
30
  var t = null != arguments[r] ? arguments[r] : {};
31
- r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
32
- _defineProperty(e, r, t[r]);
33
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
31
+ r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) {
32
+ _defineProperty$2(e, r, t[r]);
33
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) {
34
34
  Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
35
35
  });
36
36
  }
37
37
  return e;
38
38
  }
39
- function _objectWithoutProperties(e, t) {
39
+ function _objectWithoutProperties$1(e, t) {
40
40
  if (null == e) return {};
41
41
  var o,
42
42
  r,
43
- i = _objectWithoutPropertiesLoose(e, t);
43
+ i = _objectWithoutPropertiesLoose$1(e, t);
44
44
  if (Object.getOwnPropertySymbols) {
45
45
  var n = Object.getOwnPropertySymbols(e);
46
46
  for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
47
47
  }
48
48
  return i;
49
49
  }
50
- function _objectWithoutPropertiesLoose(r, e) {
50
+ function _objectWithoutPropertiesLoose$1(r, e) {
51
51
  if (null == r) return {};
52
52
  var t = {};
53
53
  for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
@@ -56,7 +56,7 @@ function _objectWithoutPropertiesLoose(r, e) {
56
56
  }
57
57
  return t;
58
58
  }
59
- function _toPrimitive(t, r) {
59
+ function _toPrimitive$2(t, r) {
60
60
  if ("object" != typeof t || !t) return t;
61
61
  var e = t[Symbol.toPrimitive];
62
62
  if (void 0 !== e) {
@@ -66,8 +66,8 @@ function _toPrimitive(t, r) {
66
66
  }
67
67
  return ("string" === r ? String : Number)(t);
68
68
  }
69
- function _toPropertyKey(t) {
70
- var i = _toPrimitive(t, "string");
69
+ function _toPropertyKey$2(t) {
70
+ var i = _toPrimitive$2(t, "string");
71
71
  return "symbol" == typeof i ? i : i + "";
72
72
  }
73
73
 
@@ -76,7 +76,7 @@ function _toPropertyKey(t) {
76
76
  * 在浏览器控制台运行 window.debugI18n() 查看当前国际化状态
77
77
  */
78
78
 
79
- const debugI18n$1 = () => {
79
+ const debugI18n$2 = () => {
80
80
  var _window$g_initialProp, _window$g_initialProp2, _window$g_initialProp3, _window$g_initialProp4, _window$g_initialProp5, _window$g_initialProp6;
81
81
  if (typeof window === 'undefined') {
82
82
  console.log('[i18n debug] Not in browser environment');
@@ -108,7 +108,7 @@ const debugI18n$1 = () => {
108
108
  const allLocales = new Set([...Object.keys(componentMessages), ...Object.keys(projectMessages), ...Object.keys(umiMessages)]);
109
109
  console.log('\n🔧 Merged Locales:', Array.from(allLocales));
110
110
  allLocales.forEach(locale => {
111
- const merged = _objectSpread2(_objectSpread2(_objectSpread2({}, umiMessages[locale] || {}), projectMessages[locale] || {}), componentMessages[locale] || {});
111
+ const merged = _objectSpread2$2(_objectSpread2$2(_objectSpread2$2({}, umiMessages[locale] || {}), projectMessages[locale] || {}), componentMessages[locale] || {});
112
112
  console.log("\n \uD83D\uDCC4 ".concat(locale, " (").concat(Object.keys(merged).length, " keys):"), merged);
113
113
  });
114
114
 
@@ -118,7 +118,7 @@ const debugI18n$1 = () => {
118
118
  const currentLocale = ((_window$g_initialProp5 = window.g_initialProps) === null || _window$g_initialProp5 === void 0 ? void 0 : _window$g_initialProp5.locale) || ((_window$g_initialProp6 = window.g_initialProps) === null || _window$g_initialProp6 === void 0 || (_window$g_initialProp6 = _window$g_initialProp6.___g_initialPropsFromServer) === null || _window$g_initialProp6 === void 0 ? void 0 : _window$g_initialProp6.locale) || localStorage.getItem('umi-locale') || 'zh-CN';
119
119
  const allMessages = {};
120
120
  allLocales.forEach(locale => {
121
- allMessages[locale] = _objectSpread2(_objectSpread2(_objectSpread2({}, umiMessages[locale] || {}), projectMessages[locale] || {}), componentMessages[locale] || {});
121
+ allMessages[locale] = _objectSpread2$2(_objectSpread2$2(_objectSpread2$2({}, umiMessages[locale] || {}), projectMessages[locale] || {}), componentMessages[locale] || {});
122
122
  });
123
123
  testKeys.forEach(key => {
124
124
  var _allMessages$currentL, _allMessages$enUS;
@@ -130,7 +130,7 @@ const debugI18n$1 = () => {
130
130
 
131
131
  // 自动在开发环境注册到 window
132
132
  if (process.env.NODE_ENV === 'development' && typeof window !== 'undefined') {
133
- window.debugI18n = debugI18n$1;
133
+ window.debugI18n = debugI18n$2;
134
134
  console.log('💡 I18n debug tool available. Run window.debugI18n() in console to check i18n status.');
135
135
  }
136
136
 
@@ -148,7 +148,7 @@ if (process.env.NODE_ENV === 'development' && typeof window !== 'undefined') {
148
148
  * 获取当前语言环境
149
149
  * 优先从 Umi 全局变量读取,其次使用默认值
150
150
  */
151
- const getLocale$1 = () => {
151
+ const getLocale = () => {
152
152
  // 尝试从 Umi 获取语言设置
153
153
  if (typeof window !== 'undefined') {
154
154
  var _window$g_initialProp, _window$g_initialProp2, _window$g_initialProp3;
@@ -199,7 +199,7 @@ const getLocale$1 = () => {
199
199
  * 获取语言包
200
200
  * 优先从主项目读取,其次使用组件库自带的语言包
201
201
  */
202
- const getMessages$1 = () => {
202
+ const getMessages = () => {
203
203
  if (typeof window !== 'undefined') {
204
204
  var _window$g_initialProp4;
205
205
  // 尝试从多个来源读取语言包
@@ -217,7 +217,7 @@ const getMessages$1 = () => {
217
217
  // 合并语言包(组件库的优先级最高,其次是主项目,最后是 Umi)
218
218
  const allLocales = new Set([...Object.keys(componentMessages), ...Object.keys(projectMessages), ...Object.keys(umiMessages)]);
219
219
  allLocales.forEach(locale => {
220
- messages[locale] = _objectSpread2(_objectSpread2(_objectSpread2({}, umiMessages[locale] || {}), projectMessages[locale] || {}), componentMessages[locale] || {});
220
+ messages[locale] = _objectSpread2$2(_objectSpread2$2(_objectSpread2$2({}, umiMessages[locale] || {}), projectMessages[locale] || {}), componentMessages[locale] || {});
221
221
  });
222
222
  return messages;
223
223
  }
@@ -231,7 +231,7 @@ const getMessages$1 = () => {
231
231
  * @param {string} locale - 语言环境
232
232
  * @param {object} messages - 语言包
233
233
  */
234
- const formatMessage$1 = function (_ref) {
234
+ const formatMessage = function (_ref) {
235
235
  var _messages$locale, _messages$enUS;
236
236
  let {
237
237
  id
@@ -261,15 +261,15 @@ const formatMessage$1 = function (_ref) {
261
261
  * const title = intl.formatMessage({ id: 'networkSettings.title' });
262
262
  * const message = intl.formatMessage({ id: 'validation.minLength' }, { min: 3 });
263
263
  */
264
- const useIntl$1 = () => {
265
- const locale = getLocale$1();
266
- const messages = getMessages$1();
264
+ const useIntl = () => {
265
+ const locale = getLocale();
266
+ const messages = getMessages();
267
267
  const formatMessageFn = function (_ref2) {
268
268
  let {
269
269
  id
270
270
  } = _ref2;
271
271
  let values = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
272
- return formatMessage$1({
272
+ return formatMessage({
273
273
  id
274
274
  }, values, locale, messages);
275
275
  };
@@ -305,14 +305,14 @@ const formatBytes = function (bytes) {
305
305
  const i = Math.floor(Math.log(bytes) / Math.log(k));
306
306
  return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
307
307
  };
308
- const UsageItem = /*#__PURE__*/React.memo(_ref => {
308
+ const UsageItem = /*#__PURE__*/react.memo(_ref => {
309
309
  let {
310
310
  title,
311
311
  iconClass,
312
312
  children,
313
313
  memTotal
314
314
  } = _ref;
315
- const intl = useIntl$1();
315
+ const intl = useIntl();
316
316
  return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
317
317
  title: /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
318
318
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
@@ -340,11 +340,11 @@ const UsageItem = /*#__PURE__*/React.memo(_ref => {
340
340
  var UsageItem$1 = UsageItem;
341
341
 
342
342
  const useHardwareWebSocket = socketUrl => {
343
- const [systemStatus, setSystemStatus] = React.useState();
344
- const handleMessage = React.useCallback(message => {
343
+ const [systemStatus, setSystemStatus] = react.useState();
344
+ const handleMessage = react.useCallback(message => {
345
345
  try {
346
346
  if (message) {
347
- setSystemStatus(prev => _objectSpread2(_objectSpread2({}, prev), message));
347
+ setSystemStatus(prev => _objectSpread2$2(_objectSpread2$2({}, prev), message));
348
348
  }
349
349
  } catch (error) {
350
350
  console.error('Message processing error:', error);
@@ -443,7 +443,7 @@ const getItems = (details, intl) => {
443
443
  }), 'seeder-icon-CPUwendu', details.cpu_temp, '℃'));
444
444
  }
445
445
  if (details.mem_usage !== null && details.mem_usage !== undefined) {
446
- items.push(_objectSpread2(_objectSpread2({}, createMetricItem(intl.formatMessage({
446
+ items.push(_objectSpread2$2(_objectSpread2$2({}, createMetricItem(intl.formatMessage({
447
447
  id: 'usage.memory'
448
448
  }), 'seeder-icon-shiyongshuai', details.mem_usage, '%')), {}, {
449
449
  memTotal: details.mem_total
@@ -477,11 +477,11 @@ const getItems = (details, intl) => {
477
477
  return items;
478
478
  };
479
479
  const useHardwareUsage = socketUrl => {
480
- const intl = useIntl$1();
480
+ const intl = useIntl();
481
481
  const {
482
482
  ps_status
483
483
  } = useHardwareWebSocket$1(socketUrl);
484
- return React.useMemo(() => {
484
+ return react.useMemo(() => {
485
485
  if (!ps_status || typeof ps_status !== 'object') return null;
486
486
  const statusItems = getItems(getDetail(ps_status), intl);
487
487
  return /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -500,16 +500,16 @@ const useHardwareUsage = socketUrl => {
500
500
  };
501
501
  var useHardwareUsage$1 = useHardwareUsage;
502
502
 
503
- const _excluded$3 = ["width", "okText", "cancelText", "styles"];
504
- const StyledModal = props => {
505
- const intl = useIntl$1();
503
+ const _excluded$4 = ["width", "okText", "cancelText", "styles"];
504
+ const StyledModal$2 = props => {
505
+ const intl = useIntl();
506
506
  const {
507
507
  width = "520px",
508
508
  okText = "button.apply",
509
509
  cancelText = "button.close",
510
510
  styles: propStyles = {}
511
511
  } = props,
512
- restProps = _objectWithoutProperties(props, _excluded$3);
512
+ restProps = _objectWithoutProperties$1(props, _excluded$4);
513
513
 
514
514
  // 处理国际化文本
515
515
  const okButtonText = typeof okText === 'string' && okText.includes('.') ? intl.formatMessage({
@@ -545,15 +545,15 @@ const StyledModal = props => {
545
545
  };
546
546
 
547
547
  // 合并样式
548
- const styles = _objectSpread2(_objectSpread2({}, baseStyles), propStyles);
549
- return /*#__PURE__*/jsxRuntime.jsx(antd.Modal, _objectSpread2({
548
+ const styles = _objectSpread2$2(_objectSpread2$2({}, baseStyles), propStyles);
549
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Modal, _objectSpread2$2({
550
550
  width: width,
551
551
  okText: okButtonText,
552
552
  cancelText: cancelButtonText,
553
553
  styles: styles
554
554
  }, restProps));
555
555
  };
556
- var StyledModal$1 = StyledModal;
556
+ var StyledModal$3 = StyledModal$2;
557
557
 
558
558
  const AuthorizationModal = _ref => {
559
559
  let {
@@ -565,11 +565,11 @@ const AuthorizationModal = _ref => {
565
565
  cancelText = 'license.button.ignore',
566
566
  width = 600
567
567
  } = _ref;
568
- const intl = useIntl$1();
568
+ const intl = useIntl();
569
569
  const {
570
570
  message
571
571
  } = antd.App.useApp();
572
- const [code, setCode] = React.useState('');
572
+ const [code, setCode] = react.useState('');
573
573
  const {
574
574
  accredit_status: isActivated,
575
575
  message: statusMessage,
@@ -621,7 +621,7 @@ const AuthorizationModal = _ref => {
621
621
  }) : intl.formatMessage({
622
622
  id: 'license.button.activate'
623
623
  });
624
- return /*#__PURE__*/jsxRuntime.jsx(StyledModal$1, {
624
+ return /*#__PURE__*/jsxRuntime.jsx(StyledModal$3, {
625
625
  title: intl.formatMessage({
626
626
  id: title
627
627
  }),
@@ -693,7 +693,7 @@ const DEFAULT_AUTH = {
693
693
  expires_time: '' // 授权到期时间
694
694
  };
695
695
  const useAuth = options => {
696
- const intl = useIntl$1();
696
+ const intl = useIntl();
697
697
  const {
698
698
  fetchAuthInfo,
699
699
  authorize,
@@ -701,13 +701,13 @@ const useAuth = options => {
701
701
  autoShowModal = true
702
702
  } = options || {};
703
703
  const [messageApi, contextHolder] = antd.message.useMessage();
704
- const [showModal, setShowModal] = React.useState(false); // 默认隐藏
705
- const [authData, setAuthData] = React.useState(defaultAuthData);
706
- const [isRegistered, setIsRegistered] = React.useState(false);
707
- const [loading, setLoading] = React.useState(false);
708
- const openModal = React.useCallback(() => setShowModal(true), []);
709
- const closeModal = React.useCallback(() => setShowModal(false), []);
710
- React.useEffect(() => {
704
+ const [showModal, setShowModal] = react.useState(false); // 默认隐藏
705
+ const [authData, setAuthData] = react.useState(defaultAuthData);
706
+ const [isRegistered, setIsRegistered] = react.useState(false);
707
+ const [loading, setLoading] = react.useState(false);
708
+ const openModal = react.useCallback(() => setShowModal(true), []);
709
+ const closeModal = react.useCallback(() => setShowModal(false), []);
710
+ react.useEffect(() => {
711
711
  async function loadAuthInfo() {
712
712
  try {
713
713
  setLoading(true);
@@ -790,28 +790,28 @@ const useUpgrade = _ref => {
790
790
  uploadCompleteDelay = 3000,
791
791
  statusPollingInterval = 1000
792
792
  } = _ref;
793
- const intl = useIntl$1();
794
- const [isSpinning, setIsSpinning] = React.useState(false);
795
- const [pollingInterval, setPollingInterval] = React.useState(undefined); // 间隔时间,当设置值为 undefined 时会停止计时器
796
- const [currentStatus, setCurrentStatus] = React.useState(intl.formatMessage({
793
+ const intl = useIntl();
794
+ const [isSpinning, setIsSpinning] = react.useState(false);
795
+ const [pollingInterval, setPollingInterval] = react.useState(undefined); // 间隔时间,当设置值为 undefined 时会停止计时器
796
+ const [currentStatus, setCurrentStatus] = react.useState(intl.formatMessage({
797
797
  id: 'upgrade.status.idle'
798
798
  })); // 'idle' | 'uploading' | 'Upload complete, starting upgrade...' | 'upgrading'
799
- const [uploadProgress, setUploadProgress] = React.useState(0);
800
- const inputRef = React.useRef(null);
799
+ const [uploadProgress, setUploadProgress] = react.useState(0);
800
+ const inputRef = react.useRef(null);
801
801
  // 控制并发上传
802
- const isUploadingRef = React.useRef(false);
802
+ const isUploadingRef = react.useRef(false);
803
803
  // 标记组件是否已卸载
804
- const isMountedRef = React.useRef(true);
804
+ const isMountedRef = react.useRef(true);
805
805
 
806
806
  // 分别创建独立的取消令牌
807
- const uploadCancelToken = React.useRef(axios.CancelToken.source());
808
- const statusCancelToken = React.useRef(axios.CancelToken.source());
807
+ const uploadCancelToken = react.useRef(axios.CancelToken.source());
808
+ const statusCancelToken = react.useRef(axios.CancelToken.source());
809
809
  const showLoader = () => setIsSpinning(true);
810
810
  const hideLoader = () => setIsSpinning(false);
811
811
 
812
812
  // 构建菜单项 - 确保至少包含download和upload
813
813
  // 构建菜单项 - 最终完美版本
814
- const finalMenuItems = React.useMemo(() => {
814
+ const finalMenuItems = react.useMemo(() => {
815
815
  const hasDownload = menuItems.some(item => item.key === 'download');
816
816
  const hasUpload = menuItems.some(item => item.key === 'upload');
817
817
  if (hasDownload && hasUpload) {
@@ -1090,7 +1090,7 @@ const useUpgrade = _ref => {
1090
1090
  ahooks.useInterval(fetchUpgradeStatus, pollingInterval);
1091
1091
 
1092
1092
  // 组件卸载时清理
1093
- React.useEffect(() => {
1093
+ react.useEffect(() => {
1094
1094
  return () => {
1095
1095
  isMountedRef.current = false;
1096
1096
  uploadCancelToken.current.cancel();
@@ -1144,7 +1144,7 @@ const useSystemOperations = function () {
1144
1144
  okText = "system.button.confirm",
1145
1145
  run
1146
1146
  } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1147
- const intl = useIntl$1();
1147
+ const intl = useIntl();
1148
1148
  const {
1149
1149
  modal: AntdModal
1150
1150
  } = antd.App.useApp();
@@ -1159,7 +1159,7 @@ const useSystemOperations = function () {
1159
1159
  const okTextValue = typeof okText === 'string' && okText.includes('.') ? intl.formatMessage({
1160
1160
  id: okText
1161
1161
  }) : okText;
1162
- const doAction = React.useCallback(action => {
1162
+ const doAction = react.useCallback(action => {
1163
1163
  try {
1164
1164
  AntdModal.confirm({
1165
1165
  icon: /*#__PURE__*/jsxRuntime.jsx(icons.ExclamationCircleFilled, {}),
@@ -1187,7 +1187,7 @@ const useSystemOperations = function () {
1187
1187
  console.error("".concat(action.toUpperCase(), " ERROR: "), error);
1188
1188
  }
1189
1189
  }, [AntdModal, confirmTitleText, cancelTextValue, okTextValue, onPowerOff, onRestart, intl]);
1190
- const getMenuItems = React.useCallback(() => [{
1190
+ const getMenuItems = react.useCallback(() => [{
1191
1191
  key: "poweroff",
1192
1192
  label: intl.formatMessage({
1193
1193
  id: 'system.poweroff'
@@ -1198,7 +1198,7 @@ const useSystemOperations = function () {
1198
1198
  id: 'system.restart'
1199
1199
  })
1200
1200
  }], [intl]);
1201
- const handleMenuClick = React.useCallback(_ref => {
1201
+ const handleMenuClick = react.useCallback(_ref => {
1202
1202
  let {
1203
1203
  key
1204
1204
  } = _ref;
@@ -1212,8 +1212,8 @@ const useSystemOperations = function () {
1212
1212
  var useSystemOperations$1 = useSystemOperations;
1213
1213
 
1214
1214
  const usePageReload = () => {
1215
- const [reloading, setReloading] = React.useState(false);
1216
- const startReload = React.useCallback(function () {
1215
+ const [reloading, setReloading] = react.useState(false);
1216
+ const startReload = react.useCallback(function () {
1217
1217
  let delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 800;
1218
1218
  if (reloading) return; // 防止重复触发
1219
1219
 
@@ -1425,21 +1425,21 @@ const createGlobalLogger = function () {
1425
1425
  // 心跳管理器
1426
1426
  const useHeartbeat = function (sendMessage, readyState, config, logger) {
1427
1427
  let enabled = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
1428
- const heartbeatTimerRef = React.useRef(null);
1429
- const lastHeartbeatTimeRef = React.useRef(Date.now());
1430
- const isMountedRef = React.useRef(true);
1431
- const configRef = React.useRef({
1428
+ const heartbeatTimerRef = react.useRef(null);
1429
+ const lastHeartbeatTimeRef = react.useRef(Date.now());
1430
+ const isMountedRef = react.useRef(true);
1431
+ const configRef = react.useRef({
1432
1432
  interval: (config === null || config === void 0 ? void 0 : config.interval) || 20000,
1433
1433
  message: (config === null || config === void 0 ? void 0 : config.message) || {
1434
1434
  type: 'ping'
1435
1435
  }
1436
1436
  });
1437
- const stateRef = React.useRef({
1437
+ const stateRef = react.useRef({
1438
1438
  sendMessage,
1439
1439
  readyState,
1440
1440
  enabled
1441
1441
  });
1442
- React.useEffect(() => {
1442
+ react.useEffect(() => {
1443
1443
  configRef.current = {
1444
1444
  interval: (config === null || config === void 0 ? void 0 : config.interval) || 20000,
1445
1445
  message: (config === null || config === void 0 ? void 0 : config.message) || {
@@ -1447,14 +1447,14 @@ const useHeartbeat = function (sendMessage, readyState, config, logger) {
1447
1447
  }
1448
1448
  };
1449
1449
  }, [config === null || config === void 0 ? void 0 : config.interval, config === null || config === void 0 ? void 0 : config.message]);
1450
- React.useEffect(() => {
1450
+ react.useEffect(() => {
1451
1451
  stateRef.current = {
1452
1452
  sendMessage,
1453
1453
  readyState,
1454
1454
  enabled
1455
1455
  };
1456
1456
  }, [sendMessage, readyState, enabled]);
1457
- React.useEffect(() => {
1457
+ react.useEffect(() => {
1458
1458
  return () => {
1459
1459
  isMountedRef.current = false;
1460
1460
  if (heartbeatTimerRef.current) {
@@ -1462,7 +1462,7 @@ const useHeartbeat = function (sendMessage, readyState, config, logger) {
1462
1462
  }
1463
1463
  };
1464
1464
  }, []);
1465
- const stopHeartbeat = React.useCallback(() => {
1465
+ const stopHeartbeat = react.useCallback(() => {
1466
1466
  if (heartbeatTimerRef.current) {
1467
1467
  clearInterval(heartbeatTimerRef.current);
1468
1468
  heartbeatTimerRef.current = null;
@@ -1471,7 +1471,7 @@ const useHeartbeat = function (sendMessage, readyState, config, logger) {
1471
1471
  }
1472
1472
  }
1473
1473
  }, [logger]);
1474
- const startHeartbeat = React.useCallback(() => {
1474
+ const startHeartbeat = react.useCallback(() => {
1475
1475
  stopHeartbeat();
1476
1476
  const currentState = stateRef.current;
1477
1477
  const currentConfig = configRef.current;
@@ -1507,7 +1507,7 @@ const useHeartbeat = function (sendMessage, readyState, config, logger) {
1507
1507
  }, [stopHeartbeat, logger]);
1508
1508
 
1509
1509
  // 自动管理心跳
1510
- React.useEffect(() => {
1510
+ react.useEffect(() => {
1511
1511
  const currentState = stateRef.current;
1512
1512
  if (currentState.enabled) {
1513
1513
  if (currentState.readyState === 1) {
@@ -1525,7 +1525,7 @@ const useHeartbeat = function (sendMessage, readyState, config, logger) {
1525
1525
  }
1526
1526
  };
1527
1527
  }, [readyState, enabled, startHeartbeat, stopHeartbeat]);
1528
- const heartbeatImpl = React.useMemo(() => {
1528
+ const heartbeatImpl = react.useMemo(() => {
1529
1529
  if (!enabled) {
1530
1530
  return {
1531
1531
  startHeartbeat: () => {},
@@ -1550,16 +1550,16 @@ const useWebSocketWithFeatures = config => {
1550
1550
  heartbeat: heartbeatConfig = false,
1551
1551
  enableLog = true
1552
1552
  } = config;
1553
- const [isConnected, setIsConnected] = React.useState(false);
1553
+ const [isConnected, setIsConnected] = react.useState(false);
1554
1554
 
1555
1555
  // 创建 logger 实例
1556
- const logger = React.useMemo(() => {
1556
+ const logger = react.useMemo(() => {
1557
1557
  if (enableLog) {
1558
1558
  return createGlobalLogger(url);
1559
1559
  }
1560
1560
  return createDummyLogger();
1561
1561
  }, [url, enableLog]);
1562
- const websocketOptions = React.useMemo(() => _objectSpread2(_objectSpread2({}, options), {}, {
1562
+ const websocketOptions = react.useMemo(() => _objectSpread2$2(_objectSpread2$2({}, options), {}, {
1563
1563
  onOpen: event => {
1564
1564
  var _options$onOpen;
1565
1565
  logger.log('INFO', 'WebSocket 连接成功', {
@@ -1611,12 +1611,12 @@ const useWebSocketWithFeatures = config => {
1611
1611
  connect,
1612
1612
  disconnect
1613
1613
  } = ahooks.useWebSocket(url, websocketOptions);
1614
- const heartbeatOptions = React.useMemo(() => heartbeatConfig === true ? {} : heartbeatConfig, [heartbeatConfig]);
1615
- const heartbeatEnabled = React.useMemo(() => heartbeatConfig !== false, [heartbeatConfig]);
1614
+ const heartbeatOptions = react.useMemo(() => heartbeatConfig === true ? {} : heartbeatConfig, [heartbeatConfig]);
1615
+ const heartbeatEnabled = react.useMemo(() => heartbeatConfig !== false, [heartbeatConfig]);
1616
1616
  const heartbeat = useHeartbeat(sendMessage, readyState, heartbeatOptions, logger, heartbeatEnabled);
1617
1617
 
1618
1618
  // 在全局暴露日志方法
1619
- React.useEffect(() => {
1619
+ react.useEffect(() => {
1620
1620
  if (typeof window !== 'undefined' && enableLog) {
1621
1621
  // 生成唯一的键名:基于URL进行base64编码
1622
1622
  const key = "exportWebSocketLogs_".concat(btoa(url));
@@ -1630,7 +1630,7 @@ const useWebSocketWithFeatures = config => {
1630
1630
  }
1631
1631
  };
1632
1632
  }, [url, enableLog, logger]);
1633
- const loggerMethods = React.useMemo(() => ({
1633
+ const loggerMethods = react.useMemo(() => ({
1634
1634
  log: (level, message, data) => logger.log(level, message, data),
1635
1635
  exportLogs: () => logger.exportLogs(),
1636
1636
  getLogStats: () => logger.getLogStats(),
@@ -1968,7 +1968,7 @@ const NetworkFieldGroup = _ref => {
1968
1968
  interfaces,
1969
1969
  fieldConfig = {}
1970
1970
  } = _ref;
1971
- const intl = useIntl$1();
1971
+ const intl = useIntl();
1972
1972
 
1973
1973
  // 默认字段配置
1974
1974
  const defaultFieldConfig = {
@@ -1991,7 +1991,7 @@ const NetworkFieldGroup = _ref => {
1991
1991
  enabled: true
1992
1992
  }
1993
1993
  };
1994
- const mergedFieldConfig = _objectSpread2(_objectSpread2(_objectSpread2({}, defaultFieldConfig), fieldConfig), {}, {
1994
+ const mergedFieldConfig = _objectSpread2$2(_objectSpread2$2(_objectSpread2$2({}, defaultFieldConfig), fieldConfig), {}, {
1995
1995
  netmask: {
1996
1996
  label: defaultFieldConfig.netmask.label,
1997
1997
  enabled: (_fieldConfig$netmask$ = (_fieldConfig$netmask = fieldConfig.netmask) === null || _fieldConfig$netmask === void 0 ? void 0 : _fieldConfig$netmask.enabled) !== null && _fieldConfig$netmask$ !== void 0 ? _fieldConfig$netmask$ : defaultFieldConfig.netmask.enabled
@@ -2055,42 +2055,42 @@ const NetworkSettingsModal = _ref2 => {
2055
2055
  },
2056
2056
  restartRemark
2057
2057
  } = _ref2;
2058
- const intl = useIntl$1();
2058
+ const intl = useIntl();
2059
2059
  const {
2060
2060
  message,
2061
2061
  modal
2062
2062
  } = antd.App.useApp();
2063
2063
  const [form] = antd.Form.useForm();
2064
- const [st2110Interfaces, setSt2110Interfaces] = React.useState([]);
2065
- const [lanConfigs, setLanConfigs] = React.useState([]);
2066
- const [submitLoading, setSubmitLoading] = React.useState(false);
2067
- const [isInitialized, setIsInitialized] = React.useState(false);
2064
+ const [st2110Interfaces, setSt2110Interfaces] = react.useState([]);
2065
+ const [lanConfigs, setLanConfigs] = react.useState([]);
2066
+ const [submitLoading, setSubmitLoading] = react.useState(false);
2067
+ const [isInitialized, setIsInitialized] = react.useState(false);
2068
2068
 
2069
2069
  // 用于保存原始 QSFP 数据,供无 getSysConfig 时做对比
2070
- const originalSt2110InterfacesRef = React.useRef([]);
2071
- const initializationStatus = React.useRef({
2070
+ const originalSt2110InterfacesRef = react.useRef([]);
2071
+ const initializationStatus = react.useRef({
2072
2072
  hasFetched: false,
2073
2073
  hasInitialized: false
2074
2074
  });
2075
- const preparedFieldConfig = React.useMemo(() => {
2076
- const config = _objectSpread2({}, fieldConfig);
2075
+ const preparedFieldConfig = react.useMemo(() => {
2076
+ const config = _objectSpread2$2({}, fieldConfig);
2077
2077
 
2078
2078
  // 确保LAN和QSFP的配置存在
2079
2079
  config.LAN = config.LAN || {};
2080
2080
  config.QSFP = config.QSFP || {};
2081
2081
  if (sections.includes('LAN')) {
2082
- config.LAN.netmask = _objectSpread2(_objectSpread2({}, config.LAN.netmask || {}), {}, {
2082
+ config.LAN.netmask = _objectSpread2$2(_objectSpread2$2({}, config.LAN.netmask || {}), {}, {
2083
2083
  enabled: showNetmask.LAN
2084
2084
  });
2085
2085
  }
2086
2086
  if (sections.includes('QSFP')) {
2087
- config.QSFP.netmask = _objectSpread2(_objectSpread2({}, config.QSFP.netmask || {}), {}, {
2087
+ config.QSFP.netmask = _objectSpread2$2(_objectSpread2$2({}, config.QSFP.netmask || {}), {}, {
2088
2088
  enabled: showNetmask.QSFP
2089
2089
  });
2090
2090
  }
2091
2091
  return config;
2092
2092
  }, [fieldConfig, showNetmask, sections]);
2093
- React.useEffect(() => {
2093
+ react.useEffect(() => {
2094
2094
  if (!open) return;
2095
2095
  const fetchData = async () => {
2096
2096
  if (initializationStatus.current.hasFetched) return;
@@ -2112,7 +2112,7 @@ const NetworkSettingsModal = _ref2 => {
2112
2112
  if (sections.includes('LAN')) {
2113
2113
  promises.push(getLanConfig());
2114
2114
  }
2115
- if (sections.includes('QSFP')) {
2115
+ if (sections.includes('QSFP') && getSysConfig) {
2116
2116
  promises.push(getSysConfig());
2117
2117
  }
2118
2118
  const results = await Promise.allSettled(promises);
@@ -2141,7 +2141,7 @@ const NetworkSettingsModal = _ref2 => {
2141
2141
  }, [open, getLanConfig, getSysConfig, getConfig, sections]);
2142
2142
 
2143
2143
  // 当模态框关闭时重置状态
2144
- React.useEffect(() => {
2144
+ react.useEffect(() => {
2145
2145
  if (!open) {
2146
2146
  setIsInitialized(false);
2147
2147
  setLanConfigs([]);
@@ -2156,10 +2156,10 @@ const NetworkSettingsModal = _ref2 => {
2156
2156
  }, [open, form]);
2157
2157
 
2158
2158
  // 动态初始值配置
2159
- const initialValues = React.useMemo(() => {
2159
+ const initialValues = react.useMemo(() => {
2160
2160
  const values = {};
2161
2161
  if (sections.includes('LAN') && lanConfigs.length > 0) {
2162
- values.LAN = lanConfigs.map(config => _objectSpread2({
2162
+ values.LAN = lanConfigs.map(config => _objectSpread2$2({
2163
2163
  connection_id: config.connection_id,
2164
2164
  display_name: config.display_name,
2165
2165
  ip_address: config.ip_address
@@ -2168,7 +2168,7 @@ const NetworkSettingsModal = _ref2 => {
2168
2168
  } : {}));
2169
2169
  }
2170
2170
  if (sections.includes('QSFP') && st2110Interfaces.length > 0) {
2171
- values.QSFP = st2110Interfaces.map(iface => _objectSpread2(_objectSpread2({}, iface.id !== undefined && {
2171
+ values.QSFP = st2110Interfaces.map(iface => _objectSpread2$2(_objectSpread2$2({}, iface.id !== undefined && {
2172
2172
  id: iface.id
2173
2173
  }), {}, {
2174
2174
  display_name: iface.display_name,
@@ -2181,7 +2181,7 @@ const NetworkSettingsModal = _ref2 => {
2181
2181
  }, [lanConfigs, st2110Interfaces, sections, showNetmask]);
2182
2182
 
2183
2183
  // 当初始值准备好后设置表单值
2184
- React.useEffect(() => {
2184
+ react.useEffect(() => {
2185
2185
  if (isInitialized && !initializationStatus.current.hasInitialized) {
2186
2186
  form.setFieldsValue(initialValues);
2187
2187
  initializationStatus.current.hasInitialized = true;
@@ -2189,7 +2189,7 @@ const NetworkSettingsModal = _ref2 => {
2189
2189
  }, [isInitialized, form, initialValues]);
2190
2190
 
2191
2191
  // 成功处理
2192
- const handleSuccess = React.useCallback(async function () {
2192
+ const handleSuccess = react.useCallback(async function () {
2193
2193
  let {
2194
2194
  messageText,
2195
2195
  isPopup = false,
@@ -2266,7 +2266,7 @@ const NetworkSettingsModal = _ref2 => {
2266
2266
  }
2267
2267
  onClose();
2268
2268
  }, [intl, message, modal, getSysConfig, restart, getConfig, sections, onClose]);
2269
- const handleSubmit = React.useCallback(async () => {
2269
+ const handleSubmit = react.useCallback(async () => {
2270
2270
  setSubmitLoading(true);
2271
2271
  try {
2272
2272
  const values = await form.validateFields();
@@ -2289,7 +2289,7 @@ const NetworkSettingsModal = _ref2 => {
2289
2289
  if (sections.includes('LAN') && values.LAN) {
2290
2290
  const lanData = values.LAN.map((item, index) => {
2291
2291
  var _lanConfigs$index;
2292
- return _objectSpread2({
2292
+ return _objectSpread2$2({
2293
2293
  connection_id: (_lanConfigs$index = lanConfigs[index]) === null || _lanConfigs$index === void 0 ? void 0 : _lanConfigs$index.connection_id,
2294
2294
  ip_address: item.ip_address
2295
2295
  }, showNetmask.LAN ? {
@@ -2303,7 +2303,7 @@ const NetworkSettingsModal = _ref2 => {
2303
2303
  if (sections.includes('QSFP') && values.QSFP) {
2304
2304
  const interfacesData = values.QSFP.map((item, index) => {
2305
2305
  var _st2110Interfaces$ind, _st2110Interfaces$ind2, _st2110Interfaces$ind3;
2306
- return _objectSpread2(_objectSpread2(_objectSpread2({}, (st2110Interfaces === null || st2110Interfaces === void 0 || (_st2110Interfaces$ind = st2110Interfaces[index]) === null || _st2110Interfaces$ind === void 0 ? void 0 : _st2110Interfaces$ind.id) !== undefined && {
2306
+ return _objectSpread2$2(_objectSpread2$2(_objectSpread2$2({}, (st2110Interfaces === null || st2110Interfaces === void 0 || (_st2110Interfaces$ind = st2110Interfaces[index]) === null || _st2110Interfaces$ind === void 0 ? void 0 : _st2110Interfaces$ind.id) !== undefined && {
2307
2307
  id: st2110Interfaces === null || st2110Interfaces === void 0 || (_st2110Interfaces$ind2 = st2110Interfaces[index]) === null || _st2110Interfaces$ind2 === void 0 ? void 0 : _st2110Interfaces$ind2.id
2308
2308
  }), (st2110Interfaces === null || st2110Interfaces === void 0 || (_st2110Interfaces$ind3 = st2110Interfaces[index]) === null || _st2110Interfaces$ind3 === void 0 ? void 0 : _st2110Interfaces$ind3.ip) !== undefined ? {
2309
2309
  ip: item.ip_address
@@ -2345,7 +2345,7 @@ const NetworkSettingsModal = _ref2 => {
2345
2345
  }, [form, sections, lanConfigs, st2110Interfaces, updateLanConfig, updateSysConfig, handleSuccess]);
2346
2346
 
2347
2347
  // 合并默认模态框属性和传入的属性
2348
- const mergedModalProps = _objectSpread2({
2348
+ const mergedModalProps = _objectSpread2$2({
2349
2349
  title: intl.formatMessage({
2350
2350
  id: 'networkSettings.title'
2351
2351
  }),
@@ -2366,7 +2366,7 @@ const NetworkSettingsModal = _ref2 => {
2366
2366
  }, modalProps);
2367
2367
 
2368
2368
  // 合并默认表单属性和传入的属性
2369
- const mergedFormProps = _objectSpread2({
2369
+ const mergedFormProps = _objectSpread2$2({
2370
2370
  form: form,
2371
2371
  labelCol: {
2372
2372
  span: 6
@@ -2376,8 +2376,8 @@ const NetworkSettingsModal = _ref2 => {
2376
2376
  },
2377
2377
  autoComplete: "off"
2378
2378
  }, formProps);
2379
- return /*#__PURE__*/jsxRuntime.jsxs(StyledModal$1, _objectSpread2(_objectSpread2({}, mergedModalProps), {}, {
2380
- children: [/*#__PURE__*/jsxRuntime.jsxs(antd.Form, _objectSpread2(_objectSpread2({}, mergedFormProps), {}, {
2379
+ return /*#__PURE__*/jsxRuntime.jsxs(StyledModal$3, _objectSpread2$2(_objectSpread2$2({}, mergedModalProps), {}, {
2380
+ children: [/*#__PURE__*/jsxRuntime.jsxs(antd.Form, _objectSpread2$2(_objectSpread2$2({}, mergedFormProps), {}, {
2381
2381
  children: [sections.includes('LAN') && lanConfigs.length > 0 && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
2382
2382
  children: [/*#__PURE__*/jsxRuntime.jsx(NetworkFieldGroup, {
2383
2383
  prefix: "LAN",
@@ -2392,7 +2392,7 @@ const NetworkSettingsModal = _ref2 => {
2392
2392
  })), restartRemark]
2393
2393
  }));
2394
2394
  };
2395
- var NetworkSettingsModal$1 = /*#__PURE__*/React.memo(NetworkSettingsModal);
2395
+ var NetworkSettingsModal$1 = /*#__PURE__*/react.memo(NetworkSettingsModal);
2396
2396
 
2397
2397
  const defaultFieldConfigs = {
2398
2398
  clock_class: {
@@ -2499,7 +2499,7 @@ function convertPtpStatusToArray(ptpStatus, fieldConfigs, fieldOrder) {
2499
2499
  formType: 'text'
2500
2500
  };
2501
2501
  const value = ptpStatus[key];
2502
- return _objectSpread2(_objectSpread2({
2502
+ return _objectSpread2$2(_objectSpread2$2({
2503
2503
  key,
2504
2504
  value
2505
2505
  }, config), {}, {
@@ -2518,14 +2518,14 @@ const PtpModal = _ref => {
2518
2518
  modalProps = {},
2519
2519
  formProps = {}
2520
2520
  } = _ref;
2521
- const intl = useIntl$1();
2522
- const [ptpStatus, setPtpStatus] = React.useState(null);
2523
- const [loading, setLoading] = React.useState(false);
2521
+ const intl = useIntl();
2522
+ const [ptpStatus, setPtpStatus] = react.useState(null);
2523
+ const [loading, setLoading] = react.useState(false);
2524
2524
  const [form] = antd.Form.useForm();
2525
2525
  const {
2526
2526
  message
2527
2527
  } = antd.App.useApp();
2528
- React.useEffect(() => {
2528
+ react.useEffect(() => {
2529
2529
  if (open) {
2530
2530
  setLoading(true);
2531
2531
  getPtpInfo().then(data => {
@@ -2545,7 +2545,7 @@ const PtpModal = _ref => {
2545
2545
  setPtpStatus(null);
2546
2546
  }
2547
2547
  }, [open, form, getPtpInfo]);
2548
- const ptpStatusArray = React.useMemo(() => {
2548
+ const ptpStatusArray = react.useMemo(() => {
2549
2549
  if (!ptpStatus) return [];
2550
2550
  return convertPtpStatusToArray(ptpStatus, fieldConfigs, fieldOrder);
2551
2551
  }, [ptpStatus, fieldConfigs, fieldOrder]);
@@ -2583,7 +2583,7 @@ const PtpModal = _ref => {
2583
2583
  var _item$options, _item$statusMap, _item$min, _item$max;
2584
2584
  switch (item.formType) {
2585
2585
  case 'select':
2586
- const selectOptions = (_item$options = item.options) === null || _item$options === void 0 ? void 0 : _item$options.map(opt => _objectSpread2(_objectSpread2({}, opt), {}, {
2586
+ const selectOptions = (_item$options = item.options) === null || _item$options === void 0 ? void 0 : _item$options.map(opt => _objectSpread2$2(_objectSpread2$2({}, opt), {}, {
2587
2587
  label: intl.formatMessage({
2588
2588
  id: opt.label
2589
2589
  }, {
@@ -2636,7 +2636,7 @@ const PtpModal = _ref => {
2636
2636
  if (!open || !ptpStatus) return null;
2637
2637
 
2638
2638
  // 合并默认模态框属性和传入的属性
2639
- const mergedModalProps = _objectSpread2({
2639
+ const mergedModalProps = _objectSpread2$2({
2640
2640
  title: intl.formatMessage({
2641
2641
  id: 'ptp.title'
2642
2642
  }),
@@ -2654,7 +2654,7 @@ const PtpModal = _ref => {
2654
2654
  }, modalProps);
2655
2655
 
2656
2656
  // 合并默认表单属性和传入的属性
2657
- const mergedFormProps = _objectSpread2({
2657
+ const mergedFormProps = _objectSpread2$2({
2658
2658
  form: form,
2659
2659
  name: "ptpForm",
2660
2660
  labelCol: {
@@ -2665,8 +2665,8 @@ const PtpModal = _ref => {
2665
2665
  },
2666
2666
  autoComplete: "off"
2667
2667
  }, formProps);
2668
- return /*#__PURE__*/jsxRuntime.jsx(StyledModal$1, _objectSpread2(_objectSpread2({}, mergedModalProps), {}, {
2669
- children: /*#__PURE__*/jsxRuntime.jsx(antd.Form, _objectSpread2(_objectSpread2({}, mergedFormProps), {}, {
2668
+ return /*#__PURE__*/jsxRuntime.jsx(StyledModal$3, _objectSpread2$2(_objectSpread2$2({}, mergedModalProps), {}, {
2669
+ children: /*#__PURE__*/jsxRuntime.jsx(antd.Form, _objectSpread2$2(_objectSpread2$2({}, mergedFormProps), {}, {
2670
2670
  children: ptpStatusArray.map(item => /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
2671
2671
  label: renderLabel(item),
2672
2672
  name: item.key,
@@ -2676,9 +2676,9 @@ const PtpModal = _ref => {
2676
2676
  }))
2677
2677
  }));
2678
2678
  };
2679
- var PtpModal$1 = /*#__PURE__*/React.memo(PtpModal);
2679
+ var PtpModal$1 = /*#__PURE__*/react.memo(PtpModal);
2680
2680
 
2681
- const LeftList = /*#__PURE__*/React.memo(_ref => {
2681
+ const LeftList = /*#__PURE__*/react.memo(_ref => {
2682
2682
  let {
2683
2683
  dataSource,
2684
2684
  selectedPresetId,
@@ -2696,7 +2696,7 @@ const LeftList = /*#__PURE__*/React.memo(_ref => {
2696
2696
  exportButton: "preset.button.export"
2697
2697
  }
2698
2698
  } = _ref;
2699
- const intl = useIntl$1();
2699
+ const intl = useIntl();
2700
2700
 
2701
2701
  // 格式化文本的辅助函数
2702
2702
  const fmt = key => {
@@ -2836,7 +2836,7 @@ const SubmitButton = _ref2 => {
2836
2836
  })
2837
2837
  });
2838
2838
  };
2839
- const RightDetailForm = /*#__PURE__*/React.memo(_ref3 => {
2839
+ const RightDetailForm = /*#__PURE__*/react.memo(_ref3 => {
2840
2840
  let {
2841
2841
  form,
2842
2842
  onSave,
@@ -2871,9 +2871,9 @@ const RightDetailForm = /*#__PURE__*/React.memo(_ref3 => {
2871
2871
  // 作用:在切换选中预设时强制触发 Checkbox 的重新初始化
2872
2872
  enableEdit = true
2873
2873
  } = _ref3;
2874
- const intl = useIntl$1();
2875
- const [initialSelected, setInitialSelected] = React.useState([]);
2876
- const [isEditMode, setIsEditMode] = React.useState(false); // 是否进入编辑模式
2874
+ const intl = useIntl();
2875
+ const [initialSelected, setInitialSelected] = react.useState([]);
2876
+ const [isEditMode, setIsEditMode] = react.useState(false); // 是否进入编辑模式
2877
2877
  const currentSelected = antd.Form.useWatch('category_list', form) || [];
2878
2878
 
2879
2879
  // 格式化文本的辅助函数
@@ -2890,7 +2890,7 @@ const RightDetailForm = /*#__PURE__*/React.memo(_ref3 => {
2890
2890
  const hasCategoryList = fields.category_list !== null && fields.category_list !== undefined;
2891
2891
 
2892
2892
  // 初始化 category_list 的选择状态
2893
- React.useEffect(() => {
2893
+ react.useEffect(() => {
2894
2894
  if (hasCategoryList) {
2895
2895
  const currentValue = form.getFieldValue('category_list') || [];
2896
2896
  setInitialSelected(currentValue);
@@ -2898,17 +2898,17 @@ const RightDetailForm = /*#__PURE__*/React.memo(_ref3 => {
2898
2898
  }, [presetChanged, form, hasCategoryList]); // 当presetChanged变化时更新
2899
2899
 
2900
2900
  // 当 isSavedPreset 或 presetChanged 变化时,重置编辑模式
2901
- React.useEffect(() => {
2901
+ react.useEffect(() => {
2902
2902
  setIsEditMode(false);
2903
2903
  }, [isSavedPreset, presetChanged]);
2904
2904
 
2905
2905
  // 动态生成 checkbox 选项
2906
- const checkboxOptions = React.useMemo(() => {
2906
+ const checkboxOptions = react.useMemo(() => {
2907
2907
  if (!hasCategoryList) return [];
2908
2908
  return fields.category_list.options.map(category => {
2909
2909
  const isInitiallySelected = initialSelected.includes(category.name);
2910
2910
  const shouldDisable = isSavedPreset ? !isInitiallySelected : false;
2911
- return _objectSpread2(_objectSpread2({}, category), {}, {
2911
+ return _objectSpread2$2(_objectSpread2$2({}, category), {}, {
2912
2912
  disabled: shouldDisable,
2913
2913
  initiallySelected: isInitiallySelected
2914
2914
  });
@@ -3034,7 +3034,7 @@ const RightDetailForm = /*#__PURE__*/React.memo(_ref3 => {
3034
3034
  }) :
3035
3035
  /*#__PURE__*/
3036
3036
  // 非编辑模式下的按钮
3037
- jsxRuntime.jsx(SubmitButton, _objectSpread2(_objectSpread2({
3037
+ jsxRuntime.jsx(SubmitButton, _objectSpread2$2(_objectSpread2$2({
3038
3038
  action: handleLoad
3039
3039
  }, hasCategoryList && {
3040
3040
  disabled: !currentSelected.length
@@ -3103,20 +3103,20 @@ const Preset = _ref => {
3103
3103
  enableEdit = true,
3104
3104
  enableImportAndExport = false
3105
3105
  } = _ref;
3106
- const intl = useIntl$1();
3106
+ const intl = useIntl();
3107
3107
  const {
3108
3108
  message,
3109
3109
  modal
3110
3110
  } = antd.App.useApp();
3111
- const [presetList, setPresetList] = React.useState([]);
3112
- const [selectedPreset, setSelectedPreset] = React.useState(null);
3113
- const [loading, setLoading] = React.useState(false);
3114
- const [uploading, setUploading] = React.useState(false);
3115
- const [presetChanged, setPresetChanged] = React.useState(0);
3111
+ const [presetList, setPresetList] = react.useState([]);
3112
+ const [selectedPreset, setSelectedPreset] = react.useState(null);
3113
+ const [loading, setLoading] = react.useState(false);
3114
+ const [uploading, setUploading] = react.useState(false);
3115
+ const [presetChanged, setPresetChanged] = react.useState(0);
3116
3116
  const [form] = antd.Form.useForm();
3117
3117
 
3118
3118
  // 格式化文本的辅助函数
3119
- const fmt = React.useCallback(key => {
3119
+ const fmt = react.useCallback(key => {
3120
3120
  if (typeof key === 'string' && key.includes('.')) {
3121
3121
  return intl.formatMessage({
3122
3122
  id: key
@@ -3124,7 +3124,7 @@ const Preset = _ref => {
3124
3124
  }
3125
3125
  return key;
3126
3126
  }, [intl]);
3127
- const fetchPresetList = React.useCallback(async () => {
3127
+ const fetchPresetList = react.useCallback(async () => {
3128
3128
  try {
3129
3129
  const data = await getPresetList();
3130
3130
  const presets = (data === null || data === void 0 ? void 0 : data.preset_list) || data || [];
@@ -3141,12 +3141,12 @@ const Preset = _ref => {
3141
3141
  console.error('Failed to fetch preset list:', error);
3142
3142
  }
3143
3143
  }, [getPresetList]);
3144
- const handleSelectPreset = React.useCallback(preset => {
3144
+ const handleSelectPreset = react.useCallback(preset => {
3145
3145
  setSelectedPreset(preset);
3146
3146
  form.setFieldsValue(preset);
3147
3147
  setPresetChanged(prev => prev + 1);
3148
3148
  }, [form]);
3149
- const handleAddNew = React.useCallback(() => {
3149
+ const handleAddNew = react.useCallback(() => {
3150
3150
  var _fields$category_list;
3151
3151
  const unsavedPreset = presetList.find(item => !item.id);
3152
3152
  if (unsavedPreset) {
@@ -3170,7 +3170,7 @@ const Preset = _ref => {
3170
3170
  setSelectedPreset(newPreset);
3171
3171
  form.setFieldsValue(newPreset);
3172
3172
  }, [form, presetList, message]);
3173
- const handleRemove = React.useCallback(async () => {
3173
+ const handleRemove = react.useCallback(async () => {
3174
3174
  if (!selectedPreset) return;
3175
3175
 
3176
3176
  // 检查是否为新建的未保存数据(无 id)
@@ -3230,7 +3230,7 @@ const Preset = _ref => {
3230
3230
  console.error('Failed to delete preset:', error);
3231
3231
  }
3232
3232
  }, [selectedPreset, form, modal, message, removePreset, getPresetList, fmt]);
3233
- const handleImport = React.useCallback(async () => {
3233
+ const handleImport = react.useCallback(async () => {
3234
3234
  // 创建一个临时的 input 元素
3235
3235
  const input = document.createElement('input');
3236
3236
  input.type = 'file';
@@ -3272,7 +3272,7 @@ const Preset = _ref => {
3272
3272
  // 触发文件选择框
3273
3273
  input.click();
3274
3274
  }, [uploadPreset, message, intl, fetchPresetList]);
3275
- const handleExport = React.useCallback(() => {
3275
+ const handleExport = react.useCallback(() => {
3276
3276
  if (!(selectedPreset !== null && selectedPreset !== void 0 && selectedPreset.id)) {
3277
3277
  message.warning(intl.formatMessage({
3278
3278
  id: 'preset.error.noSelectionOrIdMissing'
@@ -3292,7 +3292,7 @@ const Preset = _ref => {
3292
3292
  link.click();
3293
3293
  document.body.removeChild(link);
3294
3294
  }, [selectedPreset, message, intl]);
3295
- const handleLoadPreset = React.useCallback(async loadData => {
3295
+ const handleLoadPreset = react.useCallback(async loadData => {
3296
3296
  if (!loadData) return;
3297
3297
  let modalInstance = null;
3298
3298
  let resolveOk = null; // 用于控制 confirm 关闭时机
@@ -3329,7 +3329,7 @@ const Preset = _ref => {
3329
3329
  });
3330
3330
  (async () => {
3331
3331
  try {
3332
- await loadPreset(_objectSpread2({
3332
+ await loadPreset(_objectSpread2$2({
3333
3333
  id: loadData.id
3334
3334
  }, loadData.category_list && {
3335
3335
  category_list: loadData.category_list
@@ -3362,7 +3362,7 @@ const Preset = _ref => {
3362
3362
  }
3363
3363
  });
3364
3364
  }, [loadPreset, message, modal, onLoadSuccess, onLoadError, fmt]);
3365
- const handleSave = React.useCallback(async () => {
3365
+ const handleSave = react.useCallback(async () => {
3366
3366
  setLoading(true);
3367
3367
  try {
3368
3368
  var _fields$name, _fields$category_list2;
@@ -3407,7 +3407,7 @@ const Preset = _ref => {
3407
3407
  setLoading(false);
3408
3408
  }
3409
3409
  }, [form, message, fields, savePreset, getPresetList, fmt]);
3410
- const handleUpdate = React.useCallback(async () => {
3410
+ const handleUpdate = react.useCallback(async () => {
3411
3411
  if (!selectedPreset || !selectedPreset.id) {
3412
3412
  message.error(fmt('preset.error.noSelectionOrIdMissing'));
3413
3413
  return;
@@ -3450,10 +3450,10 @@ const Preset = _ref => {
3450
3450
  }, [form, message, fields, updatePreset, selectedPreset, fmt]);
3451
3451
 
3452
3452
  // 初始化数据
3453
- React.useEffect(() => {
3453
+ react.useEffect(() => {
3454
3454
  fetchPresetList();
3455
3455
  }, [fetchPresetList]);
3456
- return /*#__PURE__*/jsxRuntime.jsx(StyledModal$1, {
3456
+ return /*#__PURE__*/jsxRuntime.jsx(StyledModal$3, {
3457
3457
  title: fmt(texts.title),
3458
3458
  width: width,
3459
3459
  open: open,
@@ -3524,7 +3524,7 @@ const Preset = _ref => {
3524
3524
  })
3525
3525
  });
3526
3526
  };
3527
- var PresetModal = /*#__PURE__*/React.memo(Preset);
3527
+ var PresetModal = /*#__PURE__*/react.memo(Preset);
3528
3528
 
3529
3529
  const _excluded$2 = ["menuItems", "onMenuClick", "downloadFiles", "upgradeExecute", "upgradeStatus", "acceptFileTypes", "uploadCompleteDelay", "statusPollingInterval", "children"];
3530
3530
  const UpgradeManager = _ref => {
@@ -3539,7 +3539,7 @@ const UpgradeManager = _ref => {
3539
3539
  statusPollingInterval = 1000,
3540
3540
  children
3541
3541
  } = _ref,
3542
- dropdownProps = _objectWithoutProperties(_ref, _excluded$2);
3542
+ dropdownProps = _objectWithoutProperties$1(_ref, _excluded$2);
3543
3543
  const [upgradeElement] = useUpgrade$1({
3544
3544
  menuItems,
3545
3545
  onMenuClick,
@@ -3555,7 +3555,7 @@ const UpgradeManager = _ref => {
3555
3555
  const dropdownElement = upgradeElement.props.children[0];
3556
3556
  const otherElements = upgradeElement.props.children.slice(1);
3557
3557
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
3558
- children: [/*#__PURE__*/jsxRuntime.jsx(antd.Dropdown, _objectSpread2(_objectSpread2(_objectSpread2({}, dropdownProps), dropdownElement.props), {}, {
3558
+ children: [/*#__PURE__*/jsxRuntime.jsx(antd.Dropdown, _objectSpread2$2(_objectSpread2$2(_objectSpread2$2({}, dropdownProps), dropdownElement.props), {}, {
3559
3559
  children: children
3560
3560
  })), otherElements]
3561
3561
  });
@@ -3570,15 +3570,15 @@ UpgradeManager.defaultProps = {
3570
3570
  };
3571
3571
  var UpgradeManager$1 = UpgradeManager;
3572
3572
 
3573
- function getDefaultExportFromCjs$8 (x) {
3573
+ function getDefaultExportFromCjs$9 (x) {
3574
3574
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
3575
3575
  }
3576
3576
 
3577
- var propTypes$8 = {exports: {}};
3577
+ var propTypes$9 = {exports: {}};
3578
3578
 
3579
- var reactIs$8 = {exports: {}};
3579
+ var reactIs$9 = {exports: {}};
3580
3580
 
3581
- var reactIs_production_min$8 = {};
3581
+ var reactIs_production_min$9 = {};
3582
3582
 
3583
3583
  /** @license React v16.13.1
3584
3584
  * react-is.production.min.js
@@ -3589,21 +3589,21 @@ var reactIs_production_min$8 = {};
3589
3589
  * LICENSE file in the root directory of this source tree.
3590
3590
  */
3591
3591
 
3592
- var hasRequiredReactIs_production_min$8;
3592
+ var hasRequiredReactIs_production_min$9;
3593
3593
 
3594
- function requireReactIs_production_min$8 () {
3595
- if (hasRequiredReactIs_production_min$8) return reactIs_production_min$8;
3596
- hasRequiredReactIs_production_min$8 = 1;
3594
+ function requireReactIs_production_min$9 () {
3595
+ if (hasRequiredReactIs_production_min$9) return reactIs_production_min$9;
3596
+ hasRequiredReactIs_production_min$9 = 1;
3597
3597
  var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
3598
3598
  Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
3599
- function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}reactIs_production_min$8.AsyncMode=l;reactIs_production_min$8.ConcurrentMode=m;reactIs_production_min$8.ContextConsumer=k;reactIs_production_min$8.ContextProvider=h;reactIs_production_min$8.Element=c;reactIs_production_min$8.ForwardRef=n;reactIs_production_min$8.Fragment=e;reactIs_production_min$8.Lazy=t;reactIs_production_min$8.Memo=r;reactIs_production_min$8.Portal=d;
3600
- reactIs_production_min$8.Profiler=g;reactIs_production_min$8.StrictMode=f;reactIs_production_min$8.Suspense=p;reactIs_production_min$8.isAsyncMode=function(a){return A(a)||z(a)===l};reactIs_production_min$8.isConcurrentMode=A;reactIs_production_min$8.isContextConsumer=function(a){return z(a)===k};reactIs_production_min$8.isContextProvider=function(a){return z(a)===h};reactIs_production_min$8.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};reactIs_production_min$8.isForwardRef=function(a){return z(a)===n};reactIs_production_min$8.isFragment=function(a){return z(a)===e};reactIs_production_min$8.isLazy=function(a){return z(a)===t};
3601
- reactIs_production_min$8.isMemo=function(a){return z(a)===r};reactIs_production_min$8.isPortal=function(a){return z(a)===d};reactIs_production_min$8.isProfiler=function(a){return z(a)===g};reactIs_production_min$8.isStrictMode=function(a){return z(a)===f};reactIs_production_min$8.isSuspense=function(a){return z(a)===p};
3602
- reactIs_production_min$8.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};reactIs_production_min$8.typeOf=z;
3603
- return reactIs_production_min$8;
3599
+ function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}reactIs_production_min$9.AsyncMode=l;reactIs_production_min$9.ConcurrentMode=m;reactIs_production_min$9.ContextConsumer=k;reactIs_production_min$9.ContextProvider=h;reactIs_production_min$9.Element=c;reactIs_production_min$9.ForwardRef=n;reactIs_production_min$9.Fragment=e;reactIs_production_min$9.Lazy=t;reactIs_production_min$9.Memo=r;reactIs_production_min$9.Portal=d;
3600
+ reactIs_production_min$9.Profiler=g;reactIs_production_min$9.StrictMode=f;reactIs_production_min$9.Suspense=p;reactIs_production_min$9.isAsyncMode=function(a){return A(a)||z(a)===l};reactIs_production_min$9.isConcurrentMode=A;reactIs_production_min$9.isContextConsumer=function(a){return z(a)===k};reactIs_production_min$9.isContextProvider=function(a){return z(a)===h};reactIs_production_min$9.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};reactIs_production_min$9.isForwardRef=function(a){return z(a)===n};reactIs_production_min$9.isFragment=function(a){return z(a)===e};reactIs_production_min$9.isLazy=function(a){return z(a)===t};
3601
+ reactIs_production_min$9.isMemo=function(a){return z(a)===r};reactIs_production_min$9.isPortal=function(a){return z(a)===d};reactIs_production_min$9.isProfiler=function(a){return z(a)===g};reactIs_production_min$9.isStrictMode=function(a){return z(a)===f};reactIs_production_min$9.isSuspense=function(a){return z(a)===p};
3602
+ reactIs_production_min$9.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};reactIs_production_min$9.typeOf=z;
3603
+ return reactIs_production_min$9;
3604
3604
  }
3605
3605
 
3606
- var reactIs_development$8 = {};
3606
+ var reactIs_development$9 = {};
3607
3607
 
3608
3608
  /** @license React v16.13.1
3609
3609
  * react-is.development.js
@@ -3614,11 +3614,11 @@ var reactIs_development$8 = {};
3614
3614
  * LICENSE file in the root directory of this source tree.
3615
3615
  */
3616
3616
 
3617
- var hasRequiredReactIs_development$8;
3617
+ var hasRequiredReactIs_development$9;
3618
3618
 
3619
- function requireReactIs_development$8 () {
3620
- if (hasRequiredReactIs_development$8) return reactIs_development$8;
3621
- hasRequiredReactIs_development$8 = 1;
3619
+ function requireReactIs_development$9 () {
3620
+ if (hasRequiredReactIs_development$9) return reactIs_development$9;
3621
+ hasRequiredReactIs_development$9 = 1;
3622
3622
 
3623
3623
 
3624
3624
 
@@ -3759,51 +3759,51 @@ function requireReactIs_development$8 () {
3759
3759
  return typeOf(object) === REACT_SUSPENSE_TYPE;
3760
3760
  }
3761
3761
 
3762
- reactIs_development$8.AsyncMode = AsyncMode;
3763
- reactIs_development$8.ConcurrentMode = ConcurrentMode;
3764
- reactIs_development$8.ContextConsumer = ContextConsumer;
3765
- reactIs_development$8.ContextProvider = ContextProvider;
3766
- reactIs_development$8.Element = Element;
3767
- reactIs_development$8.ForwardRef = ForwardRef;
3768
- reactIs_development$8.Fragment = Fragment;
3769
- reactIs_development$8.Lazy = Lazy;
3770
- reactIs_development$8.Memo = Memo;
3771
- reactIs_development$8.Portal = Portal;
3772
- reactIs_development$8.Profiler = Profiler;
3773
- reactIs_development$8.StrictMode = StrictMode;
3774
- reactIs_development$8.Suspense = Suspense;
3775
- reactIs_development$8.isAsyncMode = isAsyncMode;
3776
- reactIs_development$8.isConcurrentMode = isConcurrentMode;
3777
- reactIs_development$8.isContextConsumer = isContextConsumer;
3778
- reactIs_development$8.isContextProvider = isContextProvider;
3779
- reactIs_development$8.isElement = isElement;
3780
- reactIs_development$8.isForwardRef = isForwardRef;
3781
- reactIs_development$8.isFragment = isFragment;
3782
- reactIs_development$8.isLazy = isLazy;
3783
- reactIs_development$8.isMemo = isMemo;
3784
- reactIs_development$8.isPortal = isPortal;
3785
- reactIs_development$8.isProfiler = isProfiler;
3786
- reactIs_development$8.isStrictMode = isStrictMode;
3787
- reactIs_development$8.isSuspense = isSuspense;
3788
- reactIs_development$8.isValidElementType = isValidElementType;
3789
- reactIs_development$8.typeOf = typeOf;
3762
+ reactIs_development$9.AsyncMode = AsyncMode;
3763
+ reactIs_development$9.ConcurrentMode = ConcurrentMode;
3764
+ reactIs_development$9.ContextConsumer = ContextConsumer;
3765
+ reactIs_development$9.ContextProvider = ContextProvider;
3766
+ reactIs_development$9.Element = Element;
3767
+ reactIs_development$9.ForwardRef = ForwardRef;
3768
+ reactIs_development$9.Fragment = Fragment;
3769
+ reactIs_development$9.Lazy = Lazy;
3770
+ reactIs_development$9.Memo = Memo;
3771
+ reactIs_development$9.Portal = Portal;
3772
+ reactIs_development$9.Profiler = Profiler;
3773
+ reactIs_development$9.StrictMode = StrictMode;
3774
+ reactIs_development$9.Suspense = Suspense;
3775
+ reactIs_development$9.isAsyncMode = isAsyncMode;
3776
+ reactIs_development$9.isConcurrentMode = isConcurrentMode;
3777
+ reactIs_development$9.isContextConsumer = isContextConsumer;
3778
+ reactIs_development$9.isContextProvider = isContextProvider;
3779
+ reactIs_development$9.isElement = isElement;
3780
+ reactIs_development$9.isForwardRef = isForwardRef;
3781
+ reactIs_development$9.isFragment = isFragment;
3782
+ reactIs_development$9.isLazy = isLazy;
3783
+ reactIs_development$9.isMemo = isMemo;
3784
+ reactIs_development$9.isPortal = isPortal;
3785
+ reactIs_development$9.isProfiler = isProfiler;
3786
+ reactIs_development$9.isStrictMode = isStrictMode;
3787
+ reactIs_development$9.isSuspense = isSuspense;
3788
+ reactIs_development$9.isValidElementType = isValidElementType;
3789
+ reactIs_development$9.typeOf = typeOf;
3790
3790
  })();
3791
3791
  }
3792
- return reactIs_development$8;
3792
+ return reactIs_development$9;
3793
3793
  }
3794
3794
 
3795
- var hasRequiredReactIs$8;
3795
+ var hasRequiredReactIs$9;
3796
3796
 
3797
- function requireReactIs$8 () {
3798
- if (hasRequiredReactIs$8) return reactIs$8.exports;
3799
- hasRequiredReactIs$8 = 1;
3797
+ function requireReactIs$9 () {
3798
+ if (hasRequiredReactIs$9) return reactIs$9.exports;
3799
+ hasRequiredReactIs$9 = 1;
3800
3800
 
3801
3801
  if (process.env.NODE_ENV === 'production') {
3802
- reactIs$8.exports = requireReactIs_production_min$8();
3802
+ reactIs$9.exports = requireReactIs_production_min$9();
3803
3803
  } else {
3804
- reactIs$8.exports = requireReactIs_development$8();
3804
+ reactIs$9.exports = requireReactIs_development$9();
3805
3805
  }
3806
- return reactIs$8.exports;
3806
+ return reactIs$9.exports;
3807
3807
  }
3808
3808
 
3809
3809
  /*
@@ -3812,12 +3812,12 @@ object-assign
3812
3812
  @license MIT
3813
3813
  */
3814
3814
 
3815
- var objectAssign$8;
3816
- var hasRequiredObjectAssign$8;
3815
+ var objectAssign$9;
3816
+ var hasRequiredObjectAssign$9;
3817
3817
 
3818
- function requireObjectAssign$8 () {
3819
- if (hasRequiredObjectAssign$8) return objectAssign$8;
3820
- hasRequiredObjectAssign$8 = 1;
3818
+ function requireObjectAssign$9 () {
3819
+ if (hasRequiredObjectAssign$9) return objectAssign$9;
3820
+ hasRequiredObjectAssign$9 = 1;
3821
3821
  /* eslint-disable no-unused-vars */
3822
3822
  var getOwnPropertySymbols = Object.getOwnPropertySymbols;
3823
3823
  var hasOwnProperty = Object.prototype.hasOwnProperty;
@@ -3875,7 +3875,7 @@ function requireObjectAssign$8 () {
3875
3875
  }
3876
3876
  }
3877
3877
 
3878
- objectAssign$8 = shouldUseNative() ? Object.assign : function (target, source) {
3878
+ objectAssign$9 = shouldUseNative() ? Object.assign : function (target, source) {
3879
3879
  var from;
3880
3880
  var to = toObject(target);
3881
3881
  var symbols;
@@ -3901,7 +3901,7 @@ function requireObjectAssign$8 () {
3901
3901
 
3902
3902
  return to;
3903
3903
  };
3904
- return objectAssign$8;
3904
+ return objectAssign$9;
3905
3905
  }
3906
3906
 
3907
3907
  /**
@@ -3911,27 +3911,27 @@ function requireObjectAssign$8 () {
3911
3911
  * LICENSE file in the root directory of this source tree.
3912
3912
  */
3913
3913
 
3914
- var ReactPropTypesSecret_1$8;
3915
- var hasRequiredReactPropTypesSecret$8;
3914
+ var ReactPropTypesSecret_1$9;
3915
+ var hasRequiredReactPropTypesSecret$9;
3916
3916
 
3917
- function requireReactPropTypesSecret$8 () {
3918
- if (hasRequiredReactPropTypesSecret$8) return ReactPropTypesSecret_1$8;
3919
- hasRequiredReactPropTypesSecret$8 = 1;
3917
+ function requireReactPropTypesSecret$9 () {
3918
+ if (hasRequiredReactPropTypesSecret$9) return ReactPropTypesSecret_1$9;
3919
+ hasRequiredReactPropTypesSecret$9 = 1;
3920
3920
 
3921
3921
  var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
3922
3922
 
3923
- ReactPropTypesSecret_1$8 = ReactPropTypesSecret;
3924
- return ReactPropTypesSecret_1$8;
3923
+ ReactPropTypesSecret_1$9 = ReactPropTypesSecret;
3924
+ return ReactPropTypesSecret_1$9;
3925
3925
  }
3926
3926
 
3927
- var has$8;
3928
- var hasRequiredHas$8;
3927
+ var has$9;
3928
+ var hasRequiredHas$9;
3929
3929
 
3930
- function requireHas$8 () {
3931
- if (hasRequiredHas$8) return has$8;
3932
- hasRequiredHas$8 = 1;
3933
- has$8 = Function.call.bind(Object.prototype.hasOwnProperty);
3934
- return has$8;
3930
+ function requireHas$9 () {
3931
+ if (hasRequiredHas$9) return has$9;
3932
+ hasRequiredHas$9 = 1;
3933
+ has$9 = Function.call.bind(Object.prototype.hasOwnProperty);
3934
+ return has$9;
3935
3935
  }
3936
3936
 
3937
3937
  /**
@@ -3941,19 +3941,19 @@ function requireHas$8 () {
3941
3941
  * LICENSE file in the root directory of this source tree.
3942
3942
  */
3943
3943
 
3944
- var checkPropTypes_1$8;
3945
- var hasRequiredCheckPropTypes$8;
3944
+ var checkPropTypes_1$9;
3945
+ var hasRequiredCheckPropTypes$9;
3946
3946
 
3947
- function requireCheckPropTypes$8 () {
3948
- if (hasRequiredCheckPropTypes$8) return checkPropTypes_1$8;
3949
- hasRequiredCheckPropTypes$8 = 1;
3947
+ function requireCheckPropTypes$9 () {
3948
+ if (hasRequiredCheckPropTypes$9) return checkPropTypes_1$9;
3949
+ hasRequiredCheckPropTypes$9 = 1;
3950
3950
 
3951
3951
  var printWarning = function() {};
3952
3952
 
3953
3953
  if (process.env.NODE_ENV !== 'production') {
3954
- var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret$8();
3954
+ var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret$9();
3955
3955
  var loggedTypeFailures = {};
3956
- var has = /*@__PURE__*/ requireHas$8();
3956
+ var has = /*@__PURE__*/ requireHas$9();
3957
3957
 
3958
3958
  printWarning = function(text) {
3959
3959
  var message = 'Warning: ' + text;
@@ -4041,8 +4041,8 @@ function requireCheckPropTypes$8 () {
4041
4041
  }
4042
4042
  };
4043
4043
 
4044
- checkPropTypes_1$8 = checkPropTypes;
4045
- return checkPropTypes_1$8;
4044
+ checkPropTypes_1$9 = checkPropTypes;
4045
+ return checkPropTypes_1$9;
4046
4046
  }
4047
4047
 
4048
4048
  /**
@@ -4052,19 +4052,19 @@ function requireCheckPropTypes$8 () {
4052
4052
  * LICENSE file in the root directory of this source tree.
4053
4053
  */
4054
4054
 
4055
- var factoryWithTypeCheckers$8;
4056
- var hasRequiredFactoryWithTypeCheckers$8;
4055
+ var factoryWithTypeCheckers$9;
4056
+ var hasRequiredFactoryWithTypeCheckers$9;
4057
4057
 
4058
- function requireFactoryWithTypeCheckers$8 () {
4059
- if (hasRequiredFactoryWithTypeCheckers$8) return factoryWithTypeCheckers$8;
4060
- hasRequiredFactoryWithTypeCheckers$8 = 1;
4058
+ function requireFactoryWithTypeCheckers$9 () {
4059
+ if (hasRequiredFactoryWithTypeCheckers$9) return factoryWithTypeCheckers$9;
4060
+ hasRequiredFactoryWithTypeCheckers$9 = 1;
4061
4061
 
4062
- var ReactIs = requireReactIs$8();
4063
- var assign = requireObjectAssign$8();
4062
+ var ReactIs = requireReactIs$9();
4063
+ var assign = requireObjectAssign$9();
4064
4064
 
4065
- var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret$8();
4066
- var has = /*@__PURE__*/ requireHas$8();
4067
- var checkPropTypes = /*@__PURE__*/ requireCheckPropTypes$8();
4065
+ var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret$9();
4066
+ var has = /*@__PURE__*/ requireHas$9();
4067
+ var checkPropTypes = /*@__PURE__*/ requireCheckPropTypes$9();
4068
4068
 
4069
4069
  var printWarning = function() {};
4070
4070
 
@@ -4087,7 +4087,7 @@ function requireFactoryWithTypeCheckers$8 () {
4087
4087
  return null;
4088
4088
  }
4089
4089
 
4090
- factoryWithTypeCheckers$8 = function(isValidElement, throwOnDirectAccess) {
4090
+ factoryWithTypeCheckers$9 = function(isValidElement, throwOnDirectAccess) {
4091
4091
  /* global Symbol */
4092
4092
  var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
4093
4093
  var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
@@ -4660,7 +4660,7 @@ function requireFactoryWithTypeCheckers$8 () {
4660
4660
 
4661
4661
  return ReactPropTypes;
4662
4662
  };
4663
- return factoryWithTypeCheckers$8;
4663
+ return factoryWithTypeCheckers$9;
4664
4664
  }
4665
4665
 
4666
4666
  /**
@@ -4670,20 +4670,20 @@ function requireFactoryWithTypeCheckers$8 () {
4670
4670
  * LICENSE file in the root directory of this source tree.
4671
4671
  */
4672
4672
 
4673
- var factoryWithThrowingShims$8;
4674
- var hasRequiredFactoryWithThrowingShims$8;
4673
+ var factoryWithThrowingShims$9;
4674
+ var hasRequiredFactoryWithThrowingShims$9;
4675
4675
 
4676
- function requireFactoryWithThrowingShims$8 () {
4677
- if (hasRequiredFactoryWithThrowingShims$8) return factoryWithThrowingShims$8;
4678
- hasRequiredFactoryWithThrowingShims$8 = 1;
4676
+ function requireFactoryWithThrowingShims$9 () {
4677
+ if (hasRequiredFactoryWithThrowingShims$9) return factoryWithThrowingShims$9;
4678
+ hasRequiredFactoryWithThrowingShims$9 = 1;
4679
4679
 
4680
- var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret$8();
4680
+ var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret$9();
4681
4681
 
4682
4682
  function emptyFunction() {}
4683
4683
  function emptyFunctionWithReset() {}
4684
4684
  emptyFunctionWithReset.resetWarningCache = emptyFunction;
4685
4685
 
4686
- factoryWithThrowingShims$8 = function() {
4686
+ factoryWithThrowingShims$9 = function() {
4687
4687
  function shim(props, propName, componentName, location, propFullName, secret) {
4688
4688
  if (secret === ReactPropTypesSecret) {
4689
4689
  // It is still safe when called from React.
@@ -4731,7 +4731,7 @@ function requireFactoryWithThrowingShims$8 () {
4731
4731
 
4732
4732
  return ReactPropTypes;
4733
4733
  };
4734
- return factoryWithThrowingShims$8;
4734
+ return factoryWithThrowingShims$9;
4735
4735
  }
4736
4736
 
4737
4737
  /**
@@ -4741,28 +4741,28 @@ function requireFactoryWithThrowingShims$8 () {
4741
4741
  * LICENSE file in the root directory of this source tree.
4742
4742
  */
4743
4743
 
4744
- var hasRequiredPropTypes$8;
4744
+ var hasRequiredPropTypes$9;
4745
4745
 
4746
- function requirePropTypes$8 () {
4747
- if (hasRequiredPropTypes$8) return propTypes$8.exports;
4748
- hasRequiredPropTypes$8 = 1;
4746
+ function requirePropTypes$9 () {
4747
+ if (hasRequiredPropTypes$9) return propTypes$9.exports;
4748
+ hasRequiredPropTypes$9 = 1;
4749
4749
  if (process.env.NODE_ENV !== 'production') {
4750
- var ReactIs = requireReactIs$8();
4750
+ var ReactIs = requireReactIs$9();
4751
4751
 
4752
4752
  // By explicitly using `prop-types` you are opting into new development behavior.
4753
4753
  // http://fb.me/prop-types-in-prod
4754
4754
  var throwOnDirectAccess = true;
4755
- propTypes$8.exports = /*@__PURE__*/ requireFactoryWithTypeCheckers$8()(ReactIs.isElement, throwOnDirectAccess);
4755
+ propTypes$9.exports = /*@__PURE__*/ requireFactoryWithTypeCheckers$9()(ReactIs.isElement, throwOnDirectAccess);
4756
4756
  } else {
4757
4757
  // By explicitly using `prop-types` you are opting into new production behavior.
4758
4758
  // http://fb.me/prop-types-in-prod
4759
- propTypes$8.exports = /*@__PURE__*/ requireFactoryWithThrowingShims$8()();
4759
+ propTypes$9.exports = /*@__PURE__*/ requireFactoryWithThrowingShims$9()();
4760
4760
  }
4761
- return propTypes$8.exports;
4761
+ return propTypes$9.exports;
4762
4762
  }
4763
4763
 
4764
- var propTypesExports$8 = /*@__PURE__*/ requirePropTypes$8();
4765
- var PropTypes$8 = /*@__PURE__*/getDefaultExportFromCjs$8(propTypesExports$8);
4764
+ var propTypesExports$9 = /*@__PURE__*/ requirePropTypes$9();
4765
+ var PropTypes$9 = /*@__PURE__*/getDefaultExportFromCjs$9(propTypesExports$9);
4766
4766
 
4767
4767
  const SystemOperations = _ref => {
4768
4768
  let {
@@ -4780,7 +4780,7 @@ const SystemOperations = _ref => {
4780
4780
  cancelText = "system.button.cancel",
4781
4781
  okText = "system.button.confirm"
4782
4782
  } = _ref;
4783
- const intl = useIntl$1();
4783
+ const intl = useIntl();
4784
4784
  const {
4785
4785
  modal
4786
4786
  } = antd.App.useApp();
@@ -4874,15 +4874,15 @@ const SystemOperations = _ref => {
4874
4874
  });
4875
4875
  };
4876
4876
  SystemOperations.propTypes = {
4877
- onPowerOff: PropTypes$8.func,
4878
- onRestart: PropTypes$8.func,
4879
- powerOffLabel: PropTypes$8.string,
4880
- restartLabel: PropTypes$8.string,
4881
- iconClassName: PropTypes$8.string,
4882
- confirmTitle: PropTypes$8.string,
4883
- cancelText: PropTypes$8.string,
4884
- okText: PropTypes$8.string,
4885
- run: PropTypes$8.func
4877
+ onPowerOff: PropTypes$9.func,
4878
+ onRestart: PropTypes$9.func,
4879
+ powerOffLabel: PropTypes$9.string,
4880
+ restartLabel: PropTypes$9.string,
4881
+ iconClassName: PropTypes$9.string,
4882
+ confirmTitle: PropTypes$9.string,
4883
+ cancelText: PropTypes$9.string,
4884
+ okText: PropTypes$9.string,
4885
+ run: PropTypes$9.func
4886
4886
  };
4887
4887
  var SystemOperations$1 = SystemOperations;
4888
4888
 
@@ -4925,10 +4925,10 @@ const useSpaLogo = function () {
4925
4925
  }, "logo")];
4926
4926
  };
4927
4927
  useSpaLogo.propTypes = {
4928
- logoUrl: PropTypes$8.string,
4929
- logoWidth: PropTypes$8.number,
4930
- logoAlt: PropTypes$8.string,
4931
- onClick: PropTypes$8.func
4928
+ logoUrl: PropTypes$9.string,
4929
+ logoWidth: PropTypes$9.number,
4930
+ logoAlt: PropTypes$9.string,
4931
+ onClick: PropTypes$9.func
4932
4932
  };
4933
4933
  var useSpaLogo$1 = useSpaLogo;
4934
4934
 
@@ -5015,8 +5015,8 @@ const CommonHeader = _ref => {
5015
5015
  var CommonHeader$1 = CommonHeader;
5016
5016
 
5017
5017
  const LSMLabelField = props => {
5018
- const intl = useIntl$1();
5019
- const [lsmList, setLsmList] = React.useState([]);
5018
+ const intl = useIntl();
5019
+ const [lsmList, setLsmList] = react.useState([]);
5020
5020
  const {
5021
5021
  label = "lsm.label",
5022
5022
  onLsmSelect,
@@ -5028,7 +5028,7 @@ const LSMLabelField = props => {
5028
5028
  value: 'label'
5029
5029
  }
5030
5030
  } = props;
5031
- React.useEffect(() => {
5031
+ react.useEffect(() => {
5032
5032
  const loadLsmData = async () => {
5033
5033
  try {
5034
5034
  const res = await fetchLsmData();
@@ -5041,12 +5041,12 @@ const LSMLabelField = props => {
5041
5041
  };
5042
5042
  loadLsmData();
5043
5043
  }, [fetchLsmData]);
5044
- return /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2({
5044
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2$2(_objectSpread2$2({
5045
5045
  label: typeof label === 'string' && label.includes('.') ? intl.formatMessage({
5046
5046
  id: label
5047
5047
  }) : label
5048
5048
  }, formItemProps), {}, {
5049
- children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, _objectSpread2(_objectSpread2(_objectSpread2({}, field), selectProps), {}, {
5049
+ children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, _objectSpread2$2(_objectSpread2$2(_objectSpread2$2({}, field), selectProps), {}, {
5050
5050
  options: lsmList,
5051
5051
  fieldNames: fieldNames,
5052
5052
  allowClear: true,
@@ -5062,17 +5062,17 @@ const LSMLabelField = props => {
5062
5062
  }))
5063
5063
  }));
5064
5064
  };
5065
- var LSMLabelField$1 = /*#__PURE__*/React.memo(LSMLabelField);
5065
+ var LSMLabelField$1 = /*#__PURE__*/react.memo(LSMLabelField);
5066
5066
 
5067
- function _defineProperty$1(e,r,t){return (r=_toPropertyKey$1(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e;}function ownKeys$1(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread2$1(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys$1(Object(t),!0).forEach(function(r){_defineProperty$1(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys$1(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}function _objectWithoutProperties$1(e,t){if(null==e)return {};var o,r,i=_objectWithoutPropertiesLoose$1(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(r=0;r<n.length;r++)o=n[r],-1===t.indexOf(o)&&{}.propertyIsEnumerable.call(e,o)&&(i[o]=e[o]);}return i;}function _objectWithoutPropertiesLoose$1(r,e){if(null==r)return {};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(-1!==e.indexOf(n))continue;t[n]=r[n];}return t;}function _toPrimitive$1(t,r){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return ("string"===r?String:Number)(t);}function _toPropertyKey$1(t){var i=_toPrimitive$1(t,"string");return "symbol"==typeof i?i:i+"";}/**
5067
+ function _defineProperty(e,r,t){return (r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e;}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread2(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}function _objectWithoutProperties(e,t){if(null==e)return {};var o,r,i=_objectWithoutPropertiesLoose(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(r=0;r<n.length;r++)o=n[r],-1===t.indexOf(o)&&{}.propertyIsEnumerable.call(e,o)&&(i[o]=e[o]);}return i;}function _objectWithoutPropertiesLoose(r,e){if(null==r)return {};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(-1!==e.indexOf(n))continue;t[n]=r[n];}return t;}function _toPrimitive(t,r){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return ("string"===r?String:Number)(t);}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return "symbol"==typeof i?i:i+"";}/**
5068
5068
  * 国际化调试工具
5069
5069
  * 在浏览器控制台运行 window.debugI18n() 查看当前国际化状态
5070
- */const debugI18n=()=>{var _window$g_initialProp,_window$g_initialProp2,_window$g_initialProp3,_window$g_initialProp4,_window$g_initialProp5,_window$g_initialProp6;if(typeof window==='undefined'){console.log('[i18n debug] Not in browser environment');return;}console.group('🌍 I18n Debug Information');// 1. 当前语言环境
5070
+ */const debugI18n$1=()=>{var _window$g_initialProp,_window$g_initialProp2,_window$g_initialProp3,_window$g_initialProp4,_window$g_initialProp5,_window$g_initialProp6;if(typeof window==='undefined'){console.log('[i18n debug] Not in browser environment');return;}console.group('🌍 I18n Debug Information');// 1. 当前语言环境
5071
5071
  console.log('📍 Current Locale Sources:');console.log(' - window.g_initialProps?.locale:',(_window$g_initialProp=window.g_initialProps)===null||_window$g_initialProp===void 0?void 0:_window$g_initialProp.locale);console.log(' - window.g_initialProps?.___g_initialPropsFromServer?.locale:',(_window$g_initialProp2=window.g_initialProps)===null||_window$g_initialProp2===void 0||(_window$g_initialProp2=_window$g_initialProp2.___g_initialPropsFromServer)===null||_window$g_initialProp2===void 0?void 0:_window$g_initialProp2.locale);try{console.log(' - localStorage.umi-locale:',localStorage.getItem('umi-locale'));}catch(e){console.log(' - localStorage: not available');}console.log(' - window.__COMPONENT_LOCALE__:',window.__COMPONENT_LOCALE__);// 2. 语言包
5072
5072
  console.log('\n📦 Available Message Sources:');console.log(' - window.__COMPONENT_I18N_MESSAGES__:',window.__COMPONENT_I18N_MESSAGES__);console.log(' - window.__PROJECT_I18N_MESSAGES__:',window.__PROJECT_I18N_MESSAGES__);console.log(' - window.g_initialProps?.messages:',(_window$g_initialProp3=window.g_initialProps)===null||_window$g_initialProp3===void 0?void 0:_window$g_initialProp3.messages);// 3. 合并后的语言包
5073
- const componentMessages=window.__COMPONENT_I18N_MESSAGES__||{};const projectMessages=window.__PROJECT_I18N_MESSAGES__||{};const umiMessages=((_window$g_initialProp4=window.g_initialProps)===null||_window$g_initialProp4===void 0?void 0:_window$g_initialProp4.messages)||{};const allLocales=new Set([...Object.keys(componentMessages),...Object.keys(projectMessages),...Object.keys(umiMessages)]);console.log('\n🔧 Merged Locales:',Array.from(allLocales));allLocales.forEach(locale=>{const merged=_objectSpread2$1(_objectSpread2$1(_objectSpread2$1({},umiMessages[locale]||{}),projectMessages[locale]||{}),componentMessages[locale]||{});console.log("\n \uD83D\uDCC4 ".concat(locale," (").concat(Object.keys(merged).length," keys):"),merged);});// 4. 测试几个关键的 key
5074
- console.log('\n🧪 Test Translation:');const testKeys=['networkSettings.title','button.ok','button.cancel','button.apply','button.close'];const currentLocale=((_window$g_initialProp5=window.g_initialProps)===null||_window$g_initialProp5===void 0?void 0:_window$g_initialProp5.locale)||((_window$g_initialProp6=window.g_initialProps)===null||_window$g_initialProp6===void 0||(_window$g_initialProp6=_window$g_initialProp6.___g_initialPropsFromServer)===null||_window$g_initialProp6===void 0?void 0:_window$g_initialProp6.locale)||localStorage.getItem('umi-locale')||'zh-CN';const allMessages={};allLocales.forEach(locale=>{allMessages[locale]=_objectSpread2$1(_objectSpread2$1(_objectSpread2$1({},umiMessages[locale]||{}),projectMessages[locale]||{}),componentMessages[locale]||{});});testKeys.forEach(key=>{var _allMessages$currentL,_allMessages$enUS;const translation=((_allMessages$currentL=allMessages[currentLocale])===null||_allMessages$currentL===void 0?void 0:_allMessages$currentL[key])||((_allMessages$enUS=allMessages['en-US'])===null||_allMessages$enUS===void 0?void 0:_allMessages$enUS[key])||'❌ NOT FOUND';console.log(" - ".concat(key,": ").concat(translation));});console.groupEnd();};// 自动在开发环境注册到 window
5075
- if(process.env.NODE_ENV==='development'&&typeof window!=='undefined'){window.debugI18n=debugI18n;console.log('💡 I18n debug tool available. Run window.debugI18n() in console to check i18n status.');}/**
5073
+ const componentMessages=window.__COMPONENT_I18N_MESSAGES__||{};const projectMessages=window.__PROJECT_I18N_MESSAGES__||{};const umiMessages=((_window$g_initialProp4=window.g_initialProps)===null||_window$g_initialProp4===void 0?void 0:_window$g_initialProp4.messages)||{};const allLocales=new Set([...Object.keys(componentMessages),...Object.keys(projectMessages),...Object.keys(umiMessages)]);console.log('\n🔧 Merged Locales:',Array.from(allLocales));allLocales.forEach(locale=>{const merged=_objectSpread2(_objectSpread2(_objectSpread2({},umiMessages[locale]||{}),projectMessages[locale]||{}),componentMessages[locale]||{});console.log("\n \uD83D\uDCC4 ".concat(locale," (").concat(Object.keys(merged).length," keys):"),merged);});// 4. 测试几个关键的 key
5074
+ console.log('\n🧪 Test Translation:');const testKeys=['networkSettings.title','button.ok','button.cancel','button.apply','button.close'];const currentLocale=((_window$g_initialProp5=window.g_initialProps)===null||_window$g_initialProp5===void 0?void 0:_window$g_initialProp5.locale)||((_window$g_initialProp6=window.g_initialProps)===null||_window$g_initialProp6===void 0||(_window$g_initialProp6=_window$g_initialProp6.___g_initialPropsFromServer)===null||_window$g_initialProp6===void 0?void 0:_window$g_initialProp6.locale)||localStorage.getItem('umi-locale')||'zh-CN';const allMessages={};allLocales.forEach(locale=>{allMessages[locale]=_objectSpread2(_objectSpread2(_objectSpread2({},umiMessages[locale]||{}),projectMessages[locale]||{}),componentMessages[locale]||{});});testKeys.forEach(key=>{var _allMessages$currentL,_allMessages$enUS;const translation=((_allMessages$currentL=allMessages[currentLocale])===null||_allMessages$currentL===void 0?void 0:_allMessages$currentL[key])||((_allMessages$enUS=allMessages['en-US'])===null||_allMessages$enUS===void 0?void 0:_allMessages$enUS[key])||'❌ NOT FOUND';console.log(" - ".concat(key,": ").concat(translation));});console.groupEnd();};// 自动在开发环境注册到 window
5075
+ if(process.env.NODE_ENV==='development'&&typeof window!=='undefined'){window.debugI18n=debugI18n$1;console.log('💡 I18n debug tool available. Run window.debugI18n() in console to check i18n status.');}/**
5076
5076
  * seeder-st2110-components 组件库国际化 Hook
5077
5077
  *
5078
5078
  * 设计目标:
@@ -5083,7 +5083,7 @@ if(process.env.NODE_ENV==='development'&&typeof window!=='undefined'){window.deb
5083
5083
  *//**
5084
5084
  * 获取当前语言环境
5085
5085
  * 优先从 Umi 全局变量读取,其次使用默认值
5086
- */const getLocale=()=>{// 尝试从 Umi 获取语言设置
5086
+ */const getLocale$1=()=>{// 尝试从 Umi 获取语言设置
5087
5087
  if(typeof window!=='undefined'){var _window$g_initialProp,_window$g_initialProp2,_window$g_initialProp3;// 方式 1:Umi 的运行时语言(通过 umi 的 locale 服务)
5088
5088
  // Umi 会在 window.g_lang 或 window.LOCALE 中存储当前语言
5089
5089
  if(window.g_lang){return window.g_lang;}if(window.LOCALE){return window.LOCALE;}// 方式 2:Umi 的 g_initialProps
@@ -5096,18 +5096,18 @@ if(window.__COMPONENT_LOCALE__){return window.__COMPONENT_LOCALE__;}}// 默认
5096
5096
  return 'en-US';};/**
5097
5097
  * 获取语言包
5098
5098
  * 优先从主项目读取,其次使用组件库自带的语言包
5099
- */const getMessages=()=>{if(typeof window!=='undefined'){var _window$g_initialProp4;// 尝试从多个来源读取语言包
5099
+ */const getMessages$1=()=>{if(typeof window!=='undefined'){var _window$g_initialProp4;// 尝试从多个来源读取语言包
5100
5100
  const messages={};// 1. 组件库注册的语言包
5101
5101
  const componentMessages=window.__COMPONENT_I18N_MESSAGES__||{};// 2. 主项目的语言包
5102
5102
  const projectMessages=window.__PROJECT_I18N_MESSAGES__||{};// 3. Umi 的语言包
5103
5103
  const umiMessages=((_window$g_initialProp4=window.g_initialProps)===null||_window$g_initialProp4===void 0?void 0:_window$g_initialProp4.messages)||{};// 合并语言包(组件库的优先级最高,其次是主项目,最后是 Umi)
5104
- const allLocales=new Set([...Object.keys(componentMessages),...Object.keys(projectMessages),...Object.keys(umiMessages)]);allLocales.forEach(locale=>{messages[locale]=_objectSpread2$1(_objectSpread2$1(_objectSpread2$1({},umiMessages[locale]||{}),projectMessages[locale]||{}),componentMessages[locale]||{});});return messages;}return {};};/**
5104
+ const allLocales=new Set([...Object.keys(componentMessages),...Object.keys(projectMessages),...Object.keys(umiMessages)]);allLocales.forEach(locale=>{messages[locale]=_objectSpread2(_objectSpread2(_objectSpread2({},umiMessages[locale]||{}),projectMessages[locale]||{}),componentMessages[locale]||{});});return messages;}return {};};/**
5105
5105
  * 格式化消息
5106
5106
  * @param {string} id - 国际化 key
5107
5107
  * @param {object} values - 变量替换值
5108
5108
  * @param {string} locale - 语言环境
5109
5109
  * @param {object} messages - 语言包
5110
- */const formatMessage=function(_ref){var _messages$locale,_messages$enUS;let{id}=_ref;let values=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};let locale=arguments.length>2?arguments[2]:undefined;let messages=arguments.length>3?arguments[3]:undefined;const message=((_messages$locale=messages[locale])===null||_messages$locale===void 0?void 0:_messages$locale[id])||((_messages$enUS=messages['en-US'])===null||_messages$enUS===void 0?void 0:_messages$enUS[id])||id;// 支持变量替换 {min}, {max}, {value} 等
5110
+ */const formatMessage$1=function(_ref){var _messages$locale,_messages$enUS;let{id}=_ref;let values=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};let locale=arguments.length>2?arguments[2]:undefined;let messages=arguments.length>3?arguments[3]:undefined;const message=((_messages$locale=messages[locale])===null||_messages$locale===void 0?void 0:_messages$locale[id])||((_messages$enUS=messages['en-US'])===null||_messages$enUS===void 0?void 0:_messages$enUS[id])||id;// 支持变量替换 {min}, {max}, {value} 等
5111
5111
  return message.replace(/\{(\w+)\}/g,(match,key)=>{return values[key]!==undefined?values[key]:match;});};/**
5112
5112
  * 国际化 Hook
5113
5113
  *
@@ -5121,11 +5121,206 @@ return message.replace(/\{(\w+)\}/g,(match,key)=>{return values[key]!==undefined
5121
5121
  * const intl = useIntl();
5122
5122
  * const title = intl.formatMessage({ id: 'networkSettings.title' });
5123
5123
  * const message = intl.formatMessage({ id: 'validation.minLength' }, { min: 3 });
5124
- */const useIntl=()=>{const locale=getLocale();const messages=getMessages();const formatMessageFn=function(_ref2){let{id}=_ref2;let values=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return formatMessage({id},values,locale,messages);};return {locale,formatMessage:formatMessageFn,messages};};const _excluded$4=["width","okText","cancelText","styles"];const StyledModal$2=props=>{const intl=useIntl();const{width="520px",okText="button.apply",cancelText="button.close",styles:propStyles={}}=props,restProps=_objectWithoutProperties$1(props,_excluded$4);// 处理国际化文本
5124
+ */const useIntl$1=()=>{const locale=getLocale$1();const messages=getMessages$1();const formatMessageFn=function(_ref2){let{id}=_ref2;let values=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return formatMessage$1({id},values,locale,messages);};return {locale,formatMessage:formatMessageFn,messages};};const _excluded$3=["width","okText","cancelText","styles"];const StyledModal=props=>{const intl=useIntl$1();const{width="520px",okText="button.apply",cancelText="button.close",styles:propStyles={}}=props,restProps=_objectWithoutProperties(props,_excluded$3);// 处理国际化文本
5125
5125
  const okButtonText=typeof okText==='string'&&okText.includes('.')?intl.formatMessage({id:okText}):okText;const cancelButtonText=typeof cancelText==='string'&&cancelText.includes('.')?intl.formatMessage({id:cancelText}):cancelText;// 基础样式配置
5126
5126
  const baseStyles={content:{padding:0// background: "#282828"
5127
5127
  },header:{marginBottom:0,padding:0,paddingBlock:16,paddingInlineStart:24,background:"#000000"},body:{paddingBlock:20,paddingInline:24},footer:{marginTop:0,padding:0,paddingBlockEnd:20,paddingInline:24}};// 合并样式
5128
- const styles=_objectSpread2$1(_objectSpread2$1({},baseStyles),propStyles);return/*#__PURE__*/jsxRuntime.jsx(antd.Modal,_objectSpread2$1({width:width,okText:okButtonText,cancelText:cancelButtonText,styles:styles},restProps));};var StyledModal$3=StyledModal$2;function getDefaultExportFromCjs$7(x){return x&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,'default')?x['default']:x;}var propTypes$7={exports:{}};var reactIs$7={exports:{}};var reactIs_production_min$7={};/** @license React v16.13.1
5128
+ const styles=_objectSpread2(_objectSpread2({},baseStyles),propStyles);return/*#__PURE__*/jsxRuntime.jsx(antd.Modal,_objectSpread2({width:width,okText:okButtonText,cancelText:cancelButtonText,styles:styles},restProps));};var StyledModal$1=StyledModal;function getDefaultExportFromCjs$8(x){return x&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,'default')?x['default']:x;}var propTypes$8={exports:{}};var reactIs$8={exports:{}};var reactIs_production_min$8={};/** @license React v16.13.1
5129
+ * react-is.production.min.js
5130
+ *
5131
+ * Copyright (c) Facebook, Inc. and its affiliates.
5132
+ *
5133
+ * This source code is licensed under the MIT license found in the
5134
+ * LICENSE file in the root directory of this source tree.
5135
+ */var hasRequiredReactIs_production_min$8;function requireReactIs_production_min$8(){if(hasRequiredReactIs_production_min$8)return reactIs_production_min$8;hasRequiredReactIs_production_min$8=1;var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u;}}case d:return u;}}}function A(a){return z(a)===m;}reactIs_production_min$8.AsyncMode=l;reactIs_production_min$8.ConcurrentMode=m;reactIs_production_min$8.ContextConsumer=k;reactIs_production_min$8.ContextProvider=h;reactIs_production_min$8.Element=c;reactIs_production_min$8.ForwardRef=n;reactIs_production_min$8.Fragment=e;reactIs_production_min$8.Lazy=t;reactIs_production_min$8.Memo=r;reactIs_production_min$8.Portal=d;reactIs_production_min$8.Profiler=g;reactIs_production_min$8.StrictMode=f;reactIs_production_min$8.Suspense=p;reactIs_production_min$8.isAsyncMode=function(a){return A(a)||z(a)===l;};reactIs_production_min$8.isConcurrentMode=A;reactIs_production_min$8.isContextConsumer=function(a){return z(a)===k;};reactIs_production_min$8.isContextProvider=function(a){return z(a)===h;};reactIs_production_min$8.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c;};reactIs_production_min$8.isForwardRef=function(a){return z(a)===n;};reactIs_production_min$8.isFragment=function(a){return z(a)===e;};reactIs_production_min$8.isLazy=function(a){return z(a)===t;};reactIs_production_min$8.isMemo=function(a){return z(a)===r;};reactIs_production_min$8.isPortal=function(a){return z(a)===d;};reactIs_production_min$8.isProfiler=function(a){return z(a)===g;};reactIs_production_min$8.isStrictMode=function(a){return z(a)===f;};reactIs_production_min$8.isSuspense=function(a){return z(a)===p;};reactIs_production_min$8.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v);};reactIs_production_min$8.typeOf=z;return reactIs_production_min$8;}var reactIs_development$8={};/** @license React v16.13.1
5136
+ * react-is.development.js
5137
+ *
5138
+ * Copyright (c) Facebook, Inc. and its affiliates.
5139
+ *
5140
+ * This source code is licensed under the MIT license found in the
5141
+ * LICENSE file in the root directory of this source tree.
5142
+ */var hasRequiredReactIs_development$8;function requireReactIs_development$8(){if(hasRequiredReactIs_development$8)return reactIs_development$8;hasRequiredReactIs_development$8=1;if(process.env.NODE_ENV!=="production"){(function(){// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
5143
+ // nor polyfill, then a plain number is used for performance.
5144
+ var hasSymbol=typeof Symbol==='function'&&Symbol.for;var REACT_ELEMENT_TYPE=hasSymbol?Symbol.for('react.element'):0xeac7;var REACT_PORTAL_TYPE=hasSymbol?Symbol.for('react.portal'):0xeaca;var REACT_FRAGMENT_TYPE=hasSymbol?Symbol.for('react.fragment'):0xeacb;var REACT_STRICT_MODE_TYPE=hasSymbol?Symbol.for('react.strict_mode'):0xeacc;var REACT_PROFILER_TYPE=hasSymbol?Symbol.for('react.profiler'):0xead2;var REACT_PROVIDER_TYPE=hasSymbol?Symbol.for('react.provider'):0xeacd;var REACT_CONTEXT_TYPE=hasSymbol?Symbol.for('react.context'):0xeace;// TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
5145
+ // (unstable) APIs that have been removed. Can we remove the symbols?
5146
+ var REACT_ASYNC_MODE_TYPE=hasSymbol?Symbol.for('react.async_mode'):0xeacf;var REACT_CONCURRENT_MODE_TYPE=hasSymbol?Symbol.for('react.concurrent_mode'):0xeacf;var REACT_FORWARD_REF_TYPE=hasSymbol?Symbol.for('react.forward_ref'):0xead0;var REACT_SUSPENSE_TYPE=hasSymbol?Symbol.for('react.suspense'):0xead1;var REACT_SUSPENSE_LIST_TYPE=hasSymbol?Symbol.for('react.suspense_list'):0xead8;var REACT_MEMO_TYPE=hasSymbol?Symbol.for('react.memo'):0xead3;var REACT_LAZY_TYPE=hasSymbol?Symbol.for('react.lazy'):0xead4;var REACT_BLOCK_TYPE=hasSymbol?Symbol.for('react.block'):0xead9;var REACT_FUNDAMENTAL_TYPE=hasSymbol?Symbol.for('react.fundamental'):0xead5;var REACT_RESPONDER_TYPE=hasSymbol?Symbol.for('react.responder'):0xead6;var REACT_SCOPE_TYPE=hasSymbol?Symbol.for('react.scope'):0xead7;function isValidElementType(type){return typeof type==='string'||typeof type==='function'||// Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
5147
+ type===REACT_FRAGMENT_TYPE||type===REACT_CONCURRENT_MODE_TYPE||type===REACT_PROFILER_TYPE||type===REACT_STRICT_MODE_TYPE||type===REACT_SUSPENSE_TYPE||type===REACT_SUSPENSE_LIST_TYPE||typeof type==='object'&&type!==null&&(type.$$typeof===REACT_LAZY_TYPE||type.$$typeof===REACT_MEMO_TYPE||type.$$typeof===REACT_PROVIDER_TYPE||type.$$typeof===REACT_CONTEXT_TYPE||type.$$typeof===REACT_FORWARD_REF_TYPE||type.$$typeof===REACT_FUNDAMENTAL_TYPE||type.$$typeof===REACT_RESPONDER_TYPE||type.$$typeof===REACT_SCOPE_TYPE||type.$$typeof===REACT_BLOCK_TYPE);}function typeOf(object){if(typeof object==='object'&&object!==null){var $$typeof=object.$$typeof;switch($$typeof){case REACT_ELEMENT_TYPE:var type=object.type;switch(type){case REACT_ASYNC_MODE_TYPE:case REACT_CONCURRENT_MODE_TYPE:case REACT_FRAGMENT_TYPE:case REACT_PROFILER_TYPE:case REACT_STRICT_MODE_TYPE:case REACT_SUSPENSE_TYPE:return type;default:var $$typeofType=type&&type.$$typeof;switch($$typeofType){case REACT_CONTEXT_TYPE:case REACT_FORWARD_REF_TYPE:case REACT_LAZY_TYPE:case REACT_MEMO_TYPE:case REACT_PROVIDER_TYPE:return $$typeofType;default:return $$typeof;}}case REACT_PORTAL_TYPE:return $$typeof;}}return undefined;}// AsyncMode is deprecated along with isAsyncMode
5148
+ var AsyncMode=REACT_ASYNC_MODE_TYPE;var ConcurrentMode=REACT_CONCURRENT_MODE_TYPE;var ContextConsumer=REACT_CONTEXT_TYPE;var ContextProvider=REACT_PROVIDER_TYPE;var Element=REACT_ELEMENT_TYPE;var ForwardRef=REACT_FORWARD_REF_TYPE;var Fragment=REACT_FRAGMENT_TYPE;var Lazy=REACT_LAZY_TYPE;var Memo=REACT_MEMO_TYPE;var Portal=REACT_PORTAL_TYPE;var Profiler=REACT_PROFILER_TYPE;var StrictMode=REACT_STRICT_MODE_TYPE;var Suspense=REACT_SUSPENSE_TYPE;var hasWarnedAboutDeprecatedIsAsyncMode=false;// AsyncMode should be deprecated
5149
+ function isAsyncMode(object){{if(!hasWarnedAboutDeprecatedIsAsyncMode){hasWarnedAboutDeprecatedIsAsyncMode=true;// Using console['warn'] to evade Babel and ESLint
5150
+ console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, '+'and will be removed in React 17+. Update your code to use '+'ReactIs.isConcurrentMode() instead. It has the exact same API.');}}return isConcurrentMode(object)||typeOf(object)===REACT_ASYNC_MODE_TYPE;}function isConcurrentMode(object){return typeOf(object)===REACT_CONCURRENT_MODE_TYPE;}function isContextConsumer(object){return typeOf(object)===REACT_CONTEXT_TYPE;}function isContextProvider(object){return typeOf(object)===REACT_PROVIDER_TYPE;}function isElement(object){return typeof object==='object'&&object!==null&&object.$$typeof===REACT_ELEMENT_TYPE;}function isForwardRef(object){return typeOf(object)===REACT_FORWARD_REF_TYPE;}function isFragment(object){return typeOf(object)===REACT_FRAGMENT_TYPE;}function isLazy(object){return typeOf(object)===REACT_LAZY_TYPE;}function isMemo(object){return typeOf(object)===REACT_MEMO_TYPE;}function isPortal(object){return typeOf(object)===REACT_PORTAL_TYPE;}function isProfiler(object){return typeOf(object)===REACT_PROFILER_TYPE;}function isStrictMode(object){return typeOf(object)===REACT_STRICT_MODE_TYPE;}function isSuspense(object){return typeOf(object)===REACT_SUSPENSE_TYPE;}reactIs_development$8.AsyncMode=AsyncMode;reactIs_development$8.ConcurrentMode=ConcurrentMode;reactIs_development$8.ContextConsumer=ContextConsumer;reactIs_development$8.ContextProvider=ContextProvider;reactIs_development$8.Element=Element;reactIs_development$8.ForwardRef=ForwardRef;reactIs_development$8.Fragment=Fragment;reactIs_development$8.Lazy=Lazy;reactIs_development$8.Memo=Memo;reactIs_development$8.Portal=Portal;reactIs_development$8.Profiler=Profiler;reactIs_development$8.StrictMode=StrictMode;reactIs_development$8.Suspense=Suspense;reactIs_development$8.isAsyncMode=isAsyncMode;reactIs_development$8.isConcurrentMode=isConcurrentMode;reactIs_development$8.isContextConsumer=isContextConsumer;reactIs_development$8.isContextProvider=isContextProvider;reactIs_development$8.isElement=isElement;reactIs_development$8.isForwardRef=isForwardRef;reactIs_development$8.isFragment=isFragment;reactIs_development$8.isLazy=isLazy;reactIs_development$8.isMemo=isMemo;reactIs_development$8.isPortal=isPortal;reactIs_development$8.isProfiler=isProfiler;reactIs_development$8.isStrictMode=isStrictMode;reactIs_development$8.isSuspense=isSuspense;reactIs_development$8.isValidElementType=isValidElementType;reactIs_development$8.typeOf=typeOf;})();}return reactIs_development$8;}var hasRequiredReactIs$8;function requireReactIs$8(){if(hasRequiredReactIs$8)return reactIs$8.exports;hasRequiredReactIs$8=1;if(process.env.NODE_ENV==='production'){reactIs$8.exports=requireReactIs_production_min$8();}else {reactIs$8.exports=requireReactIs_development$8();}return reactIs$8.exports;}/*
5151
+ object-assign
5152
+ (c) Sindre Sorhus
5153
+ @license MIT
5154
+ */var objectAssign$8;var hasRequiredObjectAssign$8;function requireObjectAssign$8(){if(hasRequiredObjectAssign$8)return objectAssign$8;hasRequiredObjectAssign$8=1;/* eslint-disable no-unused-vars */var getOwnPropertySymbols=Object.getOwnPropertySymbols;var hasOwnProperty=Object.prototype.hasOwnProperty;var propIsEnumerable=Object.prototype.propertyIsEnumerable;function toObject(val){if(val===null||val===undefined){throw new TypeError('Object.assign cannot be called with null or undefined');}return Object(val);}function shouldUseNative(){try{if(!Object.assign){return false;}// Detect buggy property enumeration order in older V8 versions.
5155
+ // https://bugs.chromium.org/p/v8/issues/detail?id=4118
5156
+ var test1=new String('abc');// eslint-disable-line no-new-wrappers
5157
+ test1[5]='de';if(Object.getOwnPropertyNames(test1)[0]==='5'){return false;}// https://bugs.chromium.org/p/v8/issues/detail?id=3056
5158
+ var test2={};for(var i=0;i<10;i++){test2['_'+String.fromCharCode(i)]=i;}var order2=Object.getOwnPropertyNames(test2).map(function(n){return test2[n];});if(order2.join('')!=='0123456789'){return false;}// https://bugs.chromium.org/p/v8/issues/detail?id=3056
5159
+ var test3={};'abcdefghijklmnopqrst'.split('').forEach(function(letter){test3[letter]=letter;});if(Object.keys(Object.assign({},test3)).join('')!=='abcdefghijklmnopqrst'){return false;}return true;}catch(err){// We don't expect any of the above to throw, but better to be safe.
5160
+ return false;}}objectAssign$8=shouldUseNative()?Object.assign:function(target,source){var from;var to=toObject(target);var symbols;for(var s=1;s<arguments.length;s++){from=Object(arguments[s]);for(var key in from){if(hasOwnProperty.call(from,key)){to[key]=from[key];}}if(getOwnPropertySymbols){symbols=getOwnPropertySymbols(from);for(var i=0;i<symbols.length;i++){if(propIsEnumerable.call(from,symbols[i])){to[symbols[i]]=from[symbols[i]];}}}}return to;};return objectAssign$8;}/**
5161
+ * Copyright (c) 2013-present, Facebook, Inc.
5162
+ *
5163
+ * This source code is licensed under the MIT license found in the
5164
+ * LICENSE file in the root directory of this source tree.
5165
+ */var ReactPropTypesSecret_1$8;var hasRequiredReactPropTypesSecret$8;function requireReactPropTypesSecret$8(){if(hasRequiredReactPropTypesSecret$8)return ReactPropTypesSecret_1$8;hasRequiredReactPropTypesSecret$8=1;var ReactPropTypesSecret='SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';ReactPropTypesSecret_1$8=ReactPropTypesSecret;return ReactPropTypesSecret_1$8;}var has$8;var hasRequiredHas$8;function requireHas$8(){if(hasRequiredHas$8)return has$8;hasRequiredHas$8=1;has$8=Function.call.bind(Object.prototype.hasOwnProperty);return has$8;}/**
5166
+ * Copyright (c) 2013-present, Facebook, Inc.
5167
+ *
5168
+ * This source code is licensed under the MIT license found in the
5169
+ * LICENSE file in the root directory of this source tree.
5170
+ */var checkPropTypes_1$8;var hasRequiredCheckPropTypes$8;function requireCheckPropTypes$8(){if(hasRequiredCheckPropTypes$8)return checkPropTypes_1$8;hasRequiredCheckPropTypes$8=1;var printWarning=function(){};if(process.env.NODE_ENV!=='production'){var ReactPropTypesSecret=/*@__PURE__*/requireReactPropTypesSecret$8();var loggedTypeFailures={};var has=/*@__PURE__*/requireHas$8();printWarning=function(text){var message='Warning: '+text;if(typeof console!=='undefined'){console.error(message);}try{// --- Welcome to debugging React ---
5171
+ // This error was thrown as a convenience so that you can use this stack
5172
+ // to find the callsite that caused this warning to fire.
5173
+ throw new Error(message);}catch(x){/**/}};}/**
5174
+ * Assert that the values match with the type specs.
5175
+ * Error messages are memorized and will only be shown once.
5176
+ *
5177
+ * @param {object} typeSpecs Map of name to a ReactPropType
5178
+ * @param {object} values Runtime values that need to be type-checked
5179
+ * @param {string} location e.g. "prop", "context", "child context"
5180
+ * @param {string} componentName Name of the component for error messages.
5181
+ * @param {?Function} getStack Returns the component stack.
5182
+ * @private
5183
+ */function checkPropTypes(typeSpecs,values,location,componentName,getStack){if(process.env.NODE_ENV!=='production'){for(var typeSpecName in typeSpecs){if(has(typeSpecs,typeSpecName)){var error;// Prop type validation may throw. In case they do, we don't want to
5184
+ // fail the render phase where it didn't fail before. So we log it.
5185
+ // After these have been cleaned up, we'll let them throw.
5186
+ try{// This is intentionally an invariant that gets caught. It's the same
5187
+ // behavior as without this statement except with a better message.
5188
+ if(typeof typeSpecs[typeSpecName]!=='function'){var err=Error((componentName||'React class')+': '+location+' type `'+typeSpecName+'` is invalid; '+'it must be a function, usually from the `prop-types` package, but received `'+typeof typeSpecs[typeSpecName]+'`.'+'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');err.name='Invariant Violation';throw err;}error=typeSpecs[typeSpecName](values,typeSpecName,componentName,location,null,ReactPropTypesSecret);}catch(ex){error=ex;}if(error&&!(error instanceof Error)){printWarning((componentName||'React class')+': type specification of '+location+' `'+typeSpecName+'` is invalid; the type checker '+'function must return `null` or an `Error` but returned a '+typeof error+'. '+'You may have forgotten to pass an argument to the type checker '+'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and '+'shape all require an argument).');}if(error instanceof Error&&!(error.message in loggedTypeFailures)){// Only monitor this failure once because there tends to be a lot of the
5189
+ // same error.
5190
+ loggedTypeFailures[error.message]=true;var stack=getStack?getStack():'';printWarning('Failed '+location+' type: '+error.message+(stack!=null?stack:''));}}}}}/**
5191
+ * Resets warning cache when testing.
5192
+ *
5193
+ * @private
5194
+ */checkPropTypes.resetWarningCache=function(){if(process.env.NODE_ENV!=='production'){loggedTypeFailures={};}};checkPropTypes_1$8=checkPropTypes;return checkPropTypes_1$8;}/**
5195
+ * Copyright (c) 2013-present, Facebook, Inc.
5196
+ *
5197
+ * This source code is licensed under the MIT license found in the
5198
+ * LICENSE file in the root directory of this source tree.
5199
+ */var factoryWithTypeCheckers$8;var hasRequiredFactoryWithTypeCheckers$8;function requireFactoryWithTypeCheckers$8(){if(hasRequiredFactoryWithTypeCheckers$8)return factoryWithTypeCheckers$8;hasRequiredFactoryWithTypeCheckers$8=1;var ReactIs=requireReactIs$8();var assign=requireObjectAssign$8();var ReactPropTypesSecret=/*@__PURE__*/requireReactPropTypesSecret$8();var has=/*@__PURE__*/requireHas$8();var checkPropTypes=/*@__PURE__*/requireCheckPropTypes$8();var printWarning=function(){};if(process.env.NODE_ENV!=='production'){printWarning=function(text){var message='Warning: '+text;if(typeof console!=='undefined'){console.error(message);}try{// --- Welcome to debugging React ---
5200
+ // This error was thrown as a convenience so that you can use this stack
5201
+ // to find the callsite that caused this warning to fire.
5202
+ throw new Error(message);}catch(x){}};}function emptyFunctionThatReturnsNull(){return null;}factoryWithTypeCheckers$8=function(isValidElement,throwOnDirectAccess){/* global Symbol */var ITERATOR_SYMBOL=typeof Symbol==='function'&&Symbol.iterator;var FAUX_ITERATOR_SYMBOL='@@iterator';// Before Symbol spec.
5203
+ /**
5204
+ * Returns the iterator method function contained on the iterable object.
5205
+ *
5206
+ * Be sure to invoke the function with the iterable as context:
5207
+ *
5208
+ * var iteratorFn = getIteratorFn(myIterable);
5209
+ * if (iteratorFn) {
5210
+ * var iterator = iteratorFn.call(myIterable);
5211
+ * ...
5212
+ * }
5213
+ *
5214
+ * @param {?object} maybeIterable
5215
+ * @return {?function}
5216
+ */function getIteratorFn(maybeIterable){var iteratorFn=maybeIterable&&(ITERATOR_SYMBOL&&maybeIterable[ITERATOR_SYMBOL]||maybeIterable[FAUX_ITERATOR_SYMBOL]);if(typeof iteratorFn==='function'){return iteratorFn;}}/**
5217
+ * Collection of methods that allow declaration and validation of props that are
5218
+ * supplied to React components. Example usage:
5219
+ *
5220
+ * var Props = require('ReactPropTypes');
5221
+ * var MyArticle = React.createClass({
5222
+ * propTypes: {
5223
+ * // An optional string prop named "description".
5224
+ * description: Props.string,
5225
+ *
5226
+ * // A required enum prop named "category".
5227
+ * category: Props.oneOf(['News','Photos']).isRequired,
5228
+ *
5229
+ * // A prop named "dialog" that requires an instance of Dialog.
5230
+ * dialog: Props.instanceOf(Dialog).isRequired
5231
+ * },
5232
+ * render: function() { ... }
5233
+ * });
5234
+ *
5235
+ * A more formal specification of how these methods are used:
5236
+ *
5237
+ * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
5238
+ * decl := ReactPropTypes.{type}(.isRequired)?
5239
+ *
5240
+ * Each and every declaration produces a function with the same signature. This
5241
+ * allows the creation of custom validation functions. For example:
5242
+ *
5243
+ * var MyLink = React.createClass({
5244
+ * propTypes: {
5245
+ * // An optional string or URI prop named "href".
5246
+ * href: function(props, propName, componentName) {
5247
+ * var propValue = props[propName];
5248
+ * if (propValue != null && typeof propValue !== 'string' &&
5249
+ * !(propValue instanceof URI)) {
5250
+ * return new Error(
5251
+ * 'Expected a string or an URI for ' + propName + ' in ' +
5252
+ * componentName
5253
+ * );
5254
+ * }
5255
+ * }
5256
+ * },
5257
+ * render: function() {...}
5258
+ * });
5259
+ *
5260
+ * @internal
5261
+ */var ANONYMOUS='<<anonymous>>';// Important!
5262
+ // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
5263
+ var ReactPropTypes={array:createPrimitiveTypeChecker('array'),bigint:createPrimitiveTypeChecker('bigint'),bool:createPrimitiveTypeChecker('boolean'),func:createPrimitiveTypeChecker('function'),number:createPrimitiveTypeChecker('number'),object:createPrimitiveTypeChecker('object'),string:createPrimitiveTypeChecker('string'),symbol:createPrimitiveTypeChecker('symbol'),any:createAnyTypeChecker(),arrayOf:createArrayOfTypeChecker,element:createElementTypeChecker(),elementType:createElementTypeTypeChecker(),instanceOf:createInstanceTypeChecker,node:createNodeChecker(),objectOf:createObjectOfTypeChecker,oneOf:createEnumTypeChecker,oneOfType:createUnionTypeChecker,shape:createShapeTypeChecker,exact:createStrictShapeTypeChecker};/**
5264
+ * inlined Object.is polyfill to avoid requiring consumers ship their own
5265
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
5266
+ *//*eslint-disable no-self-compare*/function is(x,y){// SameValue algorithm
5267
+ if(x===y){// Steps 1-5, 7-10
5268
+ // Steps 6.b-6.e: +0 != -0
5269
+ return x!==0||1/x===1/y;}else {// Step 6.a: NaN == NaN
5270
+ return x!==x&&y!==y;}}/*eslint-enable no-self-compare*//**
5271
+ * We use an Error-like object for backward compatibility as people may call
5272
+ * PropTypes directly and inspect their output. However, we don't use real
5273
+ * Errors anymore. We don't inspect their stack anyway, and creating them
5274
+ * is prohibitively expensive if they are created too often, such as what
5275
+ * happens in oneOfType() for any type before the one that matched.
5276
+ */function PropTypeError(message,data){this.message=message;this.data=data&&typeof data==='object'?data:{};this.stack='';}// Make `instanceof Error` still work for returned errors.
5277
+ PropTypeError.prototype=Error.prototype;function createChainableTypeChecker(validate){if(process.env.NODE_ENV!=='production'){var manualPropTypeCallCache={};var manualPropTypeWarningCount=0;}function checkType(isRequired,props,propName,componentName,location,propFullName,secret){componentName=componentName||ANONYMOUS;propFullName=propFullName||propName;if(secret!==ReactPropTypesSecret){if(throwOnDirectAccess){// New behavior only for users of `prop-types` package
5278
+ var err=new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. '+'Use `PropTypes.checkPropTypes()` to call them. '+'Read more at http://fb.me/use-check-prop-types');err.name='Invariant Violation';throw err;}else if(process.env.NODE_ENV!=='production'&&typeof console!=='undefined'){// Old behavior for people using React.PropTypes
5279
+ var cacheKey=componentName+':'+propName;if(!manualPropTypeCallCache[cacheKey]&&// Avoid spamming the console because they are often not actionable except for lib authors
5280
+ manualPropTypeWarningCount<3){printWarning('You are manually calling a React.PropTypes validation '+'function for the `'+propFullName+'` prop on `'+componentName+'`. This is deprecated '+'and will throw in the standalone `prop-types` package. '+'You may be seeing this warning due to a third-party PropTypes '+'library. See https://fb.me/react-warning-dont-call-proptypes '+'for details.');manualPropTypeCallCache[cacheKey]=true;manualPropTypeWarningCount++;}}}if(props[propName]==null){if(isRequired){if(props[propName]===null){return new PropTypeError('The '+location+' `'+propFullName+'` is marked as required '+('in `'+componentName+'`, but its value is `null`.'));}return new PropTypeError('The '+location+' `'+propFullName+'` is marked as required in '+('`'+componentName+'`, but its value is `undefined`.'));}return null;}else {return validate(props,propName,componentName,location,propFullName);}}var chainedCheckType=checkType.bind(null,false);chainedCheckType.isRequired=checkType.bind(null,true);return chainedCheckType;}function createPrimitiveTypeChecker(expectedType){function validate(props,propName,componentName,location,propFullName,secret){var propValue=props[propName];var propType=getPropType(propValue);if(propType!==expectedType){// `propValue` being instance of, say, date/regexp, pass the 'object'
5281
+ // check, but we can offer a more precise error message here rather than
5282
+ // 'of type `object`'.
5283
+ var preciseType=getPreciseType(propValue);return new PropTypeError('Invalid '+location+' `'+propFullName+'` of type '+('`'+preciseType+'` supplied to `'+componentName+'`, expected ')+('`'+expectedType+'`.'),{expectedType:expectedType});}return null;}return createChainableTypeChecker(validate);}function createAnyTypeChecker(){return createChainableTypeChecker(emptyFunctionThatReturnsNull);}function createArrayOfTypeChecker(typeChecker){function validate(props,propName,componentName,location,propFullName){if(typeof typeChecker!=='function'){return new PropTypeError('Property `'+propFullName+'` of component `'+componentName+'` has invalid PropType notation inside arrayOf.');}var propValue=props[propName];if(!Array.isArray(propValue)){var propType=getPropType(propValue);return new PropTypeError('Invalid '+location+' `'+propFullName+'` of type '+('`'+propType+'` supplied to `'+componentName+'`, expected an array.'));}for(var i=0;i<propValue.length;i++){var error=typeChecker(propValue,i,componentName,location,propFullName+'['+i+']',ReactPropTypesSecret);if(error instanceof Error){return error;}}return null;}return createChainableTypeChecker(validate);}function createElementTypeChecker(){function validate(props,propName,componentName,location,propFullName){var propValue=props[propName];if(!isValidElement(propValue)){var propType=getPropType(propValue);return new PropTypeError('Invalid '+location+' `'+propFullName+'` of type '+('`'+propType+'` supplied to `'+componentName+'`, expected a single ReactElement.'));}return null;}return createChainableTypeChecker(validate);}function createElementTypeTypeChecker(){function validate(props,propName,componentName,location,propFullName){var propValue=props[propName];if(!ReactIs.isValidElementType(propValue)){var propType=getPropType(propValue);return new PropTypeError('Invalid '+location+' `'+propFullName+'` of type '+('`'+propType+'` supplied to `'+componentName+'`, expected a single ReactElement type.'));}return null;}return createChainableTypeChecker(validate);}function createInstanceTypeChecker(expectedClass){function validate(props,propName,componentName,location,propFullName){if(!(props[propName]instanceof expectedClass)){var expectedClassName=expectedClass.name||ANONYMOUS;var actualClassName=getClassName(props[propName]);return new PropTypeError('Invalid '+location+' `'+propFullName+'` of type '+('`'+actualClassName+'` supplied to `'+componentName+'`, expected ')+('instance of `'+expectedClassName+'`.'));}return null;}return createChainableTypeChecker(validate);}function createEnumTypeChecker(expectedValues){if(!Array.isArray(expectedValues)){if(process.env.NODE_ENV!=='production'){if(arguments.length>1){printWarning('Invalid arguments supplied to oneOf, expected an array, got '+arguments.length+' arguments. '+'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).');}else {printWarning('Invalid argument supplied to oneOf, expected an array.');}}return emptyFunctionThatReturnsNull;}function validate(props,propName,componentName,location,propFullName){var propValue=props[propName];for(var i=0;i<expectedValues.length;i++){if(is(propValue,expectedValues[i])){return null;}}var valuesString=JSON.stringify(expectedValues,function replacer(key,value){var type=getPreciseType(value);if(type==='symbol'){return String(value);}return value;});return new PropTypeError('Invalid '+location+' `'+propFullName+'` of value `'+String(propValue)+'` '+('supplied to `'+componentName+'`, expected one of '+valuesString+'.'));}return createChainableTypeChecker(validate);}function createObjectOfTypeChecker(typeChecker){function validate(props,propName,componentName,location,propFullName){if(typeof typeChecker!=='function'){return new PropTypeError('Property `'+propFullName+'` of component `'+componentName+'` has invalid PropType notation inside objectOf.');}var propValue=props[propName];var propType=getPropType(propValue);if(propType!=='object'){return new PropTypeError('Invalid '+location+' `'+propFullName+'` of type '+('`'+propType+'` supplied to `'+componentName+'`, expected an object.'));}for(var key in propValue){if(has(propValue,key)){var error=typeChecker(propValue,key,componentName,location,propFullName+'.'+key,ReactPropTypesSecret);if(error instanceof Error){return error;}}}return null;}return createChainableTypeChecker(validate);}function createUnionTypeChecker(arrayOfTypeCheckers){if(!Array.isArray(arrayOfTypeCheckers)){process.env.NODE_ENV!=='production'?printWarning('Invalid argument supplied to oneOfType, expected an instance of array.'):void 0;return emptyFunctionThatReturnsNull;}for(var i=0;i<arrayOfTypeCheckers.length;i++){var checker=arrayOfTypeCheckers[i];if(typeof checker!=='function'){printWarning('Invalid argument supplied to oneOfType. Expected an array of check functions, but '+'received '+getPostfixForTypeWarning(checker)+' at index '+i+'.');return emptyFunctionThatReturnsNull;}}function validate(props,propName,componentName,location,propFullName){var expectedTypes=[];for(var i=0;i<arrayOfTypeCheckers.length;i++){var checker=arrayOfTypeCheckers[i];var checkerResult=checker(props,propName,componentName,location,propFullName,ReactPropTypesSecret);if(checkerResult==null){return null;}if(checkerResult.data&&has(checkerResult.data,'expectedType')){expectedTypes.push(checkerResult.data.expectedType);}}var expectedTypesMessage=expectedTypes.length>0?', expected one of type ['+expectedTypes.join(', ')+']':'';return new PropTypeError('Invalid '+location+' `'+propFullName+'` supplied to '+('`'+componentName+'`'+expectedTypesMessage+'.'));}return createChainableTypeChecker(validate);}function createNodeChecker(){function validate(props,propName,componentName,location,propFullName){if(!isNode(props[propName])){return new PropTypeError('Invalid '+location+' `'+propFullName+'` supplied to '+('`'+componentName+'`, expected a ReactNode.'));}return null;}return createChainableTypeChecker(validate);}function invalidValidatorError(componentName,location,propFullName,key,type){return new PropTypeError((componentName||'React class')+': '+location+' type `'+propFullName+'.'+key+'` is invalid; '+'it must be a function, usually from the `prop-types` package, but received `'+type+'`.');}function createShapeTypeChecker(shapeTypes){function validate(props,propName,componentName,location,propFullName){var propValue=props[propName];var propType=getPropType(propValue);if(propType!=='object'){return new PropTypeError('Invalid '+location+' `'+propFullName+'` of type `'+propType+'` '+('supplied to `'+componentName+'`, expected `object`.'));}for(var key in shapeTypes){var checker=shapeTypes[key];if(typeof checker!=='function'){return invalidValidatorError(componentName,location,propFullName,key,getPreciseType(checker));}var error=checker(propValue,key,componentName,location,propFullName+'.'+key,ReactPropTypesSecret);if(error){return error;}}return null;}return createChainableTypeChecker(validate);}function createStrictShapeTypeChecker(shapeTypes){function validate(props,propName,componentName,location,propFullName){var propValue=props[propName];var propType=getPropType(propValue);if(propType!=='object'){return new PropTypeError('Invalid '+location+' `'+propFullName+'` of type `'+propType+'` '+('supplied to `'+componentName+'`, expected `object`.'));}// We need to check all keys in case some are required but missing from props.
5284
+ var allKeys=assign({},props[propName],shapeTypes);for(var key in allKeys){var checker=shapeTypes[key];if(has(shapeTypes,key)&&typeof checker!=='function'){return invalidValidatorError(componentName,location,propFullName,key,getPreciseType(checker));}if(!checker){return new PropTypeError('Invalid '+location+' `'+propFullName+'` key `'+key+'` supplied to `'+componentName+'`.'+'\nBad object: '+JSON.stringify(props[propName],null,' ')+'\nValid keys: '+JSON.stringify(Object.keys(shapeTypes),null,' '));}var error=checker(propValue,key,componentName,location,propFullName+'.'+key,ReactPropTypesSecret);if(error){return error;}}return null;}return createChainableTypeChecker(validate);}function isNode(propValue){switch(typeof propValue){case'number':case'string':case'undefined':return true;case'boolean':return !propValue;case'object':if(Array.isArray(propValue)){return propValue.every(isNode);}if(propValue===null||isValidElement(propValue)){return true;}var iteratorFn=getIteratorFn(propValue);if(iteratorFn){var iterator=iteratorFn.call(propValue);var step;if(iteratorFn!==propValue.entries){while(!(step=iterator.next()).done){if(!isNode(step.value)){return false;}}}else {// Iterator will provide entry [k,v] tuples rather than values.
5285
+ while(!(step=iterator.next()).done){var entry=step.value;if(entry){if(!isNode(entry[1])){return false;}}}}}else {return false;}return true;default:return false;}}function isSymbol(propType,propValue){// Native Symbol.
5286
+ if(propType==='symbol'){return true;}// falsy value can't be a Symbol
5287
+ if(!propValue){return false;}// 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
5288
+ if(propValue['@@toStringTag']==='Symbol'){return true;}// Fallback for non-spec compliant Symbols which are polyfilled.
5289
+ if(typeof Symbol==='function'&&propValue instanceof Symbol){return true;}return false;}// Equivalent of `typeof` but with special handling for array and regexp.
5290
+ function getPropType(propValue){var propType=typeof propValue;if(Array.isArray(propValue)){return 'array';}if(propValue instanceof RegExp){// Old webkits (at least until Android 4.0) return 'function' rather than
5291
+ // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
5292
+ // passes PropTypes.object.
5293
+ return 'object';}if(isSymbol(propType,propValue)){return 'symbol';}return propType;}// This handles more types than `getPropType`. Only used for error messages.
5294
+ // See `createPrimitiveTypeChecker`.
5295
+ function getPreciseType(propValue){if(typeof propValue==='undefined'||propValue===null){return ''+propValue;}var propType=getPropType(propValue);if(propType==='object'){if(propValue instanceof Date){return 'date';}else if(propValue instanceof RegExp){return 'regexp';}}return propType;}// Returns a string that is postfixed to a warning about an invalid type.
5296
+ // For example, "undefined" or "of type array"
5297
+ function getPostfixForTypeWarning(value){var type=getPreciseType(value);switch(type){case'array':case'object':return 'an '+type;case'boolean':case'date':case'regexp':return 'a '+type;default:return type;}}// Returns class name of the object, if any.
5298
+ function getClassName(propValue){if(!propValue.constructor||!propValue.constructor.name){return ANONYMOUS;}return propValue.constructor.name;}ReactPropTypes.checkPropTypes=checkPropTypes;ReactPropTypes.resetWarningCache=checkPropTypes.resetWarningCache;ReactPropTypes.PropTypes=ReactPropTypes;return ReactPropTypes;};return factoryWithTypeCheckers$8;}/**
5299
+ * Copyright (c) 2013-present, Facebook, Inc.
5300
+ *
5301
+ * This source code is licensed under the MIT license found in the
5302
+ * LICENSE file in the root directory of this source tree.
5303
+ */var factoryWithThrowingShims$8;var hasRequiredFactoryWithThrowingShims$8;function requireFactoryWithThrowingShims$8(){if(hasRequiredFactoryWithThrowingShims$8)return factoryWithThrowingShims$8;hasRequiredFactoryWithThrowingShims$8=1;var ReactPropTypesSecret=/*@__PURE__*/requireReactPropTypesSecret$8();function emptyFunction(){}function emptyFunctionWithReset(){}emptyFunctionWithReset.resetWarningCache=emptyFunction;factoryWithThrowingShims$8=function(){function shim(props,propName,componentName,location,propFullName,secret){if(secret===ReactPropTypesSecret){// It is still safe when called from React.
5304
+ return;}var err=new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. '+'Use PropTypes.checkPropTypes() to call them. '+'Read more at http://fb.me/use-check-prop-types');err.name='Invariant Violation';throw err;}shim.isRequired=shim;function getShim(){return shim;}// Important!
5305
+ // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
5306
+ var ReactPropTypes={array:shim,bigint:shim,bool:shim,func:shim,number:shim,object:shim,string:shim,symbol:shim,any:shim,arrayOf:getShim,element:shim,elementType:shim,instanceOf:getShim,node:shim,objectOf:getShim,oneOf:getShim,oneOfType:getShim,shape:getShim,exact:getShim,checkPropTypes:emptyFunctionWithReset,resetWarningCache:emptyFunction};ReactPropTypes.PropTypes=ReactPropTypes;return ReactPropTypes;};return factoryWithThrowingShims$8;}/**
5307
+ * Copyright (c) 2013-present, Facebook, Inc.
5308
+ *
5309
+ * This source code is licensed under the MIT license found in the
5310
+ * LICENSE file in the root directory of this source tree.
5311
+ */var hasRequiredPropTypes$8;function requirePropTypes$8(){if(hasRequiredPropTypes$8)return propTypes$8.exports;hasRequiredPropTypes$8=1;if(process.env.NODE_ENV!=='production'){var ReactIs=requireReactIs$8();// By explicitly using `prop-types` you are opting into new development behavior.
5312
+ // http://fb.me/prop-types-in-prod
5313
+ var throwOnDirectAccess=true;propTypes$8.exports=/*@__PURE__*/requireFactoryWithTypeCheckers$8()(ReactIs.isElement,throwOnDirectAccess);}else {// By explicitly using `prop-types` you are opting into new production behavior.
5314
+ // http://fb.me/prop-types-in-prod
5315
+ propTypes$8.exports=/*@__PURE__*/requireFactoryWithThrowingShims$8()();}return propTypes$8.exports;}var propTypesExports$8=/*@__PURE__*/requirePropTypes$8();var PropTypes$8=/*@__PURE__*/getDefaultExportFromCjs$8(propTypesExports$8);({onPowerOff:PropTypes$8.func,onRestart:PropTypes$8.func,powerOffLabel:PropTypes$8.string,restartLabel:PropTypes$8.string,iconClassName:PropTypes$8.string,confirmTitle:PropTypes$8.string,cancelText:PropTypes$8.string,okText:PropTypes$8.string,run:PropTypes$8.func});({logoUrl:PropTypes$8.string,logoWidth:PropTypes$8.number,logoAlt:PropTypes$8.string,onClick:PropTypes$8.func});function _defineProperty$1(e,r,t){return (r=_toPropertyKey$1(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e;}function ownKeys$1(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread2$1(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys$1(Object(t),!0).forEach(function(r){_defineProperty$1(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys$1(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}function _toPrimitive$1(t,r){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return ("string"===r?String:Number)(t);}function _toPropertyKey$1(t){var i=_toPrimitive$1(t,"string");return "symbol"==typeof i?i:i+"";}/**
5316
+ * 国际化调试工具
5317
+ * 在浏览器控制台运行 window.debugI18n() 查看当前国际化状态
5318
+ */const debugI18n=()=>{var _window$g_initialProp,_window$g_initialProp2,_window$g_initialProp3,_window$g_initialProp4,_window$g_initialProp5,_window$g_initialProp6;if(typeof window==='undefined'){console.log('[i18n debug] Not in browser environment');return;}console.group('🌍 I18n Debug Information');// 1. 当前语言环境
5319
+ console.log('📍 Current Locale Sources:');console.log(' - window.g_initialProps?.locale:',(_window$g_initialProp=window.g_initialProps)===null||_window$g_initialProp===void 0?void 0:_window$g_initialProp.locale);console.log(' - window.g_initialProps?.___g_initialPropsFromServer?.locale:',(_window$g_initialProp2=window.g_initialProps)===null||_window$g_initialProp2===void 0||(_window$g_initialProp2=_window$g_initialProp2.___g_initialPropsFromServer)===null||_window$g_initialProp2===void 0?void 0:_window$g_initialProp2.locale);try{console.log(' - localStorage.umi-locale:',localStorage.getItem('umi-locale'));}catch(e){console.log(' - localStorage: not available');}console.log(' - window.__COMPONENT_LOCALE__:',window.__COMPONENT_LOCALE__);// 2. 语言包
5320
+ console.log('\n📦 Available Message Sources:');console.log(' - window.__COMPONENT_I18N_MESSAGES__:',window.__COMPONENT_I18N_MESSAGES__);console.log(' - window.__PROJECT_I18N_MESSAGES__:',window.__PROJECT_I18N_MESSAGES__);console.log(' - window.g_initialProps?.messages:',(_window$g_initialProp3=window.g_initialProps)===null||_window$g_initialProp3===void 0?void 0:_window$g_initialProp3.messages);// 3. 合并后的语言包
5321
+ const componentMessages=window.__COMPONENT_I18N_MESSAGES__||{};const projectMessages=window.__PROJECT_I18N_MESSAGES__||{};const umiMessages=((_window$g_initialProp4=window.g_initialProps)===null||_window$g_initialProp4===void 0?void 0:_window$g_initialProp4.messages)||{};const allLocales=new Set([...Object.keys(componentMessages),...Object.keys(projectMessages),...Object.keys(umiMessages)]);console.log('\n🔧 Merged Locales:',Array.from(allLocales));allLocales.forEach(locale=>{const merged=_objectSpread2$1(_objectSpread2$1(_objectSpread2$1({},umiMessages[locale]||{}),projectMessages[locale]||{}),componentMessages[locale]||{});console.log("\n \uD83D\uDCC4 ".concat(locale," (").concat(Object.keys(merged).length," keys):"),merged);});// 4. 测试几个关键的 key
5322
+ console.log('\n🧪 Test Translation:');const testKeys=['networkSettings.title','button.ok','button.cancel','button.apply','button.close'];const currentLocale=((_window$g_initialProp5=window.g_initialProps)===null||_window$g_initialProp5===void 0?void 0:_window$g_initialProp5.locale)||((_window$g_initialProp6=window.g_initialProps)===null||_window$g_initialProp6===void 0||(_window$g_initialProp6=_window$g_initialProp6.___g_initialPropsFromServer)===null||_window$g_initialProp6===void 0?void 0:_window$g_initialProp6.locale)||localStorage.getItem('umi-locale')||'zh-CN';const allMessages={};allLocales.forEach(locale=>{allMessages[locale]=_objectSpread2$1(_objectSpread2$1(_objectSpread2$1({},umiMessages[locale]||{}),projectMessages[locale]||{}),componentMessages[locale]||{});});testKeys.forEach(key=>{var _allMessages$currentL,_allMessages$enUS;const translation=((_allMessages$currentL=allMessages[currentLocale])===null||_allMessages$currentL===void 0?void 0:_allMessages$currentL[key])||((_allMessages$enUS=allMessages['en-US'])===null||_allMessages$enUS===void 0?void 0:_allMessages$enUS[key])||'❌ NOT FOUND';console.log(" - ".concat(key,": ").concat(translation));});console.groupEnd();};// 自动在开发环境注册到 window
5323
+ if(process.env.NODE_ENV==='development'&&typeof window!=='undefined'){window.debugI18n=debugI18n;console.log('💡 I18n debug tool available. Run window.debugI18n() in console to check i18n status.');}function getDefaultExportFromCjs$7(x){return x&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,'default')?x['default']:x;}var propTypes$7={exports:{}};var reactIs$7={exports:{}};var reactIs_production_min$7={};/** @license React v16.13.1
5129
5324
  * react-is.production.min.js
5130
5325
  *
5131
5326
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -6644,14 +6839,14 @@ const NmosModal = _ref => {
6644
6839
  modalProps = {},
6645
6840
  formProps = {}
6646
6841
  } = _ref;
6647
- const intl = useIntl$1();
6648
- const [nmosSettings, setNmosSettings] = React.useState(null);
6649
- const [loading, setLoading] = React.useState(false);
6842
+ const intl = useIntl();
6843
+ const [nmosSettings, setNmosSettings] = react.useState(null);
6844
+ const [loading, setLoading] = react.useState(false);
6650
6845
  const [form] = antd.Form.useForm();
6651
6846
  const {
6652
6847
  message
6653
6848
  } = antd.App.useApp();
6654
- React.useEffect(() => {
6849
+ react.useEffect(() => {
6655
6850
  // 重置表单和状态当 Modal 打开时
6656
6851
  if (open) {
6657
6852
  setLoading(true);
@@ -6683,7 +6878,7 @@ const NmosModal = _ref => {
6683
6878
  const values = await form.getFieldsValue();
6684
6879
  setLoading(true);
6685
6880
  try {
6686
- const response = await updateNmosSettings(_objectSpread2(_objectSpread2({}, nmosSettings), values));
6881
+ const response = await updateNmosSettings(_objectSpread2$2(_objectSpread2$2({}, nmosSettings), values));
6687
6882
  if (response) {
6688
6883
  message.success(intl.formatMessage({
6689
6884
  id: 'nmos.saveSuccess'
@@ -6698,7 +6893,7 @@ const NmosModal = _ref => {
6698
6893
  setLoading(false);
6699
6894
  }
6700
6895
  };
6701
- return /*#__PURE__*/jsxRuntime.jsx(StyledModal$3, _objectSpread2(_objectSpread2({
6896
+ return /*#__PURE__*/jsxRuntime.jsx(StyledModal$1, _objectSpread2$2(_objectSpread2$2({
6702
6897
  title: intl.formatMessage({
6703
6898
  id: 'nmos.title'
6704
6899
  }),
@@ -6715,7 +6910,7 @@ const NmosModal = _ref => {
6715
6910
  confirmLoading: loading,
6716
6911
  destroyOnHidden: true // 关闭时销毁组件,确保下次打开重新初始化
6717
6912
  }, modalProps), {}, {
6718
- children: /*#__PURE__*/jsxRuntime.jsxs(antd.Form, _objectSpread2(_objectSpread2({
6913
+ children: /*#__PURE__*/jsxRuntime.jsxs(antd.Form, _objectSpread2$2(_objectSpread2$2({
6719
6914
  form: form,
6720
6915
  name: "nmosForm",
6721
6916
  labelCol: {
@@ -6761,7 +6956,7 @@ const NmosModal = _ref => {
6761
6956
  id: 'nmos.registrationPort'
6762
6957
  }),
6763
6958
  name: "registration_port",
6764
- children: /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, _objectSpread2(_objectSpread2({}, numberProps), {}, {
6959
+ children: /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, _objectSpread2$2(_objectSpread2$2({}, numberProps), {}, {
6765
6960
  min: 0,
6766
6961
  max: 65535,
6767
6962
  style: {
@@ -6796,7 +6991,7 @@ const NmosModal = _ref => {
6796
6991
  id: 'nmos.loggingLevel'
6797
6992
  }),
6798
6993
  name: "logging_level",
6799
- children: /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, _objectSpread2(_objectSpread2({}, numberProps), {}, {
6994
+ children: /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, _objectSpread2$2(_objectSpread2$2({}, numberProps), {}, {
6800
6995
  min: -40,
6801
6996
  max: 40,
6802
6997
  style: {
@@ -6807,7 +7002,7 @@ const NmosModal = _ref => {
6807
7002
  }))
6808
7003
  }));
6809
7004
  };
6810
- var NmosModal$1 = /*#__PURE__*/React.memo(NmosModal);
7005
+ var NmosModal$1 = /*#__PURE__*/react.memo(NmosModal);
6811
7006
 
6812
7007
  const useDeviceHealthCheck = function () {
6813
7008
  let {
@@ -6817,12 +7012,12 @@ const useDeviceHealthCheck = function () {
6817
7012
  onRedirect,
6818
7013
  redirectPath = '/'
6819
7014
  } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6820
- const [error, setError] = React.useState(null);
6821
- const retryCountRef = React.useRef(0);
6822
- const abortControllerRef = React.useRef(null); // 用于取消轮询
7015
+ const [error, setError] = react.useState(null);
7016
+ const retryCountRef = react.useRef(0);
7017
+ const abortControllerRef = react.useRef(null); // 用于取消轮询
6823
7018
 
6824
7019
  // 默认跳转行为:原生页面跳转(兼容无路由场景)
6825
- const handleRedirect = React.useCallback(path => {
7020
+ const handleRedirect = react.useCallback(path => {
6826
7021
  if (onRedirect) {
6827
7022
  onRedirect(path);
6828
7023
  } else {
@@ -6868,7 +7063,7 @@ const useDeviceHealthCheck = function () {
6868
7063
  };
6869
7064
 
6870
7065
  // 轮询逻辑
6871
- const startPolling = React.useCallback(() => {
7066
+ const startPolling = react.useCallback(() => {
6872
7067
  // 重置状态
6873
7068
  retryCountRef.current = 0;
6874
7069
  setError(null);
@@ -6876,12 +7071,12 @@ const useDeviceHealthCheck = function () {
6876
7071
  abortControllerRef.current = new AbortController();
6877
7072
  poll();
6878
7073
  }, []);
6879
- const manualRetry = React.useCallback(() => {
7074
+ const manualRetry = react.useCallback(() => {
6880
7075
  retryCountRef.current = 0;
6881
7076
  setError(null);
6882
7077
  poll();
6883
7078
  }, []);
6884
- const cleanup = React.useCallback(() => {
7079
+ const cleanup = react.useCallback(() => {
6885
7080
  if (abortControllerRef.current) {
6886
7081
  abortControllerRef.current.abort();
6887
7082
  abortControllerRef.current = null;
@@ -6907,8 +7102,8 @@ const MaintenancePage = _ref => {
6907
7102
  // 每 2 秒重试
6908
7103
  countdownSeconds = 30 // 倒计时初始值,单位秒
6909
7104
  } = _ref;
6910
- const intl = useIntl$1();
6911
- const [countdown, setCountdown] = React.useState(countdownSeconds);
7105
+ const intl = useIntl();
7106
+ const [countdown, setCountdown] = react.useState(countdownSeconds);
6912
7107
  const {
6913
7108
  error,
6914
7109
  startPolling,
@@ -6921,7 +7116,7 @@ const MaintenancePage = _ref => {
6921
7116
  maxRetries,
6922
7117
  checkInterval
6923
7118
  });
6924
- React.useEffect(() => {
7119
+ react.useEffect(() => {
6925
7120
  if (!isRestart) return;
6926
7121
  const countdownTimer = setInterval(() => {
6927
7122
  setCountdown(prev => Math.max(0, prev - 1));
@@ -7090,25 +7285,25 @@ const DraggableNumberInput = _ref2 => {
7090
7285
  disabled = false,
7091
7286
  style
7092
7287
  } = _ref2,
7093
- restProps = _objectWithoutProperties(_ref2, _excluded$1);
7094
- const inputRef = React.useRef(null);
7095
- const [isMouseDown, setIsMouseDown] = React.useState(false);
7096
- const [isDragging, setIsDragging] = React.useState(false);
7097
- const [localValue, setLocalValue] = React.useState(() => formatNumber(value, decimalPlaces));
7098
- const [cursorPosition, setCursorPosition] = React.useState({
7288
+ restProps = _objectWithoutProperties$1(_ref2, _excluded$1);
7289
+ const inputRef = react.useRef(null);
7290
+ const [isMouseDown, setIsMouseDown] = react.useState(false);
7291
+ const [isDragging, setIsDragging] = react.useState(false);
7292
+ const [localValue, setLocalValue] = react.useState(() => formatNumber(value, decimalPlaces));
7293
+ const [cursorPosition, setCursorPosition] = react.useState({
7099
7294
  x: 0,
7100
7295
  y: 0
7101
7296
  });
7102
- const totalMovement = React.useRef(0);
7103
- const startValue = React.useRef(0);
7104
- const startX = React.useRef(0);
7105
- const currentMultiplier = React.useRef(1);
7297
+ const totalMovement = react.useRef(0);
7298
+ const startValue = react.useRef(0);
7299
+ const startX = react.useRef(0);
7300
+ const currentMultiplier = react.useRef(1);
7106
7301
 
7107
7302
  // === 编辑状态跟踪 ===
7108
- const [isEditing, setIsEditing] = React.useState(false);
7109
- const lastExternalValueRef = React.useRef(value);
7110
- const formatValue = React.useCallback(val => formatNumber(val, decimalPlaces), [decimalPlaces]);
7111
- const constrainedOnChange = React.useCallback(newValue => {
7303
+ const [isEditing, setIsEditing] = react.useState(false);
7304
+ const lastExternalValueRef = react.useRef(value);
7305
+ const formatValue = react.useCallback(val => formatNumber(val, decimalPlaces), [decimalPlaces]);
7306
+ const constrainedOnChange = react.useCallback(newValue => {
7112
7307
  if (disabled) return;
7113
7308
  let constrainedValue = newValue;
7114
7309
  if (typeof min === "number") constrainedValue = Math.max(min, constrainedValue);
@@ -7117,7 +7312,7 @@ const DraggableNumberInput = _ref2 => {
7117
7312
  }, [onChange, min, max, disabled]);
7118
7313
 
7119
7314
  // 外部值同步:仅在非编辑状态且外部值真正变化时更新
7120
- React.useEffect(() => {
7315
+ react.useEffect(() => {
7121
7316
  if (!isEditing && lastExternalValueRef.current !== value) {
7122
7317
  setLocalValue(formatValue(value));
7123
7318
  lastExternalValueRef.current = value;
@@ -7152,7 +7347,7 @@ const DraggableNumberInput = _ref2 => {
7152
7347
  setLocalValue(formatValue(value));
7153
7348
  }
7154
7349
  };
7155
- const handleMouseDown = React.useCallback(e => {
7350
+ const handleMouseDown = react.useCallback(e => {
7156
7351
  if (disabled || !inputRef.current) return;
7157
7352
  let x = 0,
7158
7353
  y = 0;
@@ -7171,8 +7366,8 @@ const DraggableNumberInput = _ref2 => {
7171
7366
  y
7172
7367
  });
7173
7368
  }, [value, disablePointerLock, disabled]);
7174
- const getModifiers = React.useCallback(e => {
7175
- const mods = _objectSpread2(_objectSpread2({}, defaultModifiers), modifierKeys);
7369
+ const getModifiers = react.useCallback(e => {
7370
+ const mods = _objectSpread2$2(_objectSpread2$2({}, defaultModifiers), modifierKeys);
7176
7371
  for (const key in mods) {
7177
7372
  if (key !== "default" && e[key]) {
7178
7373
  currentMultiplier.current = mods[key].multiplier;
@@ -7182,7 +7377,7 @@ const DraggableNumberInput = _ref2 => {
7182
7377
  currentMultiplier.current = mods.default.multiplier;
7183
7378
  return mods.default;
7184
7379
  }, [modifierKeys]);
7185
- const applyMovement = React.useCallback((newMovement, e) => {
7380
+ const applyMovement = react.useCallback((newMovement, e) => {
7186
7381
  if (disabled) return;
7187
7382
  const {
7188
7383
  sensitivity,
@@ -7195,7 +7390,7 @@ const DraggableNumberInput = _ref2 => {
7195
7390
  newValue = Object.is(newValue, -0) ? 0 : newValue;
7196
7391
  constrainedOnChange(newValue);
7197
7392
  }, [constrainedOnChange, getModifiers, decimalPlaces, disabled]);
7198
- const updateDelta = React.useCallback(e => {
7393
+ const updateDelta = react.useCallback(e => {
7199
7394
  if (disabled || !isMouseDown) return;
7200
7395
  applyMovement(totalMovement.current, e);
7201
7396
  }, [isMouseDown, disabled, applyMovement]);
@@ -7209,13 +7404,13 @@ const DraggableNumberInput = _ref2 => {
7209
7404
  constrainedOnChange(handleArrow(e, multiplier, value));
7210
7405
  }
7211
7406
  };
7212
- const handleModifierKeyDuringDrag = React.useCallback(e => {
7407
+ const handleModifierKeyDuringDrag = react.useCallback(e => {
7213
7408
  if (disabled) return;
7214
7409
  if (["Shift", "Control", "Meta", "Alt"].includes(e.key)) {
7215
7410
  updateDelta(e);
7216
7411
  }
7217
7412
  }, [updateDelta, disabled]);
7218
- const handleMouseMove = React.useCallback(e => {
7413
+ const handleMouseMove = react.useCallback(e => {
7219
7414
  if (disabled || !isMouseDown) return;
7220
7415
  if ("touches" in e) e.preventDefault();
7221
7416
  if (!disablePointerLock && document.pointerLockElement && !("touches" in e)) {
@@ -7245,7 +7440,7 @@ const DraggableNumberInput = _ref2 => {
7245
7440
  totalMovement.current = newMovement;
7246
7441
  applyMovement(newMovement, e);
7247
7442
  }, [isMouseDown, disablePointerLock, isDragging, onDragStart, applyMovement, handleModifierKeyDuringDrag, disabled]);
7248
- const handleMouseUp = React.useCallback(() => {
7443
+ const handleMouseUp = react.useCallback(() => {
7249
7444
  if (disabled) return;
7250
7445
  setIsMouseDown(false);
7251
7446
  totalMovement.current = 0;
@@ -7257,7 +7452,7 @@ const DraggableNumberInput = _ref2 => {
7257
7452
  }
7258
7453
  if (document.pointerLockElement) document.exitPointerLock();
7259
7454
  }, [isDragging, onDragEnd, disablePointerLock, disabled]);
7260
- React.useEffect(() => {
7455
+ react.useEffect(() => {
7261
7456
  if (isMouseDown && !disabled) {
7262
7457
  document.addEventListener("mousemove", handleMouseMove);
7263
7458
  document.addEventListener("touchmove", handleMouseMove, {
@@ -7280,7 +7475,7 @@ const DraggableNumberInput = _ref2 => {
7280
7475
  color: "rgba(255, 255, 255, 0.25)"
7281
7476
  } : {};
7282
7477
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
7283
- children: [/*#__PURE__*/jsxRuntime.jsx("input", _objectSpread2({
7478
+ children: [/*#__PURE__*/jsxRuntime.jsx("input", _objectSpread2$2({
7284
7479
  ref: inputRef,
7285
7480
  type: "text",
7286
7481
  inputMode: "numeric",
@@ -7293,7 +7488,7 @@ const DraggableNumberInput = _ref2 => {
7293
7488
  onKeyDown: handleArrowKeyDown,
7294
7489
  disabled: disabled,
7295
7490
  className: "draggable-number-input ".concat(className, " ").concat(isDragging ? "dragging" : "", " ").concat(disabled ? "disabled" : ""),
7296
- style: _objectSpread2(_objectSpread2({
7491
+ style: _objectSpread2$2(_objectSpread2$2({
7297
7492
  cursor: disabled ? "not-allowed" : "ew-resize",
7298
7493
  userSelect: disabled ? "none" : "auto",
7299
7494
  caretColor: isDragging ? "transparent" : "initial"
@@ -7315,8 +7510,8 @@ const BoundedInput = _ref => {
7315
7510
  placeholder = 'input.placeholder.enterInteger',
7316
7511
  disabled = false
7317
7512
  } = _ref,
7318
- props = _objectWithoutProperties(_ref, _excluded);
7319
- const intl = useIntl$1();
7513
+ props = _objectWithoutProperties$1(_ref, _excluded);
7514
+ const intl = useIntl();
7320
7515
 
7321
7516
  // 处理国际化文本
7322
7517
  const placeholderText = typeof placeholder === 'string' && placeholder.includes('.') ? intl.formatMessage({
@@ -7354,7 +7549,7 @@ const BoundedInput = _ref => {
7354
7549
  onChange === null || onChange === void 0 || onChange(safeVal);
7355
7550
  }
7356
7551
  };
7357
- return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, _objectSpread2({
7552
+ return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, _objectSpread2$2({
7358
7553
  value: value,
7359
7554
  onChange: handleChange,
7360
7555
  onBlur: handleBlur,
@@ -7381,7 +7576,7 @@ const BoundedInput = _ref => {
7381
7576
  /**
7382
7577
  * 专用端口输入框
7383
7578
  */
7384
- const PortInput = props => /*#__PURE__*/jsxRuntime.jsx(BoundedInput, _objectSpread2({
7579
+ const PortInput = props => /*#__PURE__*/jsxRuntime.jsx(BoundedInput, _objectSpread2$2({
7385
7580
  min: 0,
7386
7581
  max: 65535,
7387
7582
  placeholder: "input.placeholder.enterPort"
@@ -7390,7 +7585,7 @@ const PortInput = props => /*#__PURE__*/jsxRuntime.jsx(BoundedInput, _objectSpre
7390
7585
  /**
7391
7586
  * 专用 Payload 输入框
7392
7587
  */
7393
- const PayloadInput = props => /*#__PURE__*/jsxRuntime.jsx(BoundedInput, _objectSpread2({
7588
+ const PayloadInput = props => /*#__PURE__*/jsxRuntime.jsx(BoundedInput, _objectSpread2$2({
7394
7589
  min: 96,
7395
7590
  max: 127,
7396
7591
  placeholder: "input.placeholder.enterPayload"
@@ -7412,6 +7607,31 @@ function getSocketUrl(path) {
7412
7607
  return "".concat(protocol, "//").concat(window.location.host).concat(normalizedPath);
7413
7608
  }
7414
7609
 
7610
+ /**
7611
+ * 将相对路径解析为绝对 URL
7612
+ * @param {string|null|undefined} path - 资源路径
7613
+ * @param {string} [baseUrl] - 基础域名,未传时取当前页面 origin
7614
+ * @returns {string|null} 完整 URL;path 为空时返回 null
7615
+ */
7616
+ function resolveUrl(path, baseUrl) {
7617
+ // 空值保护
7618
+ if (!path || typeof path !== 'string') {
7619
+ return null;
7620
+ }
7621
+
7622
+ // 已是完整 URL 直接返回
7623
+ if (/^https?:\/\//i.test(path)) {
7624
+ return path;
7625
+ }
7626
+
7627
+ // 安全获取 baseUrl,兼容 SSR/Node 环境
7628
+ const base = baseUrl || (typeof window !== 'undefined' ? window.location.origin : '');
7629
+
7630
+ // 标准化路径前缀,防止拼接错误
7631
+ const normalizedPath = path.startsWith('/') ? path : '/' + path;
7632
+ return base + normalizedPath;
7633
+ }
7634
+
7415
7635
  /**
7416
7636
  * @internal 安全查找选项的通用内核
7417
7637
  */
@@ -7500,20 +7720,21 @@ exports.PayloadInput = PayloadInput;
7500
7720
  exports.PortInput = PortInput;
7501
7721
  exports.PresetModal = PresetModal;
7502
7722
  exports.PtpModal = PtpModal$1;
7503
- exports.StyledModal = StyledModal$1;
7723
+ exports.StyledModal = StyledModal$3;
7504
7724
  exports.SystemOperations = SystemOperations$1;
7505
7725
  exports.UpgradeManager = UpgradeManager$1;
7506
7726
  exports.addMessages = addMessages;
7507
- exports.debugI18n = debugI18n$1;
7727
+ exports.debugI18n = debugI18n$2;
7508
7728
  exports.getCachedNameByValue = getCachedNameByValue;
7509
7729
  exports.getDefaultValue = getDefaultValue;
7510
7730
  exports.getNameByValue = getNameByValue;
7511
7731
  exports.getSocketUrl = getSocketUrl;
7512
7732
  exports.localesEnUS = enUS;
7513
7733
  exports.localesZhCN = zhCN;
7734
+ exports.resolveUrl = resolveUrl;
7514
7735
  exports.useAuth = useAuth;
7515
7736
  exports.useHardwareUsage = useHardwareUsage$1;
7516
- exports.useIntl = useIntl$1;
7737
+ exports.useIntl = useIntl;
7517
7738
  exports.usePageReload = usePageReload$1;
7518
7739
  exports.useSystemOperations = useSystemOperations$1;
7519
7740
  exports.useUpgrade = useUpgrade$1;