call-live-sdk 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11790,7 +11790,7 @@ function getAlphaColor$1(frontColor, backgroundColor) {
11790
11790
  a: 1
11791
11791
  }).toRgbString();
11792
11792
  }
11793
- var __rest$1p = function(s3, e3) {
11793
+ var __rest$1o = function(s3, e3) {
11794
11794
  var t2 = {};
11795
11795
  for (var p2 in s3) if (Object.prototype.hasOwnProperty.call(s3, p2) && e3.indexOf(p2) < 0) t2[p2] = s3[p2];
11796
11796
  if (s3 != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p2 = Object.getOwnPropertySymbols(s3); i < p2.length; i++) {
@@ -11801,7 +11801,7 @@ var __rest$1p = function(s3, e3) {
11801
11801
  function formatToken(derivativeToken) {
11802
11802
  const {
11803
11803
  override
11804
- } = derivativeToken, restToken = __rest$1p(derivativeToken, ["override"]);
11804
+ } = derivativeToken, restToken = __rest$1o(derivativeToken, ["override"]);
11805
11805
  const overrideTokens = Object.assign({}, override);
11806
11806
  Object.keys(seedToken).forEach((token2) => {
11807
11807
  delete overrideTokens[token2];
@@ -11955,7 +11955,7 @@ function formatToken(derivativeToken) {
11955
11955
  }), overrideTokens);
11956
11956
  return aliasToken;
11957
11957
  }
11958
- var __rest$1o = function(s3, e3) {
11958
+ var __rest$1n = function(s3, e3) {
11959
11959
  var t2 = {};
11960
11960
  for (var p2 in s3) if (Object.prototype.hasOwnProperty.call(s3, p2) && e3.indexOf(p2) < 0) t2[p2] = s3[p2];
11961
11961
  if (s3 != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p2 = Object.getOwnPropertySymbols(s3); i < p2.length; i++) {
@@ -12005,7 +12005,7 @@ const getComputedToken = (originToken, overrideToken, theme2) => {
12005
12005
  const derivativeToken = theme2.getDerivativeToken(originToken);
12006
12006
  const {
12007
12007
  override
12008
- } = overrideToken, components2 = __rest$1o(overrideToken, ["override"]);
12008
+ } = overrideToken, components2 = __rest$1n(overrideToken, ["override"]);
12009
12009
  let mergedDerivativeToken = Object.assign(Object.assign({}, derivativeToken), {
12010
12010
  override
12011
12011
  });
@@ -12014,7 +12014,7 @@ const getComputedToken = (originToken, overrideToken, theme2) => {
12014
12014
  Object.entries(components2).forEach(([key, value]) => {
12015
12015
  const {
12016
12016
  theme: componentTheme
12017
- } = value, componentTokens = __rest$1o(value, ["theme"]);
12017
+ } = value, componentTokens = __rest$1n(value, ["theme"]);
12018
12018
  let mergedComponentToken = componentTokens;
12019
12019
  if (componentTheme) {
12020
12020
  mergedComponentToken = getComputedToken(Object.assign(Object.assign({}, mergedDerivativeToken), componentTokens), {
@@ -12955,7 +12955,7 @@ function MotionWrapper(props) {
12955
12955
  return children;
12956
12956
  }
12957
12957
  const PropWarning = () => null;
12958
- var __rest$1n = function(s3, e3) {
12958
+ var __rest$1m = function(s3, e3) {
12959
12959
  var t2 = {};
12960
12960
  for (var p2 in s3) if (Object.prototype.hasOwnProperty.call(s3, p2) && e3.indexOf(p2) < 0) t2[p2] = s3[p2];
12961
12961
  if (s3 != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p2 = Object.getOwnPropertySymbols(s3); i < p2.length; i++) {
@@ -13082,7 +13082,7 @@ const ProviderChildren = (props) => {
13082
13082
  timeline,
13083
13083
  timePicker,
13084
13084
  upload: upload2,
13085
- notification: notification2,
13085
+ notification,
13086
13086
  tree,
13087
13087
  colorPicker,
13088
13088
  datePicker,
@@ -13174,7 +13174,7 @@ const ProviderChildren = (props) => {
13174
13174
  timeline,
13175
13175
  timePicker,
13176
13176
  upload: upload2,
13177
- notification: notification2,
13177
+ notification,
13178
13178
  tree,
13179
13179
  colorPicker,
13180
13180
  datePicker,
@@ -13258,7 +13258,7 @@ const ProviderChildren = (props) => {
13258
13258
  token: token2,
13259
13259
  components: components2,
13260
13260
  cssVar
13261
- } = _a2, rest = __rest$1n(_a2, ["algorithm", "token", "components", "cssVar"]);
13261
+ } = _a2, rest = __rest$1m(_a2, ["algorithm", "token", "components", "cssVar"]);
13262
13262
  const themeObj = algorithm && (!Array.isArray(algorithm) || algorithm.length > 0) ? createTheme(algorithm) : defaultTheme;
13263
13263
  const parsedComponents = {};
13264
13264
  Object.entries(components2 || {}).forEach(([componentName, componentToken]) => {
@@ -13762,7 +13762,7 @@ const prepareComponentToken$D = (token2) => {
13762
13762
  };
13763
13763
  };
13764
13764
  const useStyle$16 = genStyleHooks("Alert", (token2) => [genBaseStyle$g(token2), genTypeStyle(token2), genActionStyle(token2)], prepareComponentToken$D);
13765
- var __rest$1m = function(s3, e3) {
13765
+ var __rest$1l = function(s3, e3) {
13766
13766
  var t2 = {};
13767
13767
  for (var p2 in s3) if (Object.prototype.hasOwnProperty.call(s3, p2) && e3.indexOf(p2) < 0) t2[p2] = s3[p2];
13768
13768
  if (s3 != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p2 = Object.getOwnPropertySymbols(s3); i < p2.length; i++) {
@@ -13829,7 +13829,7 @@ const Alert$1 = /* @__PURE__ */ reactExports.forwardRef((props, ref) => {
13829
13829
  closeIcon,
13830
13830
  action,
13831
13831
  id: id3
13832
- } = props, otherProps = __rest$1m(props, ["description", "prefixCls", "message", "banner", "className", "rootClassName", "style", "onMouseEnter", "onMouseLeave", "onClick", "afterClose", "showIcon", "closable", "closeText", "closeIcon", "action", "id"]);
13832
+ } = props, otherProps = __rest$1l(props, ["description", "prefixCls", "message", "banner", "className", "rootClassName", "style", "onMouseEnter", "onMouseLeave", "onClick", "afterClose", "showIcon", "closable", "closeText", "closeIcon", "action", "id"]);
13833
13833
  const [closed, setClosed] = reactExports.useState(false);
13834
13834
  const internalRef = reactExports.useRef(null);
13835
13835
  reactExports.useImperativeHandle(ref, () => ({
@@ -13900,7 +13900,7 @@ const Alert$1 = /* @__PURE__ */ reactExports.forwardRef((props, ref) => {
13900
13900
  const mergedAriaProps = reactExports.useMemo(() => {
13901
13901
  const merged = closable !== null && closable !== void 0 ? closable : contextClosable;
13902
13902
  if (typeof merged === "object") {
13903
- const ariaProps = __rest$1m(merged, ["closeIcon"]);
13903
+ const ariaProps = __rest$1l(merged, ["closeIcon"]);
13904
13904
  return ariaProps;
13905
13905
  }
13906
13906
  return {};
@@ -15192,7 +15192,7 @@ const useStyle$15 = genStyleHooks("Message", (token2) => {
15192
15192
  });
15193
15193
  return genMessageStyle(combinedToken);
15194
15194
  }, prepareComponentToken$C);
15195
- var __rest$1l = function(s3, e3) {
15195
+ var __rest$1k = function(s3, e3) {
15196
15196
  var t2 = {};
15197
15197
  for (var p2 in s3) if (Object.prototype.hasOwnProperty.call(s3, p2) && e3.indexOf(p2) < 0) t2[p2] = s3[p2];
15198
15198
  if (s3 != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p2 = Object.getOwnPropertySymbols(s3); i < p2.length; i++) {
@@ -15215,14 +15215,14 @@ const PureContent$1 = ({
15215
15215
  }) => /* @__PURE__ */ reactExports.createElement("div", {
15216
15216
  className: classNames$1(`${prefixCls}-custom-content`, `${prefixCls}-${type4}`)
15217
15217
  }, icon || TypeIcon[type4], /* @__PURE__ */ reactExports.createElement("span", null, children));
15218
- const PurePanel$e = (props) => {
15218
+ const PurePanel$d = (props) => {
15219
15219
  const {
15220
15220
  prefixCls: staticPrefixCls,
15221
15221
  className,
15222
15222
  type: type4,
15223
15223
  icon,
15224
15224
  content
15225
- } = props, restProps = __rest$1l(props, ["prefixCls", "className", "type", "icon", "content"]);
15225
+ } = props, restProps = __rest$1k(props, ["prefixCls", "className", "type", "icon", "content"]);
15226
15226
  const {
15227
15227
  getPrefixCls
15228
15228
  } = reactExports.useContext(ConfigContext);
@@ -15260,7 +15260,7 @@ function wrapPromiseFn(openFn) {
15260
15260
  result.promise = closePromise;
15261
15261
  return result;
15262
15262
  }
15263
- var __rest$1k = function(s3, e3) {
15263
+ var __rest$1j = function(s3, e3) {
15264
15264
  var t2 = {};
15265
15265
  for (var p2 in s3) if (Object.prototype.hasOwnProperty.call(s3, p2) && e3.indexOf(p2) < 0) t2[p2] = s3[p2];
15266
15266
  if (s3 != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p2 = Object.getOwnPropertySymbols(s3); i < p2.length; i++) {
@@ -15371,7 +15371,7 @@ function useInternalMessage(messageConfig) {
15371
15371
  className,
15372
15372
  style: style2,
15373
15373
  onClose
15374
- } = config2, restConfig = __rest$1k(config2, ["content", "icon", "type", "key", "className", "style", "onClose"]);
15374
+ } = config2, restConfig = __rest$1j(config2, ["content", "icon", "type", "key", "className", "style", "onClose"]);
15375
15375
  let mergedKey = key;
15376
15376
  if (mergedKey === void 0 || mergedKey === null) {
15377
15377
  keyIndex += 1;
@@ -16127,7 +16127,7 @@ const useStyle$13 = genStyleHooks(["Space", "Compact"], (token2) => [genSpaceCom
16127
16127
  // https://github.com/ant-design/ant-design/issues/40315
16128
16128
  resetStyle: false
16129
16129
  });
16130
- var __rest$1j = function(s3, e3) {
16130
+ var __rest$1i = function(s3, e3) {
16131
16131
  var t2 = {};
16132
16132
  for (var p2 in s3) if (Object.prototype.hasOwnProperty.call(s3, p2) && e3.indexOf(p2) < 0) t2[p2] = s3[p2];
16133
16133
  if (s3 != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p2 = Object.getOwnPropertySymbols(s3); i < p2.length; i++) {
@@ -16171,7 +16171,7 @@ const NoCompactStyle = (props) => {
16171
16171
  const CompactItem = (props) => {
16172
16172
  const {
16173
16173
  children
16174
- } = props, others = __rest$1j(props, ["children"]);
16174
+ } = props, others = __rest$1i(props, ["children"]);
16175
16175
  return /* @__PURE__ */ reactExports.createElement(SpaceCompactItemContext.Provider, {
16176
16176
  value: reactExports.useMemo(() => others, [others])
16177
16177
  }, children);
@@ -16189,7 +16189,7 @@ const Compact$1 = (props) => {
16189
16189
  className,
16190
16190
  rootClassName,
16191
16191
  children
16192
- } = props, restProps = __rest$1j(props, ["size", "direction", "block", "prefixCls", "className", "rootClassName", "children"]);
16192
+ } = props, restProps = __rest$1i(props, ["size", "direction", "block", "prefixCls", "className", "rootClassName", "children"]);
16193
16193
  const mergedSize = useSize((ctx2) => size !== null && size !== void 0 ? size : ctx2);
16194
16194
  const prefixCls = getPrefixCls("space-compact", customizePrefixCls);
16195
16195
  const [wrapCSSVar, hashId] = useStyle$13(prefixCls);
@@ -16217,7 +16217,7 @@ const Compact$1 = (props) => {
16217
16217
  className: clx
16218
16218
  }, restProps), nodes));
16219
16219
  };
16220
- var __rest$1i = function(s3, e3) {
16220
+ var __rest$1h = function(s3, e3) {
16221
16221
  var t2 = {};
16222
16222
  for (var p2 in s3) if (Object.prototype.hasOwnProperty.call(s3, p2) && e3.indexOf(p2) < 0) t2[p2] = s3[p2];
16223
16223
  if (s3 != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p2 = Object.getOwnPropertySymbols(s3); i < p2.length; i++) {
@@ -16235,7 +16235,7 @@ const ButtonGroup = (props) => {
16235
16235
  prefixCls: customizePrefixCls,
16236
16236
  size,
16237
16237
  className
16238
- } = props, others = __rest$1i(props, ["prefixCls", "size", "className"]);
16238
+ } = props, others = __rest$1h(props, ["prefixCls", "size", "className"]);
16239
16239
  const prefixCls = getPrefixCls("btn-group", customizePrefixCls);
16240
16240
  const [, , hashId] = useToken$4();
16241
16241
  const sizeCls = reactExports.useMemo(() => {
@@ -19034,7 +19034,7 @@ const Compact = genSubStyleComponent(["Button", "compact"], (token2) => {
19034
19034
  genButtonCompactStyle(buttonToken)
19035
19035
  ];
19036
19036
  }, prepareComponentToken$A);
19037
- var __rest$1h = function(s3, e3) {
19037
+ var __rest$1g = function(s3, e3) {
19038
19038
  var t2 = {};
19039
19039
  for (var p2 in s3) if (Object.prototype.hasOwnProperty.call(s3, p2) && e3.indexOf(p2) < 0) t2[p2] = s3[p2];
19040
19040
  if (s3 != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p2 = Object.getOwnPropertySymbols(s3); i < p2.length; i++) {
@@ -19090,7 +19090,7 @@ const InternalCompoundedButton = /* @__PURE__ */ React$2.forwardRef((props, ref)
19090
19090
  style: customStyle = {},
19091
19091
  autoInsertSpace,
19092
19092
  autoFocus
19093
- } = props, rest = __rest$1h(props, ["loading", "prefixCls", "color", "variant", "type", "danger", "shape", "size", "styles", "disabled", "className", "rootClassName", "children", "icon", "iconPosition", "ghost", "block", "htmlType", "classNames", "style", "autoInsertSpace", "autoFocus"]);
19093
+ } = props, rest = __rest$1g(props, ["loading", "prefixCls", "color", "variant", "type", "danger", "shape", "size", "styles", "disabled", "className", "rootClassName", "children", "icon", "iconPosition", "ghost", "block", "htmlType", "classNames", "style", "autoInsertSpace", "autoFocus"]);
19094
19094
  const mergedType = type4 || "default";
19095
19095
  const {
19096
19096
  button
@@ -24330,7 +24330,7 @@ const useStyle$$ = genStyleHooks("Modal", (token2) => {
24330
24330
  titleLineHeight: true
24331
24331
  }
24332
24332
  });
24333
- var __rest$1g = function(s3, e3) {
24333
+ var __rest$1f = function(s3, e3) {
24334
24334
  var t2 = {};
24335
24335
  for (var p2 in s3) if (Object.prototype.hasOwnProperty.call(s3, p2) && e3.indexOf(p2) < 0) t2[p2] = s3[p2];
24336
24336
  if (s3 != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p2 = Object.getOwnPropertySymbols(s3); i < p2.length; i++) {
@@ -24379,7 +24379,7 @@ const Modal$1 = (props) => {
24379
24379
  destroyOnClose,
24380
24380
  panelRef = null,
24381
24381
  modalRender
24382
- } = props, restProps = __rest$1g(props, ["prefixCls", "className", "rootClassName", "open", "wrapClassName", "centered", "getContainer", "focusTriggerAfterClose", "style", "visible", "width", "footer", "classNames", "styles", "children", "loading", "confirmLoading", "zIndex", "mousePosition", "onOk", "onCancel", "destroyOnHidden", "destroyOnClose", "panelRef", "modalRender"]);
24382
+ } = props, restProps = __rest$1f(props, ["prefixCls", "className", "rootClassName", "open", "wrapClassName", "centered", "getContainer", "focusTriggerAfterClose", "style", "visible", "width", "footer", "classNames", "styles", "children", "loading", "confirmLoading", "zIndex", "mousePosition", "onOk", "onCancel", "destroyOnHidden", "destroyOnClose", "panelRef", "modalRender"]);
24383
24383
  const {
24384
24384
  getPopupContainer: getContextPopupContainer,
24385
24385
  getPrefixCls,
@@ -24577,7 +24577,7 @@ const Confirm = genSubStyleComponent(["Modal", "confirm"], (token2) => {
24577
24577
  // confirm is weak than modal since no conflict here
24578
24578
  order: -1e3
24579
24579
  });
24580
- var __rest$1f = function(s3, e3) {
24580
+ var __rest$1e = function(s3, e3) {
24581
24581
  var t2 = {};
24582
24582
  for (var p2 in s3) if (Object.prototype.hasOwnProperty.call(s3, p2) && e3.indexOf(p2) < 0) t2[p2] = s3[p2];
24583
24583
  if (s3 != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p2 = Object.getOwnPropertySymbols(s3); i < p2.length; i++) {
@@ -24597,7 +24597,7 @@ const ConfirmContent = (props) => {
24597
24597
  footer,
24598
24598
  // Legacy for static function usage
24599
24599
  locale: staticLocale
24600
- } = props, resetProps = __rest$1f(props, ["prefixCls", "icon", "okText", "cancelText", "confirmPrefixCls", "type", "okCancel", "footer", "locale"]);
24600
+ } = props, resetProps = __rest$1e(props, ["prefixCls", "icon", "okText", "cancelText", "confirmPrefixCls", "type", "okCancel", "footer", "locale"]);
24601
24601
  let mergedIcon = icon;
24602
24602
  if (!icon && icon !== null) {
24603
24603
  switch (type4) {
@@ -24858,7 +24858,7 @@ function modalGlobalConfig({
24858
24858
  }) {
24859
24859
  defaultRootPrefixCls = rootPrefixCls;
24860
24860
  }
24861
- var __rest$1e = function(s3, e3) {
24861
+ var __rest$1d = function(s3, e3) {
24862
24862
  var t2 = {};
24863
24863
  for (var p2 in s3) if (Object.prototype.hasOwnProperty.call(s3, p2) && e3.indexOf(p2) < 0) t2[p2] = s3[p2];
24864
24864
  if (s3 != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p2 = Object.getOwnPropertySymbols(s3); i < p2.length; i++) {
@@ -24871,7 +24871,7 @@ const HookModal = (_a2, ref) => {
24871
24871
  var {
24872
24872
  afterClose: hookAfterClose,
24873
24873
  config: config2
24874
- } = _a2, restProps = __rest$1e(_a2, ["afterClose", "config"]);
24874
+ } = _a2, restProps = __rest$1d(_a2, ["afterClose", "config"]);
24875
24875
  const [open2, setOpen] = reactExports.useState(true);
24876
24876
  const [innerConfig, setInnerConfig] = reactExports.useState(config2);
24877
24877
  const {
@@ -25462,25 +25462,6 @@ const useStyle$_ = genStyleHooks("Notification", (token2) => {
25462
25462
  const notificationToken = prepareNotificationToken(token2);
25463
25463
  return [genNotificationStyle(notificationToken), genNotificationPlacementStyle(notificationToken), genStackStyle(notificationToken)];
25464
25464
  }, prepareComponentToken$x);
25465
- const PurePanelStyle = genSubStyleComponent(["Notification", "PurePanel"], (token2) => {
25466
- const noticeCls = `${token2.componentCls}-notice`;
25467
- const notificationToken = prepareNotificationToken(token2);
25468
- return {
25469
- [`${noticeCls}-pure-panel`]: Object.assign(Object.assign({}, genNoticeStyle(notificationToken)), {
25470
- width: notificationToken.width,
25471
- maxWidth: `calc(100vw - ${unit$1(token2.calc(notificationToken.notificationMarginEdge).mul(2).equal())})`,
25472
- margin: 0
25473
- })
25474
- };
25475
- }, prepareComponentToken$x);
25476
- var __rest$1d = function(s3, e3) {
25477
- var t2 = {};
25478
- for (var p2 in s3) if (Object.prototype.hasOwnProperty.call(s3, p2) && e3.indexOf(p2) < 0) t2[p2] = s3[p2];
25479
- if (s3 != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p2 = Object.getOwnPropertySymbols(s3); i < p2.length; i++) {
25480
- if (e3.indexOf(p2[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s3, p2[i])) t2[p2[i]] = s3[p2[i]];
25481
- }
25482
- return t2;
25483
- };
25484
25465
  function getCloseIcon(prefixCls, closeIcon) {
25485
25466
  if (closeIcon === null || closeIcon === false) {
25486
25467
  return null;
@@ -25528,51 +25509,6 @@ const PureContent = (props) => {
25528
25509
  className: `${prefixCls}-actions`
25529
25510
  }, actions));
25530
25511
  };
25531
- const PurePanel$d = (props) => {
25532
- const {
25533
- prefixCls: staticPrefixCls,
25534
- className,
25535
- icon,
25536
- type: type4,
25537
- message: message2,
25538
- description,
25539
- btn,
25540
- actions,
25541
- closable = true,
25542
- closeIcon,
25543
- className: notificationClassName
25544
- } = props, restProps = __rest$1d(props, ["prefixCls", "className", "icon", "type", "message", "description", "btn", "actions", "closable", "closeIcon", "className"]);
25545
- const {
25546
- getPrefixCls
25547
- } = reactExports.useContext(ConfigContext);
25548
- const mergedActions = actions !== null && actions !== void 0 ? actions : btn;
25549
- const prefixCls = staticPrefixCls || getPrefixCls("notification");
25550
- const noticePrefixCls = `${prefixCls}-notice`;
25551
- const rootCls = useCSSVarCls(prefixCls);
25552
- const [wrapCSSVar, hashId, cssVarCls] = useStyle$_(prefixCls, rootCls);
25553
- return wrapCSSVar(/* @__PURE__ */ reactExports.createElement("div", {
25554
- className: classNames$1(`${noticePrefixCls}-pure-panel`, hashId, className, cssVarCls, rootCls)
25555
- }, /* @__PURE__ */ reactExports.createElement(PurePanelStyle, {
25556
- prefixCls
25557
- }), /* @__PURE__ */ reactExports.createElement(Notify, Object.assign({}, restProps, {
25558
- prefixCls,
25559
- eventKey: "pure",
25560
- duration: null,
25561
- closable,
25562
- className: classNames$1({
25563
- notificationClassName
25564
- }),
25565
- closeIcon: getCloseIcon(prefixCls, closeIcon),
25566
- content: /* @__PURE__ */ reactExports.createElement(PureContent, {
25567
- prefixCls: noticePrefixCls,
25568
- icon,
25569
- type: type4,
25570
- message: message2,
25571
- description,
25572
- actions: mergedActions
25573
- })
25574
- }))));
25575
- };
25576
25512
  function getPlacementStyle(placement, top, bottom) {
25577
25513
  let style2;
25578
25514
  switch (placement) {
@@ -25630,14 +25566,14 @@ function getMotion$2(prefixCls) {
25630
25566
  motionName: `${prefixCls}-fade`
25631
25567
  };
25632
25568
  }
25633
- function getCloseIconConfig(closeIcon, notificationConfig, notification2) {
25569
+ function getCloseIconConfig(closeIcon, notificationConfig, notification) {
25634
25570
  if (typeof closeIcon !== "undefined") {
25635
25571
  return closeIcon;
25636
25572
  }
25637
25573
  if (typeof (notificationConfig === null || notificationConfig === void 0 ? void 0 : notificationConfig.closeIcon) !== "undefined") {
25638
25574
  return notificationConfig.closeIcon;
25639
25575
  }
25640
- return notification2 === null || notification2 === void 0 ? void 0 : notification2.closeIcon;
25576
+ return notification === null || notification === void 0 ? void 0 : notification.closeIcon;
25641
25577
  }
25642
25578
  var __rest$1c = function(s3, e3) {
25643
25579
  var t2 = {};
@@ -25686,7 +25622,7 @@ const Holder = /* @__PURE__ */ React$2.forwardRef((props, ref) => {
25686
25622
  const {
25687
25623
  getPrefixCls,
25688
25624
  getPopupContainer,
25689
- notification: notification2,
25625
+ notification,
25690
25626
  direction
25691
25627
  } = reactExports.useContext(ConfigContext);
25692
25628
  const [, token2] = useToken$4();
@@ -25718,7 +25654,7 @@ const Holder = /* @__PURE__ */ React$2.forwardRef((props, ref) => {
25718
25654
  });
25719
25655
  React$2.useImperativeHandle(ref, () => Object.assign(Object.assign({}, api), {
25720
25656
  prefixCls,
25721
- notification: notification2
25657
+ notification
25722
25658
  }));
25723
25659
  return holder;
25724
25660
  });
@@ -25734,7 +25670,7 @@ function useInternalNotification(notificationConfig) {
25734
25670
  const {
25735
25671
  open: originOpen,
25736
25672
  prefixCls,
25737
- notification: notification2
25673
+ notification
25738
25674
  } = holderRef.current;
25739
25675
  const noticePrefixCls = `${prefixCls}-notice`;
25740
25676
  const {
@@ -25751,7 +25687,7 @@ function useInternalNotification(notificationConfig) {
25751
25687
  closable
25752
25688
  } = config2, restConfig = __rest$1c(config2, ["message", "description", "icon", "type", "btn", "actions", "className", "style", "role", "closeIcon", "closable"]);
25753
25689
  const mergedActions = actions !== null && actions !== void 0 ? actions : btn;
25754
- const realCloseIcon = getCloseIcon(noticePrefixCls, getCloseIconConfig(closeIcon, notificationConfig, notification2));
25690
+ const realCloseIcon = getCloseIcon(noticePrefixCls, getCloseIconConfig(closeIcon, notificationConfig, notification));
25755
25691
  return originOpen(Object.assign(Object.assign({
25756
25692
  // use placement from props instead of hard-coding "topRight"
25757
25693
  placement: (_a2 = notificationConfig === null || notificationConfig === void 0 ? void 0 : notificationConfig.placement) !== null && _a2 !== void 0 ? _a2 : DEFAULT_PLACEMENT
@@ -25765,8 +25701,8 @@ function useInternalNotification(notificationConfig) {
25765
25701
  actions: mergedActions,
25766
25702
  role
25767
25703
  }),
25768
- className: classNames$1(type4 && `${noticePrefixCls}-${type4}`, className, notification2 === null || notification2 === void 0 ? void 0 : notification2.className),
25769
- style: Object.assign(Object.assign({}, notification2 === null || notification2 === void 0 ? void 0 : notification2.style), style2),
25704
+ className: classNames$1(type4 && `${noticePrefixCls}-${type4}`, className, notification === null || notification === void 0 ? void 0 : notification.className),
25705
+ style: Object.assign(Object.assign({}, notification === null || notification === void 0 ? void 0 : notification.style), style2),
25770
25706
  closeIcon: realCloseIcon,
25771
25707
  closable: closable !== null && closable !== void 0 ? closable : !!realCloseIcon
25772
25708
  }));
@@ -25835,7 +25771,7 @@ const App$2 = (props) => {
25835
25771
  className,
25836
25772
  rootClassName,
25837
25773
  message: message2,
25838
- notification: notification2,
25774
+ notification,
25839
25775
  style: style2,
25840
25776
  component = "div"
25841
25777
  } = props;
@@ -25851,8 +25787,8 @@ const App$2 = (props) => {
25851
25787
  const appConfig = reactExports.useContext(AppConfigContext);
25852
25788
  const mergedAppConfig = React$2.useMemo(() => ({
25853
25789
  message: Object.assign(Object.assign({}, appConfig.message), message2),
25854
- notification: Object.assign(Object.assign({}, appConfig.notification), notification2)
25855
- }), [message2, notification2, appConfig.message, appConfig.notification]);
25790
+ notification: Object.assign(Object.assign({}, appConfig.notification), notification)
25791
+ }), [message2, notification, appConfig.message, appConfig.notification]);
25856
25792
  const [messageApi, messageContextHolder] = useMessage(mergedAppConfig.message);
25857
25793
  const [notificationApi, notificationContextHolder] = useNotification(mergedAppConfig.notification);
25858
25794
  const [ModalApi, ModalContextHolder] = useModal();
@@ -64991,17 +64927,17 @@ const toList$1 = (candidate, skipEmpty = false) => {
64991
64927
  return Array.isArray(candidate) ? candidate : [candidate];
64992
64928
  };
64993
64929
  let message = null;
64994
- let act$1 = (callback) => callback();
64995
- let taskQueue$1 = [];
64996
- let defaultGlobalConfig$1 = {};
64997
- function getGlobalContext$1() {
64930
+ let act = (callback) => callback();
64931
+ let taskQueue = [];
64932
+ let defaultGlobalConfig = {};
64933
+ function getGlobalContext() {
64998
64934
  const {
64999
64935
  getContainer: getContainer2,
65000
64936
  duration,
65001
64937
  rtl,
65002
64938
  maxCount,
65003
64939
  top
65004
- } = defaultGlobalConfig$1;
64940
+ } = defaultGlobalConfig;
65005
64941
  const mergedContainer = (getContainer2 === null || getContainer2 === void 0 ? void 0 : getContainer2()) || document.body;
65006
64942
  return {
65007
64943
  getContainer: () => mergedContainer,
@@ -65011,7 +64947,7 @@ function getGlobalContext$1() {
65011
64947
  top
65012
64948
  };
65013
64949
  }
65014
- const GlobalHolder$1 = /* @__PURE__ */ React$2.forwardRef((props, ref) => {
64950
+ const GlobalHolder = /* @__PURE__ */ React$2.forwardRef((props, ref) => {
65015
64951
  const {
65016
64952
  messageConfig,
65017
64953
  sync: sync2
@@ -65019,7 +64955,7 @@ const GlobalHolder$1 = /* @__PURE__ */ React$2.forwardRef((props, ref) => {
65019
64955
  const {
65020
64956
  getPrefixCls
65021
64957
  } = reactExports.useContext(ConfigContext);
65022
- const prefixCls = defaultGlobalConfig$1.prefixCls || getPrefixCls("message");
64958
+ const prefixCls = defaultGlobalConfig.prefixCls || getPrefixCls("message");
65023
64959
  const appConfig = reactExports.useContext(AppConfigContext);
65024
64960
  const [api, holder] = useInternalMessage(Object.assign(Object.assign(Object.assign({}, messageConfig), {
65025
64961
  prefixCls
@@ -65039,17 +64975,17 @@ const GlobalHolder$1 = /* @__PURE__ */ React$2.forwardRef((props, ref) => {
65039
64975
  });
65040
64976
  return holder;
65041
64977
  });
65042
- const GlobalHolderWrapper$1 = /* @__PURE__ */ React$2.forwardRef((_2, ref) => {
65043
- const [messageConfig, setMessageConfig] = React$2.useState(getGlobalContext$1);
64978
+ const GlobalHolderWrapper = /* @__PURE__ */ React$2.forwardRef((_2, ref) => {
64979
+ const [messageConfig, setMessageConfig] = React$2.useState(getGlobalContext);
65044
64980
  const sync2 = () => {
65045
- setMessageConfig(getGlobalContext$1);
64981
+ setMessageConfig(getGlobalContext);
65046
64982
  };
65047
64983
  React$2.useEffect(sync2, []);
65048
64984
  const global2 = globalConfig();
65049
64985
  const rootPrefixCls = global2.getRootPrefixCls();
65050
64986
  const rootIconPrefixCls = global2.getIconPrefixCls();
65051
64987
  const theme2 = global2.getTheme();
65052
- const dom = /* @__PURE__ */ React$2.createElement(GlobalHolder$1, {
64988
+ const dom = /* @__PURE__ */ React$2.createElement(GlobalHolder, {
65053
64989
  ref,
65054
64990
  sync: sync2,
65055
64991
  messageConfig
@@ -65067,9 +65003,9 @@ const flushMessageQueue = () => {
65067
65003
  fragment: holderFragment
65068
65004
  };
65069
65005
  message = newMessage;
65070
- act$1(() => {
65006
+ act(() => {
65071
65007
  const reactRender2 = unstableSetRender();
65072
- reactRender2(/* @__PURE__ */ React$2.createElement(GlobalHolderWrapper$1, {
65008
+ reactRender2(/* @__PURE__ */ React$2.createElement(GlobalHolderWrapper, {
65073
65009
  ref: (node2) => {
65074
65010
  const {
65075
65011
  instance,
@@ -65090,7 +65026,7 @@ const flushMessageQueue = () => {
65090
65026
  if (!message.instance) {
65091
65027
  return;
65092
65028
  }
65093
- taskQueue$1.forEach((task2) => {
65029
+ taskQueue.forEach((task2) => {
65094
65030
  const {
65095
65031
  type: type4,
65096
65032
  skipped
@@ -65098,20 +65034,20 @@ const flushMessageQueue = () => {
65098
65034
  if (!skipped) {
65099
65035
  switch (type4) {
65100
65036
  case "open": {
65101
- act$1(() => {
65102
- const closeFn = message.instance.open(Object.assign(Object.assign({}, defaultGlobalConfig$1), task2.config));
65037
+ act(() => {
65038
+ const closeFn = message.instance.open(Object.assign(Object.assign({}, defaultGlobalConfig), task2.config));
65103
65039
  closeFn === null || closeFn === void 0 ? void 0 : closeFn.then(task2.resolve);
65104
65040
  task2.setCloseFn(closeFn);
65105
65041
  });
65106
65042
  break;
65107
65043
  }
65108
65044
  case "destroy":
65109
- act$1(() => {
65045
+ act(() => {
65110
65046
  message === null || message === void 0 ? void 0 : message.instance.destroy(task2.key);
65111
65047
  });
65112
65048
  break;
65113
65049
  default: {
65114
- act$1(() => {
65050
+ act(() => {
65115
65051
  var _message$instance;
65116
65052
  const closeFn = (_message$instance = message.instance)[type4].apply(_message$instance, _toConsumableArray$1(task2.args));
65117
65053
  closeFn === null || closeFn === void 0 ? void 0 : closeFn.then(task2.resolve);
@@ -65121,16 +65057,16 @@ const flushMessageQueue = () => {
65121
65057
  }
65122
65058
  }
65123
65059
  });
65124
- taskQueue$1 = [];
65060
+ taskQueue = [];
65125
65061
  };
65126
65062
  function setMessageGlobalConfig(config2) {
65127
- defaultGlobalConfig$1 = Object.assign(Object.assign({}, defaultGlobalConfig$1), config2);
65128
- act$1(() => {
65063
+ defaultGlobalConfig = Object.assign(Object.assign({}, defaultGlobalConfig), config2);
65064
+ act(() => {
65129
65065
  var _a2;
65130
65066
  (_a2 = message === null || message === void 0 ? void 0 : message.sync) === null || _a2 === void 0 ? void 0 : _a2.call(message);
65131
65067
  });
65132
65068
  }
65133
- function open$1(config2) {
65069
+ function open(config2) {
65134
65070
  const result = wrapPromiseFn((resolve) => {
65135
65071
  let closeFn;
65136
65072
  const task2 = {
@@ -65141,10 +65077,10 @@ function open$1(config2) {
65141
65077
  closeFn = fn2;
65142
65078
  }
65143
65079
  };
65144
- taskQueue$1.push(task2);
65080
+ taskQueue.push(task2);
65145
65081
  return () => {
65146
65082
  if (closeFn) {
65147
- act$1(() => {
65083
+ act(() => {
65148
65084
  closeFn();
65149
65085
  });
65150
65086
  } else {
@@ -65166,10 +65102,10 @@ function typeOpen(type4, args) {
65166
65102
  closeFn = fn2;
65167
65103
  }
65168
65104
  };
65169
- taskQueue$1.push(task2);
65105
+ taskQueue.push(task2);
65170
65106
  return () => {
65171
65107
  if (closeFn) {
65172
- act$1(() => {
65108
+ act(() => {
65173
65109
  closeFn();
65174
65110
  });
65175
65111
  } else {
@@ -65180,24 +65116,24 @@ function typeOpen(type4, args) {
65180
65116
  flushMessageQueue();
65181
65117
  return result;
65182
65118
  }
65183
- const destroy$1 = (key) => {
65184
- taskQueue$1.push({
65119
+ const destroy = (key) => {
65120
+ taskQueue.push({
65185
65121
  type: "destroy",
65186
65122
  key
65187
65123
  });
65188
65124
  flushMessageQueue();
65189
65125
  };
65190
- const methods$1 = ["success", "info", "warning", "error", "loading"];
65191
- const baseStaticMethods$1 = {
65192
- open: open$1,
65193
- destroy: destroy$1,
65126
+ const methods = ["success", "info", "warning", "error", "loading"];
65127
+ const baseStaticMethods = {
65128
+ open,
65129
+ destroy,
65194
65130
  config: setMessageGlobalConfig,
65195
65131
  useMessage,
65196
- _InternalPanelDoNotUseOrYouWillBeFired: PurePanel$e
65132
+ _InternalPanelDoNotUseOrYouWillBeFired: PurePanel$d
65197
65133
  };
65198
- const staticMethods$1 = baseStaticMethods$1;
65199
- methods$1.forEach((type4) => {
65200
- staticMethods$1[type4] = (...args) => typeOpen(type4, args);
65134
+ const staticMethods = baseStaticMethods;
65135
+ methods.forEach((type4) => {
65136
+ staticMethods[type4] = (...args) => typeOpen(type4, args);
65201
65137
  });
65202
65138
  var __rest$m = function(s3, e3) {
65203
65139
  var t2 = {};
@@ -65285,164 +65221,6 @@ Modal.destroyAll = function destroyAllFn() {
65285
65221
  };
65286
65222
  Modal.config = modalGlobalConfig;
65287
65223
  Modal._InternalPanelDoNotUseOrYouWillBeFired = PurePanel$4;
65288
- let notification = null;
65289
- let act = (callback) => callback();
65290
- let taskQueue = [];
65291
- let defaultGlobalConfig = {};
65292
- function getGlobalContext() {
65293
- const {
65294
- getContainer: getContainer2,
65295
- rtl,
65296
- maxCount,
65297
- top,
65298
- bottom,
65299
- showProgress,
65300
- pauseOnHover
65301
- } = defaultGlobalConfig;
65302
- const mergedContainer = (getContainer2 === null || getContainer2 === void 0 ? void 0 : getContainer2()) || document.body;
65303
- return {
65304
- getContainer: () => mergedContainer,
65305
- rtl,
65306
- maxCount,
65307
- top,
65308
- bottom,
65309
- showProgress,
65310
- pauseOnHover
65311
- };
65312
- }
65313
- const GlobalHolder = /* @__PURE__ */ React$2.forwardRef((props, ref) => {
65314
- const {
65315
- notificationConfig,
65316
- sync: sync2
65317
- } = props;
65318
- const {
65319
- getPrefixCls
65320
- } = reactExports.useContext(ConfigContext);
65321
- const prefixCls = defaultGlobalConfig.prefixCls || getPrefixCls("notification");
65322
- const appConfig = reactExports.useContext(AppConfigContext);
65323
- const [api, holder] = useInternalNotification(Object.assign(Object.assign(Object.assign({}, notificationConfig), {
65324
- prefixCls
65325
- }), appConfig.notification));
65326
- React$2.useEffect(sync2, []);
65327
- React$2.useImperativeHandle(ref, () => {
65328
- const instance = Object.assign({}, api);
65329
- Object.keys(instance).forEach((method4) => {
65330
- instance[method4] = (...args) => {
65331
- sync2();
65332
- return api[method4].apply(api, args);
65333
- };
65334
- });
65335
- return {
65336
- instance,
65337
- sync: sync2
65338
- };
65339
- });
65340
- return holder;
65341
- });
65342
- const GlobalHolderWrapper = /* @__PURE__ */ React$2.forwardRef((_2, ref) => {
65343
- const [notificationConfig, setNotificationConfig] = React$2.useState(getGlobalContext);
65344
- const sync2 = () => {
65345
- setNotificationConfig(getGlobalContext);
65346
- };
65347
- React$2.useEffect(sync2, []);
65348
- const global2 = globalConfig();
65349
- const rootPrefixCls = global2.getRootPrefixCls();
65350
- const rootIconPrefixCls = global2.getIconPrefixCls();
65351
- const theme2 = global2.getTheme();
65352
- const dom = /* @__PURE__ */ React$2.createElement(GlobalHolder, {
65353
- ref,
65354
- sync: sync2,
65355
- notificationConfig
65356
- });
65357
- return /* @__PURE__ */ React$2.createElement(ConfigProvider$1, {
65358
- prefixCls: rootPrefixCls,
65359
- iconPrefixCls: rootIconPrefixCls,
65360
- theme: theme2
65361
- }, global2.holderRender ? global2.holderRender(dom) : dom);
65362
- });
65363
- const flushNotificationQueue = () => {
65364
- if (!notification) {
65365
- const holderFragment = document.createDocumentFragment();
65366
- const newNotification = {
65367
- fragment: holderFragment
65368
- };
65369
- notification = newNotification;
65370
- act(() => {
65371
- const reactRender2 = unstableSetRender();
65372
- reactRender2(/* @__PURE__ */ React$2.createElement(GlobalHolderWrapper, {
65373
- ref: (node2) => {
65374
- const {
65375
- instance,
65376
- sync: sync2
65377
- } = node2 || {};
65378
- Promise.resolve().then(() => {
65379
- if (!newNotification.instance && instance) {
65380
- newNotification.instance = instance;
65381
- newNotification.sync = sync2;
65382
- flushNotificationQueue();
65383
- }
65384
- });
65385
- }
65386
- }), holderFragment);
65387
- });
65388
- return;
65389
- }
65390
- if (!notification.instance) {
65391
- return;
65392
- }
65393
- taskQueue.forEach((task2) => {
65394
- switch (task2.type) {
65395
- case "open": {
65396
- act(() => {
65397
- notification.instance.open(Object.assign(Object.assign({}, defaultGlobalConfig), task2.config));
65398
- });
65399
- break;
65400
- }
65401
- case "destroy":
65402
- act(() => {
65403
- var _a2;
65404
- (_a2 = notification === null || notification === void 0 ? void 0 : notification.instance) === null || _a2 === void 0 ? void 0 : _a2.destroy(task2.key);
65405
- });
65406
- break;
65407
- }
65408
- });
65409
- taskQueue = [];
65410
- };
65411
- function setNotificationGlobalConfig(config2) {
65412
- defaultGlobalConfig = Object.assign(Object.assign({}, defaultGlobalConfig), config2);
65413
- act(() => {
65414
- var _a2;
65415
- (_a2 = notification === null || notification === void 0 ? void 0 : notification.sync) === null || _a2 === void 0 ? void 0 : _a2.call(notification);
65416
- });
65417
- }
65418
- function open(config2) {
65419
- taskQueue.push({
65420
- type: "open",
65421
- config: config2
65422
- });
65423
- flushNotificationQueue();
65424
- }
65425
- const destroy = (key) => {
65426
- taskQueue.push({
65427
- type: "destroy",
65428
- key
65429
- });
65430
- flushNotificationQueue();
65431
- };
65432
- const methods = ["success", "info", "warning", "error"];
65433
- const baseStaticMethods = {
65434
- open,
65435
- destroy,
65436
- config: setNotificationGlobalConfig,
65437
- useNotification,
65438
- _InternalPanelDoNotUseOrYouWillBeFired: PurePanel$d
65439
- };
65440
- const staticMethods = baseStaticMethods;
65441
- methods.forEach((type4) => {
65442
- staticMethods[type4] = (config2) => open(Object.assign(Object.assign({}, config2), {
65443
- type: type4
65444
- }));
65445
- });
65446
65224
  const genBaseStyle$6 = (token2) => {
65447
65225
  const {
65448
65226
  componentCls,
@@ -83491,12 +83269,14 @@ const useSdkStore = create$c((set3, get4) => ({
83491
83269
  callConfig: {
83492
83270
  el: "1",
83493
83271
  sign: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlZGl0aW9uX2lkIjo0NywiZXhwIjoxNzY2MzY1Nzk4LCJpYXQiOjE3NjU3NjA5OTgsIm5iZiI6MTc2NTc2MDk5OCwic3ViX3VzZXJpZCI6MCwidXNlcmlkIjoiMzg3MzU5ODkifQ.rcv7Q00iJvT3UYRZ1zQWXbOTukjVihEl6B8i4xtHw8Q",
83494
- live: { id: 53065, title: "title" },
83272
+ liveId: 53065,
83273
+ title: "test",
83495
83274
  components: {
83496
- chat: { enabled: true, agent_id: 0 },
83275
+ chat: { enabled: true },
83497
83276
  team: { enabled: true },
83498
- call: { enabled: true, inviteLink: "", agent_id: 38735989 }
83499
- }
83277
+ call: { enabled: true, inviteLink: "" }
83278
+ },
83279
+ agentId: 38735989
83500
83280
  },
83501
83281
  guestConfig: {
83502
83282
  el: "",
@@ -83523,7 +83303,15 @@ const useSdkStore = create$c((set3, get4) => ({
83523
83303
  */
83524
83304
  getLiveId: () => {
83525
83305
  const { callConfig, guestConfig } = get4();
83526
- return callConfig.live.id || guestConfig.liveId;
83306
+ return (callConfig == null ? void 0 : callConfig.liveId) || (guestConfig == null ? void 0 : guestConfig.liveId);
83307
+ },
83308
+ /**
83309
+ * 获取当前SDK配置
83310
+ * @returns 当前SDK配置对象或null
83311
+ */
83312
+ getAgentId: () => {
83313
+ const { callConfig, guestConfig } = get4();
83314
+ return (callConfig == null ? void 0 : callConfig.agentId) || (guestConfig == null ? void 0 : guestConfig.agentId);
83527
83315
  },
83528
83316
  /**
83529
83317
  * 更新SDK配置
@@ -83545,51 +83333,131 @@ const useSdkStore = create$c((set3, get4) => ({
83545
83333
  */
83546
83334
  clearGlobalError: () => set3({ globalError: null })
83547
83335
  }));
83548
- const useLiveId = () => useSdkStore((state) => {
83549
- var _a2;
83550
- return (_a2 = state.callConfig) == null ? void 0 : _a2.live.id;
83551
- });
83336
+ const useLiveId = () => useSdkStore((state) => state.getLiveId());
83337
+ const ErrorPage = ({ error: error2, onClose, onRetry }) => {
83338
+ const getErrorStatus = () => {
83339
+ switch (error2.code) {
83340
+ case 404:
83341
+ return "404";
83342
+ case 401:
83343
+ return "403";
83344
+ default:
83345
+ return "error";
83346
+ }
83347
+ };
83348
+ const getErrorTitle = () => {
83349
+ switch (error2.type) {
83350
+ case GlobalErrorType.API_ERROR:
83351
+ return "接口请求失败";
83352
+ case GlobalErrorType.TOKEN_EXPIRED:
83353
+ return "登录已过期";
83354
+ case GlobalErrorType.PARAM_VALIDATION_ERROR:
83355
+ return "参数验证失败";
83356
+ case GlobalErrorType.OTHER_ERROR:
83357
+ return "系统错误";
83358
+ default:
83359
+ return "未知错误";
83360
+ }
83361
+ };
83362
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center justify-center min-h-screen bg-gray-50", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Card$1, { className: "max-w-md", children: [
83363
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
83364
+ Result$2,
83365
+ {
83366
+ status: getErrorStatus(),
83367
+ title: getErrorTitle(),
83368
+ subTitle: error2.message
83369
+ }
83370
+ ),
83371
+ error2.details && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-4 p-4 bg-gray-50 rounded", children: [
83372
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: "text-sm font-semibold mb-2", children: "错误详情:" }),
83373
+ /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: "text-xs text-gray-600 whitespace-pre-wrap", children: JSON.stringify(error2.details, null, 2) })
83374
+ ] })
83375
+ ] }) });
83376
+ };
83552
83377
  class GlobalErrorBoundary extends reactExports.Component {
83553
83378
  constructor(props) {
83554
83379
  super(props);
83380
+ this.unsubscribe = null;
83555
83381
  this.handleApiError = (event) => {
83556
83382
  const { code, message: message2, details } = event.detail;
83557
- useSdkStore.setState({
83558
- globalError: {
83559
- type: GlobalErrorType.API_ERROR,
83560
- code: code || 500,
83561
- message: message2 || "接口请求失败",
83562
- details
83563
- }
83564
- });
83383
+ const globalError = {
83384
+ type: GlobalErrorType.API_ERROR,
83385
+ code: code || 400,
83386
+ message: message2 || "参数验证失败",
83387
+ details
83388
+ };
83389
+ useSdkStore.setState({ globalError });
83565
83390
  };
83566
83391
  this.handleTokenExpired = (event) => {
83567
- useSdkStore.setState({
83568
- globalError: {
83569
- type: GlobalErrorType.TOKEN_EXPIRED,
83570
- code: 401,
83571
- message: "登录已过期,请重新登录",
83572
- details: event.detail
83573
- }
83574
- });
83392
+ const globalError = {
83393
+ type: GlobalErrorType.TOKEN_EXPIRED,
83394
+ code: 401,
83395
+ message: "登录已过期,请重新登录",
83396
+ details: event.detail
83397
+ };
83398
+ useSdkStore.setState({ globalError });
83575
83399
  };
83576
- this.handleParamValidationError = (event) => {
83577
- const { message: message2, details } = event.detail;
83578
- useSdkStore.setState({
83579
- globalError: {
83580
- type: GlobalErrorType.PARAM_VALIDATION_ERROR,
83581
- code: 400,
83582
- message: message2 || "参数校验失败",
83583
- details
83584
- }
83585
- });
83400
+ this.handleNotFoundError = (event) => {
83401
+ const { code, message: message2, details } = event.detail;
83402
+ const globalError = {
83403
+ type: GlobalErrorType.API_ERROR,
83404
+ code: code || 404,
83405
+ message: message2 || "请求的资源不存在",
83406
+ details
83407
+ };
83408
+ useSdkStore.setState({ globalError });
83409
+ };
83410
+ this.handleTimeoutError = (event) => {
83411
+ const { code, message: message2, details } = event.detail;
83412
+ const globalError = {
83413
+ type: GlobalErrorType.API_ERROR,
83414
+ code: code || 408,
83415
+ message: message2 || "网络请求超时,请检查网络连接",
83416
+ details
83417
+ };
83418
+ useSdkStore.setState({ globalError });
83419
+ };
83420
+ this.handleServerError = (event) => {
83421
+ const { code, message: message2, details } = event.detail;
83422
+ const globalError = {
83423
+ type: GlobalErrorType.API_ERROR,
83424
+ code: code || 500,
83425
+ message: message2 || "服务器内部错误",
83426
+ details
83427
+ };
83428
+ useSdkStore.setState({ globalError });
83429
+ };
83430
+ this.handleClientError = (event) => {
83431
+ const { code, message: message2, details } = event.detail;
83432
+ const globalError = {
83433
+ type: GlobalErrorType.API_ERROR,
83434
+ code: code || 400,
83435
+ message: message2 || "客户端错误",
83436
+ details
83437
+ };
83438
+ useSdkStore.setState({ globalError });
83439
+ };
83440
+ this.handleUnknownError = (event) => {
83441
+ const { code, message: message2, details } = event.detail;
83442
+ const globalError = {
83443
+ type: GlobalErrorType.OTHER_ERROR,
83444
+ code: code || 500,
83445
+ message: message2 || "发生未知错误",
83446
+ details
83447
+ };
83448
+ useSdkStore.setState({ globalError });
83586
83449
  };
83587
83450
  this.handleClearError = () => {
83588
83451
  useSdkStore.setState({ globalError: null });
83589
83452
  this.setState({ hasError: false });
83590
83453
  };
83454
+ this.handleRetry = () => {
83455
+ this.handleClearError();
83456
+ this.forceUpdate();
83457
+ };
83591
83458
  this.state = {
83592
- hasError: false
83459
+ hasError: false,
83460
+ globalError: useSdkStore.getState().globalError
83593
83461
  };
83594
83462
  }
83595
83463
  /**
@@ -83600,30 +83468,42 @@ class GlobalErrorBoundary extends reactExports.Component {
83600
83468
  */
83601
83469
  static getDerivedStateFromError(_error) {
83602
83470
  return {
83603
- hasError: true
83471
+ hasError: true,
83472
+ globalError: null
83604
83473
  };
83605
83474
  }
83606
83475
  /**
83607
- * 组件挂载时注册全局错误事件监听
83476
+ * 组件挂载时注册全局错误事件监听和状态订阅
83608
83477
  */
83609
83478
  componentDidMount() {
83610
83479
  window.addEventListener("apiError", this.handleApiError);
83611
83480
  window.addEventListener("tokenExpired", this.handleTokenExpired);
83612
- window.addEventListener(
83613
- "paramValidationError",
83614
- this.handleParamValidationError
83615
- );
83481
+ window.addEventListener("notFoundError", this.handleNotFoundError);
83482
+ window.addEventListener("timeoutError", this.handleTimeoutError);
83483
+ window.addEventListener("serverError", this.handleServerError);
83484
+ window.addEventListener("clientError", this.handleClientError);
83485
+ window.addEventListener("unknownError", this.handleUnknownError);
83486
+ this.unsubscribe = useSdkStore.subscribe((state, prevState) => {
83487
+ if (state.globalError !== prevState.globalError) {
83488
+ this.setState({ globalError: state.globalError });
83489
+ }
83490
+ });
83616
83491
  }
83617
83492
  /**
83618
- * 组件卸载时移除全局错误事件监听
83493
+ * 组件卸载时移除全局错误事件监听和状态订阅
83619
83494
  */
83620
83495
  componentWillUnmount() {
83621
83496
  window.removeEventListener("apiError", this.handleApiError);
83622
83497
  window.removeEventListener("tokenExpired", this.handleTokenExpired);
83623
- window.removeEventListener(
83624
- "paramValidationError",
83625
- this.handleParamValidationError
83626
- );
83498
+ window.removeEventListener("notFoundError", this.handleNotFoundError);
83499
+ window.removeEventListener("timeoutError", this.handleTimeoutError);
83500
+ window.removeEventListener("serverError", this.handleServerError);
83501
+ window.removeEventListener("clientError", this.handleClientError);
83502
+ window.removeEventListener("unknownError", this.handleUnknownError);
83503
+ if (this.unsubscribe) {
83504
+ this.unsubscribe();
83505
+ this.unsubscribe = null;
83506
+ }
83627
83507
  }
83628
83508
  /**
83629
83509
  * 捕获错误后记录错误信息
@@ -83632,35 +83512,34 @@ class GlobalErrorBoundary extends reactExports.Component {
83632
83512
  */
83633
83513
  componentDidCatch(error2, errorInfo) {
83634
83514
  console.error("GlobalErrorBoundary caught an error:", error2, errorInfo);
83635
- useSdkStore.setState({
83636
- globalError: {
83637
- type: GlobalErrorType.OTHER_ERROR,
83638
- code: 500,
83639
- message: error2.message || "发生未知错误",
83640
- details: {
83641
- error: error2.toString(),
83642
- stack: error2.stack,
83643
- componentStack: errorInfo.componentStack
83644
- }
83515
+ const globalError = {
83516
+ type: GlobalErrorType.OTHER_ERROR,
83517
+ code: 500,
83518
+ message: error2.message || "发生未知错误",
83519
+ details: {
83520
+ error: error2.toString(),
83521
+ stack: error2.stack,
83522
+ componentStack: errorInfo.componentStack
83645
83523
  }
83646
- });
83524
+ };
83525
+ useSdkStore.setState({ globalError });
83526
+ this.setState({ globalError });
83647
83527
  }
83648
83528
  /**
83649
83529
  * 渲染组件
83650
83530
  * @returns React节点
83651
83531
  */
83652
83532
  render() {
83653
- const { globalError } = useSdkStore.getState();
83533
+ const { globalError } = this.state;
83654
83534
  if (globalError) {
83655
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center justify-center min-h-screen bg-gray-50", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
83656
- Result$2,
83535
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
83536
+ ErrorPage,
83657
83537
  {
83658
- status: "error",
83659
- title: globalError.message,
83660
- subTitle: `错误类型: ${globalError.type},错误代码: ${globalError.code}`,
83661
- extra: /* @__PURE__ */ jsxRuntimeExports.jsx(Button$1, { type: "primary", onClick: this.handleClearError, children: "关闭" })
83538
+ error: globalError,
83539
+ onClose: this.handleClearError,
83540
+ onRetry: this.handleRetry
83662
83541
  }
83663
- ) });
83542
+ );
83664
83543
  }
83665
83544
  return this.props.children;
83666
83545
  }
@@ -88175,11 +88054,486 @@ const envConfig = {
88175
88054
  // API 相关配置
88176
88055
  liveProxyUrl: "https://api.lfeiyao.com"
88177
88056
  };
88057
+ function withResolvers() {
88058
+ let output = {};
88059
+ output.promise = new Promise((res, rej) => {
88060
+ output.resolve = res;
88061
+ output.reject = rej;
88062
+ });
88063
+ return output;
88064
+ }
88065
+ var events = { exports: {} };
88066
+ var R$2 = typeof Reflect === "object" ? Reflect : null;
88067
+ var ReflectApply = R$2 && typeof R$2.apply === "function" ? R$2.apply : function ReflectApply2(target, receiver, args) {
88068
+ return Function.prototype.apply.call(target, receiver, args);
88069
+ };
88070
+ var ReflectOwnKeys;
88071
+ if (R$2 && typeof R$2.ownKeys === "function") {
88072
+ ReflectOwnKeys = R$2.ownKeys;
88073
+ } else if (Object.getOwnPropertySymbols) {
88074
+ ReflectOwnKeys = function ReflectOwnKeys2(target) {
88075
+ return Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target));
88076
+ };
88077
+ } else {
88078
+ ReflectOwnKeys = function ReflectOwnKeys2(target) {
88079
+ return Object.getOwnPropertyNames(target);
88080
+ };
88081
+ }
88082
+ function ProcessEmitWarning(warning5) {
88083
+ if (console && console.warn) console.warn(warning5);
88084
+ }
88085
+ var NumberIsNaN = Number.isNaN || function NumberIsNaN2(value) {
88086
+ return value !== value;
88087
+ };
88088
+ function EventEmitter$2() {
88089
+ EventEmitter$2.init.call(this);
88090
+ }
88091
+ events.exports = EventEmitter$2;
88092
+ events.exports.once = once$1;
88093
+ EventEmitter$2.EventEmitter = EventEmitter$2;
88094
+ EventEmitter$2.prototype._events = void 0;
88095
+ EventEmitter$2.prototype._eventsCount = 0;
88096
+ EventEmitter$2.prototype._maxListeners = void 0;
88097
+ var defaultMaxListeners = 10;
88098
+ function checkListener(listener) {
88099
+ if (typeof listener !== "function") {
88100
+ throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
88101
+ }
88102
+ }
88103
+ Object.defineProperty(EventEmitter$2, "defaultMaxListeners", {
88104
+ enumerable: true,
88105
+ get: function() {
88106
+ return defaultMaxListeners;
88107
+ },
88108
+ set: function(arg) {
88109
+ if (typeof arg !== "number" || arg < 0 || NumberIsNaN(arg)) {
88110
+ throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + ".");
88111
+ }
88112
+ defaultMaxListeners = arg;
88113
+ }
88114
+ });
88115
+ EventEmitter$2.init = function() {
88116
+ if (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) {
88117
+ this._events = /* @__PURE__ */ Object.create(null);
88118
+ this._eventsCount = 0;
88119
+ }
88120
+ this._maxListeners = this._maxListeners || void 0;
88121
+ };
88122
+ EventEmitter$2.prototype.setMaxListeners = function setMaxListeners(n4) {
88123
+ if (typeof n4 !== "number" || n4 < 0 || NumberIsNaN(n4)) {
88124
+ throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n4 + ".");
88125
+ }
88126
+ this._maxListeners = n4;
88127
+ return this;
88128
+ };
88129
+ function _getMaxListeners(that) {
88130
+ if (that._maxListeners === void 0)
88131
+ return EventEmitter$2.defaultMaxListeners;
88132
+ return that._maxListeners;
88133
+ }
88134
+ EventEmitter$2.prototype.getMaxListeners = function getMaxListeners() {
88135
+ return _getMaxListeners(this);
88136
+ };
88137
+ EventEmitter$2.prototype.emit = function emit(type4) {
88138
+ var args = [];
88139
+ for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);
88140
+ var doError = type4 === "error";
88141
+ var events2 = this._events;
88142
+ if (events2 !== void 0)
88143
+ doError = doError && events2.error === void 0;
88144
+ else if (!doError)
88145
+ return false;
88146
+ if (doError) {
88147
+ var er2;
88148
+ if (args.length > 0)
88149
+ er2 = args[0];
88150
+ if (er2 instanceof Error) {
88151
+ throw er2;
88152
+ }
88153
+ var err2 = new Error("Unhandled error." + (er2 ? " (" + er2.message + ")" : ""));
88154
+ err2.context = er2;
88155
+ throw err2;
88156
+ }
88157
+ var handler = events2[type4];
88158
+ if (handler === void 0)
88159
+ return false;
88160
+ if (typeof handler === "function") {
88161
+ ReflectApply(handler, this, args);
88162
+ } else {
88163
+ var len = handler.length;
88164
+ var listeners3 = arrayClone(handler, len);
88165
+ for (var i = 0; i < len; ++i)
88166
+ ReflectApply(listeners3[i], this, args);
88167
+ }
88168
+ return true;
88169
+ };
88170
+ function _addListener(target, type4, listener, prepend) {
88171
+ var m3;
88172
+ var events2;
88173
+ var existing;
88174
+ checkListener(listener);
88175
+ events2 = target._events;
88176
+ if (events2 === void 0) {
88177
+ events2 = target._events = /* @__PURE__ */ Object.create(null);
88178
+ target._eventsCount = 0;
88179
+ } else {
88180
+ if (events2.newListener !== void 0) {
88181
+ target.emit(
88182
+ "newListener",
88183
+ type4,
88184
+ listener.listener ? listener.listener : listener
88185
+ );
88186
+ events2 = target._events;
88187
+ }
88188
+ existing = events2[type4];
88189
+ }
88190
+ if (existing === void 0) {
88191
+ existing = events2[type4] = listener;
88192
+ ++target._eventsCount;
88193
+ } else {
88194
+ if (typeof existing === "function") {
88195
+ existing = events2[type4] = prepend ? [listener, existing] : [existing, listener];
88196
+ } else if (prepend) {
88197
+ existing.unshift(listener);
88198
+ } else {
88199
+ existing.push(listener);
88200
+ }
88201
+ m3 = _getMaxListeners(target);
88202
+ if (m3 > 0 && existing.length > m3 && !existing.warned) {
88203
+ existing.warned = true;
88204
+ var w2 = new Error("Possible EventEmitter memory leak detected. " + existing.length + " " + String(type4) + " listeners added. Use emitter.setMaxListeners() to increase limit");
88205
+ w2.name = "MaxListenersExceededWarning";
88206
+ w2.emitter = target;
88207
+ w2.type = type4;
88208
+ w2.count = existing.length;
88209
+ ProcessEmitWarning(w2);
88210
+ }
88211
+ }
88212
+ return target;
88213
+ }
88214
+ EventEmitter$2.prototype.addListener = function addListener(type4, listener) {
88215
+ return _addListener(this, type4, listener, false);
88216
+ };
88217
+ EventEmitter$2.prototype.on = EventEmitter$2.prototype.addListener;
88218
+ EventEmitter$2.prototype.prependListener = function prependListener(type4, listener) {
88219
+ return _addListener(this, type4, listener, true);
88220
+ };
88221
+ function onceWrapper() {
88222
+ if (!this.fired) {
88223
+ this.target.removeListener(this.type, this.wrapFn);
88224
+ this.fired = true;
88225
+ if (arguments.length === 0)
88226
+ return this.listener.call(this.target);
88227
+ return this.listener.apply(this.target, arguments);
88228
+ }
88229
+ }
88230
+ function _onceWrap(target, type4, listener) {
88231
+ var state = { fired: false, wrapFn: void 0, target, type: type4, listener };
88232
+ var wrapped = onceWrapper.bind(state);
88233
+ wrapped.listener = listener;
88234
+ state.wrapFn = wrapped;
88235
+ return wrapped;
88236
+ }
88237
+ EventEmitter$2.prototype.once = function once(type4, listener) {
88238
+ checkListener(listener);
88239
+ this.on(type4, _onceWrap(this, type4, listener));
88240
+ return this;
88241
+ };
88242
+ EventEmitter$2.prototype.prependOnceListener = function prependOnceListener(type4, listener) {
88243
+ checkListener(listener);
88244
+ this.prependListener(type4, _onceWrap(this, type4, listener));
88245
+ return this;
88246
+ };
88247
+ EventEmitter$2.prototype.removeListener = function removeListener(type4, listener) {
88248
+ var list, events2, position3, i, originalListener;
88249
+ checkListener(listener);
88250
+ events2 = this._events;
88251
+ if (events2 === void 0)
88252
+ return this;
88253
+ list = events2[type4];
88254
+ if (list === void 0)
88255
+ return this;
88256
+ if (list === listener || list.listener === listener) {
88257
+ if (--this._eventsCount === 0)
88258
+ this._events = /* @__PURE__ */ Object.create(null);
88259
+ else {
88260
+ delete events2[type4];
88261
+ if (events2.removeListener)
88262
+ this.emit("removeListener", type4, list.listener || listener);
88263
+ }
88264
+ } else if (typeof list !== "function") {
88265
+ position3 = -1;
88266
+ for (i = list.length - 1; i >= 0; i--) {
88267
+ if (list[i] === listener || list[i].listener === listener) {
88268
+ originalListener = list[i].listener;
88269
+ position3 = i;
88270
+ break;
88271
+ }
88272
+ }
88273
+ if (position3 < 0)
88274
+ return this;
88275
+ if (position3 === 0)
88276
+ list.shift();
88277
+ else {
88278
+ spliceOne(list, position3);
88279
+ }
88280
+ if (list.length === 1)
88281
+ events2[type4] = list[0];
88282
+ if (events2.removeListener !== void 0)
88283
+ this.emit("removeListener", type4, originalListener || listener);
88284
+ }
88285
+ return this;
88286
+ };
88287
+ EventEmitter$2.prototype.off = EventEmitter$2.prototype.removeListener;
88288
+ EventEmitter$2.prototype.removeAllListeners = function removeAllListeners(type4) {
88289
+ var listeners3, events2, i;
88290
+ events2 = this._events;
88291
+ if (events2 === void 0)
88292
+ return this;
88293
+ if (events2.removeListener === void 0) {
88294
+ if (arguments.length === 0) {
88295
+ this._events = /* @__PURE__ */ Object.create(null);
88296
+ this._eventsCount = 0;
88297
+ } else if (events2[type4] !== void 0) {
88298
+ if (--this._eventsCount === 0)
88299
+ this._events = /* @__PURE__ */ Object.create(null);
88300
+ else
88301
+ delete events2[type4];
88302
+ }
88303
+ return this;
88304
+ }
88305
+ if (arguments.length === 0) {
88306
+ var keys2 = Object.keys(events2);
88307
+ var key;
88308
+ for (i = 0; i < keys2.length; ++i) {
88309
+ key = keys2[i];
88310
+ if (key === "removeListener") continue;
88311
+ this.removeAllListeners(key);
88312
+ }
88313
+ this.removeAllListeners("removeListener");
88314
+ this._events = /* @__PURE__ */ Object.create(null);
88315
+ this._eventsCount = 0;
88316
+ return this;
88317
+ }
88318
+ listeners3 = events2[type4];
88319
+ if (typeof listeners3 === "function") {
88320
+ this.removeListener(type4, listeners3);
88321
+ } else if (listeners3 !== void 0) {
88322
+ for (i = listeners3.length - 1; i >= 0; i--) {
88323
+ this.removeListener(type4, listeners3[i]);
88324
+ }
88325
+ }
88326
+ return this;
88327
+ };
88328
+ function _listeners(target, type4, unwrap) {
88329
+ var events2 = target._events;
88330
+ if (events2 === void 0)
88331
+ return [];
88332
+ var evlistener = events2[type4];
88333
+ if (evlistener === void 0)
88334
+ return [];
88335
+ if (typeof evlistener === "function")
88336
+ return unwrap ? [evlistener.listener || evlistener] : [evlistener];
88337
+ return unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
88338
+ }
88339
+ EventEmitter$2.prototype.listeners = function listeners(type4) {
88340
+ return _listeners(this, type4, true);
88341
+ };
88342
+ EventEmitter$2.prototype.rawListeners = function rawListeners(type4) {
88343
+ return _listeners(this, type4, false);
88344
+ };
88345
+ EventEmitter$2.listenerCount = function(emitter, type4) {
88346
+ if (typeof emitter.listenerCount === "function") {
88347
+ return emitter.listenerCount(type4);
88348
+ } else {
88349
+ return listenerCount.call(emitter, type4);
88350
+ }
88351
+ };
88352
+ EventEmitter$2.prototype.listenerCount = listenerCount;
88353
+ function listenerCount(type4) {
88354
+ var events2 = this._events;
88355
+ if (events2 !== void 0) {
88356
+ var evlistener = events2[type4];
88357
+ if (typeof evlistener === "function") {
88358
+ return 1;
88359
+ } else if (evlistener !== void 0) {
88360
+ return evlistener.length;
88361
+ }
88362
+ }
88363
+ return 0;
88364
+ }
88365
+ EventEmitter$2.prototype.eventNames = function eventNames() {
88366
+ return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
88367
+ };
88368
+ function arrayClone(arr, n4) {
88369
+ var copy2 = new Array(n4);
88370
+ for (var i = 0; i < n4; ++i)
88371
+ copy2[i] = arr[i];
88372
+ return copy2;
88373
+ }
88374
+ function spliceOne(list, index2) {
88375
+ for (; index2 + 1 < list.length; index2++)
88376
+ list[index2] = list[index2 + 1];
88377
+ list.pop();
88378
+ }
88379
+ function unwrapListeners(arr) {
88380
+ var ret = new Array(arr.length);
88381
+ for (var i = 0; i < ret.length; ++i) {
88382
+ ret[i] = arr[i].listener || arr[i];
88383
+ }
88384
+ return ret;
88385
+ }
88386
+ function once$1(emitter, name) {
88387
+ return new Promise(function(resolve, reject) {
88388
+ function errorListener(err2) {
88389
+ emitter.removeListener(name, resolver);
88390
+ reject(err2);
88391
+ }
88392
+ function resolver() {
88393
+ if (typeof emitter.removeListener === "function") {
88394
+ emitter.removeListener("error", errorListener);
88395
+ }
88396
+ resolve([].slice.call(arguments));
88397
+ }
88398
+ eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });
88399
+ if (name !== "error") {
88400
+ addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });
88401
+ }
88402
+ });
88403
+ }
88404
+ function addErrorHandlerIfEventEmitter(emitter, handler, flags2) {
88405
+ if (typeof emitter.on === "function") {
88406
+ eventTargetAgnosticAddListener(emitter, "error", handler, flags2);
88407
+ }
88408
+ }
88409
+ function eventTargetAgnosticAddListener(emitter, name, listener, flags2) {
88410
+ if (typeof emitter.on === "function") {
88411
+ if (flags2.once) {
88412
+ emitter.once(name, listener);
88413
+ } else {
88414
+ emitter.on(name, listener);
88415
+ }
88416
+ } else if (typeof emitter.addEventListener === "function") {
88417
+ emitter.addEventListener(name, function wrapListener(arg) {
88418
+ if (flags2.once) {
88419
+ emitter.removeEventListener(name, wrapListener);
88420
+ }
88421
+ listener(arg);
88422
+ });
88423
+ } else {
88424
+ throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
88425
+ }
88426
+ }
88427
+ var eventsExports = events.exports;
88428
+ const EventEmitter$3 = /* @__PURE__ */ getDefaultExportFromCjs$2(eventsExports);
88429
+ const eventBus = new EventEmitter$3();
88430
+ function canvasToBlob(canvas) {
88431
+ const { promise: promise2, resolve } = withResolvers();
88432
+ if (canvas instanceof HTMLCanvasElement) {
88433
+ canvas.toBlob((blob2) => resolve(blob2));
88434
+ } else {
88435
+ canvas.convertToBlob().then(resolve);
88436
+ }
88437
+ return promise2;
88438
+ }
88439
+ function scaleImage({
88440
+ max: max2,
88441
+ ratio,
88442
+ blob: blob2
88443
+ }) {
88444
+ if (ratio === 1 || ratio === void 0 && max2 === void 0) {
88445
+ return Blob;
88446
+ }
88447
+ const { promise: promise2, resolve, reject } = withResolvers();
88448
+ let usedRatio = ratio;
88449
+ const url3 = URL.createObjectURL(blob2);
88450
+ const img = new Image();
88451
+ img.src = url3;
88452
+ img.onerror = reject;
88453
+ img.onload = async () => {
88454
+ const { naturalWidth, naturalHeight } = img;
88455
+ console.log("natural", naturalWidth, naturalHeight, max2);
88456
+ if (usedRatio === void 0) {
88457
+ if (max2 > Math.max(naturalWidth, naturalHeight)) {
88458
+ resolve(blob2);
88459
+ URL.revokeObjectURL(url3);
88460
+ return;
88461
+ }
88462
+ usedRatio = max2 / Math.max(naturalWidth, naturalHeight);
88463
+ const usedWidth = naturalWidth * usedRatio;
88464
+ const usedHeight = naturalHeight * usedRatio;
88465
+ const canvas = new OffscreenCanvas(usedWidth, usedHeight);
88466
+ const ctx2 = canvas.getContext("2d");
88467
+ ctx2.drawImage(img, 0, 0, usedWidth, usedHeight);
88468
+ resolve(await canvasToBlob(canvas));
88469
+ URL.revokeObjectURL(url3);
88470
+ }
88471
+ };
88472
+ return promise2;
88473
+ }
88474
+ const DEFAULT_SIGN_PREFIX = "feiayo_callsdk";
88475
+ function getSignStorageKey(options = {}) {
88476
+ const {
88477
+ prefix: prefix2 = DEFAULT_SIGN_PREFIX,
88478
+ key = "sign"
88479
+ } = options;
88480
+ return `${prefix2}_${key}`;
88481
+ }
88482
+ function saveSign(sign2, options = {}) {
88483
+ const storageKey = getSignStorageKey(options);
88484
+ console.log(storageKey, sign2);
88485
+ localStorage.setItem(storageKey, sign2);
88486
+ }
88487
+ function getSign(options = {}) {
88488
+ const storageKey = getSignStorageKey(options);
88489
+ return localStorage.getItem(storageKey);
88490
+ }
88491
+ function removeSign(options = {}) {
88492
+ const storageKey = getSignStorageKey(options);
88493
+ localStorage.removeItem(storageKey);
88494
+ }
88495
+ const isMobile$2 = /Mobile|Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
88496
+ navigator.userAgent
88497
+ );
88498
+ const checkMicrophonePermission = async () => {
88499
+ try {
88500
+ const stream = await navigator.mediaDevices.getUserMedia({
88501
+ audio: true,
88502
+ video: false
88503
+ });
88504
+ if (stream) {
88505
+ stream.getTracks().forEach((track) => track.stop());
88506
+ return true;
88507
+ }
88508
+ return false;
88509
+ } catch (error2) {
88510
+ console.error("麦克风权限检测失败:", error2);
88511
+ throw error2;
88512
+ }
88513
+ };
88514
+ const checkCameraPermission = async () => {
88515
+ try {
88516
+ const stream = await navigator.mediaDevices.getUserMedia({
88517
+ audio: false,
88518
+ video: true
88519
+ });
88520
+ if (stream) {
88521
+ stream.getTracks().forEach((track) => track.stop());
88522
+ return true;
88523
+ }
88524
+ return false;
88525
+ } catch (error2) {
88526
+ console.error("摄像头权限检测失败:", error2);
88527
+ return false;
88528
+ }
88529
+ };
88178
88530
  const errorConfig = {
88179
88531
  // 处理登录失效
88180
88532
  handleLoginExpired: () => {
88181
- localStorage.removeItem("feiayo_callsdk_sign");
88182
- localStorage.removeItem("sid");
88533
+ removeSign();
88534
+ window.dispatchEvent(new CustomEvent("tokenExpired", {
88535
+ detail: { reason: "登录已过期,请重新登录" }
88536
+ }));
88183
88537
  console.warn("Login expired, please re-login");
88184
88538
  }
88185
88539
  };
@@ -88196,9 +88550,9 @@ const axiosInstance = axios.create({
88196
88550
  });
88197
88551
  axiosInstance.interceptors.request.use(
88198
88552
  (config2) => {
88199
- const token2 = localStorage.getItem("feiayo_callsdk_sign");
88200
- if (token2) {
88201
- config2.headers.set("token", token2);
88553
+ const sign2 = getSign();
88554
+ if (sign2) {
88555
+ config2.headers.set("token", sign2);
88202
88556
  }
88203
88557
  return config2;
88204
88558
  },
@@ -88207,45 +88561,156 @@ axiosInstance.interceptors.request.use(
88207
88561
  }
88208
88562
  );
88209
88563
  const errorHandler = (error2, opts) => {
88210
- var _a2;
88564
+ var _a2, _b, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j, _k, _l2;
88211
88565
  if (opts == null ? void 0 : opts.skipErrorHandler) throw error2;
88212
- if (((_a2 = error2.response) == null ? void 0 : _a2.status) === 401) {
88566
+ if (((_a2 = error2.response) == null ? void 0 : _a2.status) === 401 || ((_b = error2.info) == null ? void 0 : _b.errorCode) === 401 || ((_c2 = error2.info) == null ? void 0 : _c2.errorCode) === 61) {
88213
88567
  errorConfig.handleLoginExpired();
88214
88568
  return;
88215
88569
  }
88216
- if (error2.name === "BizError") {
88217
- const errorInfo = error2.info;
88218
- if (errorInfo) {
88219
- const { errorMessage, errorCode, showType } = errorInfo;
88220
- switch (showType) {
88221
- case 0:
88222
- break;
88223
- case 1:
88224
- staticMethods$1.warning(errorMessage);
88225
- break;
88226
- case 2:
88227
- staticMethods$1.error(errorMessage);
88228
- break;
88229
- case 3:
88230
- staticMethods.open({
88231
- description: errorMessage,
88232
- message: String(errorCode)
88233
- });
88234
- break;
88235
- case 9:
88236
- break;
88237
- default:
88238
- staticMethods$1.error(errorMessage);
88570
+ if (((_d2 = error2.response) == null ? void 0 : _d2.status) === 400 || ((_e2 = error2.info) == null ? void 0 : _e2.errorCode) === 400) {
88571
+ let errorDetails = {};
88572
+ let errorMessage2 = "参数验证失败";
88573
+ if (error2.name === "BizError" && error2.info) {
88574
+ errorMessage2 = error2.info.errorMessage || errorMessage2;
88575
+ errorDetails = error2.info;
88576
+ } else if (error2.response) {
88577
+ errorMessage2 = ((_f2 = error2.response.data) == null ? void 0 : _f2.errorMessage) || errorMessage2;
88578
+ errorDetails = {
88579
+ url: error2.response.config.url,
88580
+ method: error2.response.config.method,
88581
+ status: error2.response.status,
88582
+ data: error2.response.data
88583
+ };
88584
+ }
88585
+ window.dispatchEvent(new CustomEvent("apiError", {
88586
+ detail: {
88587
+ code: 400,
88588
+ message: errorMessage2,
88589
+ details: errorDetails
88590
+ }
88591
+ }));
88592
+ return;
88593
+ }
88594
+ if (((_g2 = error2.response) == null ? void 0 : _g2.status) === 404) {
88595
+ const errorMessage2 = ((_h2 = error2.response.data) == null ? void 0 : _h2.errorMessage) || "请求的资源不存在";
88596
+ const errorDetails = {
88597
+ url: error2.response.config.url,
88598
+ method: error2.response.config.method,
88599
+ status: 404,
88600
+ data: error2.response.data
88601
+ };
88602
+ window.dispatchEvent(new CustomEvent("notFoundError", {
88603
+ detail: {
88604
+ code: 404,
88605
+ message: errorMessage2,
88606
+ details: errorDetails
88607
+ }
88608
+ }));
88609
+ return;
88610
+ }
88611
+ if (((_i2 = error2.response) == null ? void 0 : _i2.status) === 408 || ((_j = error2.info) == null ? void 0 : _j.errorCode) === 408) {
88612
+ const errorMessage2 = "网络请求超时,请检查网络连接";
88613
+ const errorDetails = error2.response ? {
88614
+ url: error2.response.config.url,
88615
+ method: error2.response.config.method,
88616
+ status: 408
88617
+ } : {
88618
+ type: "NETWORK_TIMEOUT",
88619
+ request: error2.request
88620
+ };
88621
+ window.dispatchEvent(new CustomEvent("timeoutError", {
88622
+ detail: {
88623
+ code: 408,
88624
+ message: errorMessage2,
88625
+ details: errorDetails
88239
88626
  }
88627
+ }));
88628
+ return;
88629
+ }
88630
+ if (error2.response && error2.response.status >= 500) {
88631
+ const errorCode = error2.response.status;
88632
+ const errorMessage2 = ((_k = error2.response.data) == null ? void 0 : _k.errorMessage) || `服务器内部错误 (${errorCode})`;
88633
+ const errorDetails = {
88634
+ url: error2.response.config.url,
88635
+ method: error2.response.config.method,
88636
+ status: errorCode,
88637
+ data: error2.response.data
88638
+ };
88639
+ window.dispatchEvent(new CustomEvent("serverError", {
88640
+ detail: {
88641
+ code: errorCode,
88642
+ message: errorMessage2,
88643
+ details: errorDetails
88644
+ }
88645
+ }));
88646
+ return;
88647
+ }
88648
+ if (error2.response && error2.response.status >= 400 && error2.response.status < 500) {
88649
+ const errorCode = error2.response.status;
88650
+ const errorMessage2 = ((_l2 = error2.response.data) == null ? void 0 : _l2.errorMessage) || `客户端错误 (${errorCode})`;
88651
+ const errorDetails = {
88652
+ url: error2.response.config.url,
88653
+ method: error2.response.config.method,
88654
+ status: errorCode,
88655
+ data: error2.response.data
88656
+ };
88657
+ window.dispatchEvent(new CustomEvent("clientError", {
88658
+ detail: {
88659
+ code: errorCode,
88660
+ message: errorMessage2,
88661
+ details: errorDetails
88662
+ }
88663
+ }));
88664
+ return;
88665
+ }
88666
+ if (error2.name === "BizError" && error2.info) {
88667
+ const errorInfo = error2.info;
88668
+ const errorCode = errorInfo.errorCode || 500;
88669
+ const errorMessage2 = errorInfo.errorMessage || "业务逻辑错误";
88670
+ if (errorCode >= 500) {
88671
+ window.dispatchEvent(new CustomEvent("serverError", {
88672
+ detail: {
88673
+ code: errorCode,
88674
+ message: errorMessage2,
88675
+ details: errorInfo
88676
+ }
88677
+ }));
88678
+ } else {
88679
+ window.dispatchEvent(new CustomEvent("clientError", {
88680
+ detail: {
88681
+ code: errorCode,
88682
+ message: errorMessage2,
88683
+ details: errorInfo
88684
+ }
88685
+ }));
88240
88686
  }
88241
- } else if (error2.response) {
88242
- const { status } = error2.response;
88243
- staticMethods$1.error(`Response status: ${status}`);
88244
- } else if (error2.request) {
88245
- staticMethods$1.error("None response! Please retry.");
88246
- } else {
88247
- staticMethods$1.error("Request error, please retry.");
88687
+ return;
88688
+ }
88689
+ if (error2.request) {
88690
+ const errorMessage2 = "网络请求超时,请检查网络连接";
88691
+ window.dispatchEvent(new CustomEvent("timeoutError", {
88692
+ detail: {
88693
+ code: 408,
88694
+ message: errorMessage2,
88695
+ details: {
88696
+ type: "NETWORK_TIMEOUT",
88697
+ request: error2.request
88698
+ }
88699
+ }
88700
+ }));
88701
+ return;
88248
88702
  }
88703
+ const errorMessage = error2.message || "请求发送失败";
88704
+ window.dispatchEvent(new CustomEvent("unknownError", {
88705
+ detail: {
88706
+ code: 500,
88707
+ message: errorMessage,
88708
+ details: {
88709
+ type: "UNKNOWN_ERROR",
88710
+ error: error2
88711
+ }
88712
+ }
88713
+ }));
88249
88714
  };
88250
88715
  const request = async (url3, options = {}) => {
88251
88716
  var _a2;
@@ -88266,16 +88731,16 @@ const request = async (url3, options = {}) => {
88266
88731
  });
88267
88732
  const { headers } = response;
88268
88733
  if (headers["x-new-token"]) {
88269
- localStorage.setItem("feiayo_callsdk_sign", headers["x-new-token"]);
88734
+ saveSign(headers["x-new-token"]);
88270
88735
  }
88271
88736
  if (url3.includes("login") || url3.includes("qr-code-check")) {
88272
88737
  if ((_a2 = response.data.data) == null ? void 0 : _a2.token) {
88273
- localStorage.setItem("feiayo_callsdk_sign", response.data.data.token);
88738
+ saveSign(response.data.data.token);
88274
88739
  }
88275
88740
  }
88276
88741
  if (response.data.success === false && response.data.errorCode === 61) {
88277
88742
  errorConfig.handleLoginExpired();
88278
- staticMethods$1.error({
88743
+ staticMethods.error({
88279
88744
  content: response.data.errorMessage,
88280
88745
  key: "requestError"
88281
88746
  });
@@ -88347,13 +88812,13 @@ const useLivePushCodeStore = create$c((set3, get4) => ({
88347
88812
  set3({ livePushCode: res.data, isLoading: false });
88348
88813
  return res.data;
88349
88814
  } else {
88350
- staticMethods$1.error(res.errorMessage);
88815
+ staticMethods.error(res.errorMessage);
88351
88816
  set3({ error: res.errorMessage, isLoading: false });
88352
88817
  return void 0;
88353
88818
  }
88354
88819
  } catch (error2) {
88355
88820
  const errorMessage = error2.message || "获取推流码失败";
88356
- staticMethods$1.error(errorMessage);
88821
+ staticMethods.error(errorMessage);
88357
88822
  set3({ error: errorMessage, isLoading: false });
88358
88823
  return void 0;
88359
88824
  }
@@ -104665,41 +105130,6 @@ const CountDown = ({ isLive }) => {
104665
105130
  return isLive && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-16px text-#fff h-full flex items-center mr-3", children: timer });
104666
105131
  };
104667
105132
  const CountDown$1 = reactExports.memo(CountDown);
104668
- const isMobile$2 = /Mobile|Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
104669
- navigator.userAgent
104670
- );
104671
- const checkMicrophonePermission = async () => {
104672
- try {
104673
- const stream = await navigator.mediaDevices.getUserMedia({
104674
- audio: true,
104675
- video: false
104676
- });
104677
- if (stream) {
104678
- stream.getTracks().forEach((track) => track.stop());
104679
- return true;
104680
- }
104681
- return false;
104682
- } catch (error2) {
104683
- console.error("麦克风权限检测失败:", error2);
104684
- throw error2;
104685
- }
104686
- };
104687
- const checkCameraPermission = async () => {
104688
- try {
104689
- const stream = await navigator.mediaDevices.getUserMedia({
104690
- audio: false,
104691
- video: true
104692
- });
104693
- if (stream) {
104694
- stream.getTracks().forEach((track) => track.stop());
104695
- return true;
104696
- }
104697
- return false;
104698
- } catch (error2) {
104699
- console.error("摄像头权限检测失败:", error2);
104700
- return false;
104701
- }
104702
- };
104703
105133
  function _mergeNamespaces$1(e3, t2) {
104704
105134
  return t2.forEach(function(t3) {
104705
105135
  t3 && "string" != typeof t3 && !Array.isArray(t3) && Object.keys(t3).forEach(function(i) {
@@ -105734,7 +106164,7 @@ let IDB$1 = class IDB {
105734
106164
  }
105735
106165
  };
105736
106166
  var iDB$1 = new IDB$1();
105737
- let EventEmitter$1$1 = class EventEmitter$1 {
106167
+ let EventEmitter$1 = class {
105738
106168
  constructor() {
105739
106169
  _defineProperty$a(this, "_all", {});
105740
106170
  }
@@ -105774,7 +106204,7 @@ const configNumberKeys$1 = ["UPLOAD_CONSOLE_LENGTH_CUT", "UPLOAD_REPORT_LIMIT"];
105774
106204
  function needToNumber$1(e3) {
105775
106205
  return configNumberKeys$1.includes(e3);
105776
106206
  }
105777
- let Config$2 = class extends EventEmitter$1$1 {
106207
+ let Config$2 = class extends EventEmitter$1 {
105778
106208
  constructor() {
105779
106209
  super(...arguments), _defineProperty$a(this, "config", { UPLOAD_CONSOLE_ON: false, UPLOAD_CONSOLE_LENGTH_CUT: 200, UPLOAD_REPORT_LIMIT: 45e4, ENABLE_REPORT_IDB_BUFFER: false });
105780
106210
  }
@@ -122073,371 +122503,6 @@ const useGuestStore = create$c()((set3, get4) => ({
122073
122503
  set3({ status });
122074
122504
  }
122075
122505
  }));
122076
- var events = { exports: {} };
122077
- var R$2 = typeof Reflect === "object" ? Reflect : null;
122078
- var ReflectApply = R$2 && typeof R$2.apply === "function" ? R$2.apply : function ReflectApply2(target, receiver, args) {
122079
- return Function.prototype.apply.call(target, receiver, args);
122080
- };
122081
- var ReflectOwnKeys;
122082
- if (R$2 && typeof R$2.ownKeys === "function") {
122083
- ReflectOwnKeys = R$2.ownKeys;
122084
- } else if (Object.getOwnPropertySymbols) {
122085
- ReflectOwnKeys = function ReflectOwnKeys2(target) {
122086
- return Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target));
122087
- };
122088
- } else {
122089
- ReflectOwnKeys = function ReflectOwnKeys2(target) {
122090
- return Object.getOwnPropertyNames(target);
122091
- };
122092
- }
122093
- function ProcessEmitWarning(warning5) {
122094
- if (console && console.warn) console.warn(warning5);
122095
- }
122096
- var NumberIsNaN = Number.isNaN || function NumberIsNaN2(value) {
122097
- return value !== value;
122098
- };
122099
- function EventEmitter$12() {
122100
- EventEmitter$12.init.call(this);
122101
- }
122102
- events.exports = EventEmitter$12;
122103
- events.exports.once = once$1;
122104
- EventEmitter$12.EventEmitter = EventEmitter$12;
122105
- EventEmitter$12.prototype._events = void 0;
122106
- EventEmitter$12.prototype._eventsCount = 0;
122107
- EventEmitter$12.prototype._maxListeners = void 0;
122108
- var defaultMaxListeners = 10;
122109
- function checkListener(listener) {
122110
- if (typeof listener !== "function") {
122111
- throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
122112
- }
122113
- }
122114
- Object.defineProperty(EventEmitter$12, "defaultMaxListeners", {
122115
- enumerable: true,
122116
- get: function() {
122117
- return defaultMaxListeners;
122118
- },
122119
- set: function(arg) {
122120
- if (typeof arg !== "number" || arg < 0 || NumberIsNaN(arg)) {
122121
- throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + ".");
122122
- }
122123
- defaultMaxListeners = arg;
122124
- }
122125
- });
122126
- EventEmitter$12.init = function() {
122127
- if (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) {
122128
- this._events = /* @__PURE__ */ Object.create(null);
122129
- this._eventsCount = 0;
122130
- }
122131
- this._maxListeners = this._maxListeners || void 0;
122132
- };
122133
- EventEmitter$12.prototype.setMaxListeners = function setMaxListeners(n4) {
122134
- if (typeof n4 !== "number" || n4 < 0 || NumberIsNaN(n4)) {
122135
- throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n4 + ".");
122136
- }
122137
- this._maxListeners = n4;
122138
- return this;
122139
- };
122140
- function _getMaxListeners(that) {
122141
- if (that._maxListeners === void 0)
122142
- return EventEmitter$12.defaultMaxListeners;
122143
- return that._maxListeners;
122144
- }
122145
- EventEmitter$12.prototype.getMaxListeners = function getMaxListeners() {
122146
- return _getMaxListeners(this);
122147
- };
122148
- EventEmitter$12.prototype.emit = function emit(type4) {
122149
- var args = [];
122150
- for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);
122151
- var doError = type4 === "error";
122152
- var events2 = this._events;
122153
- if (events2 !== void 0)
122154
- doError = doError && events2.error === void 0;
122155
- else if (!doError)
122156
- return false;
122157
- if (doError) {
122158
- var er2;
122159
- if (args.length > 0)
122160
- er2 = args[0];
122161
- if (er2 instanceof Error) {
122162
- throw er2;
122163
- }
122164
- var err2 = new Error("Unhandled error." + (er2 ? " (" + er2.message + ")" : ""));
122165
- err2.context = er2;
122166
- throw err2;
122167
- }
122168
- var handler = events2[type4];
122169
- if (handler === void 0)
122170
- return false;
122171
- if (typeof handler === "function") {
122172
- ReflectApply(handler, this, args);
122173
- } else {
122174
- var len = handler.length;
122175
- var listeners3 = arrayClone(handler, len);
122176
- for (var i = 0; i < len; ++i)
122177
- ReflectApply(listeners3[i], this, args);
122178
- }
122179
- return true;
122180
- };
122181
- function _addListener(target, type4, listener, prepend) {
122182
- var m3;
122183
- var events2;
122184
- var existing;
122185
- checkListener(listener);
122186
- events2 = target._events;
122187
- if (events2 === void 0) {
122188
- events2 = target._events = /* @__PURE__ */ Object.create(null);
122189
- target._eventsCount = 0;
122190
- } else {
122191
- if (events2.newListener !== void 0) {
122192
- target.emit(
122193
- "newListener",
122194
- type4,
122195
- listener.listener ? listener.listener : listener
122196
- );
122197
- events2 = target._events;
122198
- }
122199
- existing = events2[type4];
122200
- }
122201
- if (existing === void 0) {
122202
- existing = events2[type4] = listener;
122203
- ++target._eventsCount;
122204
- } else {
122205
- if (typeof existing === "function") {
122206
- existing = events2[type4] = prepend ? [listener, existing] : [existing, listener];
122207
- } else if (prepend) {
122208
- existing.unshift(listener);
122209
- } else {
122210
- existing.push(listener);
122211
- }
122212
- m3 = _getMaxListeners(target);
122213
- if (m3 > 0 && existing.length > m3 && !existing.warned) {
122214
- existing.warned = true;
122215
- var w2 = new Error("Possible EventEmitter memory leak detected. " + existing.length + " " + String(type4) + " listeners added. Use emitter.setMaxListeners() to increase limit");
122216
- w2.name = "MaxListenersExceededWarning";
122217
- w2.emitter = target;
122218
- w2.type = type4;
122219
- w2.count = existing.length;
122220
- ProcessEmitWarning(w2);
122221
- }
122222
- }
122223
- return target;
122224
- }
122225
- EventEmitter$12.prototype.addListener = function addListener(type4, listener) {
122226
- return _addListener(this, type4, listener, false);
122227
- };
122228
- EventEmitter$12.prototype.on = EventEmitter$12.prototype.addListener;
122229
- EventEmitter$12.prototype.prependListener = function prependListener(type4, listener) {
122230
- return _addListener(this, type4, listener, true);
122231
- };
122232
- function onceWrapper() {
122233
- if (!this.fired) {
122234
- this.target.removeListener(this.type, this.wrapFn);
122235
- this.fired = true;
122236
- if (arguments.length === 0)
122237
- return this.listener.call(this.target);
122238
- return this.listener.apply(this.target, arguments);
122239
- }
122240
- }
122241
- function _onceWrap(target, type4, listener) {
122242
- var state = { fired: false, wrapFn: void 0, target, type: type4, listener };
122243
- var wrapped = onceWrapper.bind(state);
122244
- wrapped.listener = listener;
122245
- state.wrapFn = wrapped;
122246
- return wrapped;
122247
- }
122248
- EventEmitter$12.prototype.once = function once(type4, listener) {
122249
- checkListener(listener);
122250
- this.on(type4, _onceWrap(this, type4, listener));
122251
- return this;
122252
- };
122253
- EventEmitter$12.prototype.prependOnceListener = function prependOnceListener(type4, listener) {
122254
- checkListener(listener);
122255
- this.prependListener(type4, _onceWrap(this, type4, listener));
122256
- return this;
122257
- };
122258
- EventEmitter$12.prototype.removeListener = function removeListener(type4, listener) {
122259
- var list, events2, position3, i, originalListener;
122260
- checkListener(listener);
122261
- events2 = this._events;
122262
- if (events2 === void 0)
122263
- return this;
122264
- list = events2[type4];
122265
- if (list === void 0)
122266
- return this;
122267
- if (list === listener || list.listener === listener) {
122268
- if (--this._eventsCount === 0)
122269
- this._events = /* @__PURE__ */ Object.create(null);
122270
- else {
122271
- delete events2[type4];
122272
- if (events2.removeListener)
122273
- this.emit("removeListener", type4, list.listener || listener);
122274
- }
122275
- } else if (typeof list !== "function") {
122276
- position3 = -1;
122277
- for (i = list.length - 1; i >= 0; i--) {
122278
- if (list[i] === listener || list[i].listener === listener) {
122279
- originalListener = list[i].listener;
122280
- position3 = i;
122281
- break;
122282
- }
122283
- }
122284
- if (position3 < 0)
122285
- return this;
122286
- if (position3 === 0)
122287
- list.shift();
122288
- else {
122289
- spliceOne(list, position3);
122290
- }
122291
- if (list.length === 1)
122292
- events2[type4] = list[0];
122293
- if (events2.removeListener !== void 0)
122294
- this.emit("removeListener", type4, originalListener || listener);
122295
- }
122296
- return this;
122297
- };
122298
- EventEmitter$12.prototype.off = EventEmitter$12.prototype.removeListener;
122299
- EventEmitter$12.prototype.removeAllListeners = function removeAllListeners(type4) {
122300
- var listeners3, events2, i;
122301
- events2 = this._events;
122302
- if (events2 === void 0)
122303
- return this;
122304
- if (events2.removeListener === void 0) {
122305
- if (arguments.length === 0) {
122306
- this._events = /* @__PURE__ */ Object.create(null);
122307
- this._eventsCount = 0;
122308
- } else if (events2[type4] !== void 0) {
122309
- if (--this._eventsCount === 0)
122310
- this._events = /* @__PURE__ */ Object.create(null);
122311
- else
122312
- delete events2[type4];
122313
- }
122314
- return this;
122315
- }
122316
- if (arguments.length === 0) {
122317
- var keys2 = Object.keys(events2);
122318
- var key;
122319
- for (i = 0; i < keys2.length; ++i) {
122320
- key = keys2[i];
122321
- if (key === "removeListener") continue;
122322
- this.removeAllListeners(key);
122323
- }
122324
- this.removeAllListeners("removeListener");
122325
- this._events = /* @__PURE__ */ Object.create(null);
122326
- this._eventsCount = 0;
122327
- return this;
122328
- }
122329
- listeners3 = events2[type4];
122330
- if (typeof listeners3 === "function") {
122331
- this.removeListener(type4, listeners3);
122332
- } else if (listeners3 !== void 0) {
122333
- for (i = listeners3.length - 1; i >= 0; i--) {
122334
- this.removeListener(type4, listeners3[i]);
122335
- }
122336
- }
122337
- return this;
122338
- };
122339
- function _listeners(target, type4, unwrap) {
122340
- var events2 = target._events;
122341
- if (events2 === void 0)
122342
- return [];
122343
- var evlistener = events2[type4];
122344
- if (evlistener === void 0)
122345
- return [];
122346
- if (typeof evlistener === "function")
122347
- return unwrap ? [evlistener.listener || evlistener] : [evlistener];
122348
- return unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
122349
- }
122350
- EventEmitter$12.prototype.listeners = function listeners(type4) {
122351
- return _listeners(this, type4, true);
122352
- };
122353
- EventEmitter$12.prototype.rawListeners = function rawListeners(type4) {
122354
- return _listeners(this, type4, false);
122355
- };
122356
- EventEmitter$12.listenerCount = function(emitter, type4) {
122357
- if (typeof emitter.listenerCount === "function") {
122358
- return emitter.listenerCount(type4);
122359
- } else {
122360
- return listenerCount.call(emitter, type4);
122361
- }
122362
- };
122363
- EventEmitter$12.prototype.listenerCount = listenerCount;
122364
- function listenerCount(type4) {
122365
- var events2 = this._events;
122366
- if (events2 !== void 0) {
122367
- var evlistener = events2[type4];
122368
- if (typeof evlistener === "function") {
122369
- return 1;
122370
- } else if (evlistener !== void 0) {
122371
- return evlistener.length;
122372
- }
122373
- }
122374
- return 0;
122375
- }
122376
- EventEmitter$12.prototype.eventNames = function eventNames() {
122377
- return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
122378
- };
122379
- function arrayClone(arr, n4) {
122380
- var copy2 = new Array(n4);
122381
- for (var i = 0; i < n4; ++i)
122382
- copy2[i] = arr[i];
122383
- return copy2;
122384
- }
122385
- function spliceOne(list, index2) {
122386
- for (; index2 + 1 < list.length; index2++)
122387
- list[index2] = list[index2 + 1];
122388
- list.pop();
122389
- }
122390
- function unwrapListeners(arr) {
122391
- var ret = new Array(arr.length);
122392
- for (var i = 0; i < ret.length; ++i) {
122393
- ret[i] = arr[i].listener || arr[i];
122394
- }
122395
- return ret;
122396
- }
122397
- function once$1(emitter, name) {
122398
- return new Promise(function(resolve, reject) {
122399
- function errorListener(err2) {
122400
- emitter.removeListener(name, resolver);
122401
- reject(err2);
122402
- }
122403
- function resolver() {
122404
- if (typeof emitter.removeListener === "function") {
122405
- emitter.removeListener("error", errorListener);
122406
- }
122407
- resolve([].slice.call(arguments));
122408
- }
122409
- eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });
122410
- if (name !== "error") {
122411
- addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });
122412
- }
122413
- });
122414
- }
122415
- function addErrorHandlerIfEventEmitter(emitter, handler, flags2) {
122416
- if (typeof emitter.on === "function") {
122417
- eventTargetAgnosticAddListener(emitter, "error", handler, flags2);
122418
- }
122419
- }
122420
- function eventTargetAgnosticAddListener(emitter, name, listener, flags2) {
122421
- if (typeof emitter.on === "function") {
122422
- if (flags2.once) {
122423
- emitter.once(name, listener);
122424
- } else {
122425
- emitter.on(name, listener);
122426
- }
122427
- } else if (typeof emitter.addEventListener === "function") {
122428
- emitter.addEventListener(name, function wrapListener(arg) {
122429
- if (flags2.once) {
122430
- emitter.removeEventListener(name, wrapListener);
122431
- }
122432
- listener(arg);
122433
- });
122434
- } else {
122435
- throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
122436
- }
122437
- }
122438
- var eventsExports = events.exports;
122439
- const EventEmitter$2 = /* @__PURE__ */ getDefaultExportFromCjs$2(eventsExports);
122440
- const eventBus = new EventEmitter$2();
122441
122506
  var VideoType = /* @__PURE__ */ ((VideoType2) => {
122442
122507
  VideoType2["CAMERA"] = "video";
122443
122508
  VideoType2["SCREEN"] = "screen";
@@ -122795,10 +122860,10 @@ const useCallStore = create$c()(
122795
122860
  appid,
122796
122861
  token: token2,
122797
122862
  password,
122798
- live_id,
122799
122863
  rtc_room_id,
122800
122864
  nickname
122801
122865
  } = callConfig;
122866
+ const { getLiveId } = useSdkStore.getState();
122802
122867
  const errors = [];
122803
122868
  const requiredFields = [
122804
122869
  { field: "isCall", value: isCall, name: "连麦开关" },
@@ -122806,7 +122871,7 @@ const useCallStore = create$c()(
122806
122871
  { field: "appid", value: appid, name: "APP ID" },
122807
122872
  { field: "token", value: token2, name: "访问令牌" },
122808
122873
  { field: "password", value: password, name: "房间密码" },
122809
- { field: "live_id", value: live_id, name: "直播ID" },
122874
+ { field: "live_id", value: getLiveId(), name: "直播ID" },
122810
122875
  { field: "rtc_room_id", value: rtc_room_id, name: "RTC房间ID" },
122811
122876
  { field: "nickname", value: nickname, name: "用户昵称" }
122812
122877
  ];
@@ -125054,13 +125119,13 @@ const useActivityTypeStore = create$c((set3, get4) => ({
125054
125119
  set3({ activityType: res.data, isLoading: false });
125055
125120
  return res.data;
125056
125121
  } else {
125057
- staticMethods$1.error(res.errorMessage);
125122
+ staticMethods.error(res.errorMessage);
125058
125123
  set3({ error: res.errorMessage, isLoading: false });
125059
125124
  return void 0;
125060
125125
  }
125061
125126
  } catch (error2) {
125062
125127
  const errorMessage = error2.message || "获取活动类型失败";
125063
- staticMethods$1.error(errorMessage);
125128
+ staticMethods.error(errorMessage);
125064
125129
  set3({ error: errorMessage, isLoading: false });
125065
125130
  return void 0;
125066
125131
  }
@@ -125131,7 +125196,7 @@ const Head = ({
125131
125196
  }));
125132
125197
  const { fetchActivityType } = useActivityTypeStore();
125133
125198
  const { fetChatUrl } = useCommentChatUrlStore();
125134
- const liveId = useSdkStore((state) => state.callConfig.live.id);
125199
+ const liveId = useSdkStore((state) => state.getLiveId());
125135
125200
  const { callConfig, getter } = useCallStore((state) => ({
125136
125201
  callConfig: state.callConfig,
125137
125202
  getter: state.getter
@@ -125492,14 +125557,14 @@ const Head = ({
125492
125557
  }
125493
125558
  if (state === 2) {
125494
125559
  console.log("推流成功");
125495
- staticMethods$1.success("开始推流");
125560
+ staticMethods.success("开始推流");
125496
125561
  setIsCurrentPagePushing(true);
125497
125562
  setLocalPushingStatusWithTimeout(PUSHING_STATUS.PUSHING);
125498
125563
  setIsLive(true);
125499
125564
  setRtmpLoading(false);
125500
125565
  }
125501
125566
  if (state === 3) {
125502
- staticMethods$1.success("网络异常重连中");
125567
+ staticMethods.success("网络异常重连中");
125503
125568
  }
125504
125569
  };
125505
125570
  rtmpRef.current.observer.onError = (e3) => {
@@ -125508,7 +125573,7 @@ const Head = ({
125508
125573
  setIsCurrentPagePushing(false);
125509
125574
  setRtmpLoading(false);
125510
125575
  setIsLive(false);
125511
- staticMethods$1.error(`推流失败,错误码:${e3.code},错误信息:${e3.message}`);
125576
+ staticMethods.error(`推流失败,错误码:${e3.code},错误信息:${e3.message}`);
125512
125577
  };
125513
125578
  await rtmpRef.current.stopCustomVideoCapture();
125514
125579
  await rtmpRef.current.stopCustomAudioCapture();
@@ -125553,12 +125618,12 @@ const Head = ({
125553
125618
  setTimeout(() => {
125554
125619
  setRtmpLoading(false);
125555
125620
  setIsLive(false);
125556
- staticMethods$1.success("推流已停止");
125621
+ staticMethods.success("推流已停止");
125557
125622
  }, TIMEOUT_CONFIG.STOP_DELAY);
125558
125623
  } catch (error2) {
125559
125624
  console.error("停止推流失败:", error2);
125560
125625
  setRtmpLoading(false);
125561
- staticMethods$1.error("停止推流失败");
125626
+ staticMethods.error("停止推流失败");
125562
125627
  }
125563
125628
  },
125564
125629
  1e3,
@@ -191014,7 +191079,7 @@ const useJoinRoomCanvas = ({
191014
191079
  "[useJoinRoomCanvas.init] canvas进入房间失败",
191015
191080
  msg2
191016
191081
  );
191017
- staticMethods$1.error("画布进入房间失败");
191082
+ staticMethods.error("画布进入房间失败");
191018
191083
  } else {
191019
191084
  console.log("[useJoinRoomCanvas.init] canvas进入房间成功");
191020
191085
  }
@@ -191921,13 +191986,10 @@ const CallSingleColumnLayout = ({
191921
191986
  const useOnlineUsers = () => {
191922
191987
  const { callUsers, callConfig } = useCallStore();
191923
191988
  const [isLoading, setIsLoading] = reactExports.useState(false);
191924
- const { liveId, agentId } = useSdkStore((state) => {
191925
- var _a2, _b;
191926
- return {
191927
- liveId: ((_a2 = state.callConfig) == null ? void 0 : _a2.live.id) || state.guestConfig.liveId,
191928
- agentId: ((_b = state.callConfig) == null ? void 0 : _b.components.call.agent_id) || state.guestConfig.agentId
191929
- };
191930
- });
191989
+ const { liveId, agentId } = useSdkStore((state) => ({
191990
+ liveId: state.getLiveId(),
191991
+ agentId: state.getAgentId()
191992
+ }));
191931
191993
  reactExports.useEffect(() => {
191932
191994
  if (callConfig.isCall) {
191933
191995
  setIsLoading(true);
@@ -192025,12 +192087,16 @@ const LeaveRoom = ({
192025
192087
  cancelText = "取消",
192026
192088
  onConfirm
192027
192089
  }) => {
192028
- const { leave, callConfig } = useCallStore();
192090
+ const { leave } = useCallStore();
192091
+ const { liveId, agentId } = useSdkStore((state) => ({
192092
+ liveId: state.getLiveId(),
192093
+ agentId: state.getAgentId()
192094
+ }));
192029
192095
  const handleConfirm = () => {
192030
192096
  if (onConfirm) {
192031
192097
  onConfirm();
192032
192098
  } else {
192033
- leave(callConfig.live_id, callConfig.agent_id);
192099
+ leave(liveId, agentId);
192034
192100
  }
192035
192101
  };
192036
192102
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -192063,12 +192129,12 @@ const ControlBottom = () => {
192063
192129
  try {
192064
192130
  const result = await toggleScreenShare();
192065
192131
  if (result.success) {
192066
- staticMethods$1.success(result.message);
192132
+ staticMethods.success(result.message);
192067
192133
  } else {
192068
- staticMethods$1.error(result.message);
192134
+ staticMethods.error(result.message);
192069
192135
  }
192070
192136
  } catch (error2) {
192071
- staticMethods$1.error("屏幕共享操作失败");
192137
+ staticMethods.error("屏幕共享操作失败");
192072
192138
  }
192073
192139
  },
192074
192140
  children: [
@@ -192102,12 +192168,12 @@ const ControlBottom = () => {
192102
192168
  try {
192103
192169
  const result = await toggleAudio();
192104
192170
  if (result.success) {
192105
- staticMethods$1.success(result.message);
192171
+ staticMethods.success(result.message);
192106
192172
  } else {
192107
- staticMethods$1.error(result.message);
192173
+ staticMethods.error(result.message);
192108
192174
  }
192109
192175
  } catch (error2) {
192110
- staticMethods$1.error("麦克风操作失败");
192176
+ staticMethods.error("麦克风操作失败");
192111
192177
  }
192112
192178
  },
192113
192179
  children: [
@@ -192124,12 +192190,12 @@ const ControlBottom = () => {
192124
192190
  try {
192125
192191
  const result = await toggleVideo();
192126
192192
  if (result.success) {
192127
- staticMethods$1.success(result.message);
192193
+ staticMethods.success(result.message);
192128
192194
  } else {
192129
- staticMethods$1.error(result.message);
192195
+ staticMethods.error(result.message);
192130
192196
  }
192131
192197
  } catch (error2) {
192132
- staticMethods$1.error("摄像头操作失败");
192198
+ staticMethods.error("摄像头操作失败");
192133
192199
  }
192134
192200
  },
192135
192201
  children: [
@@ -200576,7 +200642,7 @@ var compatibleBorder = function compatibleBorder2(bordered) {
200576
200642
  };
200577
200643
  var _excluded$H = ["map_row_parentKey"], _excluded2$f = ["map_row_parentKey", "map_row_key"], _excluded3$2 = ["map_row_key"];
200578
200644
  var warning3 = function warning4(messageStr) {
200579
- return (staticMethods$1.warn || staticMethods$1.warning)(messageStr);
200645
+ return (staticMethods.warn || staticMethods.warning)(messageStr);
200580
200646
  };
200581
200647
  var recordKeyToString = function recordKeyToString2(rowKey) {
200582
200648
  if (Array.isArray(rowKey)) return rowKey.join(",");
@@ -218088,7 +218154,7 @@ const useLibrary = ({
218088
218154
  success: true
218089
218155
  };
218090
218156
  } else {
218091
- staticMethods$1.error(res.errorMessage || "获取图片库数据失败");
218157
+ staticMethods.error(res.errorMessage || "获取图片库数据失败");
218092
218158
  return {
218093
218159
  data: [],
218094
218160
  total: 0,
@@ -218097,7 +218163,7 @@ const useLibrary = ({
218097
218163
  }
218098
218164
  } catch (error2) {
218099
218165
  console.error("加载图片库数据失败:", error2);
218100
- staticMethods$1.error("加载图片库数据失败");
218166
+ staticMethods.error("加载图片库数据失败");
218101
218167
  return {
218102
218168
  data: [],
218103
218169
  total: 0,
@@ -218284,10 +218350,10 @@ const Document$1 = ({ value, children, addDocument, fabricObjRemove }) => {
218284
218350
  data: obj
218285
218351
  });
218286
218352
  if (res.success) {
218287
- staticMethods$1.success("成功");
218353
+ staticMethods.success("成功");
218288
218354
  (_a2 = actionRef.current) == null ? void 0 : _a2.reload();
218289
218355
  } else {
218290
- staticMethods$1.error(res.errorMessage);
218356
+ staticMethods.error(res.errorMessage);
218291
218357
  return false;
218292
218358
  }
218293
218359
  return true;
@@ -218423,9 +218489,9 @@ const Document$1 = ({ value, children, addDocument, fabricObjRemove }) => {
218423
218489
  data: { id: id3 }
218424
218490
  });
218425
218491
  if (res.success) {
218426
- staticMethods$1.success("删除成功");
218492
+ staticMethods.success("删除成功");
218427
218493
  } else {
218428
- staticMethods$1.error(res.errorMessage);
218494
+ staticMethods.error(res.errorMessage);
218429
218495
  }
218430
218496
  (_a2 = actionRef.current) == null ? void 0 : _a2.reload();
218431
218497
  };
@@ -218436,9 +218502,9 @@ const Document$1 = ({ value, children, addDocument, fabricObjRemove }) => {
218436
218502
  data: { filename, title }
218437
218503
  });
218438
218504
  if (res.success) {
218439
- staticMethods$1.success("上传成功");
218505
+ staticMethods.success("上传成功");
218440
218506
  } else {
218441
- staticMethods$1.error(res.errorMessage);
218507
+ staticMethods.error(res.errorMessage);
218442
218508
  }
218443
218509
  (_a2 = actionRef.current) == null ? void 0 : _a2.reload();
218444
218510
  };
@@ -218461,14 +218527,14 @@ const Document$1 = ({ value, children, addDocument, fabricObjRemove }) => {
218461
218527
  // action: '/bis/document-upload',
218462
218528
  accept: ".ppt,.pptx,.doc,.docx,.pdf",
218463
218529
  // headers: {
218464
- // token: localStorage.getItem('sign'),
218530
+ // token: getSign(),
218465
218531
  // },
218466
218532
  showUploadList: false,
218467
218533
  customRequest,
218468
218534
  beforeUpload(file) {
218469
218535
  const isLt100M = file.size / 1024 / 1024 <= 100;
218470
218536
  if (!isLt100M) {
218471
- staticMethods$1.error("上传文件不能大于100M!");
218537
+ staticMethods.error("上传文件不能大于100M!");
218472
218538
  }
218473
218539
  return isLt100M;
218474
218540
  },
@@ -218479,7 +218545,7 @@ const Document$1 = ({ value, children, addDocument, fabricObjRemove }) => {
218479
218545
  uploadname(info.file.response, info.file.name);
218480
218546
  (_a2 = actionRef.current) == null ? void 0 : _a2.reload();
218481
218547
  } else if (info.file.status === "error") {
218482
- staticMethods$1.error("上传失败");
218548
+ staticMethods.error("上传失败");
218483
218549
  }
218484
218550
  }
218485
218551
  };
@@ -218504,7 +218570,7 @@ const Document$1 = ({ value, children, addDocument, fabricObjRemove }) => {
218504
218570
  centered: true,
218505
218571
  onOk: () => {
218506
218572
  if (selectedRowKeys.length === 0) {
218507
- staticMethods$1.error("请选择表单");
218573
+ staticMethods.error("请选择表单");
218508
218574
  return;
218509
218575
  }
218510
218576
  const documentItem = fabricObjects.find(
@@ -222058,11 +222124,11 @@ const InviteGuestModal = ({
222058
222124
  const { callConfig, updateCallConfig } = useCallStore();
222059
222125
  const { data: data2 } = useLiveInfoStore();
222060
222126
  const { call: call2 } = useSdkStore((state) => {
222061
- var _a2, _b, _c2, _d2;
222127
+ var _a2, _b;
222062
222128
  return {
222063
- liveId: (_a2 = state.callConfig) == null ? void 0 : _a2.live.id,
222064
- agentId: (_b = state.callConfig) == null ? void 0 : _b.components.call.agent_id,
222065
- call: (_d2 = (_c2 = state.callConfig) == null ? void 0 : _c2.components) == null ? void 0 : _d2.call
222129
+ liveId: state.getLiveId(),
222130
+ agentId: state.getAgentId(),
222131
+ call: (_b = (_a2 = state.callConfig) == null ? void 0 : _a2.components) == null ? void 0 : _b.call
222066
222132
  };
222067
222133
  });
222068
222134
  const [open2, setOpen] = reactExports.useState(false);
@@ -222074,9 +222140,9 @@ const InviteGuestModal = ({
222074
222140
  加入密码: ${callConfig.password}`;
222075
222141
  const copyInviteLink = () => {
222076
222142
  navigator.clipboard.writeText(copyText).then(() => {
222077
- staticMethods$1.success("邀请链接已复制");
222143
+ staticMethods.success("邀请链接已复制");
222078
222144
  }).catch(() => {
222079
- staticMethods$1.error("复制失败,请手动复制");
222145
+ staticMethods.error("复制失败,请手动复制");
222080
222146
  });
222081
222147
  };
222082
222148
  const getInviteCode = async () => {
@@ -222091,7 +222157,7 @@ const InviteGuestModal = ({
222091
222157
  });
222092
222158
  }
222093
222159
  } catch (error2) {
222094
- staticMethods$1.error("获取邀请密码失败");
222160
+ staticMethods.error("获取邀请密码失败");
222095
222161
  }
222096
222162
  };
222097
222163
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
@@ -230834,7 +230900,7 @@ const useImageLibrary = ({
230834
230900
  success: true
230835
230901
  };
230836
230902
  } else {
230837
- staticMethods$1.error(res.errorMessage || "获取图片库数据失败");
230903
+ staticMethods.error(res.errorMessage || "获取图片库数据失败");
230838
230904
  return {
230839
230905
  data: [],
230840
230906
  total: 0,
@@ -230843,7 +230909,7 @@ const useImageLibrary = ({
230843
230909
  }
230844
230910
  } catch (error2) {
230845
230911
  console.error("加载图片库数据失败:", error2);
230846
- staticMethods$1.error("加载图片库数据失败");
230912
+ staticMethods.error("加载图片库数据失败");
230847
230913
  return {
230848
230914
  data: [],
230849
230915
  total: 0,
@@ -230922,58 +230988,6 @@ const useImageLibrary = ({
230922
230988
  setPageSize
230923
230989
  };
230924
230990
  };
230925
- function withResolvers() {
230926
- let output = {};
230927
- output.promise = new Promise((res, rej) => {
230928
- output.resolve = res;
230929
- output.reject = rej;
230930
- });
230931
- return output;
230932
- }
230933
- function canvasToBlob(canvas) {
230934
- const { promise: promise2, resolve } = withResolvers();
230935
- if (canvas instanceof HTMLCanvasElement) {
230936
- canvas.toBlob((blob2) => resolve(blob2));
230937
- } else {
230938
- canvas.convertToBlob().then(resolve);
230939
- }
230940
- return promise2;
230941
- }
230942
- function scaleImage({
230943
- max: max2,
230944
- ratio,
230945
- blob: blob2
230946
- }) {
230947
- if (ratio === 1 || ratio === void 0 && max2 === void 0) {
230948
- return Blob;
230949
- }
230950
- const { promise: promise2, resolve, reject } = withResolvers();
230951
- let usedRatio = ratio;
230952
- const url3 = URL.createObjectURL(blob2);
230953
- const img = new Image();
230954
- img.src = url3;
230955
- img.onerror = reject;
230956
- img.onload = async () => {
230957
- const { naturalWidth, naturalHeight } = img;
230958
- console.log("natural", naturalWidth, naturalHeight, max2);
230959
- if (usedRatio === void 0) {
230960
- if (max2 > Math.max(naturalWidth, naturalHeight)) {
230961
- resolve(blob2);
230962
- URL.revokeObjectURL(url3);
230963
- return;
230964
- }
230965
- usedRatio = max2 / Math.max(naturalWidth, naturalHeight);
230966
- const usedWidth = naturalWidth * usedRatio;
230967
- const usedHeight = naturalHeight * usedRatio;
230968
- const canvas = new OffscreenCanvas(usedWidth, usedHeight);
230969
- const ctx2 = canvas.getContext("2d");
230970
- ctx2.drawImage(img, 0, 0, usedWidth, usedHeight);
230971
- resolve(await canvasToBlob(canvas));
230972
- URL.revokeObjectURL(url3);
230973
- }
230974
- };
230975
- return promise2;
230976
- }
230977
230991
  const UploadImageFrom$1 = (props) => {
230978
230992
  const {
230979
230993
  aspect = 1,
@@ -231130,7 +231144,7 @@ const UploadImageFrom$1 = (props) => {
231130
231144
  });
231131
231145
  if (resp.success) {
231132
231146
  setLoading(false);
231133
- staticMethods$1.success({ key: "uploadsuccess", content: "上传成功" });
231147
+ staticMethods.success({ key: "uploadsuccess", content: "上传成功" });
231134
231148
  window.removeEventListener("beforeunload", handleBeforeUnload);
231135
231149
  setCurrentPage(1);
231136
231150
  setTimeout(() => {
@@ -231141,7 +231155,7 @@ const UploadImageFrom$1 = (props) => {
231141
231155
  });
231142
231156
  ttUploader.current.on("error", (infor) => {
231143
231157
  window.removeEventListener("beforeunload", handleBeforeUnload);
231144
- staticMethods$1.error("上传失败");
231158
+ staticMethods.error("上传失败");
231145
231159
  });
231146
231160
  ttUploader.current.on("progress", (infor) => {
231147
231161
  setcomplete(infor.percent);
@@ -231160,7 +231174,7 @@ const UploadImageFrom$1 = (props) => {
231160
231174
  };
231161
231175
  const beforeUpload = async (file, fileList) => {
231162
231176
  if (file.size > maxSizeMB * 1024 * 1024) {
231163
- staticMethods$1.error("上传图片大小超过" + maxSizeMB + "M");
231177
+ staticMethods.error("上传图片大小超过" + maxSizeMB + "M");
231164
231178
  return false;
231165
231179
  }
231166
231180
  if (nocrop) {
@@ -231428,7 +231442,7 @@ const UploadImageFrom$1 = (props) => {
231428
231442
  resetSelection();
231429
231443
  setIsModalOpen(false);
231430
231444
  } else {
231431
- staticMethods$1.error("请选择图片");
231445
+ staticMethods.error("请选择图片");
231432
231446
  }
231433
231447
  },
231434
231448
  onCancel: () => {
@@ -231534,7 +231548,7 @@ const CallControls = ({
231534
231548
  const [isStopping, setIsStopping] = reactExports.useState(false);
231535
231549
  const handleStartCall = async () => {
231536
231550
  if (!liveId) {
231537
- staticMethods$1.error("直播间ID不能为空");
231551
+ staticMethods.error("直播间ID不能为空");
231538
231552
  return;
231539
231553
  }
231540
231554
  setIsStarting(true);
@@ -231553,13 +231567,13 @@ const CallControls = ({
231553
231567
  setTimeout(() => {
231554
231568
  renderCompositeFrameSmooth();
231555
231569
  }, 100);
231556
- staticMethods$1.success("连麦已开启");
231570
+ staticMethods.success("连麦已开启");
231557
231571
  } else {
231558
- staticMethods$1.error("开启连麦失败");
231572
+ staticMethods.error("开启连麦失败");
231559
231573
  }
231560
231574
  } catch (error2) {
231561
231575
  console.error("开始连麦失败:", error2);
231562
- staticMethods$1.error("开启连麦失败,请重试");
231576
+ staticMethods.error("开启连麦失败,请重试");
231563
231577
  } finally {
231564
231578
  setIsStarting(false);
231565
231579
  }
@@ -231567,7 +231581,7 @@ const CallControls = ({
231567
231581
  const handleStopCall = async () => {
231568
231582
  var _a2;
231569
231583
  if (!liveId) {
231570
- staticMethods$1.error("直播间ID不能为空");
231584
+ staticMethods.error("直播间ID不能为空");
231571
231585
  return;
231572
231586
  }
231573
231587
  setIsStopping(true);
@@ -231602,26 +231616,26 @@ const CallControls = ({
231602
231616
  renderCompositeFrameSmooth();
231603
231617
  }, 100);
231604
231618
  eventBus.emit("callStatusChanged", { isCall: false });
231605
- staticMethods$1.success("连麦已关闭,房间已解散");
231619
+ staticMethods.success("连麦已关闭,房间已解散");
231606
231620
  } else {
231607
231621
  console.warn("房间解散失败:", dismissResponse.message);
231608
- staticMethods$1.error(
231622
+ staticMethods.error(
231609
231623
  `房间解散失败: ${dismissResponse.message || "未知错误"}`
231610
231624
  );
231611
231625
  return;
231612
231626
  }
231613
231627
  } catch (dismissError) {
231614
231628
  console.error("解散房间失败:", dismissError);
231615
- staticMethods$1.error("解散房间失败,请稍后重试");
231629
+ staticMethods.error("解散房间失败,请稍后重试");
231616
231630
  return;
231617
231631
  }
231618
231632
  } else {
231619
- staticMethods$1.error("关闭连麦失败");
231633
+ staticMethods.error("关闭连麦失败");
231620
231634
  }
231621
231635
  leave();
231622
231636
  } catch (error2) {
231623
231637
  console.error("停止连麦失败:", error2);
231624
- staticMethods$1.error("停止连麦失败,但已执行本地离开");
231638
+ staticMethods.error("停止连麦失败,但已执行本地离开");
231625
231639
  } finally {
231626
231640
  setIsStopping(false);
231627
231641
  }
@@ -237268,14 +237282,14 @@ const useUserActions = () => {
237268
237282
  const handleCameraToggle = (userId, enabled) => {
237269
237283
  if (userId === callConfig.rtc_userid) {
237270
237284
  toggleVideo().catch((error2) => {
237271
- staticMethods$1.warning("摄像头操作失败,请重试");
237285
+ staticMethods.warning("摄像头操作失败,请重试");
237272
237286
  console.error("视频切换异常:", error2);
237273
237287
  });
237274
237288
  } else {
237275
237289
  rtc == null ? void 0 : rtc.engine.unsubscribeStream(userId, MediaType$1.VIDEO).then(() => {
237276
237290
  updateCallUser(userId, { isVideoEnabled: enabled });
237277
237291
  }).catch((error2) => {
237278
- staticMethods$1.warning("摄像头操作失败,请重试");
237292
+ staticMethods.warning("摄像头操作失败,请重试");
237279
237293
  console.error("视频切换异常:", error2);
237280
237294
  });
237281
237295
  }
@@ -237308,11 +237322,11 @@ const useUserActions = () => {
237308
237322
  }
237309
237323
  })
237310
237324
  ));
237311
- staticMethods$1.success("已发送邀请开启麦克风的请求");
237325
+ staticMethods.success("已发送邀请开启麦克风的请求");
237312
237326
  console.log("邀请开启麦克风消息已发送:", userId);
237313
237327
  } catch (error2) {
237314
237328
  console.error("发送邀请开启麦克风消息失败:", error2);
237315
- staticMethods$1.error("发送邀请失败,请重试");
237329
+ staticMethods.error("发送邀请失败,请重试");
237316
237330
  }
237317
237331
  };
237318
237332
  const handleInviteEnableCamera = async (userId) => {
@@ -237329,11 +237343,11 @@ const useUserActions = () => {
237329
237343
  }
237330
237344
  })
237331
237345
  ));
237332
- staticMethods$1.success("已发送邀请开启摄像头的请求");
237346
+ staticMethods.success("已发送邀请开启摄像头的请求");
237333
237347
  console.log("邀请开启摄像头消息已发送:", userId);
237334
237348
  } catch (error2) {
237335
237349
  console.error("发送邀请开启摄像头消息失败:", error2);
237336
- staticMethods$1.error("发送邀请失败,请重试");
237350
+ staticMethods.error("发送邀请失败,请重试");
237337
237351
  }
237338
237352
  };
237339
237353
  return {
@@ -237391,11 +237405,11 @@ const CallUser = reactExports.memo(({ user }) => {
237391
237405
  var _a2;
237392
237406
  const trimmedName = newName.trim();
237393
237407
  if (trimmedName.length < 2) {
237394
- staticMethods$1.error("用户名至少需要2个字符");
237408
+ staticMethods.error("用户名至少需要2个字符");
237395
237409
  return;
237396
237410
  }
237397
237411
  if (trimmedName.length > 10) {
237398
- staticMethods$1.error("用户名最多10个字符");
237412
+ staticMethods.error("用户名最多10个字符");
237399
237413
  return;
237400
237414
  }
237401
237415
  if (trimmedName && trimmedName !== user.nickname) {
@@ -237422,7 +237436,7 @@ const CallUser = reactExports.memo(({ user }) => {
237422
237436
  switch (key) {
237423
237437
  case "closeCamera":
237424
237438
  if (user.isVideoDisabled) {
237425
- staticMethods$1.warning("用户已被封禁摄像头无法开启");
237439
+ staticMethods.warning("用户已被封禁摄像头无法开启");
237426
237440
  } else {
237427
237441
  handleCameraToggle(user.rtc_userid || "", !user.isVideoEnabled);
237428
237442
  }
@@ -238207,7 +238221,7 @@ const UploadImageFrom = (props) => {
238207
238221
  });
238208
238222
  if (resp.success) {
238209
238223
  setLoading(false);
238210
- staticMethods$1.success({ key: "uploadsuccess", content: "上传成功" });
238224
+ staticMethods.success({ key: "uploadsuccess", content: "上传成功" });
238211
238225
  onChange();
238212
238226
  window.removeEventListener("beforeunload", handleBeforeUnload);
238213
238227
  }
@@ -238216,7 +238230,7 @@ const UploadImageFrom = (props) => {
238216
238230
  ttUploader.current.on("error", (infor) => {
238217
238231
  console.log(infor.extra);
238218
238232
  window.removeEventListener("beforeunload", handleBeforeUnload);
238219
- staticMethods$1.success("上传失败");
238233
+ staticMethods.success("上传失败");
238220
238234
  });
238221
238235
  ttUploader.current.on("progress", (infor) => {
238222
238236
  console.log(infor.percent);
@@ -238240,7 +238254,7 @@ const UploadImageFrom = (props) => {
238240
238254
  };
238241
238255
  const beforeUpload = async (file, fileList) => {
238242
238256
  if (file.size > maxSizeMB * 1024 * 1024) {
238243
- staticMethods$1.error("上传图片大小超过" + maxSizeMB + "M");
238257
+ staticMethods.error("上传图片大小超过" + maxSizeMB + "M");
238244
238258
  return false;
238245
238259
  }
238246
238260
  if (nocrop) {
@@ -238284,7 +238298,7 @@ const UploadImageFrom = (props) => {
238284
238298
  }
238285
238299
  if (info.file.status === "done") {
238286
238300
  setLoading(false);
238287
- staticMethods$1.success({ key: "uploadsuccess", content: "上传成功" });
238301
+ staticMethods.success({ key: "uploadsuccess", content: "上传成功" });
238288
238302
  if (!isStorage) {
238289
238303
  onChange(info.file.response);
238290
238304
  }
@@ -246338,11 +246352,11 @@ const ChatComponent = () => {
246338
246352
  setFinished(true);
246339
246353
  }
246340
246354
  } else {
246341
- staticMethods$1.error(res.errorMessage);
246355
+ staticMethods.error(res.errorMessage);
246342
246356
  }
246343
246357
  };
246344
246358
  const sendComment = async () => {
246345
- if (!comment2) return staticMethods$1.error("请输入聊天内容");
246359
+ if (!comment2) return staticMethods.error("请输入聊天内容");
246346
246360
  const res = await request("/bis/interaction-comment", {
246347
246361
  method: "POST",
246348
246362
  data: {
@@ -246354,7 +246368,7 @@ const ChatComponent = () => {
246354
246368
  if (res.success) {
246355
246369
  setComment("");
246356
246370
  } else {
246357
- staticMethods$1.error(res.errorMessage);
246371
+ staticMethods.error(res.errorMessage);
246358
246372
  }
246359
246373
  };
246360
246374
  reactExports.useEffect(() => {
@@ -246622,7 +246636,7 @@ const ChatComponent = () => {
246622
246636
  });
246623
246637
  if (res.success) ;
246624
246638
  else {
246625
- staticMethods$1.error(res.errorMessage);
246639
+ staticMethods.error(res.errorMessage);
246626
246640
  }
246627
246641
  },
246628
246642
  accept: ".jpg,.jpeg,.png",
@@ -246685,11 +246699,11 @@ const PaginatedList = ({
246685
246699
  setFinished(true);
246686
246700
  }
246687
246701
  } else {
246688
- staticMethods$1.error(res.errorMessage);
246702
+ staticMethods.error(res.errorMessage);
246689
246703
  }
246690
246704
  } catch (error2) {
246691
246705
  console.error("Error fetching data:", error2);
246692
- staticMethods$1.error("请求失败,请稍后再试");
246706
+ staticMethods.error("请求失败,请稍后再试");
246693
246707
  }
246694
246708
  };
246695
246709
  const handleLoadMore = async () => {
@@ -247309,10 +247323,10 @@ const OnlineListComponent = ({ AudienceOperate, searchNickname }, ref) => {
247309
247323
  data: { live_id: liveId, sid, client_userid }
247310
247324
  });
247311
247325
  if (res.success) {
247312
- staticMethods$1.success("操作成功");
247326
+ staticMethods.success("操作成功");
247313
247327
  return true;
247314
247328
  } else {
247315
- staticMethods$1.error(res.errorMessage);
247329
+ staticMethods.error(res.errorMessage);
247316
247330
  return false;
247317
247331
  }
247318
247332
  };
@@ -247612,10 +247626,10 @@ const TeamComponent = () => {
247612
247626
  data: data2
247613
247627
  });
247614
247628
  if (res.success) {
247615
- staticMethods$1.success("操作成功");
247629
+ staticMethods.success("操作成功");
247616
247630
  return true;
247617
247631
  } else {
247618
- staticMethods$1.error(res.errorMessage);
247632
+ staticMethods.error(res.errorMessage);
247619
247633
  return false;
247620
247634
  }
247621
247635
  };
@@ -247628,7 +247642,7 @@ const TeamComponent = () => {
247628
247642
  if (res.success) {
247629
247643
  setOnlineData(res.data);
247630
247644
  } else {
247631
- staticMethods$1.error(res.errorMessage);
247645
+ staticMethods.error(res.errorMessage);
247632
247646
  }
247633
247647
  };
247634
247648
  reactExports.useEffect(() => {
@@ -247880,7 +247894,7 @@ const LiveWaitingRoom = ({
247880
247894
  video: true,
247881
247895
  audio: true
247882
247896
  });
247883
- staticMethods$1.success("设备测试成功!摄像头和麦克风工作正常");
247897
+ staticMethods.success("设备测试成功!摄像头和麦克风工作正常");
247884
247898
  stream.getTracks().forEach((track) => track.stop());
247885
247899
  console.log("设备测试完成:", {
247886
247900
  video: stream.getVideoTracks().length > 0,
@@ -247891,11 +247905,11 @@ const LiveWaitingRoom = ({
247891
247905
  console.error("设备测试失败:", error2);
247892
247906
  const err2 = error2;
247893
247907
  if (err2.name === "NotAllowedError") {
247894
- staticMethods$1.error("请允许访问摄像头和麦克风权限");
247908
+ staticMethods.error("请允许访问摄像头和麦克风权限");
247895
247909
  } else if (err2.name === "NotFoundError") {
247896
- staticMethods$1.error("未检测到摄像头或麦克风设备");
247910
+ staticMethods.error("未检测到摄像头或麦克风设备");
247897
247911
  } else {
247898
- staticMethods$1.error("设备测试失败,请检查设备连接");
247912
+ staticMethods.error("设备测试失败,请检查设备连接");
247899
247913
  }
247900
247914
  } finally {
247901
247915
  setIsTestingDevice(false);
@@ -248115,13 +248129,10 @@ const useRoomMessageHandler = (params = {}) => {
248115
248129
  callUsers: state.callUsers,
248116
248130
  callCurrentUser: state.callCurrentUser
248117
248131
  }));
248118
- const { liveId, agentId } = useSdkStore((state) => {
248119
- var _a2, _b;
248120
- return {
248121
- liveId: ((_a2 = state.callConfig) == null ? void 0 : _a2.live.id) || state.guestConfig.liveId,
248122
- agentId: ((_b = state.callConfig) == null ? void 0 : _b.components.call.agent_id) || state.guestConfig.agentId
248123
- };
248124
- });
248132
+ const { liveId, agentId } = useSdkStore((state) => ({
248133
+ liveId: state.getLiveId(),
248134
+ agentId: state.getAgentId()
248135
+ }));
248125
248136
  const messageCache = reactExports.useRef({});
248126
248137
  const MESSAGE_DEBOUNCE_TIME = 1e3;
248127
248138
  const CACHE_CLEANUP_INTERVAL = 6e4;
@@ -248220,7 +248231,7 @@ const useRoomMessageHandler = (params = {}) => {
248220
248231
  data: data2.data
248221
248232
  });
248222
248233
  if (handlerName !== "handleChangeConfigMessage") {
248223
- staticMethods$1.error(`消息处理失败,请稍后重试`);
248234
+ staticMethods.error(`消息处理失败,请稍后重试`);
248224
248235
  }
248225
248236
  }
248226
248237
  };
@@ -248233,18 +248244,18 @@ const useRoomMessageHandler = (params = {}) => {
248233
248244
  const { is_muted } = muteData || {};
248234
248245
  try {
248235
248246
  await toggleAudio(is_muted);
248236
- staticMethods$1.success(
248247
+ staticMethods.success(
248237
248248
  !is_muted ? "主持人开启了全体静音" : "主持人解除了全体静音"
248238
248249
  );
248239
248250
  } catch (error2) {
248240
- staticMethods$1.error("设备权限获取失败,全体静音失败");
248251
+ staticMethods.error("设备权限获取失败,全体静音失败");
248241
248252
  }
248242
248253
  },
248243
248254
  [toggleAudio]
248244
248255
  );
248245
248256
  const handleLeaveMessage = reactExports.useCallback(
248246
248257
  (data2) => {
248247
- staticMethods$1.warning("主持人结束了连麦");
248258
+ staticMethods.warning("主持人结束了连麦");
248248
248259
  leave(liveId, agentId);
248249
248260
  console.log("主持人解散房间", {
248250
248261
  liveId,
@@ -248380,14 +248391,14 @@ const useRoomMessageHandler = (params = {}) => {
248380
248391
  );
248381
248392
  const handleChangeConfigMessage = reactExports.useCallback(async () => {
248382
248393
  const res = await getRTCGuestConfig({
248383
- live_id: callConfig.live_id,
248384
- agent_id: callConfig.agent_id,
248394
+ live_id: liveId,
248395
+ agent_id: agentId,
248385
248396
  rtc_userid: callConfig.rtc_userid || ""
248386
248397
  });
248387
248398
  if (res == null ? void 0 : res.data) {
248388
248399
  updateCallConfig(res.data);
248389
248400
  }
248390
- }, [updateCallConfig, callConfig]);
248401
+ }, [updateCallConfig, liveId, agentId]);
248391
248402
  const handleUsersMessage = reactExports.useCallback(
248392
248403
  (data2, userid) => {
248393
248404
  const { users, rtc_userid } = data2.data;
@@ -248492,17 +248503,17 @@ const useRoomMessageHandler = (params = {}) => {
248492
248503
  }
248493
248504
  console.log("收到嘉宾邀请回馈消息", feedbackData);
248494
248505
  if (feedbackData.status === "accepted") {
248495
- staticMethods$1.success(
248506
+ staticMethods.success(
248496
248507
  `用户已${feedbackData.action === "enable_microphone" ? "开启麦克风" : "开启摄像头"}`
248497
248508
  );
248498
248509
  } else {
248499
- staticMethods$1.error(
248510
+ staticMethods.error(
248500
248511
  `用户${feedbackData.action === "enable_microphone" ? "开启麦克风" : "开启摄像头"}失败: ${feedbackData.error || "未知错误"}`
248501
248512
  );
248502
248513
  }
248503
248514
  } catch (error2) {
248504
248515
  console.error("处理邀请回馈消息失败", error2);
248505
- staticMethods$1.error("处理邀请回馈消息时发生错误");
248516
+ staticMethods.error("处理邀请回馈消息时发生错误");
248506
248517
  }
248507
248518
  },
248508
248519
  []
@@ -248519,7 +248530,7 @@ const useRoomMessageHandler = (params = {}) => {
248519
248530
  if (getter().rtc) {
248520
248531
  const { success: _success, message: _message } = await toggleAudio(true);
248521
248532
  if (_success) {
248522
- staticMethods$1.success(_message);
248533
+ staticMethods.success(_message);
248523
248534
  } else {
248524
248535
  errorMessage = _message;
248525
248536
  }
@@ -248531,7 +248542,7 @@ const useRoomMessageHandler = (params = {}) => {
248531
248542
  if (getter().rtc) {
248532
248543
  const { success: _success, message: _message } = await toggleVideo(true);
248533
248544
  if (_success) {
248534
- staticMethods$1.success(_message);
248545
+ staticMethods.success(_message);
248535
248546
  } else {
248536
248547
  errorMessage = _message;
248537
248548
  }
@@ -248577,7 +248588,7 @@ const useRoomMessageHandler = (params = {}) => {
248577
248588
  data: errorFeedback
248578
248589
  })
248579
248590
  ));
248580
- staticMethods$1.error(
248591
+ staticMethods.error(
248581
248592
  `${inviteData.action === "enable_microphone" ? "开启麦克风" : "开启摄像头"}失败`
248582
248593
  );
248583
248594
  }
@@ -248800,8 +248811,8 @@ const RtcJoomRoom = reactExports.memo(({ access }) => {
248800
248811
  const autoPlayFailUserdRef = reactExports.useRef([]);
248801
248812
  const [hasUserInteracted, setHasUserInteracted] = reactExports.useState(false);
248802
248813
  const { liveId, agentId } = useSdkStore((state) => ({
248803
- liveId: state.callConfig.live.id || state.guestConfig.liveId,
248804
- agentId: state.callConfig.components.call.agent_id || state.guestConfig.agentId
248814
+ liveId: state.getLiveId(),
248815
+ agentId: state.getAgentId()
248805
248816
  }));
248806
248817
  const {
248807
248818
  visible: inviteModalVisible,
@@ -248859,7 +248870,7 @@ const RtcJoomRoom = reactExports.memo(({ access }) => {
248859
248870
  setOriginalInviteData(null);
248860
248871
  } catch (error2) {
248861
248872
  console.error("处理邀请确认失败", error2);
248862
- staticMethods$1.error("处理邀请失败,请重试");
248873
+ staticMethods.error("处理邀请失败,请重试");
248863
248874
  } finally {
248864
248875
  setInviteLoading(false);
248865
248876
  }
@@ -248958,7 +248969,7 @@ const RtcJoomRoom = reactExports.memo(({ access }) => {
248958
248969
  appid
248959
248970
  } = callConfig;
248960
248971
  if (!localUser) {
248961
- staticMethods$1.error("加入房间失败,本地用户不存在");
248972
+ staticMethods.error("加入房间失败,本地用户不存在");
248962
248973
  return;
248963
248974
  }
248964
248975
  try {
@@ -249046,7 +249057,7 @@ const RtcJoomRoom = reactExports.memo(({ access }) => {
249046
249057
  falsyParams,
249047
249058
  currentValues: requiredParams
249048
249059
  });
249049
- staticMethods$1.error("加入房间失败");
249060
+ staticMethods.error("加入房间失败");
249050
249061
  return;
249051
249062
  } else {
249052
249063
  console.log("加入房间成功");
@@ -249100,14 +249111,14 @@ const RtcJoomRoom = reactExports.memo(({ access }) => {
249100
249111
  if (uid2 === callConfig.rtc_userid) {
249101
249112
  if (banned) {
249102
249113
  toggleVideo(false);
249103
- staticMethods$1.warning({
249114
+ staticMethods.warning({
249104
249115
  content: "视频被主持人封禁了",
249105
249116
  key: "video-banned-message",
249106
249117
  duration: 2
249107
249118
  });
249108
249119
  } else {
249109
249120
  toggleVideo(true);
249110
- staticMethods$1.success({
249121
+ staticMethods.success({
249111
249122
  content: "视频被主持人解封了",
249112
249123
  key: "video-unbanned-message",
249113
249124
  duration: 2
@@ -249121,14 +249132,14 @@ const RtcJoomRoom = reactExports.memo(({ access }) => {
249121
249132
  if (uid2 === callConfig.rtc_userid) {
249122
249133
  if (banned) {
249123
249134
  toggleAudio(false);
249124
- staticMethods$1.warning({
249135
+ staticMethods.warning({
249125
249136
  content: "音频被主持人封禁了",
249126
249137
  key: "audio-banned-message",
249127
249138
  duration: 2
249128
249139
  });
249129
249140
  } else {
249130
249141
  toggleAudio(true);
249131
- staticMethods$1.success({
249142
+ staticMethods.success({
249132
249143
  content: "音频被主持人解封了",
249133
249144
  key: "audio-unbanned-message",
249134
249145
  duration: 2
@@ -249167,13 +249178,13 @@ const RtcJoomRoom = reactExports.memo(({ access }) => {
249167
249178
  [VERTC2.ErrorCode.KICKED_OUT]: {
249168
249179
  msg: "被主持人踢出",
249169
249180
  fn: () => {
249170
- leave(callConfig.live_id, callConfig.agent_id);
249181
+ leave(liveId, agentId);
249171
249182
  }
249172
249183
  },
249173
249184
  [VERTC2.ErrorCode.ROOM_DISMISS]: {
249174
249185
  msg: "房间解散",
249175
249186
  fn: () => {
249176
- leave(callConfig.live_id, callConfig.agent_id);
249187
+ leave(liveId, agentId);
249177
249188
  }
249178
249189
  },
249179
249190
  [VERTC2.ErrorCode.ROOM_FORBIDDEN]: {
@@ -249201,7 +249212,7 @@ const RtcJoomRoom = reactExports.memo(({ access }) => {
249201
249212
  console.log(
249202
249213
  `[RTC Error] 显示错误消息: ${errorMessage}, 错误码: ${errorCode}`
249203
249214
  );
249204
- staticMethods$1.error(errorMessage);
249215
+ staticMethods.error(errorMessage);
249205
249216
  if ((_b = map3[errorCode]) == null ? void 0 : _b.fn) {
249206
249217
  (_d2 = (_c2 = map3[errorCode]).fn) == null ? void 0 : _d2.call(_c2);
249207
249218
  }
@@ -249656,7 +249667,7 @@ const MediaSettings = () => {
249656
249667
  try {
249657
249668
  if (!navigator.mediaDevices || !navigator.mediaDevices.enumerateDevices) {
249658
249669
  console.error("浏览器不支持获取媒体设备列表");
249659
- staticMethods$1.error("您的浏览器不支持媒体设备选择功能");
249670
+ staticMethods.error("您的浏览器不支持媒体设备选择功能");
249660
249671
  return;
249661
249672
  }
249662
249673
  await navigator.mediaDevices.getUserMedia({ audio: true, video: true }).catch((err2) => console.error("获取媒体权限失败:", err2));
@@ -249683,7 +249694,7 @@ const MediaSettings = () => {
249683
249694
  }
249684
249695
  } catch (error2) {
249685
249696
  console.error("获取设备列表失败:", error2);
249686
- staticMethods$1.error("获取媒体设备失败,请检查设备权限");
249697
+ staticMethods.error("获取媒体设备失败,请检查设备权限");
249687
249698
  setCameraDevices([{ id: "default", label: "默认摄像头" }]);
249688
249699
  setMicrophoneDevices([{ id: "default", label: "默认麦克风" }]);
249689
249700
  }
@@ -249722,25 +249733,25 @@ const MediaSettings = () => {
249722
249733
  compatibilityResult.message || "兼容性检查失败"
249723
249734
  );
249724
249735
  setBeautyCompatible(false);
249725
- staticMethods$1.warning(
249736
+ staticMethods.warning(
249726
249737
  "您的浏览器不支持美颜功能,请使用 Chrome 78+ 或其他兼容浏览器"
249727
249738
  );
249728
249739
  }
249729
249740
  } else {
249730
249741
  console.warn("RTC客户端或美颜扩展未初始化");
249731
249742
  setBeautyCompatible(false);
249732
- staticMethods$1.warning("RTC客户端未初始化,无法使用美颜功能");
249743
+ staticMethods.warning("RTC客户端未初始化,无法使用美颜功能");
249733
249744
  }
249734
249745
  } catch (error2) {
249735
249746
  console.error("美颜扩展初始化失败:", error2);
249736
249747
  setBeautyCompatible(false);
249737
- staticMethods$1.error("美颜功能初始化失败");
249748
+ staticMethods.error("美颜功能初始化失败");
249738
249749
  }
249739
249750
  }, [rtc]);
249740
249751
  const handleBeautyToggle = reactExports.useCallback(
249741
249752
  (enabled) => {
249742
249753
  if (!beautyExtension || !beautyCompatible) {
249743
- staticMethods$1.warning("美颜功能不可用");
249754
+ staticMethods.warning("美颜功能不可用");
249744
249755
  return;
249745
249756
  }
249746
249757
  try {
@@ -249754,7 +249765,7 @@ const MediaSettings = () => {
249754
249765
  setBeautySettings((prev2) => ({ ...prev2, enabled }));
249755
249766
  } catch (error2) {
249756
249767
  console.error("美颜开关操作失败:", error2);
249757
- staticMethods$1.error("美颜开关操作失败");
249768
+ staticMethods.error("美颜开关操作失败");
249758
249769
  }
249759
249770
  },
249760
249771
  [beautyExtension, beautyCompatible]
@@ -249788,7 +249799,7 @@ const MediaSettings = () => {
249788
249799
  console.log(`${type4} 强度已设置为:`, value);
249789
249800
  } catch (error2) {
249790
249801
  console.error("美颜强度设置失败:", error2);
249791
- staticMethods$1.error("美颜强度设置失败");
249802
+ staticMethods.error("美颜强度设置失败");
249792
249803
  }
249793
249804
  }, 300),
249794
249805
  // 300ms 防抖延迟
@@ -249822,12 +249833,12 @@ const MediaSettings = () => {
249822
249833
  console.log("摄像头设备已切换:", newCameraId);
249823
249834
  } else {
249824
249835
  console.error("摄像头切换失败:", result.message);
249825
- staticMethods$1.error("摄像头切换失败");
249836
+ staticMethods.error("摄像头切换失败");
249826
249837
  }
249827
249838
  }
249828
249839
  } catch (error2) {
249829
249840
  console.error("摄像头配置失败:", error2);
249830
- staticMethods$1.error("摄像头配置失败");
249841
+ staticMethods.error("摄像头配置失败");
249831
249842
  }
249832
249843
  },
249833
249844
  [rtc, mirrorEnabled]
@@ -249845,12 +249856,12 @@ const MediaSettings = () => {
249845
249856
  console.log("麦克风设备已切换:", newMicrophoneId);
249846
249857
  } else {
249847
249858
  console.error("麦克风切换失败:", result.message);
249848
- staticMethods$1.error("麦克风切换失败");
249859
+ staticMethods.error("麦克风切换失败");
249849
249860
  }
249850
249861
  }
249851
249862
  } catch (error2) {
249852
249863
  console.error("麦克风配置失败:", error2);
249853
- staticMethods$1.error("麦克风配置失败");
249864
+ staticMethods.error("麦克风配置失败");
249854
249865
  }
249855
249866
  },
249856
249867
  [rtc]
@@ -249869,12 +249880,12 @@ const MediaSettings = () => {
249869
249880
  console.log("镜像翻转已设置:", checked);
249870
249881
  } else {
249871
249882
  console.error("镜像翻转设置失败:", result.message);
249872
- staticMethods$1.error("镜像翻转设置失败");
249883
+ staticMethods.error("镜像翻转设置失败");
249873
249884
  }
249874
249885
  }
249875
249886
  } catch (error2) {
249876
249887
  console.error("镜像翻转配置失败:", error2);
249877
- staticMethods$1.error("镜像翻转配置失败");
249888
+ staticMethods.error("镜像翻转配置失败");
249878
249889
  }
249879
249890
  },
249880
249891
  [rtc, selectedCamera]
@@ -250189,14 +250200,14 @@ const getCompatibleUserMedia = (constraints) => {
250189
250200
  const { Title } = Typography;
250190
250201
  const WebLiveLogin = () => {
250191
250202
  const [form] = Form2.useForm();
250192
- const queryParams = new URLSearchParams(window.location.search);
250203
+ new URLSearchParams(window.location.search);
250193
250204
  const { setStatus, setDeviceType } = useGuestStore((state) => ({
250194
250205
  setStatus: state.setStatus,
250195
250206
  setDeviceType: state.setDeviceType
250196
250207
  }));
250197
- const { liveId, agent_id } = useSdkStore((state) => ({
250198
- liveId: state.guestConfig.liveId,
250199
- agent_id: state.guestConfig.agentId
250208
+ const { liveId, agentId } = useSdkStore((state) => ({
250209
+ liveId: state.getLiveId(),
250210
+ agentId: state.getAgentId()
250200
250211
  }));
250201
250212
  const { setMainCanvasId, setCallCurrentUser, updateCallConfig } = useCallStore();
250202
250213
  const [devicePermissions, setDevicePermissions] = reactExports.useState({
@@ -250286,7 +250297,7 @@ const WebLiveLogin = () => {
250286
250297
  enabled: false
250287
250298
  }
250288
250299
  }));
250289
- staticMethods$1.error("麦克风权限获取失败,请检查浏览器设置");
250300
+ staticMethods.error("麦克风权限获取失败,请检查浏览器设置");
250290
250301
  }
250291
250302
  }, []);
250292
250303
  const requestCameraPermission = reactExports.useCallback(async () => {
@@ -250309,7 +250320,7 @@ const WebLiveLogin = () => {
250309
250320
  enabled: false
250310
250321
  }
250311
250322
  }));
250312
- staticMethods$1.error("摄像头权限获取失败,请检查浏览器设置");
250323
+ staticMethods.error("摄像头权限获取失败,请检查浏览器设置");
250313
250324
  }
250314
250325
  }, []);
250315
250326
  const toggleMicrophoneEnabled = reactExports.useCallback(() => {
@@ -250357,32 +250368,30 @@ const WebLiveLogin = () => {
250357
250368
  requestMicrophonePermission();
250358
250369
  }, [checkDevicePermissions]);
250359
250370
  reactExports.useEffect(() => {
250360
- const live_id = liveId;
250361
- const agent_id2 = queryParams.get("agent_id") || "";
250362
- if (live_id && agent_id2) {
250371
+ if (liveId && agentId) {
250363
250372
  updateCallConfig({
250364
- live_id: Number(live_id),
250365
- agent_id: Number(agent_id2)
250373
+ live_id: Number(liveId),
250374
+ agent_id: Number(agentId)
250366
250375
  });
250367
250376
  console.log("Login页面:已存储URL参数到store", {
250368
- live_id: Number(live_id),
250369
- agent_id: Number(agent_id2)
250377
+ live_id: Number(liveId),
250378
+ agent_id: Number(agentId)
250370
250379
  });
250371
250380
  }
250372
- }, [liveId, agent_id, updateCallConfig]);
250381
+ }, [liveId, agentId, updateCallConfig]);
250373
250382
  const handleError = reactExports.useCallback((error2, context) => {
250374
250383
  var _a2, _b, _c2;
250375
250384
  console.error(`${context}失败:`, error2);
250376
250385
  if (((_a2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _a2.status) === 401) {
250377
- staticMethods$1.error("登录凭证已过期,请重新登录");
250386
+ staticMethods.error("登录凭证已过期,请重新登录");
250378
250387
  } else if (((_b = error2 == null ? void 0 : error2.response) == null ? void 0 : _b.status) === 403) {
250379
- staticMethods$1.error("没有权限访问该房间");
250388
+ staticMethods.error("没有权限访问该房间");
250380
250389
  } else if (((_c2 = error2 == null ? void 0 : error2.response) == null ? void 0 : _c2.status) >= 500) {
250381
- staticMethods$1.error("服务器错误,请稍后重试");
250390
+ staticMethods.error("服务器错误,请稍后重试");
250382
250391
  } else if (error2 == null ? void 0 : error2.message) {
250383
- staticMethods$1.error(error2.message);
250392
+ staticMethods.error(error2.message);
250384
250393
  } else {
250385
- staticMethods$1.error(`${context}失败,请重试`);
250394
+ staticMethods.error(`${context}失败,请重试`);
250386
250395
  }
250387
250396
  }, []);
250388
250397
  const handleCompleteLogin = reactExports.useCallback(
@@ -250404,7 +250413,7 @@ const WebLiveLogin = () => {
250404
250413
  const onlineUsersParams = {
250405
250414
  live_id: Number(liveId),
250406
250415
  rtc_userid: loginData.data.rtc_userid,
250407
- agent_id: Number(agent_id)
250416
+ agent_id: Number(agentId)
250408
250417
  };
250409
250418
  const onlineUsersRes = await getRoomOnlineUsers(onlineUsersParams);
250410
250419
  if (!onlineUsersRes.success || !onlineUsersRes.data) {
@@ -250419,12 +250428,12 @@ const WebLiveLogin = () => {
250419
250428
  );
250420
250429
  console.log("totalOnlineUsers", totalOnlineUsers);
250421
250430
  if (totalOnlineUsers >= 17) {
250422
- staticMethods$1.error(`房间人数已满(${totalOnlineUsers}/17),无法加入房间`);
250431
+ staticMethods.error(`房间人数已满(${totalOnlineUsers}/17),无法加入房间`);
250423
250432
  return;
250424
250433
  }
250425
250434
  const rtcConfigParams = {
250426
250435
  live_id: Number(liveId),
250427
- agent_id: Number(agent_id),
250436
+ agent_id: Number(agentId),
250428
250437
  rtc_userid: loginData.data.rtc_userid
250429
250438
  };
250430
250439
  const falsyParams = Object.entries(rtcConfigParams).filter(
@@ -250437,7 +250446,7 @@ const WebLiveLogin = () => {
250437
250446
  currentValues: rtcConfigParams,
250438
250447
  originalParams: {
250439
250448
  liveId,
250440
- agent_id,
250449
+ agentId,
250441
250450
  "loginData.data.rtc_userid": loginData.data.rtc_userid
250442
250451
  }
250443
250452
  });
@@ -250450,15 +250459,15 @@ const WebLiveLogin = () => {
250450
250459
  }
250451
250460
  const rtcConfig = rtcConfigRes.data;
250452
250461
  if (rtcConfig.lock_mode) {
250453
- staticMethods$1.error("当前房间已被锁定,无法加入连麦");
250462
+ staticMethods.error("当前房间已被锁定,无法加入连麦");
250454
250463
  return;
250455
250464
  }
250456
250465
  if (rtcConfig.status === 0) {
250457
- staticMethods$1.error("当前房间未开启连麦,无法加入连麦");
250466
+ staticMethods.error("当前房间未开启连麦,无法加入连麦");
250458
250467
  return;
250459
250468
  }
250460
250469
  if (rtcConfig.status === 2) {
250461
- staticMethods$1.error("当前房间连麦已结束,无法加入连麦");
250470
+ staticMethods.error("当前房间连麦已结束,无法加入连麦");
250462
250471
  return;
250463
250472
  }
250464
250473
  setMainCanvasId(rtcConfig.rtc_userid || "");
@@ -250482,13 +250491,11 @@ const WebLiveLogin = () => {
250482
250491
  ...loginData.data,
250483
250492
  isCall: true,
250484
250493
  rule: "sub",
250485
- agent_id: Number(agent_id),
250486
- live_id: Number(liveId),
250487
250494
  isVideoEnabled: devicePermissions.camera.granted && devicePermissions.camera.enabled,
250488
250495
  isAudioEnabled: devicePermissions.microphone.granted && devicePermissions.microphone.enabled
250489
250496
  });
250490
250497
  if (!loginData.success || !rtcConfigRes.success) return;
250491
- staticMethods$1.success("登录成功!");
250498
+ staticMethods.success("登录成功!");
250492
250499
  setStatus(1);
250493
250500
  setDeviceType(isMobile$2 ? "mobile" : "pc");
250494
250501
  } catch (error2) {
@@ -250787,11 +250794,11 @@ const DeviceSelectionModal = reactExports.memo(
250787
250794
  setTimeout(() => {
250788
250795
  onOk == null ? void 0 : onOk(audioDeviceId, videoDeviceId);
250789
250796
  }, 200);
250790
- staticMethods$1.success("设备切换成功");
250797
+ staticMethods.success("设备切换成功");
250791
250798
  }
250792
250799
  } catch (error22) {
250793
250800
  console.error("[MobileLive] 设备切换失败:", error22);
250794
- staticMethods$1.error("设备切换失败,请重试");
250801
+ staticMethods.error("设备切换失败,请重试");
250795
250802
  }
250796
250803
  },
250797
250804
  [rtc, callConfig.rtc_userid]
@@ -251165,11 +251172,11 @@ const MeetingListModal = reactExports.memo(
251165
251172
  var _a2;
251166
251173
  const trimmedName = newName.trim();
251167
251174
  if (trimmedName.length < 2) {
251168
- staticMethods$1.error("用户名至少需要2个字符");
251175
+ staticMethods.error("用户名至少需要2个字符");
251169
251176
  return;
251170
251177
  }
251171
251178
  if (trimmedName.length > 10) {
251172
- staticMethods$1.error("用户名最多10个字符");
251179
+ staticMethods.error("用户名最多10个字符");
251173
251180
  return;
251174
251181
  }
251175
251182
  if (trimmedName && trimmedName !== (callCurrentUser == null ? void 0 : callCurrentUser.nickname)) {
@@ -251190,10 +251197,10 @@ const MeetingListModal = reactExports.memo(
251190
251197
  } catch (error2) {
251191
251198
  console.error("发送名称更新消息失败:", error2);
251192
251199
  }
251193
- staticMethods$1.success("名称修改成功");
251200
+ staticMethods.success("名称修改成功");
251194
251201
  } catch (error2) {
251195
251202
  console.error("名称修改失败:", error2);
251196
- staticMethods$1.error("名称修改失败");
251203
+ staticMethods.error("名称修改失败");
251197
251204
  }
251198
251205
  }
251199
251206
  },
@@ -251338,9 +251345,9 @@ const MobileControlBar = reactExports.memo(
251338
251345
  onClick: () => {
251339
251346
  toggleAudio().then((res) => {
251340
251347
  if (res.success) {
251341
- staticMethods$1.success(res.message);
251348
+ staticMethods.success(res.message);
251342
251349
  } else {
251343
- staticMethods$1.error(res.message);
251350
+ staticMethods.error(res.message);
251344
251351
  }
251345
251352
  });
251346
251353
  }
@@ -251355,9 +251362,9 @@ const MobileControlBar = reactExports.memo(
251355
251362
  onClick: () => {
251356
251363
  toggleVideo().then((res) => {
251357
251364
  if (res.success) {
251358
- staticMethods$1.success(res.message);
251365
+ staticMethods.success(res.message);
251359
251366
  } else {
251360
- staticMethods$1.error(res.message);
251367
+ staticMethods.error(res.message);
251361
251368
  }
251362
251369
  });
251363
251370
  }
@@ -253415,12 +253422,12 @@ const CanvasUploadVideo = ({ addVideo }) => {
253415
253422
  beforeUpload: (file) => {
253416
253423
  const isMP4 = file.type === "video/mp4";
253417
253424
  if (!isMP4) {
253418
- staticMethods$1.error("只能上传 MP4 文件!");
253425
+ staticMethods.error("只能上传 MP4 文件!");
253419
253426
  return false;
253420
253427
  }
253421
253428
  const isLt4M = file.size / 1024 / 1024 < 5e3;
253422
253429
  if (!isLt4M) {
253423
- staticMethods$1.error("文件大小不能超过5GB!");
253430
+ staticMethods.error("文件大小不能超过5GB!");
253424
253431
  return false;
253425
253432
  }
253426
253433
  return isMP4 || Upload.LIST_IGNORE;
@@ -253455,7 +253462,7 @@ const CanvasUploadVideo = ({ addVideo }) => {
253455
253462
  title: "视频文件",
253456
253463
  open: isModalOpen,
253457
253464
  onOk: () => {
253458
- if (!videoUrlBlob.current) return staticMethods$1.error("请先上传文件");
253465
+ if (!videoUrlBlob.current) return staticMethods.error("请先上传文件");
253459
253466
  addVideo(
253460
253467
  videoUrlBlob.current,
253461
253468
  fileData.current.name,
@@ -253521,7 +253528,7 @@ const CanvasVideoSlot = ({ onCreateEmpty }) => {
253521
253528
  await Promise.resolve(onCreateEmpty());
253522
253529
  } catch (err2) {
253523
253530
  console.error("预制空槽失败", err2);
253524
- staticMethods$1.error("预制空槽失败,请稍后重试");
253531
+ staticMethods.error("预制空槽失败,请稍后重试");
253525
253532
  }
253526
253533
  };
253527
253534
  return (
@@ -253550,12 +253557,12 @@ const CanvasUploadAudio = ({ addAudio }) => {
253550
253557
  beforeUpload: (file) => {
253551
253558
  const isMP3 = file.type === "audio/mpeg";
253552
253559
  if (!isMP3) {
253553
- staticMethods$1.error("只能上传 MP3 文件!");
253560
+ staticMethods.error("只能上传 MP3 文件!");
253554
253561
  return false;
253555
253562
  }
253556
253563
  const isLt4M = file.size / 1024 / 1024 < 5e3;
253557
253564
  if (!isLt4M) {
253558
- staticMethods$1.error("文件大小不能超过5GB!");
253565
+ staticMethods.error("文件大小不能超过5GB!");
253559
253566
  return false;
253560
253567
  }
253561
253568
  return isMP3 || Upload.LIST_IGNORE;
@@ -253582,7 +253589,7 @@ const CanvasUploadAudio = ({ addAudio }) => {
253582
253589
  title: "音频文件",
253583
253590
  open: isModalOpen,
253584
253591
  onOk: () => {
253585
- if (!audioUrlBlob.current) return staticMethods$1.error("请先上传文件");
253592
+ if (!audioUrlBlob.current) return staticMethods.error("请先上传文件");
253586
253593
  addAudio(
253587
253594
  audioUrlBlob.current,
253588
253595
  fileData.current.name,
@@ -262061,7 +262068,7 @@ const MetaItem = ({ isSelectedId, item, livePlayerRef, provided }) => {
262061
262068
  e3.stopPropagation();
262062
262069
  e3.preventDefault();
262063
262070
  if (!items.evented) {
262064
- staticMethods$1.error("锁定状态下无法进行删除,需要删除先解锁");
262071
+ staticMethods.error("锁定状态下无法进行删除,需要删除先解锁");
262065
262072
  return;
262066
262073
  }
262067
262074
  if (item.objectType === "sharing") {
@@ -263329,7 +263336,7 @@ class CallLiveSdk {
263329
263336
  this.root = null;
263330
263337
  this.config = config2;
263331
263338
  useSdkStore.setState({ callConfig: this.config });
263332
- localStorage.setItem("feiayo_callsdk_sign", this.config.sign);
263339
+ saveSign(this.config.sign);
263333
263340
  }
263334
263341
  /**
263335
263342
  * 初始化SDK
@@ -263351,32 +263358,7 @@ class CallLiveSdk {
263351
263358
  throw new Error("SDK not initialized");
263352
263359
  }
263353
263360
  this.root.render(
263354
- /* @__PURE__ */ jsxRuntimeExports.jsx(React$2.StrictMode, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(App$1, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(GlobalErrorBoundary, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sdk-config-info", children: [
263355
- /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { children: "SDK配置信息" }),
263356
- /* @__PURE__ */ jsxRuntimeExports.jsxs("ul", { children: [
263357
- /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
263358
- "直播ID: ",
263359
- this.config.live.id
263360
- ] }),
263361
- /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
263362
- "直播标题: ",
263363
- this.config.live.title
263364
- ] }),
263365
- /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
263366
- "签名: ",
263367
- this.config.sign
263368
- ] }),
263369
- /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
263370
- "聊天功能: ",
263371
- this.config.components.chat ? "启用" : "禁用"
263372
- ] }),
263373
- /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
263374
- "团队功能: ",
263375
- this.config.components.team ? "启用" : "禁用"
263376
- ] })
263377
- ] }),
263378
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(WebLiveIndex, {}) })
263379
- ] }) }) }) })
263361
+ /* @__PURE__ */ jsxRuntimeExports.jsx(React$2.StrictMode, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(App$1, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(GlobalErrorBoundary, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(WebLiveIndex, {}) }) }) })
263380
263362
  );
263381
263363
  }
263382
263364
  /**
@@ -263402,13 +263384,60 @@ class CallLiveSdk {
263402
263384
  this.root = null;
263403
263385
  }
263404
263386
  }
263387
+ /**
263388
+ * 测试 API 错误(用于调试和验证错误处理机制)
263389
+ * @param errorCode 错误代码
263390
+ * @param errorMessage 错误信息
263391
+ */
263392
+ testApiError(errorCode = 500, errorMessage = "测试 API 错误") {
263393
+ console.log(`测试触发 API 错误: ${errorCode} - ${errorMessage}`);
263394
+ window.dispatchEvent(new CustomEvent("apiError", {
263395
+ detail: {
263396
+ code: errorCode,
263397
+ message: errorMessage,
263398
+ details: {
263399
+ url: "/test/api/error",
263400
+ method: "GET",
263401
+ test: true
263402
+ }
263403
+ }
263404
+ }));
263405
+ }
263406
+ /**
263407
+ * 测试 Token 过期错误(用于调试和验证错误处理机制)
263408
+ */
263409
+ testTokenExpired() {
263410
+ console.log("测试触发 Token 过期错误");
263411
+ window.dispatchEvent(new CustomEvent("tokenExpired", {
263412
+ detail: {
263413
+ reason: "测试 Token 过期"
263414
+ }
263415
+ }));
263416
+ }
263417
+ /**
263418
+ * 测试参数验证错误(用于调试和验证错误处理机制)
263419
+ * @param errorMessage 错误信息
263420
+ */
263421
+ testParamValidationError(errorMessage = "测试参数验证错误") {
263422
+ console.log(`测试触发参数验证错误: ${errorMessage}`);
263423
+ window.dispatchEvent(new CustomEvent("paramValidationError", {
263424
+ detail: {
263425
+ message: errorMessage,
263426
+ details: {
263427
+ param: "test_param",
263428
+ value: "invalid_value",
263429
+ test: true
263430
+ }
263431
+ }
263432
+ }));
263433
+ }
263405
263434
  }
263406
263435
  class GuestCallSdk {
263407
263436
  constructor(config2) {
263408
263437
  this.root = null;
263409
263438
  this.config = config2;
263410
263439
  useSdkStore.setState({ guestConfig: this.config });
263411
- localStorage.setItem("feiayo_callsdk_sign", this.config.sign);
263440
+ saveSign(this.config.sign);
263412
263441
  }
263413
263442
  /**
263414
263443
  * 初始化SDK
@@ -263429,28 +263458,8 @@ class GuestCallSdk {
263429
263458
  if (!this.root) {
263430
263459
  throw new Error("SDK not initialized");
263431
263460
  }
263432
- const { liveId, agentId } = this.config;
263433
263461
  this.root.render(
263434
- /* @__PURE__ */ jsxRuntimeExports.jsx(React$2.StrictMode, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { width: "100%" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(App$1, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(GlobalErrorBoundary, { children: [
263435
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "sdk-config-info", children: [
263436
- /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { children: "SDK配置信息" }),
263437
- /* @__PURE__ */ jsxRuntimeExports.jsxs("ul", { children: [
263438
- /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
263439
- "直播ID: ",
263440
- liveId
263441
- ] }),
263442
- /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
263443
- "商户ID: ",
263444
- agentId
263445
- ] }),
263446
- /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
263447
- "令牌: ",
263448
- this.config.sign
263449
- ] })
263450
- ] })
263451
- ] }),
263452
- /* @__PURE__ */ jsxRuntimeExports.jsx(Guest, {})
263453
- ] }) }) }) })
263462
+ /* @__PURE__ */ jsxRuntimeExports.jsx(React$2.StrictMode, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { width: "100%" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(App$1, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(GlobalErrorBoundary, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Guest, {}) }) }) }) })
263454
263463
  );
263455
263464
  }
263456
263465
  }