karin-plugin-kkk 2.33.0 → 2.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,13 @@
1
1
  /// <reference types="node" />
2
2
  import { A as RichTextDocument } from "./index-B2QgJ0_6.mjs";
3
- import { EventEmitter } from "node:events";
3
+ import { EventEmitter as EventEmitter$1 } from "node:events";
4
4
  import { AxiosRequestConfig, AxiosResponse } from "axios";
5
5
  import React$1 from "react";
6
- import { EventEmitter as EventEmitter$1 } from "events";
6
+ import { EventEmitter as EventEmitter$2 } from "events";
7
7
  import { Agent, ClientRequest, ClientRequestArgs, IncomingMessage, OutgoingHttpHeaders, Server } from "http";
8
+ import { Server as Server$1 } from "https";
8
9
  import { createConnection } from "net";
9
10
  import { SecureContextOptions } from "tls";
10
- import { Server as Server$1 } from "https";
11
11
  import { URL } from "url";
12
12
  import { ZlibOptions } from "zlib";
13
13
 
@@ -1564,7 +1564,7 @@ type BufferLike = string | Buffer | DataView | number | ArrayBufferView | Uint8A
1564
1564
  } | {
1565
1565
  [Symbol.toPrimitive](hint: string): string;
1566
1566
  }; // WebSocket socket.
1567
- declare class WebSocket extends EventEmitter$1 {
1567
+ declare class WebSocket extends EventEmitter$2 {
1568
1568
  /** The connection is not yet open. */
1569
1569
  static readonly CONNECTING: 0;
1570
1570
  /** The connection is open and ready to communicate. */
@@ -1810,7 +1810,9 @@ declare namespace WebSocket {
1810
1810
  }
1811
1811
  }
1812
1812
  //#endregion
1813
- //#region ../../node_modules/.pnpm/node-karin@1.15.5/node_modules/node-karin/dist/index.d.ts
1813
+ //#region ../../node_modules/.pnpm/node-karin@1.16.1/node_modules/node-karin/dist/index.d.ts
1814
+ //#endregion
1815
+ //#region src/types/adapter/info.d.ts
1814
1816
  /**
1815
1817
  * 适配器所属平台
1816
1818
  * - `qq`: QQ
@@ -1891,7 +1893,8 @@ interface AdapterInfo$1 {
1891
1893
  connectTime: number;
1892
1894
  /** 鉴权秘钥 */
1893
1895
  secret: string | null;
1894
- }
1896
+ } //#endregion
1897
+ //#region src/types/event/account.d.ts
1895
1898
  /**
1896
1899
  * 适配器账号信息
1897
1900
  */
@@ -1,10 +1,10 @@
1
1
  import { i as __toESM, n as __exportAll, r as __require, t as __commonJSMin } from "./rolldown-runtime.js";
2
2
  import minpath from "node:path";
3
3
  import { URL as URL$1, fileURLToPath as urlToPath } from "node:url";
4
- import os from "node:os";
5
4
  import { EventEmitter } from "node:events";
6
5
  import { createHash, randomBytes } from "node:crypto";
7
6
  import minproc, { default as process$1 } from "node:process";
7
+ import os from "node:os";
8
8
  import tty from "node:tty";
9
9
  import http from "node:http";
10
10
  import https from "node:https";
@@ -43105,7 +43105,7 @@ function $2b2d34ff061957fb$export$2b85b721e524d74b(doc) {
43105
43105
  return nonce;
43106
43106
  }
43107
43107
  //#endregion
43108
- //#region ../../node_modules/.pnpm/@heroui+react@3.1.0_@react-spectrum+provider@3.11.0_react-dom@19.2.7_react@19.2.7__react@19.2_wx2jm66w7xiqhkjmghxsoqlyxu/node_modules/@heroui/react/dist/utils/dom.js
43108
+ //#region ../../node_modules/.pnpm/@heroui+react@3.1.0_@react-spectrum+provider@3.11.0_react-dom@19.2.7_react@19.2.7__react@19.2_2oq7vk4eeujbapsv6zzh3x4rhy/node_modules/@heroui/react/dist/utils/dom.js
43109
43109
  var import_react_dom = /* @__PURE__ */ __toESM(require_react_dom(), 1);
43110
43110
  var import_jsx_runtime = require_jsx_runtime();
43111
43111
  function DOMElement(ElementType, props, forwardedRef) {
@@ -48267,7 +48267,7 @@ function $7705c033048f6da7$var$useDisableInteractions(props, isPending) {
48267
48267
  return props;
48268
48268
  }
48269
48269
  //#endregion
48270
- //#region ../../node_modules/.pnpm/@heroui+react@3.1.0_@react-spectrum+provider@3.11.0_react-dom@19.2.7_react@19.2.7__react@19.2_wx2jm66w7xiqhkjmghxsoqlyxu/node_modules/@heroui/react/dist/utils/compose.js
48270
+ //#region ../../node_modules/.pnpm/@heroui+react@3.1.0_@react-spectrum+provider@3.11.0_react-dom@19.2.7_react@19.2.7__react@19.2_2oq7vk4eeujbapsv6zzh3x4rhy/node_modules/@heroui/react/dist/utils/compose.js
48271
48271
  function composeTwRenderProps(className, tailwind) {
48272
48272
  return $7230ffa83bc0c2cf$export$c245e6201fed2f75(className, (className, renderProps) => {
48273
48273
  return cx(typeof tailwind === "function" ? tailwind(renderProps) ?? "" : tailwind ?? "", className ?? "") ?? "";
@@ -48280,11 +48280,11 @@ var composeSlotClassName = (slotFn, className, variants) => {
48280
48280
  }) : className;
48281
48281
  };
48282
48282
  //#endregion
48283
- //#region ../../node_modules/.pnpm/@heroui+react@3.1.0_@react-spectrum+provider@3.11.0_react-dom@19.2.7_react@19.2.7__react@19.2_wx2jm66w7xiqhkjmghxsoqlyxu/node_modules/@heroui/react/dist/components/button-group/button-group.js
48283
+ //#region ../../node_modules/.pnpm/@heroui+react@3.1.0_@react-spectrum+provider@3.11.0_react-dom@19.2.7_react@19.2.7__react@19.2_2oq7vk4eeujbapsv6zzh3x4rhy/node_modules/@heroui/react/dist/components/button-group/button-group.js
48284
48284
  var ButtonGroupContext = /*#__PURE__*/ (0, import_react.createContext)({});
48285
48285
  var BUTTON_GROUP_CHILD = "__button_group_child";
48286
48286
  //#endregion
48287
- //#region ../../node_modules/.pnpm/@heroui+react@3.1.0_@react-spectrum+provider@3.11.0_react-dom@19.2.7_react@19.2.7__react@19.2_wx2jm66w7xiqhkjmghxsoqlyxu/node_modules/@heroui/react/dist/components/button/button.js
48287
+ //#region ../../node_modules/.pnpm/@heroui+react@3.1.0_@react-spectrum+provider@3.11.0_react-dom@19.2.7_react@19.2.7__react@19.2_2oq7vk4eeujbapsv6zzh3x4rhy/node_modules/@heroui/react/dist/components/button/button.js
48288
48288
  var ButtonRoot = ({ children, className, fullWidth, isDisabled, isIconOnly, size, slot, style, variant, [BUTTON_GROUP_CHILD]: isButtonGroupChild, ...rest }) => {
48289
48289
  const buttonGroupContext = (0, import_react.useContext)(ButtonGroupContext);
48290
48290
  const shouldUseContext = isButtonGroupChild === true;
@@ -48307,10 +48307,10 @@ var ButtonRoot = ({ children, className, fullWidth, isDisabled, isIconOnly, size
48307
48307
  });
48308
48308
  };
48309
48309
  //#endregion
48310
- //#region ../../node_modules/.pnpm/@heroui+react@3.1.0_@react-spectrum+provider@3.11.0_react-dom@19.2.7_react@19.2.7__react@19.2_wx2jm66w7xiqhkjmghxsoqlyxu/node_modules/@heroui/react/dist/components/button/index.js
48310
+ //#region ../../node_modules/.pnpm/@heroui+react@3.1.0_@react-spectrum+provider@3.11.0_react-dom@19.2.7_react@19.2.7__react@19.2_2oq7vk4eeujbapsv6zzh3x4rhy/node_modules/@heroui/react/dist/components/button/index.js
48311
48311
  var Button = Object.assign(ButtonRoot, { Root: ButtonRoot });
48312
48312
  //#endregion
48313
- //#region ../../node_modules/.pnpm/@heroui+react@3.1.0_@react-spectrum+provider@3.11.0_react-dom@19.2.7_react@19.2.7__react@19.2_wx2jm66w7xiqhkjmghxsoqlyxu/node_modules/@heroui/react/dist/components/chip/chip.js
48313
+ //#region ../../node_modules/.pnpm/@heroui+react@3.1.0_@react-spectrum+provider@3.11.0_react-dom@19.2.7_react@19.2.7__react@19.2_2oq7vk4eeujbapsv6zzh3x4rhy/node_modules/@heroui/react/dist/components/chip/chip.js
48314
48314
  var ChipContext = /*#__PURE__*/ (0, import_react.createContext)({});
48315
48315
  var ChipRoot = ({ children, className, color, size, variant, ...props }) => {
48316
48316
  const slots = import_react.useMemo(() => chipVariants({
@@ -48346,7 +48346,7 @@ var ChipLabel = ({ children, className, ...props }) => {
48346
48346
  });
48347
48347
  };
48348
48348
  //#endregion
48349
- //#region ../../node_modules/.pnpm/@heroui+react@3.1.0_@react-spectrum+provider@3.11.0_react-dom@19.2.7_react@19.2.7__react@19.2_wx2jm66w7xiqhkjmghxsoqlyxu/node_modules/@heroui/react/dist/components/chip/index.js
48349
+ //#region ../../node_modules/.pnpm/@heroui+react@3.1.0_@react-spectrum+provider@3.11.0_react-dom@19.2.7_react@19.2.7__react@19.2_2oq7vk4eeujbapsv6zzh3x4rhy/node_modules/@heroui/react/dist/components/chip/index.js
48350
48350
  var Chip = Object.assign(ChipRoot, {
48351
48351
  Root: ChipRoot,
48352
48352
  Label: ChipLabel
@@ -78278,7 +78278,7 @@ function isUint8Array(value) {
78278
78278
  return Boolean(value && typeof value === "object" && "byteLength" in value && "byteOffset" in value);
78279
78279
  }
78280
78280
  //#endregion
78281
- //#region ../../node_modules/.pnpm/react-markdown@10.1.0_@types+react@19.2.16_react@19.2.7/node_modules/react-markdown/lib/index.js
78281
+ //#region ../../node_modules/.pnpm/react-markdown@10.1.0_@types+react@19.2.17_react@19.2.7/node_modules/react-markdown/lib/index.js
78282
78282
  /**
78283
78283
  * @import {Element, Nodes, Parents, Root} from 'hast'
78284
78284
  * @import {Root as MdastRoot} from 'mdast'
@@ -119347,7 +119347,7 @@ var require_lib = /* @__PURE__ */ __commonJSMin(((exports, module) => {
119347
119347
  })();
119348
119348
  }));
119349
119349
  //#endregion
119350
- //#region ../../node_modules/.pnpm/httpxy@0.5.1/node_modules/httpxy/dist/index.mjs
119350
+ //#region ../../node_modules/.pnpm/httpxy@0.5.3/node_modules/httpxy/dist/index.mjs
119351
119351
  var upgradeHeader = /(^|,)\s*upgrade\s*($|,)/i;
119352
119352
  var defaultAgents = {
119353
119353
  http: new http.Agent({
@@ -119385,6 +119385,10 @@ function setupOutgoing(outgoing, options, req, forward) {
119385
119385
  const value = options[forward || "target"][e];
119386
119386
  if (value !== void 0) outgoing[e] = value;
119387
119387
  }
119388
+ if (outgoing.host === void 0 && typeof outgoing.hostname === "string") {
119389
+ const bracketedHost = outgoing.hostname.includes(":") && !outgoing.hostname.startsWith("[") ? `[${outgoing.hostname}]` : outgoing.hostname;
119390
+ outgoing.host = outgoing.port ? `${bracketedHost}:${outgoing.port}` : bracketedHost;
119391
+ }
119388
119392
  outgoing.method = options.method || req.method;
119389
119393
  outgoing.headers = { ...req.headers };
119390
119394
  if (req.headers?.[":authority"]) outgoing.headers.host = req.headers[":authority"];
@@ -119883,15 +119887,15 @@ function _createProxyFn(type, server) {
119883
119887
  for (const pass of server._getPasses(type)) {
119884
119888
  let stop;
119885
119889
  try {
119886
- stop = pass(req, res, requestOptions, server, head, (error) => {
119890
+ stop = pass(req, res, requestOptions, server, head, (error, _req, _res, url) => {
119887
119891
  if (server.listenerCount("error") > 0) {
119888
- server.emit("error", error, req, res);
119892
+ server.emit("error", error, req, res, url);
119889
119893
  _resolve();
119890
119894
  } else _reject(error);
119891
119895
  });
119892
119896
  } catch (error) {
119893
119897
  if (server.listenerCount("error") > 0) {
119894
- server.emit("error", error, req, res);
119898
+ server.emit("error", error, req, res, requestOptions.target || requestOptions.forward);
119895
119899
  _resolve();
119896
119900
  } else _reject(error);
119897
119901
  break;
@@ -119905,7 +119909,7 @@ function _createProxyFn(type, server) {
119905
119909
  };
119906
119910
  }
119907
119911
  //#endregion
119908
- //#region ../../node_modules/.pnpm/http-proxy-middleware@4.0.0/node_modules/http-proxy-middleware/dist/errors.js
119912
+ //#region ../../node_modules/.pnpm/http-proxy-middleware@4.1.0/node_modules/http-proxy-middleware/dist/errors.js
119909
119913
  var ERRORS;
119910
119914
  (function(ERRORS) {
119911
119915
  ERRORS["ERR_CONFIG_FACTORY_TARGET_MISSING"] = "[HPM] Missing \"target\" option. Example: {target: \"http://www.example.org\"}";
@@ -119914,7 +119918,7 @@ var ERRORS;
119914
119918
  ERRORS["ERR_PATH_REWRITER_CONFIG"] = "[HPM] Invalid pathRewrite config. Expecting object with pathRewrite config or a rewrite function";
119915
119919
  })(ERRORS || (ERRORS = {}));
119916
119920
  //#endregion
119917
- //#region ../../node_modules/.pnpm/http-proxy-middleware@4.0.0/node_modules/http-proxy-middleware/dist/configuration.js
119921
+ //#region ../../node_modules/.pnpm/http-proxy-middleware@4.1.0/node_modules/http-proxy-middleware/dist/configuration.js
119918
119922
  function verifyConfig(options) {
119919
119923
  if (!options.target && !options.router) throw new Error(ERRORS.ERR_CONFIG_FACTORY_TARGET_MISSING);
119920
119924
  }
@@ -120435,20 +120439,47 @@ var require_browser = /* @__PURE__ */ __commonJSMin(((exports, module) => {
120435
120439
  };
120436
120440
  }));
120437
120441
  //#endregion
120438
- //#region ../../node_modules/.pnpm/http-proxy-middleware@4.0.0/node_modules/http-proxy-middleware/dist/debug.js
120442
+ //#region ../../node_modules/.pnpm/http-proxy-middleware@4.1.0/node_modules/http-proxy-middleware/dist/debug.js
120439
120443
  var import_browser = /* @__PURE__ */ __toESM(require_browser(), 1);
120440
120444
  /**
120441
120445
  * Debug instance with the given namespace: http-proxy-middleware
120442
120446
  */
120443
120447
  var Debug = (0, import_browser.default)("http-proxy-middleware");
120444
120448
  //#endregion
120445
- //#region ../../node_modules/.pnpm/http-proxy-middleware@4.0.0/node_modules/http-proxy-middleware/dist/plugins/default/debug-proxy-errors-plugin.js
120449
+ //#region ../../node_modules/.pnpm/http-proxy-middleware@4.1.0/node_modules/http-proxy-middleware/dist/plugins/define-plugin.js
120450
+ /**
120451
+ * Helper function to define a http-proxy-middleware plugin
120452
+ * @see proxyServer {@link ProxyServer} - proxy server instance to which the plugin is being applied
120453
+ * @see options {@link Options} - options object passed to `createProxyMiddleware`
120454
+ *
120455
+ * @example defining a plugin
120456
+ * ```js
120457
+ * export const myPlugin = definePlugin((proxyServer, options) => {
120458
+ * // plugin implementation
120459
+ * });
120460
+ * ```
120461
+ *
120462
+ * @example using a plugin
120463
+ * ```js
120464
+ * createProxyMiddleware({
120465
+ * target: 'http://example.com',
120466
+ * plugins: [myPlugin],
120467
+ * });
120468
+ * ```
120469
+ *
120470
+ * @since 4.1.0
120471
+ */
120472
+ function definePlugin(fn) {
120473
+ return fn;
120474
+ }
120475
+ //#endregion
120476
+ //#region ../../node_modules/.pnpm/http-proxy-middleware@4.1.0/node_modules/http-proxy-middleware/dist/plugins/default/debug-proxy-errors-plugin.js
120446
120477
  var debug$5 = Debug.extend("debug-proxy-errors-plugin");
120447
120478
  /**
120448
120479
  * Subscribe to {@link https://github.com/unjs/httpxy#events `httpxy` error events} to prevent server from crashing.
120449
120480
  * Errors are logged with {@link https://www.npmjs.com/package/debug debug} library.
120450
120481
  */
120451
- var debugProxyErrorsPlugin = (proxyServer) => {
120482
+ var debugProxyErrorsPlugin = definePlugin((proxyServer, options) => {
120452
120483
  /**
120453
120484
  * The old `http-proxy` doesn't handle any errors by default (https://github.com/http-party/node-http-proxy#listening-for-proxy-events)
120454
120485
  * > We do not do any error handling of messages passed between client and proxy, and messages passed between proxy and target, so it is recommended that you listen on errors and handle them.
@@ -120498,9 +120529,9 @@ var debugProxyErrorsPlugin = (proxyServer) => {
120498
120529
  proxyServer.on("econnreset", (error, req, res, target) => {
120499
120530
  debug$5(`httpxy econnreset event: \n%O`, error);
120500
120531
  });
120501
- };
120532
+ });
120502
120533
  //#endregion
120503
- //#region ../../node_modules/.pnpm/http-proxy-middleware@4.0.0/node_modules/http-proxy-middleware/dist/status-code.js
120534
+ //#region ../../node_modules/.pnpm/http-proxy-middleware@4.1.0/node_modules/http-proxy-middleware/dist/status-code.js
120504
120535
  function getStatusCode(errorCode) {
120505
120536
  let statusCode;
120506
120537
  if (/HPE_INVALID/.test(errorCode)) statusCode = 502;
@@ -120518,19 +120549,19 @@ function getStatusCode(errorCode) {
120518
120549
  return statusCode;
120519
120550
  }
120520
120551
  //#endregion
120521
- //#region ../../node_modules/.pnpm/http-proxy-middleware@4.0.0/node_modules/http-proxy-middleware/dist/utils/sanitize.js
120552
+ //#region ../../node_modules/.pnpm/http-proxy-middleware@4.1.0/node_modules/http-proxy-middleware/dist/utils/sanitize.js
120522
120553
  function sanitize(input) {
120523
120554
  return input?.replace(/[<>]/g, (i) => encodeURIComponent(i)) ?? "";
120524
120555
  }
120525
120556
  //#endregion
120526
- //#region ../../node_modules/.pnpm/http-proxy-middleware@4.0.0/node_modules/http-proxy-middleware/dist/plugins/default/error-response-plugin.js
120557
+ //#region ../../node_modules/.pnpm/http-proxy-middleware@4.1.0/node_modules/http-proxy-middleware/dist/plugins/default/error-response-plugin.js
120527
120558
  function isResponseLike(obj) {
120528
120559
  return obj && typeof obj.writeHead === "function";
120529
120560
  }
120530
120561
  function isSocketLike(obj) {
120531
120562
  return obj && typeof obj.write === "function" && !("writeHead" in obj);
120532
120563
  }
120533
- var errorResponsePlugin = (proxyServer, options) => {
120564
+ var errorResponsePlugin = definePlugin((proxyServer, options) => {
120534
120565
  proxyServer.on("error", (err, req, res, target) => {
120535
120566
  if (!req || !res) throw err;
120536
120567
  if (isResponseLike(res)) {
@@ -120542,9 +120573,9 @@ var errorResponsePlugin = (proxyServer, options) => {
120542
120573
  res.end(`Error occurred while trying to proxy: ${sanitize(host)}${sanitize(req.url)}`);
120543
120574
  } else if (isSocketLike(res)) res.destroy();
120544
120575
  });
120545
- };
120576
+ });
120546
120577
  //#endregion
120547
- //#region ../../node_modules/.pnpm/http-proxy-middleware@4.0.0/node_modules/http-proxy-middleware/dist/logger.js
120578
+ //#region ../../node_modules/.pnpm/http-proxy-middleware@4.1.0/node_modules/http-proxy-middleware/dist/logger.js
120548
120579
  /**
120549
120580
  * Compatibility matrix
120550
120581
  *
@@ -120567,7 +120598,7 @@ function getLogger(options) {
120567
120598
  return options.logger || noopLogger;
120568
120599
  }
120569
120600
  //#endregion
120570
- //#region ../../node_modules/.pnpm/http-proxy-middleware@4.0.0/node_modules/http-proxy-middleware/dist/utils/create-url.js
120601
+ //#region ../../node_modules/.pnpm/http-proxy-middleware@4.1.0/node_modules/http-proxy-middleware/dist/utils/create-url.js
120571
120602
  function createUrl({ protocol, host, port, path }) {
120572
120603
  const ipv6Host = host?.includes(":") ? `[${host}]` : host;
120573
120604
  const url = new URL$3(`${protocol || "undefined:"}//${ipv6Host || "[::]"}`);
@@ -120576,7 +120607,7 @@ function createUrl({ protocol, host, port, path }) {
120576
120607
  return url;
120577
120608
  }
120578
120609
  //#endregion
120579
- //#region ../../node_modules/.pnpm/http-proxy-middleware@4.0.0/node_modules/http-proxy-middleware/dist/utils/logger-plugin.js
120610
+ //#region ../../node_modules/.pnpm/http-proxy-middleware@4.1.0/node_modules/http-proxy-middleware/dist/utils/logger-plugin.js
120580
120611
  /**
120581
120612
  * Get port from target
120582
120613
  * Using proxyRes.req.agent.sockets to determine the target port
@@ -120585,8 +120616,8 @@ function getPort(sockets) {
120585
120616
  return Object.keys(sockets || {})?.[0]?.split(":")[1];
120586
120617
  }
120587
120618
  //#endregion
120588
- //#region ../../node_modules/.pnpm/http-proxy-middleware@4.0.0/node_modules/http-proxy-middleware/dist/plugins/default/logger-plugin.js
120589
- var loggerPlugin = (proxyServer, options) => {
120619
+ //#region ../../node_modules/.pnpm/http-proxy-middleware@4.1.0/node_modules/http-proxy-middleware/dist/plugins/default/logger-plugin.js
120620
+ var loggerPlugin = definePlugin((proxyServer, options) => {
120590
120621
  const logger = getLogger(options);
120591
120622
  proxyServer.on("error", (err, req, res, target) => {
120592
120623
  const requestHref = `${req?.headers?.host}${req?.url}`;
@@ -120633,14 +120664,14 @@ var loggerPlugin = (proxyServer, options) => {
120633
120664
  proxyServer.on("close", (req, proxySocket, proxyHead) => {
120634
120665
  logger.info("[HPM] Client disconnected: %o", proxySocket.address());
120635
120666
  });
120636
- };
120667
+ });
120637
120668
  //#endregion
120638
- //#region ../../node_modules/.pnpm/http-proxy-middleware@4.0.0/node_modules/http-proxy-middleware/dist/utils/function.js
120669
+ //#region ../../node_modules/.pnpm/http-proxy-middleware@4.1.0/node_modules/http-proxy-middleware/dist/utils/function.js
120639
120670
  function getFunctionName(fn) {
120640
120671
  return fn.name || "[anonymous Function]";
120641
120672
  }
120642
120673
  //#endregion
120643
- //#region ../../node_modules/.pnpm/http-proxy-middleware@4.0.0/node_modules/http-proxy-middleware/dist/plugins/default/proxy-events.js
120674
+ //#region ../../node_modules/.pnpm/http-proxy-middleware@4.1.0/node_modules/http-proxy-middleware/dist/plugins/default/proxy-events.js
120644
120675
  var debug$4 = Debug.extend("proxy-events-plugin");
120645
120676
  /**
120646
120677
  * Implements option.on object to subscribe to `httpxy` events.
@@ -120662,7 +120693,7 @@ var debug$4 = Debug.extend("proxy-events-plugin");
120662
120693
  * });
120663
120694
  * ```
120664
120695
  */
120665
- var proxyEventsPlugin = (proxyServer, options) => {
120696
+ var proxyEventsPlugin = definePlugin((proxyServer, options) => {
120666
120697
  if (!options.on) return;
120667
120698
  let eventName;
120668
120699
  for (eventName in options.on) if (Object.prototype.hasOwnProperty.call(options.on, eventName)) {
@@ -120671,9 +120702,9 @@ var proxyEventsPlugin = (proxyServer, options) => {
120671
120702
  debug$4(`register event handler: "${eventName}" -> "${getFunctionName(handler)}"`);
120672
120703
  proxyServer.on(eventName, handler);
120673
120704
  }
120674
- };
120705
+ });
120675
120706
  //#endregion
120676
- //#region ../../node_modules/.pnpm/http-proxy-middleware@4.0.0/node_modules/http-proxy-middleware/dist/get-plugins.js
120707
+ //#region ../../node_modules/.pnpm/http-proxy-middleware@4.1.0/node_modules/http-proxy-middleware/dist/get-plugins.js
120677
120708
  function getPlugins(options) {
120678
120709
  const maybeErrorResponsePlugin = options.on?.error ? [] : [errorResponsePlugin];
120679
120710
  const defaultPlugins = options.ejectPlugins ? [] : [
@@ -124129,7 +124160,7 @@ var require_micromatch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
124129
124160
  module.exports = micromatch;
124130
124161
  }));
124131
124162
  //#endregion
124132
- //#region ../../node_modules/.pnpm/http-proxy-middleware@4.0.0/node_modules/http-proxy-middleware/dist/path-filter.js
124163
+ //#region ../../node_modules/.pnpm/http-proxy-middleware@4.1.0/node_modules/http-proxy-middleware/dist/path-filter.js
124133
124164
  var import_is_glob = /* @__PURE__ */ __toESM(require_is_glob(), 1);
124134
124165
  var import_micromatch = /* @__PURE__ */ __toESM(require_micromatch(), 1);
124135
124166
  function matchPathFilter(pathFilter = "/", uri, req) {
@@ -124140,7 +124171,10 @@ function matchPathFilter(pathFilter = "/", uri, req) {
124140
124171
  if (pathFilter.every(isGlobPath)) return matchMultiGlobPath(pathFilter, uri);
124141
124172
  throw new Error(ERRORS.ERR_CONTEXT_MATCHER_INVALID_ARRAY);
124142
124173
  }
124143
- if (typeof pathFilter === "function") return pathFilter(getUrlPathName(uri), req);
124174
+ if (typeof pathFilter === "function") {
124175
+ const pathname = getUrlPathName(uri);
124176
+ return Boolean(pathFilter(pathname, req));
124177
+ }
124144
124178
  throw new Error(ERRORS.ERR_CONTEXT_MATCHER_GENERIC);
124145
124179
  }
124146
124180
  /**
@@ -124187,7 +124221,7 @@ function isGlobPath(pathFilter) {
124187
124221
  return (0, import_is_glob.default)(pathFilter);
124188
124222
  }
124189
124223
  //#endregion
124190
- //#region ../../node_modules/.pnpm/http-proxy-middleware@4.0.0/node_modules/http-proxy-middleware/dist/path-rewriter.js
124224
+ //#region ../../node_modules/.pnpm/http-proxy-middleware@4.1.0/node_modules/http-proxy-middleware/dist/path-rewriter.js
124191
124225
  var debug$3 = Debug.extend("path-rewriter");
124192
124226
  /**
124193
124227
  * Create rewrite function, to cache parsed rewrite rules.
@@ -124228,21 +124262,28 @@ function parsePathRewriteRules(rewriteConfig) {
124228
124262
  return rules;
124229
124263
  }
124230
124264
  //#endregion
124231
- //#region ../../node_modules/.pnpm/http-proxy-middleware@4.0.0/node_modules/http-proxy-middleware/dist/router.js
124265
+ //#region ../../node_modules/.pnpm/http-proxy-middleware@4.1.0/node_modules/http-proxy-middleware/dist/router.js
124232
124266
  var debug$2 = Debug.extend("router");
124233
- async function getTarget(req, config) {
124267
+ async function getTarget(req, res, config) {
124234
124268
  let newTarget;
124235
124269
  const router = config.router;
124236
124270
  if (isPlainObject$5(router)) newTarget = getTargetFromProxyTable(req, router);
124237
- else if (typeof router === "function") newTarget = await router(req);
124271
+ else if (typeof router === "function") newTarget = await router(req, res, config);
124238
124272
  return newTarget;
124239
124273
  }
124240
124274
  function getTargetFromProxyTable(req, table) {
124241
124275
  let result;
124242
124276
  const host = req.headers.host ?? "";
124243
- const hostAndPath = host + (req.url ?? "");
124277
+ const path = req.url ?? "";
124244
124278
  for (const [key, value] of Object.entries(table)) if (containsPath(key)) {
124245
- if (hostAndPath.indexOf(key) > -1) {
124279
+ if (isHostAndPathKey(key)) {
124280
+ const [keyHost, keyPath] = splitHostAndPathKey(key);
124281
+ if (host === keyHost && path.startsWith(keyPath)) {
124282
+ result = value;
124283
+ debug$2("match: \"%s\" -> \"%s\"", key, result);
124284
+ break;
124285
+ }
124286
+ } else if (path.startsWith(key)) {
124246
124287
  result = value;
124247
124288
  debug$2("match: \"%s\" -> \"%s\"", key, result);
124248
124289
  break;
@@ -124257,8 +124298,15 @@ function getTargetFromProxyTable(req, table) {
124257
124298
  function containsPath(v) {
124258
124299
  return v.indexOf("/") > -1;
124259
124300
  }
124301
+ function isHostAndPathKey(v) {
124302
+ return containsPath(v) && !v.startsWith("/");
124303
+ }
124304
+ function splitHostAndPathKey(v) {
124305
+ const firstSlash = v.indexOf("/");
124306
+ return [v.slice(0, firstSlash), v.slice(firstSlash)];
124307
+ }
124260
124308
  //#endregion
124261
- //#region ../../node_modules/.pnpm/http-proxy-middleware@4.0.0/node_modules/http-proxy-middleware/dist/utils/ipv6.js
124309
+ //#region ../../node_modules/.pnpm/http-proxy-middleware@4.1.0/node_modules/http-proxy-middleware/dist/utils/ipv6.js
124262
124310
  var debug$1 = Debug.extend("ipv6");
124263
124311
  /**
124264
124312
  * Normalize bracketed IPv6 URL targets into unbracketed host options.
@@ -124284,9 +124332,11 @@ function normalizeIPv6LiteralTargets(options) {
124284
124332
  function normalizeIPv6ProxyTarget(target, optionName) {
124285
124333
  const targetUrl = toTargetUrl(target);
124286
124334
  if (targetUrl && isBracketedIPv6Hostname(targetUrl.hostname)) {
124335
+ const normalizedHostname = normalizeIPv6DestinationHostname(stripBrackets(targetUrl.hostname));
124287
124336
  debug$1("normalized IPv6 \"%s\" %s", optionName, target);
124288
124337
  return {
124289
- hostname: stripBrackets(targetUrl.hostname),
124338
+ hostname: normalizedHostname,
124339
+ auth: targetUrl.username || targetUrl.password ? `${targetUrl.username}:${targetUrl.password}` : void 0,
124290
124340
  pathname: targetUrl.pathname,
124291
124341
  port: targetUrl.port,
124292
124342
  protocol: targetUrl.protocol,
@@ -124305,11 +124355,18 @@ function isBracketedIPv6Hostname(hostname) {
124305
124355
  function stripBrackets(hostname) {
124306
124356
  return hostname.replace(/^\[|\]$/g, "");
124307
124357
  }
124358
+ function normalizeIPv6DestinationHostname(hostname) {
124359
+ if (hostname === "::") {
124360
+ debug$1("normalizing hostname unspecified IPv6 address (::) to loopback (::1)");
124361
+ return "::1";
124362
+ }
124363
+ return hostname;
124364
+ }
124308
124365
  //#endregion
124309
- //#region ../../node_modules/.pnpm/http-proxy-middleware@4.0.0/node_modules/http-proxy-middleware/dist/http-proxy-middleware.js
124366
+ //#region ../../node_modules/.pnpm/http-proxy-middleware@4.1.0/node_modules/http-proxy-middleware/dist/http-proxy-middleware.js
124310
124367
  var HttpProxyMiddleware = class {
124311
- wsInternalSubscribed = false;
124312
- serverOnCloseSubscribed = false;
124368
+ wsInternalSubscribedServers = /* @__PURE__ */ new WeakSet();
124369
+ activeServers = /* @__PURE__ */ new Set();
124313
124370
  proxyOptions;
124314
124371
  proxy;
124315
124372
  pathRewriter;
@@ -124323,14 +124380,18 @@ var HttpProxyMiddleware = class {
124323
124380
  this.registerPlugins(this.proxy, this.proxyOptions);
124324
124381
  this.pathRewriter = createPathRewriter(this.proxyOptions.pathRewrite);
124325
124382
  this.middleware.upgrade = (req, socket, head) => {
124326
- if (!this.wsInternalSubscribed) this.handleUpgrade(req, socket, head);
124383
+ const server = this.#getServer(req);
124384
+ if (server && !this.wsInternalSubscribedServers.has(server)) this.handleUpgrade(req, socket, head);
124327
124385
  };
124328
124386
  }
124387
+ #getServer(req) {
124388
+ return req.socket?.server;
124389
+ }
124329
124390
  middleware = (async (req, res, next) => {
124330
124391
  if (this.shouldProxy(this.proxyOptions.pathFilter, req)) {
124331
124392
  let activeProxyOptions;
124332
124393
  try {
124333
- activeProxyOptions = await this.prepareProxyRequest(req);
124394
+ activeProxyOptions = await this.prepareProxyRequest(req, res);
124334
124395
  if (!activeProxyOptions.target && !activeProxyOptions.forward) throw new Error("Must provide a proper URL as target");
124335
124396
  } catch (err) {
124336
124397
  next?.(err);
@@ -124348,15 +124409,21 @@ var HttpProxyMiddleware = class {
124348
124409
  * Get the server object to subscribe to server events;
124349
124410
  * 'upgrade' for websocket and 'close' for graceful shutdown
124350
124411
  */
124351
- const server = req.socket?.server;
124352
- if (server && !this.serverOnCloseSubscribed) {
124412
+ const server = this.#getServer(req);
124413
+ if (server && !this.activeServers.has(server)) {
124414
+ Debug("registering server close listener");
124415
+ this.activeServers.add(server);
124353
124416
  server.on("close", () => {
124354
- Debug("server close signal received: closing proxy server");
124355
- this.proxy.close(() => {
124356
- Debug("proxy server closed");
124357
- });
124417
+ Debug("server close signal received.");
124418
+ this.activeServers.delete(server);
124419
+ if (this.activeServers.size > 0) {
124420
+ Debug(`proxy server not closed: ${this.activeServers.size} server(s) still active`);
124421
+ return;
124422
+ } else {
124423
+ Debug("closing proxy server");
124424
+ this.proxy.close(() => Debug("proxy server closed"));
124425
+ }
124358
124426
  });
124359
- this.serverOnCloseSubscribed = true;
124360
124427
  }
124361
124428
  if (this.proxyOptions.ws === true && server) this.catchUpgradeRequest(server);
124362
124429
  });
@@ -124367,18 +124434,17 @@ var HttpProxyMiddleware = class {
124367
124434
  });
124368
124435
  }
124369
124436
  catchUpgradeRequest = (server) => {
124370
- if (!this.wsInternalSubscribed) {
124437
+ if (!this.wsInternalSubscribedServers.has(server)) {
124371
124438
  Debug("subscribing to server upgrade event");
124372
124439
  server.on("upgrade", this.handleUpgrade);
124373
- this.wsInternalSubscribed = true;
124440
+ this.wsInternalSubscribedServers.add(server);
124374
124441
  }
124375
124442
  };
124376
124443
  handleUpgrade = async (req, socket, head) => {
124377
124444
  try {
124378
124445
  if (this.shouldProxy(this.proxyOptions.pathFilter, req)) {
124379
- const proxiedReq = req;
124380
- const activeProxyOptions = await this.prepareProxyRequest(proxiedReq);
124381
- await this.proxy.ws(proxiedReq, socket, activeProxyOptions, head);
124446
+ const activeProxyOptions = await this.prepareProxyRequest(req, void 0);
124447
+ await this.proxy.ws(req, socket, activeProxyOptions, head);
124382
124448
  Debug("server upgrade event received. Proxying WebSocket");
124383
124449
  }
124384
124450
  } catch (err) {
@@ -124405,26 +124471,26 @@ var HttpProxyMiddleware = class {
124405
124471
  * @param {Object} req
124406
124472
  * @return {Object} proxy options
124407
124473
  */
124408
- prepareProxyRequest = async (req) => {
124474
+ prepareProxyRequest = async (req, res) => {
124409
124475
  const newProxyOptions = Object.assign({}, this.proxyOptions);
124410
- await this.applyRouter(req, newProxyOptions);
124476
+ await this.applyRouter(req, res, newProxyOptions);
124411
124477
  normalizeIPv6LiteralTargets(newProxyOptions);
124412
- await this.applyPathRewrite(req, this.pathRewriter);
124478
+ await this.applyPathRewrite(req, res, this.pathRewriter, newProxyOptions);
124413
124479
  return newProxyOptions;
124414
124480
  };
124415
- applyRouter = async (req, options) => {
124481
+ applyRouter = async (req, res, options) => {
124416
124482
  let newTarget;
124417
124483
  if (options.router) {
124418
- newTarget = await getTarget(req, options);
124484
+ newTarget = await getTarget(req, res, options);
124419
124485
  if (newTarget) {
124420
124486
  Debug("router new target: \"%s\"", newTarget);
124421
124487
  options.target = newTarget;
124422
124488
  }
124423
124489
  }
124424
124490
  };
124425
- applyPathRewrite = async (req, pathRewriter) => {
124491
+ applyPathRewrite = async (req, res, pathRewriter, options) => {
124426
124492
  if (req.url && pathRewriter) {
124427
- const path = await pathRewriter(req.url, req);
124493
+ const path = await pathRewriter(req.url, req, res, options);
124428
124494
  if (typeof path === "string") {
124429
124495
  Debug("pathRewrite new path: %s", path);
124430
124496
  req.url = path;
@@ -124433,7 +124499,7 @@ var HttpProxyMiddleware = class {
124433
124499
  };
124434
124500
  };
124435
124501
  //#endregion
124436
- //#region ../../node_modules/.pnpm/http-proxy-middleware@4.0.0/node_modules/http-proxy-middleware/dist/factory.js
124502
+ //#region ../../node_modules/.pnpm/http-proxy-middleware@4.1.0/node_modules/http-proxy-middleware/dist/factory.js
124437
124503
  /**
124438
124504
  * Create proxy middleware for Express-like servers. ([list of servers with examples](https://github.com/chimurai/http-proxy-middleware/blob/master/recipes/servers.md))
124439
124505
  *
@@ -124515,7 +124581,7 @@ function createProxyMiddleware(options) {
124515
124581
  return middleware;
124516
124582
  }
124517
124583
  //#endregion
124518
- //#region ../../node_modules/.pnpm/http-proxy-middleware@4.0.0/node_modules/http-proxy-middleware/dist/handlers/response-interceptor.js
124584
+ //#region ../../node_modules/.pnpm/http-proxy-middleware@4.1.0/node_modules/http-proxy-middleware/dist/handlers/response-interceptor.js
124519
124585
  var debug = Debug.extend("response-interceptor");
124520
124586
  //#endregion
124521
124587
  export { SiGooglephotos as $, ArrowDownToLine as $n, RefreshCw as $t, RiHashtag as A, Download as An, Users as At, RiThumbUpFill as B, CircleFadingArrowUp as Bn, Square as Bt, AiFillHeart as C, Gift as Cn, format$1 as Ct, Markdown as D, Eye as Dn, X as Dt, AiOutlineVideoCamera as E, FilePlay as En, Zap as Et, RiMessage3Fill as F, Code as Fn, TriangleAlert as Ft, RiVideoLine as G, Check as Gn, Shield as Gt, RiTrophyFill as H, CircleCheck as Hn, Sparkles as Ht, RiPieChart2Fill as I, Clock as In, Trash2 as It, SiSamsung as J, Calendar as Jn, Settings2 as Jt, SiXiaomi as K, ChartColumn as Kn, ShieldCheck as Kt, RiShareForwardFill as L, Clock3 as Ln, Terminal as Lt, RiHeart3Line as M, Cpu as Mn, UsersRound as Mt, RiHeartLine as N, CornerDownLeft as Nn, UserPlus as Nt, RiArrowRightFill as O, EyeOff as On, WandSparkles as Ot, RiLiveLine as P, Copy as Pn, Upload as Pt, SiHonor as Q, BellRing as Qn, RotateCcw as Qt, RiStarFill as R, Clapperboard as Rn, Sun as Rt, BiImage as S, GitBranch as Sn, formatDistanceToNow as St, AiFillStar as T, FileText as Tn, twMerge as Tt, RiUserFollowLine as U, CircleCheckBig as Un, Smartphone as Ut, RiTiktokFill as V, CircleEllipsis as Vn, SquarePen as Vt, RiVerifiedBadgeFill as W, CircleAlert as Wn, ShoppingBag as Wt, SiOneplus as X, Bot as Xn, ScanLine as Xt, SiOppo as Y, Box as Yn, Search as Yt, SiHuawei as Z, Bookmark as Zn, Save as Zt, MdSchedule as _, LayoutTemplate as _n, t as _t, VictoryScatter as a, Play as an, require_react as ar, r$1 as at, FaTiktok as b, Heart as bn, parse$1 as bt, VictoryChart as c, Music as cn, Xhshow as cr, e as ct, VictoryTheme as d, MessageCircle as dn, n as dt, Radio as en, Chip as er, SiGithub as et, rehypeHighlight as f, Menu as fn, e$2 as ft, MdLocationOn as g, Link as gn, c$2 as gt, MdLightbulbOutline as h, LoaderCircle as hn, o$4 as ht, require_heic_decode as i, Plus as in, require_server_node as ir, o as it, RiHeart3Fill as j, Crown as jn, User as jt, RiGroupLine as k, ExternalLink as kn, Video as kt, VictoryAxis as l, Moon as ln, zod_default as lr, m as lt, MdInfoOutline as m, MapPin as mn, o$3 as mt, require_lib as n, QrCode as nn, clsx as nr, SiApple as nt, VictoryPie as o, Pencil as on, require_protobufjs as or, o$1 as ot, MdFitScreen as p, Maximize as pn, a$2 as pt, SiVivo as q, Camera as qn, Share2 as qt, require_jpeg_js as r, Puzzle as rn, require_jsx_runtime as rr, SiAnthropic as rt, VictoryLine as s, Palette as sn, Chalk as sr, o$2 as st, createProxyMiddleware as t, Quote as tn, Button as tr, SiBilibili as tt, VictoryLabel as u, Monitor as un, a$1 as ut, FaCommentDots as v, Info$1 as vn, r$2 as vt, AiFillPushpin as w, Gamepad2 as wn, differenceInSeconds as wt, FaUserGroup as x, Hash as xn, fromUnixTime as xt, FaMusic as y, Image as yn, zhCN as yt, RiStarLine as z, CircleQuestionMark as zn, Star as zt };
@@ -0,0 +1 @@
1
+ import{a as e,c as t,l as n,m as r,p as i,t as a,x as o}from"./index-CQhoJUBv.js";var s=e(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),c=e(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),l=e(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),u=e(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),d=e(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),f=e(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),p=e(`package`,[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]),m=e(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),h=e(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),g=`https://github.com/ikenxuan.png`,_=o(),v=({className:e})=>{let{isDark:t,toggleTheme:i}=a();return(0,_.jsxs)(n,{delay:1,closeDelay:1,children:[(0,_.jsx)(r,{isIconOnly:!0,"aria-label":t?`切换到浅色模式`:`切换到深色模式`,className:e,variant:`ghost`,onPress:i,children:t?(0,_.jsx)(h,{size:20,"aria-hidden":`true`}):(0,_.jsx)(f,{size:20,"aria-hidden":`true`})}),(0,_.jsx)(n.Content,{children:t?`浅色模式`:`深色模式`})]})},y=()=>{let e=e=>{window.open(e,`_blank`)};return(0,_.jsxs)(i,{className:`mx-auto max-w-3xl`,children:[(0,_.jsxs)(i.Header,{className:`items-center text-center gap-4 pt-8 pb-6`,children:[(0,_.jsx)(p,{size:64,"aria-hidden":`true`}),(0,_.jsx)(i.Title,{children:`karin-plugin-kkk`}),(0,_.jsx)(i.Description,{children:`版本 2.33.0`})]}),(0,_.jsxs)(i.Content,{className:`flex flex-col gap-6 pb-8`,children:[(0,_.jsxs)(`section`,{children:[(0,_.jsx)(`h3`,{className:`mb-3 text-base font-semibold`,children:`插件简介`}),(0,_.jsx)(t,{children:`Karin 的「抖音」「B站」视频解析/动态推送插件。 支持视频解析、动态推送、扫码登录等功能。`})]}),(0,_.jsxs)(`section`,{children:[(0,_.jsx)(`h3`,{className:`mb-3 text-base font-semibold`,children:`开发者`}),(0,_.jsx)(t,{children:`ikenxuan, sj817`})]}),(0,_.jsxs)(`section`,{children:[(0,_.jsx)(`h3`,{className:`mb-3 text-base font-semibold`,children:`相关链接`}),(0,_.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-3`,children:[(0,_.jsxs)(r,{variant:`outline`,onPress:()=>e(`https://github.com/ikenxuan/karin-plugin-kkk`),children:[(0,_.jsx)(c,{size:18,"aria-hidden":`true`}),(0,_.jsx)(`span`,{children:`GitHub 仓库`})]}),(0,_.jsxs)(r,{variant:`outline`,onPress:()=>e(`https://github.com/ikenxuan/karin-plugin-kkk/issues`),children:[(0,_.jsx)(c,{size:18,"aria-hidden":`true`}),(0,_.jsx)(`span`,{children:`反馈问题`})]})]})]})]})]})};export{p as a,l as c,m as i,s as l,v as n,d as o,g as r,u as s,y as t};
@@ -0,0 +1 @@
1
+ import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"./AboutPanel-DFjZYu60.js";import{C as l,S as u,_ as d,a as f,b as p,d as m,g as h,h as g,i as _,m as v,n as y,o as b,r as x,s as S,v as C,x as w,y as T}from"./index-CQhoJUBv.js";var E=p({base:`separator`,defaultVariants:{orientation:`horizontal`,variant:`default`},variants:{orientation:{horizontal:`separator--horizontal`,vertical:`separator--vertical`},variant:{default:`separator--default`,secondary:`separator--secondary`,tertiary:`separator--tertiary`}}}),D=w(),O=({className:e,orientation:t,variant:n,...r})=>{let i=C(d),a=t??i?.orientation??`horizontal`;return(0,D.jsx)(h,{"data-orientation":a,"data-slot":`separator`,orientation:a,className:E({orientation:a,variant:n,className:e}),...r})},k=Object.assign(O,{Root:O}),A=f(`panel-left-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]]),j=l(u(),1),M=[{id:`config`,label:`配置管理`,icon:n},{id:`about`,label:`关于插件`,icon:t}],N=({collapsed:e,activeMenu:t,onMenuChange:n})=>{let i=S(()=>{window.open(`https://kkk.karinjs.com`,`_blank`,`noopener,noreferrer`)}),a=S(()=>{_(),window.location.reload()});return e?null:(0,D.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,D.jsx)(`div`,{className:`shrink-0 px-4 pt-3 pb-2`,children:(0,D.jsxs)(m,{children:[(0,D.jsx)(m.Trigger,{"aria-label":`用户信息`,children:(0,D.jsxs)(`button`,{className:`flex w-full items-center gap-3 rounded-lg p-2 transition-colors hover:bg-default-100`,children:[(0,D.jsxs)(g,{size:`lg`,children:[(0,D.jsx)(g.Image,{src:o}),(0,D.jsx)(g.Fallback,{children:`ikenxuan`})]}),(0,D.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col items-start`,children:[(0,D.jsx)(`p`,{className:`truncate text-lg font-semibold`,children:`炫炫`}),(0,D.jsx)(`p`,{className:`truncate text-md text-muted`,children:`Super Admin`})]})]})}),(0,D.jsx)(m.Content,{className:`w-60`,children:(0,D.jsxs)(m.Dialog,{children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-3 pb-3`,children:[(0,D.jsxs)(g,{size:`md`,children:[(0,D.jsx)(g.Image,{src:o}),(0,D.jsx)(g.Fallback,{children:`U`})]}),(0,D.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,D.jsx)(`p`,{className:`truncate font-medium`,children:`用户`}),(0,D.jsx)(`p`,{className:`truncate text-md text-muted`,children:`Super Admin`})]})]}),(0,D.jsx)(k,{className:`my-2`}),(0,D.jsx)(`p`,{className:`text-xs text-muted`,children:`当前身份:管理员`})]})})]})}),(0,D.jsx)(`nav`,{className:`flex flex-1 flex-col gap-1 overflow-y-auto px-3 py-3`,"aria-label":`主导航`,children:M.map(e=>{let r=e.icon,i=t===e.id;return(0,D.jsxs)(v,{fullWidth:!0,className:`justify-start`,size:`lg`,variant:i?`tertiary`:`ghost`,"aria-label":e.label,"aria-current":i?`page`:void 0,onPress:()=>n(e.id),children:[(0,D.jsx)(r,{size:20,className:T(`shrink-0 mr-3`,!i&&`text-muted`),"aria-hidden":`true`}),(0,D.jsx)(`span`,{className:T(`truncate`,i&&`font-medium`),children:e.label})]},e.id)})}),(0,D.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-1 px-3 py-3`,children:[(0,D.jsxs)(v,{fullWidth:!0,className:`justify-start`,size:`lg`,variant:`ghost`,"aria-label":`查看帮助文档`,onPress:i,children:[(0,D.jsx)(r,{size:20,className:`shrink-0 mr-3 text-muted`,"aria-hidden":`true`}),(0,D.jsx)(`span`,{className:`truncate`,children:`帮助文档`})]}),(0,D.jsxs)(v,{fullWidth:!0,className:`justify-start`,size:`lg`,variant:`ghost`,"aria-label":`登出`,onPress:a,children:[(0,D.jsx)(s,{size:20,className:`shrink-0 mr-3 text-muted`,"aria-hidden":`true`}),(0,D.jsx)(`span`,{className:`truncate`,children:`登出`})]})]})]})},P=({onToggleSidebar:t,sidebarCollapsed:n,currentMenuLabel:r})=>(0,D.jsxs)(`div`,{className:`flex w-full items-center justify-between`,children:[(0,D.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,D.jsx)(v,{isIconOnly:!0,variant:`ghost`,onPress:t,"aria-label":n?`展开侧边栏`:`折叠侧边栏`,"aria-expanded":!n,children:n?(0,D.jsx)(a,{size:20,"aria-hidden":`true`}):(0,D.jsx)(A,{size:20,"aria-hidden":`true`})}),n&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(e,{size:24,"aria-hidden":`true`}),(0,D.jsx)(`h1`,{className:`truncate text-lg font-semibold`,children:`KKK Config`})]}),!n&&(0,D.jsx)(`h1`,{className:`truncate text-lg font-semibold`,children:r||`配置管理面板`})]}),(0,D.jsx)(i,{})]}),F=({activeMenu:e})=>(0,D.jsx)(`div`,{className:`mx-auto w-full max-w-7xl px-4`,children:(()=>{switch(e){case`config`:return(0,D.jsx)(y,{device:`desktop`});case`about`:return(0,D.jsx)(c,{});default:return(0,D.jsx)(y,{})}})()}),I=[{id:`config`,label:`配置管理`,icon:n},{id:`about`,label:`关于插件`,icon:t}],L=({activeMenu:e,onMenuChange:t})=>{let[n,{toggle:r}]=b(!1),i=(0,j.useRef)(null);return(0,j.useEffect)(()=>{i.current&&(n?x.to(i.current,{width:0,opacity:0,borderRightWidth:0,duration:.3,ease:`power2.inOut`,onComplete:()=>{i.current&&(i.current.style.display=`none`)}}):(i.current.style.display=`flex`,x.fromTo(i.current,{width:0,opacity:0,borderRightWidth:0},{width:260,opacity:1,borderRightWidth:1,duration:.3,ease:`power2.inOut`})))},[n]),(0,D.jsxs)(`div`,{className:`flex h-screen overflow-hidden`,children:[(0,D.jsx)(`aside`,{ref:i,className:`flex h-full w-65 shrink-0 flex-col border-r border-default-100`,"aria-label":`侧边栏导航`,children:(0,D.jsx)(N,{collapsed:n,activeMenu:e,onMenuChange:t,onToggleCollapse:r})}),(0,D.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col overflow-hidden`,children:[(0,D.jsx)(`header`,{className:`flex h-16 shrink-0 items-center px-6`,children:(0,D.jsx)(P,{onToggleSidebar:r,sidebarCollapsed:n,currentMenuLabel:I.find(t=>t.id===e)?.label})}),(0,D.jsx)(`main`,{className:`scrollbar flex-1 overflow-y-auto p-6`,id:`main-content`,children:(0,D.jsx)(`div`,{"data-scrollbar":`thin`,children:(0,D.jsx)(F,{activeMenu:e})})})]})]})};export{L as default};
@@ -0,0 +1,2 @@
1
+ import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"./AboutPanel-DFjZYu60.js";import{C as l,S as u,a as d,f,h as p,i as m,m as h,n as g,o as _,s as v,u as y,x as b,y as x}from"./index-CQhoJUBv.js";var S=d(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),C=l(u(),1),w=b(),T=[{id:`config`,label:`配置管理`,icon:n},{id:`about`,label:`关于插件`,icon:t}],E=({open:e,onClose:t,activeMenu:n,onMenuChange:i})=>{let a=v(()=>{window.open(`https://kkk.karinjs.com`,`_blank`,`noopener,noreferrer`)}),c=v(()=>{m(),window.location.reload()});return(0,C.useEffect)(()=>{let n=n=>{n.key===`Escape`&&e&&t()};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t]),(0,C.useEffect)(()=>(e?document.body.style.overflow=`hidden`:document.body.style.overflow=``,()=>{document.body.style.overflow=``}),[e]),(0,w.jsx)(f,{isOpen:e,onOpenChange:e=>{e||t()},children:(0,w.jsx)(f.Backdrop,{isDismissable:!0,className:`backdrop-blur-sm`,children:(0,w.jsx)(f.Content,{placement:`right`,children:(0,w.jsxs)(f.Dialog,{className:`px-4`,children:[(0,w.jsx)(f.Header,{className:`flex items-center justify-between pb-4`,children:(0,w.jsx)(f.CloseTrigger,{"aria-label":`关闭菜单`,className:`mr-2`,children:(0,w.jsx)(S,{size:24,"aria-hidden":`true`})})}),(0,w.jsxs)(f.Body,{className:`flex flex-col`,children:[(0,w.jsx)(`div`,{className:`shrink-0 pb-5`,children:(0,w.jsxs)(`div`,{className:`flex items-center gap-3 px-1`,children:[(0,w.jsxs)(p,{size:`md`,children:[(0,w.jsx)(p.Image,{src:o}),(0,w.jsx)(p.Fallback,{children:`ikenxuan`})]}),(0,w.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,w.jsx)(`p`,{className:`truncate text-sm font-medium`,children:`炫炫`}),(0,w.jsx)(`p`,{className:`truncate text-xs text-muted`,children:`Super Admin`})]})]})}),(0,w.jsx)(`nav`,{className:`flex flex-1 flex-col gap-2 overflow-y-auto`,"aria-label":`主导航`,children:T.map(e=>{let t=e.icon,r=n===e.id;return(0,w.jsxs)(h,{fullWidth:!0,className:`justify-start`,size:`lg`,variant:r?`tertiary`:`ghost`,"aria-label":e.label,"aria-current":r?`page`:void 0,onPress:()=>i(e.id),children:[(0,w.jsx)(t,{size:20,className:x(`shrink-0 mr-3`,!r&&`text-muted`),"aria-hidden":`true`}),(0,w.jsx)(`span`,{className:x(`truncate`,r&&`font-semibold`),children:e.label})]},e.id)})}),(0,w.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-2`,children:[(0,w.jsxs)(h,{fullWidth:!0,className:`justify-start`,size:`lg`,variant:`ghost`,"aria-label":`查看帮助文档`,onPress:a,children:[(0,w.jsx)(r,{size:20,className:`shrink-0 mr-3 text-muted`,"aria-hidden":`true`}),(0,w.jsx)(`span`,{className:`truncate`,children:`帮助文档`})]}),(0,w.jsxs)(h,{fullWidth:!0,className:`justify-start`,size:`lg`,variant:`ghost`,"aria-label":`登出`,onPress:c,children:[(0,w.jsx)(s,{size:20,className:`shrink-0 mr-3 text-muted`,"aria-hidden":`true`}),(0,w.jsx)(`span`,{className:`truncate`,children:`登出`})]})]})]})]})})})})},D=({onOpenDrawer:t})=>(0,w.jsxs)(`div`,{className:`flex h-full items-center justify-between px-4`,children:[(0,w.jsx)(i,{className:`shrink-0`}),(0,w.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center justify-center gap-2 px-2`,children:[(0,w.jsx)(e,{size:22,"aria-hidden":`true`}),(0,w.jsx)(`h1`,{className:`truncate text-base font-semibold`,children:`KKK Config`})]}),(0,w.jsx)(h,{isIconOnly:!0,className:`shrink-0`,variant:`ghost`,onPress:t,"aria-label":`打开菜单`,"aria-expanded":!1,children:(0,w.jsx)(a,{size:24,"aria-hidden":`true`})})]}),O=({activeMenu:e})=>(0,w.jsx)(`div`,{className:`w-full max-w-2xl mx-auto`,children:(()=>{switch(e){case`config`:return(0,w.jsx)(g,{device:`mobile`});case`about`:return(0,w.jsx)(c,{});default:return(0,w.jsx)(g,{})}})()}),k=({activeMenu:e,onMenuChange:t})=>{let[n,{setTrue:r,setFalse:i}]=_(!1),a=v(e=>{t(e),i()});return(0,w.jsxs)(y,{"data-scrollbar":`thin`,className:`flex min-h-screen flex-col`,children:[(0,w.jsx)(`header`,{className:`sticky top-0 z-50 h-14 shrink-0 backdrop-blur-xs bg-white/60
2
+ mask-[linear-gradient(to_bottom,black_40%,transparent_100%)]`,children:(0,w.jsx)(D,{onOpenDrawer:r})}),(0,w.jsx)(E,{open:n,onClose:i,activeMenu:e,onMenuChange:a}),(0,w.jsx)(`main`,{className:`scrollbar flex-1 overflow-y-auto p-4`,id:`main-content`,children:(0,w.jsx)(O,{activeMenu:e})})]})};export{k as default};