@opentiny/next-sdk 0.3.3 → 0.4.1

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.
Files changed (134) hide show
  1. package/agent/AgentModelProvider.ts +78 -81
  2. package/agent/type.ts +6 -9
  3. package/agent/utils/getAISDKTools.ts +0 -1
  4. package/agent/utils/getBuiltinMcpTools.ts +7 -7
  5. package/core.ts +1 -3
  6. package/dist/SimulatorMask-BHVXyogh-iNUb4dyF.js +361 -0
  7. package/dist/agent/type.d.ts +4 -12
  8. package/dist/agent/utils/getBuiltinMcpTools.d.ts +3 -3
  9. package/dist/core.d.ts +1 -1
  10. package/dist/core.js +18 -18
  11. package/dist/index-CXK8CcKq.js +6076 -0
  12. package/dist/index.d.ts +2 -4
  13. package/dist/index.js +57 -2783
  14. package/dist/initialize-builtin-WebMCP-rALfqS-o.js +6389 -0
  15. package/dist/page-tools/a11y/build.d.ts +11 -0
  16. package/dist/page-tools/a11y/constants.d.ts +9 -0
  17. package/dist/page-tools/a11y/search.d.ts +17 -0
  18. package/dist/page-tools/a11y/types.d.ts +104 -0
  19. package/dist/page-tools/a11y/utils.d.ts +34 -0
  20. package/dist/page-tools/a11y/vnode.d.ts +37 -0
  21. package/dist/page-tools/a11y-tree.d.ts +12 -0
  22. package/dist/page-tools/bridge.d.ts +0 -6
  23. package/dist/page-tools/constants.d.ts +22 -0
  24. package/dist/page-tools/context.d.ts +28 -0
  25. package/dist/page-tools/handlers/browserState.d.ts +8 -0
  26. package/dist/page-tools/handlers/click.d.ts +8 -0
  27. package/dist/page-tools/handlers/executeJavascript.d.ts +8 -0
  28. package/dist/page-tools/handlers/fill.d.ts +8 -0
  29. package/dist/page-tools/handlers/scroll.d.ts +8 -0
  30. package/dist/page-tools/handlers/searchTree.d.ts +8 -0
  31. package/dist/page-tools/handlers/select.d.ts +8 -0
  32. package/dist/page-tools/initialize-builtin-WebMCP.d.ts +1 -0
  33. package/dist/page-tools/page-agent-highlight/index.d.ts +9 -0
  34. package/dist/page-tools/page-agent-mask/SimulatorMask.d.ts +14 -0
  35. package/dist/page-tools/page-agent-mask/checkDarkMode.d.ts +5 -0
  36. package/dist/page-tools/page-agent-tool.d.ts +4 -0
  37. package/dist/page-tools/page-state-cache.d.ts +36 -0
  38. package/dist/page-tools/schema.d.ts +43 -0
  39. package/dist/page-tools/utils/dom.d.ts +6 -0
  40. package/dist/page-tools/utils/scroll.d.ts +15 -0
  41. package/dist/runtime.d.ts +4 -0
  42. package/dist/runtime.js +744 -0
  43. package/dist/utils/builtinProxy.d.ts +1 -1
  44. package/index.ts +2 -19
  45. package/package.json +14 -18
  46. package/page-tools/a11y/build.ts +70 -0
  47. package/page-tools/a11y/constants.ts +110 -0
  48. package/page-tools/a11y/search.ts +129 -0
  49. package/page-tools/a11y/types.ts +108 -0
  50. package/page-tools/a11y/utils.ts +266 -0
  51. package/page-tools/a11y/vnode.ts +229 -0
  52. package/page-tools/a11y-tree.ts +13 -0
  53. package/page-tools/bridge.ts +49 -15
  54. package/page-tools/constants.ts +72 -0
  55. package/page-tools/context.ts +13 -0
  56. package/page-tools/handlers/browserState.ts +12 -0
  57. package/page-tools/handlers/click.ts +26 -0
  58. package/page-tools/handlers/executeJavascript.ts +22 -0
  59. package/page-tools/handlers/fill.ts +60 -0
  60. package/page-tools/handlers/scroll.ts +66 -0
  61. package/page-tools/handlers/searchTree.ts +30 -0
  62. package/page-tools/handlers/select.ts +34 -0
  63. package/page-tools/initialize-builtin-WebMCP.ts +20 -0
  64. package/page-tools/page-agent-highlight/index.ts +198 -0
  65. package/page-tools/page-agent-mask/SimulatorMask.module.css +14 -0
  66. package/page-tools/page-agent-mask/SimulatorMask.ts +279 -0
  67. package/page-tools/page-agent-mask/checkDarkMode.ts +181 -0
  68. package/page-tools/page-agent-mask/cursor-border.svg +3 -0
  69. package/page-tools/page-agent-mask/cursor-fill.svg +5 -0
  70. package/page-tools/page-agent-mask/cursor.module.css +70 -0
  71. package/page-tools/page-agent-prompt.md +139 -0
  72. package/page-tools/page-agent-tool.ts +175 -0
  73. package/page-tools/page-state-cache.ts +78 -0
  74. package/page-tools/schema.ts +51 -0
  75. package/page-tools/utils/dom.ts +155 -0
  76. package/page-tools/utils/scroll.ts +58 -0
  77. package/runtime.ts +13 -0
  78. package/utils/builtinProxy.ts +45 -13
  79. package/vite.config.runtime.ts +22 -0
  80. package/vite.config.ts +52 -8
  81. package/McpSdk.ts +0 -14
  82. package/WebAgent.ts +0 -5
  83. package/WebMcp.ts +0 -20
  84. package/Zod.ts +0 -1
  85. package/dist/AgentModelProvider-CwqOT28f.js +0 -4198
  86. package/dist/McpSdk.d.ts +0 -14
  87. package/dist/WebAgent.d.ts +0 -5
  88. package/dist/WebMcp.d.ts +0 -20
  89. package/dist/Zod.d.ts +0 -1
  90. package/dist/index.es.dev.js +0 -53427
  91. package/dist/index.es.js +0 -42147
  92. package/dist/index.umd.dev.js +0 -53820
  93. package/dist/index.umd.js +0 -814
  94. package/dist/mcpsdk@1.25.3.dev.js +0 -22621
  95. package/dist/mcpsdk@1.25.3.es.dev.js +0 -22619
  96. package/dist/mcpsdk@1.25.3.es.js +0 -16802
  97. package/dist/mcpsdk@1.25.3.js +0 -43
  98. package/dist/transport/ExtensionClientTransport.d.ts +0 -24
  99. package/dist/transport/ExtensionContentServerTransport.d.ts +0 -39
  100. package/dist/transport/ExtensionPageServerTransport.d.ts +0 -36
  101. package/dist/transport/messages.d.ts +0 -9
  102. package/dist/vite.config.mcpSdk.d.ts +0 -2
  103. package/dist/vite.config.webAgent.d.ts +0 -2
  104. package/dist/vite.config.webMcp.d.ts +0 -2
  105. package/dist/vite.config.webMcpFull.d.ts +0 -2
  106. package/dist/vite.config.zod.d.ts +0 -2
  107. package/dist/webagent.dev.js +0 -47597
  108. package/dist/webagent.es.dev.js +0 -47204
  109. package/dist/webagent.es.js +0 -37494
  110. package/dist/webagent.js +0 -634
  111. package/dist/webmcp-full.dev.js +0 -24430
  112. package/dist/webmcp-full.es.dev.js +0 -24426
  113. package/dist/webmcp-full.es.js +0 -18333
  114. package/dist/webmcp-full.js +0 -43
  115. package/dist/webmcp.dev.js +0 -1595
  116. package/dist/webmcp.es.dev.js +0 -1589
  117. package/dist/webmcp.es.js +0 -1406
  118. package/dist/webmcp.js +0 -1
  119. package/dist/zod@3.25.76.dev.js +0 -4037
  120. package/dist/zod@3.25.76.es.dev.js +0 -4033
  121. package/dist/zod@3.25.76.es.js +0 -2945
  122. package/dist/zod@3.25.76.js +0 -1
  123. package/transport/ExtensionClientTransport.ts +0 -100
  124. package/transport/ExtensionContentServerTransport.ts +0 -162
  125. package/transport/ExtensionPageServerTransport.ts +0 -149
  126. package/transport/messages.ts +0 -63
  127. package/vite-build-tsc.ts +0 -63
  128. package/vite-env.d.ts +0 -5
  129. package/vite.config.mcpSdk.ts +0 -28
  130. package/vite.config.webAgent.ts +0 -19
  131. package/vite.config.webMcp.ts +0 -40
  132. package/vite.config.webMcpFull.ts +0 -19
  133. package/vite.config.zod.ts +0 -23
  134. /package/dist/{vite-build-tsc.d.ts → vite.config.runtime.d.ts} +0 -0
package/dist/index.js CHANGED
@@ -1,2785 +1,59 @@
1
- import { default as pt } from "ajv";
2
- import { z as n2 } from "zod";
3
- import { z as ht } from "zod";
4
- import { AuthClientProvider as gt } from "@opentiny/next";
5
- import { ResourceTemplate as Ct } from "@modelcontextprotocol/sdk/server/mcp.js";
6
- import { UriTemplate as xt } from "@modelcontextprotocol/sdk/shared/uriTemplate.js";
7
- import { completable as vt } from "@modelcontextprotocol/sdk/server/completable.js";
8
- import { getDisplayName as kt } from "@modelcontextprotocol/sdk/shared/metadataUtils.js";
9
- import { InMemoryTransport as Lt } from "@modelcontextprotocol/sdk/inMemory.js";
10
- import { o as w0, s as U, n as x0, p as W2 } from "./AgentModelProvider-CwqOT28f.js";
11
- import { A as Tt, E as Et, d as Mt, W as Pt, h as It, a as Ot, c as Nt, e as Rt, f as zt, g as At, m as Ft, b as jt, l as Dt, i as Ut, j as Zt, k as Bt } from "./AgentModelProvider-CwqOT28f.js";
12
- import { JSONRPCMessageSchema as e0 } from "@modelcontextprotocol/sdk/types.js";
13
- import H2 from "qrcode";
14
- import { tool as b0 } from "ai";
15
- const E2 = () => typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (e) => {
16
- const t = Math.random() * 16 | 0;
17
- return (e === "x" ? t : t & 3 | 8).toString(16);
18
- });
19
- class Qe {
20
- constructor(t = null) {
21
- this._isStarted = !1, this._isClosed = !1, this._lastRegistration = null, this.sessionId = t || E2(), this._messageListener2 = w0(
22
- "mcp-client-to-server-to-page",
23
- (r) => {
24
- if (r.sessionId !== this.sessionId) return;
25
- console.log("【Page Svr Transport】 即将处理 mcpMessage", r.mcpMessage);
26
- const o = e0.parse(r.mcpMessage);
27
- this.onmessage?.(o), r.mcpMessage.params?.name && U(
28
- "update-page-app-message",
29
- { status: "run", message: r.mcpMessage.params?.name },
30
- "page->content"
31
- );
32
- },
33
- "content->page"
34
- );
35
- }
36
- // 最后一次注册信息(用于 Sidepanel 刷新后重新注册)
37
- _throwError(t, r) {
38
- if (t()) {
39
- const o = new Error(r);
40
- throw console.log(r, o), this.onerror && this.onerror(o), o;
41
- }
42
- }
43
- /** 启动 transport,开始监听消息 */
44
- async start() {
45
- if (!this._isStarted) {
46
- if (this._isClosed) throw new Error("【Page Svr Transport】 已关闭,无法重新启动");
47
- this._isStarted = !0;
48
- }
49
- }
50
- /** 发送消息到 MCP Client */
51
- async send(t, r) {
52
- this._throwError(() => !this._isStarted, "【Page Svr Transport】 未启动,无法发送消息"), this._throwError(() => this._isClosed, "【Page Svr Transport】 已关闭,无法发送消息"), U(
53
- "mcp-server-to-client-from-page",
54
- {
55
- sessionId: this.sessionId,
56
- mcpMessage: t
57
- },
58
- "page->content"
59
- ), "result" in t && t.result?.content && U(
60
- "update-page-app-message",
61
- { status: "ready", message: "" },
62
- "page->content"
63
- // 此处应该是 content->content, 但为了和pageServerTransport统一。
64
- );
65
- }
66
- /** 通知 Sidepanel 此 Server 已启动并准备接受连接 */
67
- async notifyRegistration(t) {
68
- this._throwError(() => !this._isStarted, "【Page Svr Transport】 未启动,无法注册消息"), this._lastRegistration = t;
69
- try {
70
- U(
71
- "mcp-server-register-from-page",
72
- {
73
- sessionId: this.sessionId,
74
- serverInfo: {
75
- ...t,
76
- url: window.location.origin,
77
- title: document.title
78
- }
79
- },
80
- "page->content"
81
- );
82
- } catch (r) {
83
- this._throwError(() => !0, "【Page Svr Transport】 注册 server 失败" + String(r));
84
- }
85
- }
86
- /** 关闭 transport */
87
- async close() {
88
- if (!this._isClosed)
89
- try {
90
- this._messageListener2 && this._messageListener2(), this._isClosed = !0, this._isStarted = !1, this.onclose && this.onclose();
91
- } catch (t) {
92
- this._throwError(() => !0, "【Page Svr Transport】 关闭时发生错误" + String(t));
93
- }
94
- }
95
- }
96
- class et {
97
- constructor(t = null, r) {
98
- this._isStarted = !1, this._isClosed = !1, this._lastRegistration = null, this.sessionId = t || E2(), this.tabId = r;
99
- }
100
- // 最后一次注册信息(用于 Sidepanel 刷新后重新注册)
101
- _throwError(t, r) {
102
- if (t()) {
103
- const o = new Error(r);
104
- throw console.log(r, o), this.onerror && this.onerror(o), o;
105
- }
106
- }
107
- /** 启动 transport,开始监听MCP client 消息 */
108
- async start() {
109
- if (console.log("【Content Svr Transport】 启动 start", this.sessionId), !this._isStarted) {
110
- if (this._isClosed) throw new Error("【Content Svr Transport】 已关闭,无法重新启动");
111
- x0(
112
- "mcp-client-to-server",
113
- (t) => {
114
- if (!(t.sessionId !== this.sessionId || t.tabId !== this.tabId))
115
- try {
116
- console.log("【Content Svr Transport】 即将处理 mcpMessage", t.mcpMessage);
117
- const r = e0.parse(t.mcpMessage);
118
- this.onmessage?.(r), t.mcpMessage.params?.name && U(
119
- "update-page-app-message",
120
- { status: "run", message: t.mcpMessage.params?.name },
121
- "page->content"
122
- // 此处应该是 content->content, 但为了和pageServerTransport统一。
123
- );
124
- } catch (r) {
125
- console.log("【Content Svr Transport】 处理消息时发生错误:", r);
126
- }
127
- },
128
- "bg->content",
129
- this.tabId
130
- ), this._isStarted = !0;
131
- }
132
- }
133
- /** 发送消息到 MCP Client */
134
- async send(t, r) {
135
- this._throwError(() => !this._isStarted, "【Content Svr Transport】 未启动,无法发送消息"), this._throwError(() => this._isClosed, "【Content Svr Transport】 已关闭,无法发送消息");
136
- try {
137
- console.log("【Content Svr Transport】 发送消息到 MCP Client", t), W2(
138
- "mcp-server-to-client",
139
- {
140
- sessionId: this.sessionId,
141
- mcpMessage: t
142
- },
143
- "content->bg"
144
- ), "result" in t && t.result?.content && U(
145
- "update-page-app-message",
146
- { status: "ready", message: "" },
147
- "page->content"
148
- // 此处应该是 content->content, 但为了和pageServerTransport统一。
149
- );
150
- } catch (o) {
151
- this._throwError(() => !0, "【Content Svr Transport】发送消息失败" + String(o));
152
- }
153
- }
154
- /** 通知 Sidepanel 此 Server 已启动并准备接受连接 */
155
- async notifyRegistration(t) {
156
- this._isStarted && (this._lastRegistration = t, W2(
157
- "mcp-server-register",
158
- {
159
- sessionId: this.sessionId,
160
- serverInfo: {
161
- ...t,
162
- url: window.location.origin,
163
- title: document.title
164
- }
165
- },
166
- "content->bg"
167
- ));
168
- }
169
- async close() {
170
- if (!this._isClosed)
171
- try {
172
- this._isClosed = !0, this._isStarted = !1, this.onclose && this.onclose();
173
- } catch (t) {
174
- this._throwError(() => !0, "【Content Svr Transport】 关闭时发生错误" + String(t));
175
- }
176
- }
177
- }
178
- class v0 {
179
- constructor(t, { size: r = 200, margin: o = 4, color: n = "#000", bgColor: s = "#fff" }) {
180
- this.value = t, this.size = r, this.margin = o, this.color = n, this.bgColor = s;
181
- }
182
- get qrCodeOption() {
183
- return {
184
- width: this.size,
185
- margin: this.margin,
186
- color: {
187
- dark: this.color,
188
- // 前景色
189
- light: this.bgColor
190
- // 背景色
191
- }
192
- };
193
- }
194
- /** 生成二维码的 Data URL(base64 图片) */
195
- async toDataURL() {
196
- return H2.toDataURL(this.value, this.qrCodeOption);
197
- }
198
- /** 渲染二维码到指定的 canvas 元素 */
199
- async toCanvas(t) {
200
- return H2.toCanvas(t, this.value, this.qrCodeOption);
201
- }
202
- /** 渲染二维码到指定的 img 元素 */
203
- async toImage(t) {
204
- t.src = await this.toDataURL();
205
- }
206
- }
207
- const _0 = {
208
- content: "",
209
- placement: "top",
210
- trigger: "hover",
211
- delay: 150,
212
- hideDelay: 150,
213
- container: document.body,
214
- className: "tiny-remoter-native-tooltip"
215
- };
216
- class k0 {
217
- constructor(t, r = {}) {
218
- if (this.tip = null, this.showTimer = 0, this.hideTimer = 0, this.clickOutside = null, this.el = typeof t == "string" ? document.querySelector(t) : t, !this.el) throw new Error("Tooltip: invalid element");
219
- this.opts = { ..._0, ...r }, this.bindEvents();
220
- }
221
- /* 公开 API */
222
- open() {
223
- this.isShown() || (this.clearTimer(), this.showTimer = window.setTimeout(() => {
224
- this.render(), this.opts.container.appendChild(this.tip), this.reposition(), this.attachExtraEvents();
225
- }, this.opts.delay));
226
- }
227
- close() {
228
- this.clearTimer(), this.hideTimer = window.setTimeout(() => {
229
- this.tip?.remove(), this.detachExtraEvents();
230
- }, this.opts.hideDelay);
231
- }
232
- toggle() {
233
- this.isShown() ? this.close() : this.open();
234
- }
235
- destroy() {
236
- this.close();
237
- const t = this.opts.trigger;
238
- this.el.removeEventListener("mouseenter", this.open), this.el.removeEventListener("mouseleave", this.close), this.el.removeEventListener("focus", this.open), this.el.removeEventListener("blur", this.close), t === "click" && this.el.removeEventListener("click", this.toggle);
239
- }
240
- /* 私有方法 */
241
- bindEvents() {
242
- const t = this.opts.trigger;
243
- t === "hover" ? (this.el.addEventListener("mouseenter", () => this.open()), this.el.addEventListener("mouseleave", () => this.close())) : t === "focus" ? (this.el.addEventListener("focus", () => this.open()), this.el.addEventListener("blur", () => this.close())) : t === "click" && this.el.addEventListener("click", () => this.toggle());
244
- }
245
- render() {
246
- if (this.tip) return;
247
- const t = typeof this.opts.content == "function" ? this.opts.content() : this.opts.content;
248
- this.tip = document.createElement("div"), this.tip.className = `${this.opts.className} ${this.opts.className}--${this.opts.placement}`, this.tip.innerHTML = `
249
- <div class="${this.opts.className}__arrow"></div>
250
- <div class="${this.opts.className}__inner">${t}</div>
251
- `;
252
- }
253
- reposition() {
254
- const t = this.placementList(this.opts.placement);
255
- for (const r of t) {
256
- const o = this.calcStyle(r);
257
- if (this.checkViewport(o)) {
258
- this.applyStyle(o), this.tip.className = `${this.opts.className} ${this.opts.className}--${r}`;
259
- return;
260
- }
261
- }
262
- this.applyStyle(this.calcStyle("top"));
263
- }
264
- calcStyle(t) {
265
- const r = this.el.getBoundingClientRect(), o = this.tip.getBoundingClientRect(), n = window.pageYOffset || document.documentElement.scrollTop, s = window.pageXOffset || document.documentElement.scrollLeft, i = 6, [a, l = "center"] = t.split("-");
266
- let h = 0, p = 0;
267
- return a === "top" ? h = r.top + n - o.height - i : a === "bottom" ? h = r.bottom + n + i : a === "left" ? p = r.left + s - o.width - i : a === "right" && (p = r.right + s + i), (a === "top" || a === "bottom") && (l === "start" ? p = r.left + s : l === "end" ? p = r.right + s - o.width : p = (r.left + r.right) / 2 + s - o.width / 2), (a === "left" || a === "right") && (l === "start" ? h = r.top + n : l === "end" ? h = r.bottom + n - o.height : h = (r.top + r.bottom) / 2 + n - o.height / 2), { top: Math.round(h), left: Math.round(p) };
268
- }
269
- applyStyle({ top: t, left: r }) {
270
- Object.assign(this.tip.style, {
271
- position: "absolute",
272
- top: `${t}px`,
273
- left: `${r}px`
274
- });
275
- }
276
- checkViewport({ top: t, left: r }) {
277
- const n = window.innerWidth, s = window.innerHeight, i = this.tip.getBoundingClientRect();
278
- return r >= 5 && t >= 5 && r + i.width <= n - 5 && t + i.height <= s - 5;
279
- }
280
- placementList(t) {
281
- const r = {
282
- top: ["top", "bottom", "top-start", "bottom-start", "top-end", "bottom-end"],
283
- bottom: ["bottom", "top", "bottom-start", "top-start", "bottom-end", "top-end"],
284
- left: ["left", "right", "left-start", "right-start", "left-end", "right-end"],
285
- right: ["right", "left", "right-start", "left-start", "right-end", "left-end"]
286
- };
287
- return r[t.split("-")[0]] || r.top;
288
- }
289
- attachExtraEvents() {
290
- this.opts.trigger === "click" ? (this.clickOutside = (t) => {
291
- const r = t.composedPath();
292
- !r.includes(this.el) && !r.includes(this.tip) && this.close();
293
- }, document.addEventListener("mousedown", this.clickOutside)) : this.opts.trigger === "hover" && (this.tip.addEventListener("mouseenter", () => this.clearTimer()), this.tip.addEventListener("mouseleave", () => this.close()));
294
- }
295
- detachExtraEvents() {
296
- this.clickOutside && (document.removeEventListener("mousedown", this.clickOutside), this.clickOutside = null);
297
- }
298
- clearTimer() {
299
- clearTimeout(this.showTimer), clearTimeout(this.hideTimer);
300
- }
301
- isShown() {
302
- return !!this.tip?.parentNode;
303
- }
304
- }
305
- const J2 = "tiny-remoter-native-tooltip-style";
306
- (() => {
307
- if (document.getElementById(J2)) return;
308
- const e = document.createElement("style");
309
- e.id = J2, e.textContent = `
310
- .tiny-remoter-native-tooltip {
311
- position: absolute;
312
- z-index: 9999;
313
- max-width: 200px;
314
- padding: 6px 10px;
315
- font-size: 12px;
316
- line-height: 1.4;
317
- color: #fff;
318
- background: #191919;
319
- border-radius: 4px;
320
- pointer-events: none;
321
- box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.2);
322
- }
323
- .tiny-remoter-native-tooltip__arrow {
324
- position: absolute;
325
- width: 0; height: 0;
326
- border: 6px solid transparent;
327
- }
328
- .tiny-remoter-native-tooltip--top
329
- .tiny-remoter-native-tooltip__arrow {
330
- bottom: -12px;
331
- left: 50%; transform:
332
- translateX(-50%);
333
- border-top-color: rgba(0,0,0,.75);
334
- }
335
- .tiny-remoter-native-tooltip--bottom
336
- .tiny-remoter-native-tooltip__arrow {
337
- top: -12px;
338
- left: 50%; transform:
339
- translateX(-50%);
340
- border-bottom-color: rgba(0,0,0,.75);
341
- }
342
- .tiny-remoter-native-tooltip--left
343
- .tiny-remoter-native-tooltip__arrow {
344
- right: -12px;
345
- top: 50%;
346
- transform: translateY(-50%);
347
- border-left-color: rgba(0,0,0,.75);
348
- }
349
- .tiny-remoter-native-tooltip--right
350
- .tiny-remoter-native-tooltip__arrow {
351
- left: -12px;
352
- top: 50%;
353
- transform: translateY(-50%);
354
- border-right-color: rgba(0,0,0,.75);
355
- }
356
- `, document.head.appendChild(e);
357
- })();
358
- const t0 = "data:image/svg+xml,%3csvg%20viewBox='0%200%2040%2039.9692'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='40.000000'%20height='39.969238'%20fill='none'%20customFrame='url(%23clipPath_3)'%3e%3cdefs%3e%3cclipPath%20id='clipPath_3'%3e%3crect%20width='40.000000'%20height='39.969238'%20x='0.000000'%20y='0.000000'%20rx='12.000000'%20fill='rgb(255,255,255)'%20/%3e%3c/clipPath%3e%3cclipPath%20id='clipPath_4'%3e%3crect%20width='24.000000'%20height='24.000000'%20x='8.000000'%20y='7.984619'%20fill='rgb(255,255,255)'%20/%3e%3c/clipPath%3e%3cclipPath%20id='clipPath_5'%3e%3crect%20width='20.000000'%20height='20.000000'%20x='10.000000'%20y='9.984619'%20fill='rgb(255,255,255)'%20/%3e%3c/clipPath%3e%3cclipPath%20id='clipPath_6'%3e%3crect%20width='20.000000'%20height='20.000000'%20x='10.000000'%20y='9.984619'%20fill='rgb(255,255,255)'%20/%3e%3c/clipPath%3e%3cclipPath%20id='clipPath_7'%3e%3crect%20width='21.666666'%20height='13.333333'%20x='20.000000'%20y='9.984619'%20rx='6.666667'%20fill='rgb(255,255,255)'%20/%3e%3c/clipPath%3e%3cclipPath%20id='clipPath_8'%3e%3crect%20width='6.666667'%20height='6.666667'%20x='23.333496'%20y='9.984619'%20fill='rgb(255,255,255)'%20/%3e%3c/clipPath%3e%3c/defs%3e%3crect%20id='2'%20width='40.000000'%20height='39.969238'%20x='0.000000'%20y='0.000000'%20rx='12.000000'%20fill='rgb(239,246,255)'%20/%3e%3cg%20id='物业'%20clip-path='url(%23clipPath_4)'%20customFrame='url(%23clipPath_4)'%3e%3crect%20id='物业'%20width='24.000000'%20height='24.000000'%20x='8.000000'%20y='7.984619'%20/%3e%3cg%20id='物业服务'%3e%3cg%20id='00公共/红点/图标+红点'%20customFrame='url(%23clipPath_5)'%3e%3crect%20id='00公共/红点/图标+红点'%20width='20.000000'%20height='20.000000'%20x='10.000000'%20y='9.984619'%20/%3e%3cg%20id='common_chats_line'%20customFrame='url(%23clipPath_6)'%3e%3crect%20id='common_chats_line'%20width='20.000000'%20height='20.000000'%20x='10.000000'%20y='9.984619'%20/%3e%3cpath%20id='形状'%20d='M28.3332%2019.9847C28.3332%2015.3823%2024.6022%2011.6514%2019.9998%2011.6514C15.3975%2011.6514%2011.6665%2015.3823%2011.6665%2019.9847C11.6665%2024.5871%2015.3975%2028.318%2019.9998%2028.318C21.0018%2028.318%2021.9624%2028.1412%2022.8522%2027.8171L26.581%2028.1578C26.7205%2028.1706%2026.8611%2028.1598%2026.9971%2028.1259C27.6669%2027.959%2028.0746%2027.2806%2027.9077%2026.6108L27.2716%2024.0578C27.9477%2022.8535%2028.3332%2021.4641%2028.3332%2019.9847ZM19.9998%2013.1514C16.2259%2013.1514%2013.1665%2016.2108%2013.1665%2019.9847C13.1665%2023.7586%2016.2259%2026.818%2019.9998%2026.818C20.8089%2026.818%2021.5967%2026.678%2022.3388%2026.4077C22.505%2026.3471%2022.6803%2026.3166%2022.8565%2026.3171L22.9887%2026.3233L26.3665%2026.6322L25.8161%2024.4205C25.7352%2024.0958%2025.7655%2023.7548%2025.8997%2023.4512L25.9636%2023.3236C26.5311%2022.3126%2026.8332%2021.1723%2026.8332%2019.9847C26.8332%2016.2108%2023.7738%2013.1514%2019.9998%2013.1514ZM23.1152%2021.2468C23.352%2020.9069%2023.2684%2020.4394%2022.9286%2020.2026C22.5887%2019.9659%2022.1212%2020.0494%2021.8845%2020.3893C21.2894%2021.2433%2020.4268%2021.7347%2019.5102%2021.7347C18.9513%2021.7347%2018.4132%2021.554%2017.9375%2021.2122C17.6011%2020.9705%2017.1325%2021.0472%2016.8908%2021.3836C16.6491%2021.7199%2016.7258%2022.1886%2017.0622%2022.4303C17.7879%2022.9518%2018.6305%2023.2347%2019.5102%2023.2347C20.9394%2023.2347%2022.2505%2022.4878%2023.1152%2021.2468Z'%20fill='rgb(65,142,255)'%20fill-rule='evenodd'%20/%3e%3c/g%3e%3cg%20id='00公共/3位数红点'%20opacity='0'%20customFrame='url(%23clipPath_7)'%3e%3crect%20id='00公共/3位数红点'%20width='21.666666'%20height='13.333333'%20x='20.000000'%20y='9.984619'%20rx='6.666667'%20opacity='0'%20fill='rgb(243,111,100)'%20/%3e%3cpath%20id='文本'%20d='M26.0421%2013.4421C26.4259%2013.4421%2026.7677%2013.5255%2027.0675%2013.6923C27.3672%2013.8591%2027.6005%2014.0931%2027.7673%2014.3942C27.9342%2014.694%2028.0176%2015.0351%2028.0176%2015.4176C28.0176%2015.7173%2027.9633%2015.994%2027.8548%2016.2476C27.7463%2016.4999%2027.5673%2016.8315%2027.3177%2017.2425L25.859%2019.6432L25.0167%2019.6432L26.276%2017.5924C26.3534%2017.4704%2026.4307%2017.3564%2026.508%2017.2507C26.3357%2017.3063%2026.1445%2017.3341%2025.9342%2017.3341C25.5721%2017.3341%2025.2493%2017.2479%2024.9658%2017.0757C24.6837%2016.9034%2024.4633%2016.6701%2024.3046%2016.3758C24.1459%2016.0815%2024.0666%2015.7566%2024.0666%2015.4013C24.0666%2015.0351%2024.1513%2014.7021%2024.3209%2014.4023C24.4904%2014.1012%2024.7264%2013.8659%2025.0289%2013.6964C25.3314%2013.5268%2025.6691%2013.4421%2026.0421%2013.4421ZM26.0421%2016.6505C26.4029%2016.6505%2026.6904%2016.5325%2026.9047%2016.2965C27.119%2016.0605%2027.2262%2015.7539%2027.2262%2015.3769C27.2262%2014.9985%2027.119%2014.694%2026.9047%2014.4634C26.6904%2014.2328%2026.4029%2014.1175%2026.0421%2014.1175C25.6867%2014.1175%2025.4019%2014.2342%2025.1876%2014.4674C24.9733%2014.7007%2024.8661%2015.0039%2024.8661%2015.3769C24.8661%2015.7539%2024.9719%2016.0605%2025.1835%2016.2965C25.3951%2016.5325%2025.6813%2016.6505%2026.0421%2016.6505ZM30.7921%2013.4421C31.1759%2013.4421%2031.5177%2013.5255%2031.8175%2013.6923C32.1172%2013.8591%2032.3505%2014.0931%2032.5173%2014.3942C32.6842%2014.694%2032.7676%2015.0351%2032.7676%2015.4176C32.7676%2015.7173%2032.7133%2015.994%2032.6048%2016.2476C32.4963%2016.4999%2032.3173%2016.8315%2032.0677%2017.2425L30.609%2019.6432L29.7667%2019.6432L31.026%2017.5924C31.1034%2017.4704%2031.1807%2017.3564%2031.258%2017.2507C31.0857%2017.3063%2030.8945%2017.3341%2030.6842%2017.3341C30.3221%2017.3341%2029.9993%2017.2479%2029.7158%2017.0757C29.4337%2016.9034%2029.2133%2016.6701%2029.0546%2016.3758C28.8959%2016.0815%2028.8166%2015.7566%2028.8166%2015.4013C28.8166%2015.0351%2028.9013%2014.7021%2029.0709%2014.4023C29.2404%2014.1012%2029.4764%2013.8659%2029.7789%2013.6964C30.0814%2013.5268%2030.4191%2013.4421%2030.7921%2013.4421ZM30.7921%2016.6505C31.1529%2016.6505%2031.4404%2016.5325%2031.6547%2016.2965C31.869%2016.0605%2031.9762%2015.7539%2031.9762%2015.3769C31.9762%2014.9985%2031.869%2014.694%2031.6547%2014.4634C31.4404%2014.2328%2031.1529%2014.1175%2030.7921%2014.1175C30.4367%2014.1175%2030.1519%2014.2342%2029.9376%2014.4674C29.7233%2014.7007%2029.6161%2015.0039%2029.6161%2015.3769C29.6161%2015.7539%2029.7219%2016.0605%2029.9335%2016.2965C30.1451%2016.5325%2030.4313%2016.6505%2030.7921%2016.6505ZM35.2674%2014.6851L35.9001%2014.6851L35.9001%2016.3188L37.5339%2016.3188L37.5339%2016.9516L35.9001%2016.9516L35.9001%2018.5853L35.2674%2018.5853L35.2674%2016.9516L33.6337%2016.9516L33.6337%2016.3188L35.2674%2016.3188L35.2674%2014.6851Z'%20fill='rgb(255,255,255)'%20fill-rule='nonzero'%20/%3e%3c/g%3e%3cg%20id='00公共/单红点'%20opacity='0'%20customFrame='url(%23clipPath_8)'%3e%3crect%20id='00公共/单红点'%20width='6.666667'%20height='6.666667'%20x='23.333496'%20y='9.984619'%20opacity='0'%20fill='rgb(255,255,255)'%20fill-opacity='0'%20/%3e%3ccircle%20id='红点'%20cx='26.6668301'%20cy='13.3179522'%20r='3.33333325'%20fill='rgb(243,111,100)'%20/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", r0 = "data:image/svg+xml,%3csvg%20viewBox='0%200%2040%2040'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='40.000000'%20height='40.000000'%20fill='none'%20customFrame='url(%23clipPath_12)'%3e%3cdefs%3e%3cclipPath%20id='clipPath_12'%3e%3crect%20width='40.000000'%20height='40.000000'%20x='0.000000'%20y='0.000000'%20rx='12.000000'%20fill='rgb(255,255,255)'%20/%3e%3c/clipPath%3e%3cclipPath%20id='clipPath_13'%3e%3crect%20width='24.000000'%20height='24.000000'%20x='8.000000'%20y='8.000000'%20fill='rgb(255,255,255)'%20/%3e%3c/clipPath%3e%3cclipPath%20id='clipPath_14'%3e%3crect%20width='20.000000'%20height='20.000000'%20x='10.000000'%20y='10.000000'%20fill='rgb(255,255,255)'%20/%3e%3c/clipPath%3e%3c/defs%3e%3crect%20id='4'%20width='40.000000'%20height='40.000000'%20x='0.000000'%20y='0.000000'%20rx='12.000000'%20fill='rgb(234,255,244)'%20/%3e%3cg%20id='我的信息'%20clip-path='url(%23clipPath_13)'%20customFrame='url(%23clipPath_13)'%3e%3crect%20id='我的信息'%20width='24.000000'%20height='24.000000'%20x='8.000000'%20y='8.000000'%20/%3e%3cg%20id='组合%208'%20customFrame='url(%23clipPath_14)'%3e%3crect%20id='组合%208'%20width='20.000000'%20height='20.000000'%20x='10.000000'%20y='10.000000'%20/%3e%3cpath%20id='合并'%20d='M28.4994%2012.3142C28.4994%2012.2578%2028.4937%2012.2018%2028.4825%2012.1465C28.4713%2012.0911%2028.4547%2012.0373%2028.4327%2011.9851C28.4107%2011.933%2028.3836%2011.8835%2028.3516%2011.8365C28.3197%2011.7896%2028.2834%2011.7461%2028.2427%2011.7062C28.202%2011.6663%2028.1579%2011.6307%2028.1101%2011.5993C28.0622%2011.568%2028.0117%2011.5415%2027.9585%2011.5199C27.9054%2011.4983%2027.8506%2011.4819%2027.7942%2011.4709C27.7378%2011.4599%2027.6806%2011.4544%2027.6231%2011.4544L24.1832%2011.5199L24.1832%2010L29.0796%2010C29.1472%2010%2029.2143%2010.0065%2029.2806%2010.0194C29.347%2010.0324%2029.4114%2010.0516%2029.4739%2010.077C29.5364%2010.1024%2029.5961%2010.1336%2029.6523%2010.1705C29.7086%2010.2074%2029.7605%2010.2493%2029.8084%2010.2963C29.8562%2010.3433%2029.8991%2010.3944%2029.9367%2010.4496C29.9743%2010.5048%2030.006%2010.5631%2030.0319%2010.6244C30.0578%2010.6858%2030.0773%2010.7491%2030.0905%2010.8142C30.1037%2010.8794%2030.1104%2010.9451%2030.1104%2011.0115L30.1832%2014.4522L28.4992%2014.5L28.4994%2012.3142ZM11.6995%2012.3143C11.6995%2012.2579%2011.7051%2012.2019%2011.7163%2012.1466C11.7275%2012.0912%2011.7441%2012.0374%2011.7661%2011.9852C11.7882%2011.9331%2011.8152%2011.8836%2011.8472%2011.8366C11.8791%2011.7897%2011.9155%2011.7462%2011.9562%2011.7063C11.9968%2011.6664%2012.0409%2011.6308%2012.0888%2011.5994C12.1366%2011.5681%2012.1871%2011.5416%2012.2403%2011.52C12.2934%2011.4984%2012.3482%2011.482%2012.4046%2011.471C12.4611%2011.46%2012.5182%2011.4545%2012.5758%2011.4545L16.0157%2011.52L16.0157%2010.0001L11.1193%2010.0001C11.0516%2010.0001%2010.9846%2010.0066%2010.9182%2010.0196C10.8518%2010.0325%2010.7874%2010.0517%2010.7249%2010.0771C10.6624%2010.1025%2010.6028%2010.1337%2010.5465%2010.1706C10.4902%2010.2075%2010.4383%2010.2494%2010.3904%2010.2964C10.3426%2010.3434%2010.2997%2010.3945%2010.2621%2010.4497C10.2245%2010.5049%2010.1929%2010.5632%2010.167%2010.6245C10.1411%2010.6859%2010.1215%2010.7492%2010.1083%2010.8143C10.0951%2010.8795%2010.0885%2010.9452%2010.0884%2011.0116L10.0157%2014.4523L11.6997%2014.5L11.6995%2012.3143ZM25.3135%2021.8051L25.3135%2022.8167C25.7656%2022.8929%2026.2209%2022.9249%2026.6792%2022.9127C28.3381%2022.9127%2029.1675%2022.326%2029.1675%2021.1527C29.1733%2020.9869%2029.151%2020.825%2029.1006%2020.667C29.0503%2020.509%2028.9747%2020.3641%2028.8742%2020.2322C28.767%2020.1025%2028.6403%2019.9963%2028.4938%2019.9134C28.3474%2019.8306%2028.191%2019.7767%2028.0246%2019.7517L28.0246%2019.7011C28.0971%2019.6839%2028.1676%2019.6606%2028.236%2019.6311C28.3044%2019.6016%2028.3698%2019.5665%2028.4321%2019.5257C28.4944%2019.4848%2028.5526%2019.4389%2028.6069%2019.3879C28.6613%2019.3369%2028.7109%2019.2816%2028.7556%2019.222C28.8003%2019.1624%2028.8394%2019.0994%2028.8732%2019.033C28.9069%2018.9665%2028.9346%2018.8977%2028.9564%2018.8265C28.9782%2018.7552%2028.9937%2018.6826%2029.0028%2018.6086C29.0119%2018.5347%2029.0145%2018.4605%2029.0107%2018.3861C29.0217%2018.2675%2029.0176%2018.1495%2028.9984%2018.0319C28.9791%2017.9144%2028.9454%2017.8012%2028.8971%2017.6923C28.8489%2017.5834%2028.7875%2017.4823%2028.7134%2017.3891C28.6393%2017.2959%2028.5547%2017.2135%2028.4595%2017.1419C28.219%2017.0003%2027.963%2016.8972%2027.6915%2016.8326C27.4199%2016.7679%2027.1449%2016.7446%2026.8664%2016.7626C26.6258%2016.7621%2026.3864%2016.7791%2026.1482%2016.8132C25.9479%2016.8386%2025.7504%2016.8791%2025.5563%2016.9346L25.5563%2017.8854C25.743%2017.8264%2025.9337%2017.7842%2026.128%2017.759C26.3276%2017.73%2026.5282%2017.7148%2026.7298%2017.7134C27.0252%2017.6949%2027.3049%2017.7523%2027.5692%2017.8854C27.6168%2017.9161%2027.6595%2017.9525%2027.6972%2017.9947C27.7348%2018.037%2027.766%2018.0835%2027.791%2018.1343C27.816%2018.1851%2027.8337%2018.2383%2027.8441%2018.294C27.8545%2018.3496%2027.8573%2018.4056%2027.8525%2018.462C27.8566%2018.5278%2027.8514%2018.5927%2027.8367%2018.657C27.822%2018.7212%2027.7986%2018.7821%2027.7663%2018.8395C27.734%2018.897%2027.694%2018.9487%2027.6468%2018.9946C27.5995%2019.0405%2027.5468%2019.0787%2027.4885%2019.1093C27.1544%2019.2631%2026.8037%2019.3306%2026.4364%2019.3117L25.9862%2019.3117L25.9862%2020.1917L26.4466%2020.1917C26.8409%2020.1669%2027.2202%2020.2309%2027.5845%2020.3839C27.6459%2020.4167%2027.7011%2020.4576%2027.7505%2020.5066C27.7999%2020.5556%2027.8412%2020.6107%2027.8745%2020.6718C27.9077%2020.733%2027.9315%2020.7976%2027.9458%2020.8656C27.9602%2020.9337%2027.9644%2021.0024%2027.9587%2021.0717C27.9648%2021.1402%2027.9612%2021.2083%2027.9478%2021.2757C27.9344%2021.3432%2027.912%2021.4074%2027.8801%2021.4683C27.8483%2021.5293%2027.8086%2021.5846%2027.7609%2021.6341C27.7132%2021.6837%2027.6593%2021.7254%2027.5996%2021.7596C27.2884%2021.9045%2026.9613%2021.9685%2026.6184%2021.9518C26.1786%2021.9465%2025.7436%2021.8977%2025.3135%2021.8051ZM21.3382%2018.6238C21.3445%2018.5593%2021.343%2018.495%2021.3335%2018.4308C21.3241%2018.3667%2021.3069%2018.3046%2021.2822%2018.2447C21.2575%2018.1847%2021.226%2018.1287%2021.1876%2018.0765C21.1492%2018.0242%2021.1049%2017.9774%2021.055%2017.936C20.9359%2017.8608%2020.808%2017.806%2020.6714%2017.7714C20.5349%2017.7368%2020.3964%2017.7242%2020.2558%2017.7337C19.8009%2017.7395%2019.356%2017.8087%2018.9208%2017.9411L18.9208%2016.9598C19.4252%2016.8181%2019.9393%2016.7524%2020.4633%2016.7626C20.7322%2016.7484%2020.9964%2016.7773%2021.256%2016.8491C21.5156%2016.9209%2021.7571%2017.032%2021.9806%2017.1824C22.0729%2017.2601%2022.1548%2017.3474%2022.2263%2017.4446C22.2978%2017.5418%2022.3567%2017.646%2022.4034%2017.7573C22.45%2017.8686%2022.483%2017.9838%2022.5021%2018.1029C22.5213%2018.222%2022.5261%2018.3417%2022.5167%2018.462C22.5245%2018.7882%2022.4655%2019.1017%2022.3396%2019.4027C22.1879%2019.7384%2021.984%2020.0384%2021.7277%2020.3029C21.3021%2020.7337%2020.8502%2021.135%2020.3721%2021.5067L19.9928%2021.8051L19.9928%2021.8759L22.6938%2021.8759L22.6938%2022.8419L18.5464%2022.8419L18.5464%2021.7697C19.2882%2021.1796%2019.8579%2020.6975%2020.2558%2020.3232C20.574%2020.0432%2020.8523%2019.728%2021.0905%2019.3774C21.1675%2019.2665%2021.2269%2019.1469%2021.2691%2019.0187C21.3113%2018.8904%2021.3344%2018.7588%2021.3382%2018.6238ZM12.3102%2017.2127L12.3102%2018.1939L13.7769%2017.9107L13.7769%2022.8419L14.9605%2022.8419L14.9605%2016.8486L14.0957%2016.8486L12.3102%2017.2127ZM28.5524%2028.0475C28.5524%2028.104%2028.5467%2028.1599%2028.5353%2028.2152C28.5239%2028.2706%2028.5071%2028.3244%2028.4849%2028.3766C28.4626%2028.4287%2028.4352%2028.4782%2028.4028%2028.5252C28.3705%2028.5721%2028.3337%2028.6156%2028.2925%2028.6555C28.2513%2028.6954%2028.2067%2028.731%2028.1583%2028.7624C28.1098%2028.7937%2028.0587%2028.8202%2028.0049%2028.8418C27.9511%2028.8634%2027.8957%2028.8798%2027.8385%2028.8908C27.7814%2028.9018%2027.7235%2028.9073%2027.6653%2028.9073L24.1832%2028.8418L24.1832%2030.3617L29.1397%2030.3617C29.2082%2030.3617%2029.276%2030.3552%2029.3432%2030.3423C29.4104%2030.3293%2029.4756%2030.3101%2029.5389%2030.2847C29.6022%2030.2593%2029.6625%2030.2281%2029.7195%2030.1912C29.7765%2030.1543%2029.829%2030.1124%2029.8774%2030.0654C29.9259%2030.0184%2029.9693%2029.9673%2030.0074%2029.9121C30.0454%2029.8569%2030.0774%2029.7986%2030.1037%2029.7373C30.1299%2029.6759%2030.1497%2029.6126%2030.163%2029.5475C30.1764%2029.4823%2030.1831%2029.4166%2030.1832%2029.3502L30.1832%2026.0478L28.4785%2026L28.5524%2028.0475ZM11.6308%2028.0099C11.6308%2028.0664%2011.6365%2028.1223%2011.6479%2028.1777C11.6592%2028.233%2011.676%2028.2868%2011.6983%2028.339C11.7206%2028.3911%2011.748%2028.4406%2011.7803%2028.4876C11.8127%2028.5345%2011.8495%2028.578%2011.8906%2028.6179C11.9318%2028.6578%2011.9765%2028.6934%2012.0249%2028.7248C12.0733%2028.7562%2012.1244%2028.7826%2012.1783%2028.8042C12.2321%2028.8259%2012.2875%2028.8422%2012.3446%2028.8532C12.4017%2028.8642%2012.4596%2028.8697%2012.5178%2028.8698L16%2028.8042L16%2030.3241L11.0435%2030.3241C10.975%2030.3241%2010.9071%2030.3176%2010.8399%2030.3047C10.7727%2030.2917%2010.7076%2030.2725%2010.6443%2030.2471C10.581%2030.2217%2010.5206%2030.1906%2010.4637%2030.1537C10.4067%2030.1168%2010.3542%2030.0748%2010.3057%2030.0278C10.2573%2029.9809%2010.2138%2029.9298%2010.1758%2029.8745C10.1377%2029.8193%2010.1057%2029.7611%2010.0795%2029.6997C10.0533%2029.6383%2010.0335%2029.575%2010.0201%2029.5099C10.0068%2029.4448%2010%2029.379%2010%2029.3126L10%2026.0478L11.7047%2026L11.6308%2028.0099Z'%20fill='rgb(14,191,241)'%20fill-rule='evenodd'%20/%3e%3c/g%3e%3c/g%3e%3c/svg%3e", o0 = "data:image/svg+xml,%3csvg%20viewBox='0%200%2040%2040'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='40.000000'%20height='40.000000'%20fill='none'%20customFrame='url(%23clipPath_9)'%3e%3cdefs%3e%3cclipPath%20id='clipPath_9'%3e%3crect%20width='40.000000'%20height='40.000000'%20x='0.000000'%20y='0.000000'%20rx='12.000000'%20fill='rgb(255,255,255)'%20/%3e%3c/clipPath%3e%3cclipPath%20id='clipPath_10'%3e%3crect%20width='24.000000'%20height='24.000000'%20x='8.000000'%20y='8.000000'%20fill='rgb(255,255,255)'%20/%3e%3c/clipPath%3e%3cclipPath%20id='clipPath_11'%3e%3crect%20width='20.000000'%20height='20.000000'%20x='10.000000'%20y='10.000000'%20fill='rgb(255,255,255)'%20/%3e%3c/clipPath%3e%3c/defs%3e%3crect%20id='3'%20width='40.000000'%20height='40.000000'%20x='0.000000'%20y='0.000000'%20rx='12.000000'%20fill='rgb(236,250,254)'%20/%3e%3cg%20id='画板%202310'%20customFrame='url(%23clipPath_10)'%3e%3crect%20id='画板%202310'%20width='24.000000'%20height='24.000000'%20x='8.000000'%20y='8.000000'%20fill='rgb(255,255,255)'%20fill-opacity='0'%20/%3e%3cg%20id='人事服务'%3e%3cg%20id='ic_public_link'%20clip-path='url(%23clipPath_11)'%20customFrame='url(%23clipPath_11)'%3e%3crect%20id='ic_public_link'%20width='20.000000'%20height='20.000000'%20x='10.000000'%20y='10.000000'%20/%3e%3cpath%20id='path1'%20d='M9.9999%2019.9917C9.9999%2018.4292%209.99573%2016.8667%209.9999%2015.3042C9.99573%2014.5459%2010.0916%2013.7917%2010.2749%2013.0626C10.6874%2011.5126%2011.6957%2010.5917%2013.2457%2010.2334C14.0207%2010.0667%2014.8166%209.98756%2015.6082%2010.0001C18.6041%2010.0001%2021.5999%2010.0001%2024.5999%2010.0001C25.3541%209.99589%2026.1082%2010.0792%2026.8457%2010.2584C28.4416%2010.6459%2029.3999%2011.6584%2029.7624%2013.2501C29.9291%2014.0001%2030.0041%2014.7667%2029.9957%2015.5376C29.9957%2018.5667%2029.9957%2021.5959%2029.9957%2024.6209C29.9999%2025.3709%2029.9166%2026.1209%2029.7416%2026.8459C29.3499%2028.4459%2028.3332%2029.3959%2026.7457%2029.7626C25.9666%2029.9292%2025.1749%2030.0084%2024.3791%2029.9959C21.3957%2029.9959%2018.4124%2029.9959%2015.4291%2029.9959C14.6666%2030.0042%2013.9082%2029.9167%2013.1666%2029.7417C11.5624%2029.3542%2010.5999%2028.3376%2010.2374%2026.7376C10.0499%2025.9251%209.9999%2025.1126%209.9999%2024.2917C9.9999%2022.8584%209.9999%2021.4251%209.9999%2019.9917Z'%20fill='rgb(255,255,255)'%20fill-opacity='0'%20fill-rule='evenodd'%20/%3e%3ccircle%20id='path2'%20cx='20'%20cy='20'%20r='10'%20fill='rgb(255,255,255)'%20fill-opacity='0'%20/%3e%3cpath%20id='path3'%20d='M25.0333%2021.8666L26.9%2020C28.8083%2018.0916%2028.8083%2015%2026.9%2013.0958C24.9958%2011.1875%2021.9041%2011.1875%2020%2013.0958L18.1291%2014.9625M21.8666%2025.0333L20%2026.9C18.0916%2028.8083%2015%2028.8083%2013.0958%2026.9C11.1875%2024.9958%2011.1875%2021.9041%2013.0958%2020L14.9625%2018.1291'%20fill-rule='nonzero'%20stroke='rgb(14,191,241)'%20stroke-linecap='round'%20stroke-width='1.25'%20/%3e%3cpath%20id='pah4'%20d='M18.125%2021.875L21.875%2018.125'%20stroke='rgb(14,191,241)'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='1.25'%20/%3e%3cpath%20id='path5'%20d='M25.8207%2019.2626L24.0457%2021.0376C23.7998%2021.2834%2023.6748%2021.5292%2023.6748%2021.7751C23.6748%2022.0209%2023.7998%2022.2667%2024.0457%2022.5126C24.1498%2022.6167%2024.2665%2022.6959%2024.3915%2022.7459C24.5123%2022.7917%2024.6415%2022.8167%2024.779%2022.8167C24.9207%2022.8167%2025.0498%2022.7917%2025.1665%2022.7459C25.2957%2022.6959%2025.4123%2022.6167%2025.5165%2022.5126L27.2915%2020.7334C27.8165%2020.2126%2028.2165%2019.6334%2028.4957%2019.0001C28.5082%2018.9667%2028.5248%2018.9334%2028.5373%2018.8959C28.554%2018.8626%2028.5665%2018.8292%2028.579%2018.7917C28.8332%2018.1501%2028.9582%2017.4584%2028.9582%2016.7209C28.9582%2015.9792%2028.8332%2015.2876%2028.579%2014.6459C28.5665%2014.6084%2028.554%2014.5751%2028.5373%2014.5417C28.5248%2014.5042%2028.5082%2014.4709%2028.4957%2014.4376C28.2165%2013.8042%2027.8165%2013.2292%2027.2915%2012.7042C26.7707%2012.1792%2026.1915%2011.7792%2025.5582%2011.5001C25.5248%2011.4876%2025.4915%2011.4709%2025.454%2011.4584C25.4207%2011.4417%2025.3873%2011.4292%2025.354%2011.4167C24.7082%2011.1667%2024.0165%2011.0417%2023.279%2011.0417C22.5373%2011.0417%2021.8457%2011.1667%2021.204%2011.4167C21.1665%2011.4292%2021.1332%2011.4417%2021.0998%2011.4584C21.0623%2011.4709%2021.029%2011.4876%2020.9957%2011.5001C20.3623%2011.7792%2019.7832%2012.1792%2019.2623%2012.7042L17.4832%2014.4792C17.379%2014.5834%2017.2998%2014.7001%2017.2498%2014.8292C17.204%2014.9501%2017.179%2015.0751%2017.179%2015.2167C17.179%2015.3542%2017.204%2015.4834%2017.2498%2015.6042C17.2998%2015.7292%2017.379%2015.8459%2017.4832%2015.9542C17.5915%2016.0584%2017.7082%2016.1376%2017.8332%2016.1876C17.954%2016.2334%2018.0832%2016.2584%2018.2207%2016.2584C18.3623%2016.2584%2018.4915%2016.2334%2018.6082%2016.1876C18.7373%2016.1376%2018.854%2016.0584%2018.9582%2015.9542L20.7332%2014.1751C21.0873%2013.8209%2021.4748%2013.5584%2021.8957%2013.3834C22.3165%2013.2084%2022.779%2013.1251%2023.279%2013.1251C23.7748%2013.1251%2024.2373%2013.2084%2024.6582%2013.3834C25.079%2013.5584%2025.4665%2013.8209%2025.8207%2014.1751C26.1748%2014.5292%2026.4373%2014.9167%2026.6123%2015.3376C26.7873%2015.7584%2026.8748%2016.2167%2026.8748%2016.7209C26.8748%2017.2209%2026.7873%2017.6792%2026.6123%2018.1001C26.4373%2018.5209%2026.1748%2018.9084%2025.8207%2019.2626ZM13.3832%2021.8959C13.5582%2021.4751%2013.8207%2021.0876%2014.1748%2020.7334L15.954%2018.9584C16.0582%2018.8542%2016.1373%2018.7376%2016.1873%2018.6084C16.2332%2018.4876%2016.2582%2018.3626%2016.2582%2018.2209C16.2582%2018.0834%2016.2332%2017.9542%2016.1873%2017.8334C16.1373%2017.7084%2016.0582%2017.5917%2015.954%2017.4834C15.7082%2017.2417%2015.4623%2017.1167%2015.2165%2017.1167C14.9707%2017.1167%2014.7248%2017.2417%2014.479%2017.4834L12.704%2019.2626C12.179%2019.7876%2011.779%2020.3626%2011.4998%2020.9959C11.4873%2021.0292%2011.4707%2021.0626%2011.4582%2021.1001C11.4415%2021.1334%2011.429%2021.1667%2011.4165%2021.2042C11.1665%2021.8459%2011.0415%2022.5376%2011.0415%2023.2792C11.0415%2024.0167%2011.1665%2024.7084%2011.4165%2025.3542C11.429%2025.3876%2011.4415%2025.4209%2011.4582%2025.4584C11.4707%2025.4917%2011.4873%2025.5251%2011.4998%2025.5584C11.779%2026.1917%2012.179%2026.7709%2012.704%2027.2917C13.2248%2027.8167%2013.804%2028.2167%2014.4373%2028.4959C14.4707%2028.5084%2014.504%2028.5251%2014.5415%2028.5376C14.5748%2028.5542%2014.6082%2028.5667%2014.6457%2028.5792C15.2873%2028.8292%2015.979%2028.9584%2016.7207%2028.9584C17.4582%2028.9584%2018.1498%2028.8292%2018.7915%2028.5792C18.829%2028.5667%2018.8623%2028.5542%2018.8957%2028.5376C18.9332%2028.5251%2018.9665%2028.5084%2018.9998%2028.4959C19.6332%2028.2167%2020.2123%2027.8167%2020.7332%2027.2917L22.5123%2025.5167C22.6165%2025.4126%2022.6957%2025.2959%2022.7457%2025.1667C22.7915%2025.0459%2022.8165%2024.9209%2022.8165%2024.7792C22.8165%2024.6417%2022.7915%2024.5126%2022.7457%2024.3917C22.6957%2024.2667%2022.6165%2024.1501%2022.5123%2024.0417C22.2665%2023.8001%2022.0207%2023.6751%2021.7748%2023.6751C21.529%2023.6751%2021.2832%2023.8001%2021.0373%2024.0417L19.2623%2025.8209C18.9082%2026.1751%2018.5207%2026.4376%2018.0998%2026.6126C17.679%2026.7876%2017.2165%2026.8751%2016.7207%2026.8751C16.2207%2026.8751%2015.7582%2026.7876%2015.3373%2026.6126C14.9165%2026.4376%2014.529%2026.1751%2014.1748%2025.8209C13.8207%2025.4667%2013.5582%2025.0792%2013.3832%2024.6584C13.2082%2024.2376%2013.1248%2023.7792%2013.1248%2023.2792C13.1248%2022.7751%2013.2082%2022.3167%2013.3832%2021.8959Z'%20fill='rgb(255,255,255)'%20fill-opacity='0'%20fill-rule='evenodd'%20/%3e%3cpath%20id='path6'%20d='M21.8127%2016.7458C21.746%2016.7874%2021.6877%2016.8374%2021.6293%2016.8916L16.8918%2021.6291C16.8377%2021.6874%2016.7877%2021.7499%2016.746%2021.8124C16.7127%2021.8624%2016.6877%2021.9166%2016.6627%2021.9749C16.6377%2022.0374%2016.6168%2022.1041%2016.6043%2022.1708C16.5918%2022.2333%2016.5835%2022.2999%2016.5835%2022.3666C16.5835%2022.4333%2016.5918%2022.4999%2016.6043%2022.5666C16.6168%2022.6333%2016.6377%2022.6999%2016.6627%2022.7624C16.6877%2022.8166%2016.7127%2022.8708%2016.746%2022.9208C16.7877%2022.9874%2016.8377%2023.0499%2016.8918%2023.1041C16.946%2023.1583%2017.0085%2023.2083%2017.0752%2023.2499C17.1252%2023.2833%2017.1793%2023.3083%2017.2335%2023.3333C17.3002%2023.3583%2017.3627%2023.3791%2017.4293%2023.3916C17.496%2023.4041%2017.5627%2023.4124%2017.6293%2023.4124C17.696%2023.4124%2017.7627%2023.4041%2017.8252%2023.3916C17.8918%2023.3791%2017.9585%2023.3583%2018.021%2023.3333C18.0793%2023.3083%2018.1335%2023.2833%2018.1835%2023.2499C18.246%2023.2083%2018.3085%2023.1583%2018.3668%2023.1041L23.1043%2018.3666C23.1585%2018.3083%2023.2085%2018.2499%2023.2502%2018.1833C23.2835%2018.1333%2023.3085%2018.0791%2023.3335%2018.0208C23.3585%2017.9583%2023.3793%2017.8916%2023.3918%2017.8249C23.4043%2017.7624%2023.4127%2017.6958%2023.4127%2017.6291C23.4127%2017.5624%2023.4043%2017.4958%2023.3918%2017.4291C23.3793%2017.3624%2023.3585%2017.2999%2023.3335%2017.2333C23.3085%2017.1791%2023.2835%2017.1249%2023.2502%2017.0749C23.2085%2017.0083%2023.1585%2016.9458%2023.1043%2016.8916C23.046%2016.8374%2022.9877%2016.7874%2022.921%2016.7458C22.871%2016.7124%2022.8168%2016.6874%2022.7627%2016.6624C22.696%2016.6374%2022.6335%2016.6166%2022.5668%2016.6041C22.5002%2016.5916%2022.4335%2016.5833%2022.3668%2016.5833C22.3002%2016.5833%2022.2335%2016.5916%2022.171%2016.6041C22.1043%2016.6166%2022.0377%2016.6374%2021.9752%2016.6624C21.9168%2016.6874%2021.8627%2016.7124%2021.8127%2016.7458Z'%20fill='rgb(255,255,255)'%20fill-opacity='0'%20fill-rule='evenodd'%20/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", i0 = "data:image/svg+xml,%3csvg%20viewBox='0%200%2040%2040'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='40.000000'%20height='40.000000'%20fill='none'%20customFrame='url(%23clipPath_0)'%3e%3cdefs%3e%3cclipPath%20id='clipPath_0'%3e%3crect%20width='40.000000'%20height='40.000000'%20x='0.000000'%20y='0.000000'%20rx='12.000000'%20fill='rgb(255,255,255)'%20/%3e%3c/clipPath%3e%3cclipPath%20id='clipPath_1'%3e%3crect%20width='24.000000'%20height='24.000000'%20x='8.000000'%20y='8.000000'%20fill='rgb(255,255,255)'%20/%3e%3c/clipPath%3e%3cclipPath%20id='clipPath_2'%3e%3crect%20width='20.000000'%20height='20.000000'%20x='10.000000'%20y='10.000000'%20fill='rgb(255,255,255)'%20/%3e%3c/clipPath%3e%3c/defs%3e%3crect%20id='1'%20width='40.000000'%20height='40.000000'%20x='0.000000'%20y='0.000000'%20rx='12.000000'%20fill='rgb(236,250,254)'%20/%3e%3cg%20id='车辆'%20clip-path='url(%23clipPath_1)'%20customFrame='url(%23clipPath_1)'%3e%3crect%20id='车辆'%20width='24.000000'%20height='24.000000'%20x='8.000000'%20y='8.000000'%20/%3e%3cg%20id='编组'%3e%3cg%20id='ic_public_qrcode'%20clip-path='url(%23clipPath_2)'%20customFrame='url(%23clipPath_2)'%3e%3crect%20id='ic_public_qrcode'%20width='20.000000'%20height='20.000000'%20x='10.000000'%20y='10.000000'%20/%3e%3cg%20id='ic_public_qrcode_1_1'%3e%3cpath%20id='ic_public_qrcode_2_0'%20d='M10.6273%2019.9924C10.6273%2018.5277%2010.6222%2017.0631%2010.6273%2015.5985C10.6243%2014.8898%2010.7114%2014.1836%2010.8865%2013.4968C11.2702%2012.0432%2012.2171%2011.1805%2013.6693%2010.8458C14.3974%2010.6885%2015.1411%2010.6148%2015.886%2010.6261C18.6946%2010.6261%2021.5035%2010.6261%2024.3127%2010.6261C25.0221%2010.6217%2025.7295%2010.7029%2026.4195%2010.8678C27.9156%2011.2339%2028.8134%2012.1816%2029.1554%2013.6725C29.3092%2014.3772%2029.3826%2015.097%2029.3744%2015.8182C29.3744%2018.6571%2029.3744%2021.4963%2029.3744%2024.3357C29.3782%2025.0383%2029.2973%2025.7388%2029.1334%2026.422C28.7673%2027.9189%2027.8153%2028.8123%2026.3243%2029.1543C25.5961%2029.311%2024.8524%2029.3847%2024.1076%2029.374C21.3107%2029.374%2018.514%2029.374%2015.7176%2029.374C15.0027%2029.3798%2014.2897%2029.2999%2013.5939%2029.136C12.0912%2028.7698%2011.189%2027.8178%2010.8477%2026.3195C10.6734%2025.5579%2010.6273%2024.7941%2010.6273%2024.0237C10.6273%2022.6802%2010.6273%2021.3364%2010.6273%2019.9924Z'%20fill='rgb(255,255,255)'%20fill-opacity='0'%20fill-rule='nonzero'%20/%3e%3cpath%20id='ic_public_qrcode_2_0'%20d='M10.6273%2015.5985C10.6243%2014.8898%2010.7114%2014.1836%2010.8865%2013.4968C11.2702%2012.0432%2012.2171%2011.1805%2013.6693%2010.8458C14.3974%2010.6885%2015.1411%2010.6148%2015.886%2010.6261C18.6946%2010.6261%2021.5035%2010.6261%2024.3127%2010.6261C25.0221%2010.6217%2025.7295%2010.7029%2026.4195%2010.8678C27.9156%2011.2339%2028.8134%2012.1816%2029.1554%2013.6725C29.3092%2014.3772%2029.3826%2015.097%2029.3744%2015.8182C29.3744%2018.6571%2029.3744%2021.4963%2029.3744%2024.3357C29.3782%2025.0383%2029.2973%2025.7388%2029.1334%2026.422C28.7673%2027.9189%2027.8153%2028.8123%2026.3243%2029.1543C25.5961%2029.311%2024.8524%2029.3847%2024.1076%2029.374C21.3107%2029.374%2018.514%2029.374%2015.7176%2029.374C15.0027%2029.3798%2014.2897%2029.2999%2013.5939%2029.136C12.0912%2028.7698%2011.189%2027.8178%2010.8477%2026.3195C10.6734%2025.5579%2010.6273%2024.7941%2010.6273%2024.0237C10.6273%2022.6802%2010.6273%2021.3364%2010.6273%2019.9924C10.6273%2018.5277%2010.6222%2017.0631%2010.6273%2015.5985Z'%20fill-rule='nonzero'%20stroke='rgb(255,255,255)'%20stroke-opacity='0'%20stroke-width='1.25'%20/%3e%3cpath%20id='ic_public_qrcode_2_1'%20d='M10.6273%2015.5985C10.6243%2014.8898%2010.7114%2014.1836%2010.8865%2013.4968C11.2702%2012.0432%2012.2171%2011.1805%2013.6693%2010.8458C14.3974%2010.6885%2015.1411%2010.6148%2015.886%2010.6261C18.6946%2010.6261%2021.5035%2010.6261%2024.3127%2010.6261C25.0221%2010.6217%2025.7295%2010.7029%2026.4195%2010.8678C27.9156%2011.2339%2028.8134%2012.1816%2029.1554%2013.6725C29.3092%2014.3772%2029.3826%2015.097%2029.3744%2015.8182C29.3744%2018.6571%2029.3744%2021.4963%2029.3744%2024.3357C29.3782%2025.0383%2029.2973%2025.7388%2029.1334%2026.422C28.7673%2027.9189%2027.8153%2028.8123%2026.3243%2029.1543C25.5961%2029.311%2024.8524%2029.3847%2024.1076%2029.374C21.3107%2029.374%2018.514%2029.374%2015.7176%2029.374C15.0027%2029.3798%2014.2897%2029.2999%2013.5939%2029.136C12.0912%2028.7698%2011.189%2027.8178%2010.8477%2026.3195C10.6734%2025.5579%2010.6273%2024.7941%2010.6273%2024.0237C10.6273%2022.6802%2010.6273%2021.3364%2010.6273%2019.9924C10.6273%2018.5277%2010.6222%2017.0631%2010.6273%2015.5985Z'%20opacity='0.200000003'%20fill-rule='nonzero'%20stroke='rgb(255,255,255)'%20stroke-opacity='0'%20stroke-width='1.25'%20/%3e%3ccircle%20id='ic_public_qrcode_2_2'%20cx='20'%20cy='20'%20r='10'%20fill='rgb(255,255,255)'%20fill-opacity='0'%20/%3e%3cpath%20id='ic_public_qrcode_2_3'%20d='M17.5%2011.25C17.9602%2011.25%2018.3333%2011.6231%2018.3333%2012.0833L18.3333%2017.5C18.3333%2017.9602%2017.9602%2018.3333%2017.5%2018.3333L12.0833%2018.3333C11.6231%2018.3333%2011.25%2017.9602%2011.25%2017.5L11.25%2012.0833C11.25%2011.6231%2011.6231%2011.25%2012.0833%2011.25L17.5%2011.25ZM17.5%2021.6667C17.9602%2021.6667%2018.3333%2022.0398%2018.3333%2022.5L18.3333%2027.9167C18.3333%2028.3769%2017.9602%2028.75%2017.5%2028.75L12.0833%2028.75C11.6231%2028.75%2011.25%2028.3769%2011.25%2027.9167L11.25%2022.5C11.25%2022.0398%2011.6231%2021.6667%2012.0833%2021.6667L17.5%2021.6667ZM27.9167%2011.25C28.3769%2011.25%2028.75%2011.6231%2028.75%2012.0833L28.75%2017.5C28.75%2017.9602%2028.3769%2018.3333%2027.9167%2018.3333L22.5%2018.3333C22.0398%2018.3333%2021.6667%2017.9602%2021.6667%2017.5L21.6667%2012.0833C21.6667%2011.6231%2022.0398%2011.25%2022.5%2011.25L27.9167%2011.25Z'%20fill-rule='evenodd'%20stroke='rgb(14,191,241)'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='1.25'%20/%3e%3cpath%20id='ic_public_qrcode_2_4'%20d='M17.5002%2010.8333C18.1905%2010.8333%2018.7502%2011.3929%2018.7502%2012.0833L18.7502%2017.4999C18.7502%2018.1903%2018.1905%2018.7499%2017.5002%2018.7499L12.0835%2018.7499C11.3931%2018.7499%2010.8335%2018.1903%2010.8335%2017.4999L10.8335%2012.0833C10.8335%2011.3929%2011.3931%2010.8333%2012.0835%2010.8333L17.5002%2010.8333ZM17.5002%2011.6666L12.0835%2011.6666C11.8534%2011.6666%2011.6668%2011.8531%2011.6668%2012.0833L11.6668%2017.4999C11.6668%2017.73%2011.8534%2017.9166%2012.0835%2017.9166L17.5002%2017.9166C17.7303%2017.9166%2017.9168%2017.73%2017.9168%2017.4999L17.9168%2012.0833C17.9168%2011.8531%2017.7303%2011.6666%2017.5002%2011.6666ZM17.5002%2021.2499C18.1905%2021.2499%2018.7502%2021.8096%2018.7502%2022.4999L18.7502%2027.9166C18.7502%2028.6069%2018.1905%2029.1666%2017.5002%2029.1666L12.0835%2029.1666C11.3931%2029.1666%2010.8335%2028.6069%2010.8335%2027.9166L10.8335%2022.4999C10.8335%2021.8096%2011.3931%2021.2499%2012.0835%2021.2499L17.5002%2021.2499ZM17.5002%2022.0833L12.0835%2022.0833C11.8534%2022.0833%2011.6668%2022.2698%2011.6668%2022.4999L11.6668%2027.9166C11.6668%2028.1467%2011.8534%2028.3333%2012.0835%2028.3333L17.5002%2028.3333C17.7303%2028.3333%2017.9168%2028.1467%2017.9168%2027.9166L17.9168%2022.4999C17.9168%2022.2698%2017.7303%2022.0833%2017.5002%2022.0833ZM27.9168%2010.8333C28.6072%2010.8333%2029.1668%2011.3929%2029.1668%2012.0833L29.1668%2017.4999C29.1668%2018.1903%2028.6072%2018.7499%2027.9168%2018.7499L22.5002%2018.7499C21.8098%2018.7499%2021.2502%2018.1903%2021.2502%2017.4999L21.2502%2012.0833C21.2502%2011.3929%2021.8098%2010.8333%2022.5002%2010.8333L27.9168%2010.8333ZM27.9168%2011.6666L22.5002%2011.6666C22.27%2011.6666%2022.0835%2011.8531%2022.0835%2012.0833L22.0835%2017.4999C22.0835%2017.73%2022.27%2017.9166%2022.5002%2017.9166L27.9168%2017.9166C28.1469%2017.9166%2028.3335%2017.73%2028.3335%2017.4999L28.3335%2012.0833C28.3335%2011.8531%2028.1469%2011.6666%2027.9168%2011.6666Z'%20fill='rgb(255,255,255)'%20fill-opacity='0'%20fill-rule='nonzero'%20/%3e%3cpath%20id='ic_public_qrcode_2_4'%20d='M18.7502%2012.0833L18.7502%2017.4999C18.7502%2018.1903%2018.1905%2018.7499%2017.5002%2018.7499L12.0835%2018.7499C11.3931%2018.7499%2010.8335%2018.1903%2010.8335%2017.4999L10.8335%2012.0833C10.8335%2011.3929%2011.3931%2010.8333%2012.0835%2010.8333L17.5002%2010.8333C18.1905%2010.8333%2018.7502%2011.3929%2018.7502%2012.0833ZM12.0835%2011.6666C11.8534%2011.6666%2011.6668%2011.8531%2011.6668%2012.0833L11.6668%2017.4999C11.6668%2017.73%2011.8534%2017.9166%2012.0835%2017.9166L17.5002%2017.9166C17.7303%2017.9166%2017.9168%2017.73%2017.9168%2017.4999L17.9168%2012.0833C17.9168%2011.8531%2017.7303%2011.6666%2017.5002%2011.6666L12.0835%2011.6666ZM18.7502%2022.4999L18.7502%2027.9166C18.7502%2028.6069%2018.1905%2029.1666%2017.5002%2029.1666L12.0835%2029.1666C11.3931%2029.1666%2010.8335%2028.6069%2010.8335%2027.9166L10.8335%2022.4999C10.8335%2021.8096%2011.3931%2021.2499%2012.0835%2021.2499L17.5002%2021.2499C18.1905%2021.2499%2018.7502%2021.8096%2018.7502%2022.4999ZM12.0835%2022.0833C11.8534%2022.0833%2011.6668%2022.2698%2011.6668%2022.4999L11.6668%2027.9166C11.6668%2028.1467%2011.8534%2028.3333%2012.0835%2028.3333L17.5002%2028.3333C17.7303%2028.3333%2017.9168%2028.1467%2017.9168%2027.9166L17.9168%2022.4999C17.9168%2022.2698%2017.7303%2022.0833%2017.5002%2022.0833L12.0835%2022.0833ZM29.1668%2012.0833L29.1668%2017.4999C29.1668%2018.1903%2028.6072%2018.7499%2027.9168%2018.7499L22.5002%2018.7499C21.8098%2018.7499%2021.2502%2018.1903%2021.2502%2017.4999L21.2502%2012.0833C21.2502%2011.3929%2021.8098%2010.8333%2022.5002%2010.8333L27.9168%2010.8333C28.6072%2010.8333%2029.1668%2011.3929%2029.1668%2012.0833ZM22.5002%2011.6666C22.27%2011.6666%2022.0835%2011.8531%2022.0835%2012.0833L22.0835%2017.4999C22.0835%2017.73%2022.27%2017.9166%2022.5002%2017.9166L27.9168%2017.9166C28.1469%2017.9166%2028.3335%2017.73%2028.3335%2017.4999L28.3335%2012.0833C28.3335%2011.8531%2028.1469%2011.6666%2027.9168%2011.6666L22.5002%2011.6666Z'%20fill-rule='nonzero'%20stroke='rgb(255,255,255)'%20stroke-opacity='0'%20stroke-linejoin='round'%20stroke-width='1.25'%20/%3e%3cpath%20id='ic_public_qrcode_2_5'%20d='M27.9165%2021.6667L27.9165%2024.5834L28.7498%2024.5834L28.7498%2021.6667L27.9165%2021.6667ZM24.5832%2021.6667L24.5832%2022.639L24.5828%2022.6388L24.5832%2024.5834L23.6109%2024.5834L23.6107%2022.6388L21.6665%2022.639L21.6665%2021.6667L24.5832%2021.6667ZM21.6665%2025.8334L21.6665%2028.7501L22.4998%2028.7501L22.4998%2025.8334L21.6665%2025.8334ZM27.9165%2027.9167L27.9165%2028.7501L28.7498%2028.7501L28.7498%2027.9167L27.9165%2027.9167ZM25.8332%2025.8334L25.8332%2026.6667L26.6665%2026.6667L26.6665%2025.8334L25.8332%2025.8334Z'%20fill='rgb(14,191,241)'%20fill-rule='nonzero'%20/%3e%3cpath%20id='ic_public_qrcode_2_5'%20d='M27.9165%2024.5834L28.7498%2024.5834L28.7498%2021.6667L27.9165%2021.6667L27.9165%2024.5834ZM24.5832%2022.639L24.5828%2022.6388L24.5832%2024.5834L23.6109%2024.5834L23.6107%2022.6388L21.6665%2022.639L21.6665%2021.6667L24.5832%2021.6667L24.5832%2022.639ZM21.6665%2028.7501L22.4998%2028.7501L22.4998%2025.8334L21.6665%2025.8334L21.6665%2028.7501ZM27.9165%2028.7501L28.7498%2028.7501L28.7498%2027.9167L27.9165%2027.9167L27.9165%2028.7501ZM25.8332%2026.6667L26.6665%2026.6667L26.6665%2025.8334L25.8332%2025.8334L25.8332%2026.6667Z'%20fill-rule='nonzero'%20stroke='rgb(14,191,241)'%20stroke-linejoin='round'%20stroke-width='1.25'%20/%3e%3cpath%20id='ic_public_qrcode_2_6'%20d='M14.375%2014.375L14.375%2015.2083L15.2083%2015.2083L15.2083%2014.375L14.375%2014.375ZM14.375%2024.7917L14.375%2025.625L15.2083%2025.625L15.2083%2024.7917L14.375%2024.7917ZM24.7917%2014.375L24.7917%2015.2083L25.625%2015.2083L25.625%2014.375L24.7917%2014.375Z'%20fill='rgb(14,191,241)'%20fill-rule='nonzero'%20/%3e%3cpath%20id='ic_public_qrcode_2_6'%20d='M14.375%2015.2083L15.2083%2015.2083L15.2083%2014.375L14.375%2014.375L14.375%2015.2083ZM14.375%2025.625L15.2083%2025.625L15.2083%2024.7917L14.375%2024.7917L14.375%2025.625ZM24.7917%2015.2083L25.625%2015.2083L25.625%2014.375L24.7917%2014.375L24.7917%2015.2083Z'%20fill-rule='nonzero'%20stroke='rgb(14,191,241)'%20stroke-linejoin='round'%20stroke-width='1.25'%20/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", $0 = "data:image/svg+xml,%3csvg%20viewBox='0%200%2012%2012'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='12.000000'%20height='12.000000'%20fill='none'%3e%3cdefs%3e%3cfilter%20id='pixso_custom_mask_type_luminance'%3e%3cfeColorMatrix%20type='matrix'%20values='1%200%200%200%200%200%201%200%200%200%200%200%201%200%200%200%200%200%201%200%20'%20/%3e%3c/filter%3e%3c/defs%3e%3cmask%20id='mask_0'%20width='11.999876'%20height='11.999876'%20x='0.000000'%20y='0.000000'%20maskUnits='userSpaceOnUse'%3e%3cg%20filter='url(%23pixso_custom_mask_type_luminance)'%3e%3cg%20id='mask401_19830'%3e%3cpath%20id='蒙版'%20d='M0%200L11.9999%200L11.9999%2011.9999L0%2011.9999L0%200ZM2.69992%201.34999L8.09977%201.34999C9.5082%201.34999%2010.6498%202.49167%2010.6498%203.89998L10.6498%209.2999C10.6498%2010.7082%209.5082%2011.8499%208.09977%2011.8499L2.69992%2011.8499C1.29149%2011.8499%200.149901%2010.7082%200.149901%209.2999L0.149901%203.89998C0.149901%202.49167%201.29149%201.34999%202.69992%201.34999Z'%20fill='rgb(196,196,196)'%20fill-rule='evenodd'%20/%3e%3c/g%3e%3c/g%3e%3c/mask%3e%3crect%20id='ic_public_copy'%20width='12.000000'%20height='12.000000'%20x='0.000000'%20y='0.000000'%20/%3e%3crect%20id='ic_public_copy-复制/base/ic_public_copy'%20width='11.999876'%20height='11.999876'%20x='0.000000'%20y='0.000000'%20fill='rgb(255,255,255)'%20fill-opacity='0'%20/%3e%3cpath%20id='path1'%20d='M0.000134537%205.99497C0.000134537%205.05748%20-0.00236544%204.11999%200.000134537%203.1825C-0.00236544%202.72751%200.055134%202.27501%200.165133%201.83752C0.41263%200.907526%201.01762%200.355032%201.94761%200.140034C2.41261%200.040035%202.8901%20-0.00746449%203.3651%203.54269e-05C5.16258%203.54269e-05%206.96006%203.54269e-05%208.76004%203.54269e-05C9.21254%20-0.00246455%209.66503%200.0475349%2010.1075%200.155034C11.065%200.387531%2011.64%200.995025%2011.8575%201.95002C11.9575%202.40001%2012.005%202.86001%2011.9975%203.3225C11.9975%205.13998%2011.9975%206.95746%2011.9975%208.77244C12%209.22244%2011.95%209.67243%2011.845%2010.1099C11.61%2011.0674%2011%2011.6374%2010.0475%2011.8574C9.58003%2011.9574%209.10504%2012.0049%208.62754%2011.9974C6.83756%2011.9974%205.04758%2011.9974%203.2576%2011.9974C2.80011%2012.0024%202.34511%2011.9499%201.90011%2011.8449C0.937625%2011.6124%200.360131%2011.0024%200.142633%2010.0424C0.0301342%209.55494%200.000134537%209.06744%200.000134537%208.57495C0.000134537%207.71495%200.000134537%206.85496%200.000134537%205.99497Z'%20fill='rgb(255,255,255)'%20fill-opacity='0'%20fill-rule='evenodd'%20/%3e%3ccircle%20id='path2'%20cx='5.99993801'%20cy='5.99993801'%20r='5.99993801'%20fill='rgb(255,255,255)'%20fill-opacity='0'%20/%3e%3cg%20id='mask'%20mask='url(%23mask_0)'%3e%3cg%20id='组合%208'%3e%3cpath%20id='path'%20d='M11.1%203.89993L11.1%206.8999C11.1%208.55488%209.75502%209.89737%208.10004%209.89737L5.10007%209.89737C3.44258%209.89737%202.1001%208.55488%202.1001%206.8999L2.1001%203.89993C2.1001%202.24245%203.44258%200.897461%205.10007%200.897461L8.10004%200.897461C9.75502%200.897461%2011.1%202.24245%2011.1%203.89993Z'%20fill-rule='nonzero'%20stroke='rgb(25,25,25)'%20stroke-linejoin='round'%20stroke-width='0.749992251'%20/%3e%3c/g%3e%3c/g%3e%3cpath%20id='path4'%20d='M2.10008%202.39746L8.10002%202.39746C8.92751%202.39746%209.6%203.06995%209.6%203.89995L9.6%209.89738C9.6%2010.7274%208.92751%2011.3999%208.10002%2011.3999L2.10008%2011.3999C1.27009%2011.3999%200.600098%2010.7274%200.600098%209.89738L0.600098%203.89995C0.600098%203.06995%201.27009%202.39746%202.10008%202.39746Z'%20fill='rgb(255,255,255)'%20fill-opacity='0'%20fill-rule='evenodd'%20/%3e%3cpath%20id='path4'%20d='M9.6%203.89995L9.6%209.89738C9.6%2010.7274%208.92751%2011.3999%208.10002%2011.3999L2.10008%2011.3999C1.27009%2011.3999%200.600098%2010.7274%200.600098%209.89738L0.600098%203.89995C0.600098%203.06995%201.27009%202.39746%202.10008%202.39746L8.10002%202.39746C8.92751%202.39746%209.6%203.06995%209.6%203.89995Z'%20fill-rule='nonzero'%20stroke='rgb(25,25,25)'%20stroke-linejoin='round'%20stroke-width='0.749992251'%20/%3e%3c/svg%3e", L0 = "data:image/svg+xml,%3csvg%20width='100.000000'%20height='100.000000'%20viewBox='0%200%20100%20100'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cdesc%3e%20Created%20with%20Pixso.%20%3c/desc%3e%3cdefs%3e%3cradialGradient%20gradientTransform='translate(67.5526%2065.1155)%20rotate(51.0683)%20scale(22.991%2020.6919)'%20cx='0.000000'%20cy='0.000000'%20r='1.000000'%20id='paint_radial_9_3036_0'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%235ADDF8'/%3e%3cstop%20stop-color='%23AEBFFF'/%3e%3cstop%20offset='0.329153'%20stop-color='%231476FF'/%3e%3cstop%20offset='0.667785'%20stop-color='%23655AF8'/%3e%3cstop%20offset='0.868255'%20stop-color='%23948CFF'/%3e%3cstop%20offset='1.000000'%20stop-color='%23D25AF8'/%3e%3cstop%20offset='1.000000'%20stop-color='%235A8BF8'/%3e%3c/radialGradient%3e%3clinearGradient%20x1='69.000122'%20y1='85.000198'%20x2='69.500107'%20y2='70.500183'%20id='paint_linear_9_3039_0'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23000000'%20stop-opacity='0.000000'/%3e%3cstop%20offset='1.000000'%20stop-color='%23000000'/%3e%3c/linearGradient%3e%3cradialGradient%20gradientTransform='translate(26.9999%2024.7118)%20rotate(38.3655)%20scale(77.7996%20109.496)'%20cx='0.000000'%20cy='0.000000'%20r='1.000000'%20id='paint_radial_9_3040_0'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%235ADDF8'/%3e%3cstop%20stop-color='%23AEBFFF'/%3e%3cstop%20offset='0.329153'%20stop-color='%231476FF'/%3e%3cstop%20offset='0.667785'%20stop-color='%23655AF8'/%3e%3cstop%20offset='0.868255'%20stop-color='%23948CFF'/%3e%3cstop%20offset='1.000000'%20stop-color='%23D25AF8'/%3e%3cstop%20offset='1.000000'%20stop-color='%235A8BF8'/%3e%3c/radialGradient%3e%3c/defs%3e%3crect%20id='NEXT-LOGO-无背景渐变-左'%20width='100.000000'%20height='99.999939'%20fill='%23FFFFFF'%20fill-opacity='0'/%3e%3cmask%20id='mask9_3032'%20mask-type='alpha'%20maskUnits='userSpaceOnUse'%20x='0.000000'%20y='0.000061'%20width='99.999939'%20height='99.999939'%3e%3crect%20id='画板%201773'%20y='0.000061'%20width='99.999962'%20height='99.999947'%20fill='%23000000'%20fill-opacity='1.000000'/%3e%3c/mask%3e%3cg%20mask='url(%23mask9_3032)'%3e%3cpath%20id='矢量%201'%20d='M64.07%2081.01L64%2063L82%2063.07L67.51%2082.23C66.39%2083.71%2064.07%2082.9%2064.07%2081.01Z'%20fill='url(%23paint_radial_9_3036_0)'%20fill-opacity='1.000000'%20fill-rule='evenodd'/%3e%3cg%20opacity='0.100000'%20style='mix-blend-mode:normal'%3e%3cpath%20id='矢量%201'%20d='M64.07%2081.01L64%2063L82%2063.07L67.51%2082.23C66.39%2083.71%2064.07%2082.9%2064.07%2081.01Z'%20fill='url(%23paint_linear_9_3039_0)'%20fill-opacity='1.000000'%20fill-rule='evenodd'/%3e%3c/g%3e%3crect%20id='矩形%205'%20x='12.000000'%20y='19.000153'%20rx='26.999992'%20width='75.999977'%20height='53.999985'%20fill='url(%23paint_radial_9_3040_0)'%20fill-opacity='1.000000'/%3e%3crect%20id='矩形%205'%20x='12.500000'%20y='19.500153'%20rx='26.499992'%20width='74.999977'%20height='52.999985'%20fill='%23000000'%20fill-opacity='0'/%3e%3crect%20id='矩形%205'%20x='12.500000'%20y='19.500153'%20rx='26.499992'%20width='74.999977'%20height='52.999985'%20stroke='%23000000'%20stroke-opacity='0'%20stroke-width='1.000000'/%3e%3cpath%20id='path'%20d='M54.61%2059.06C55.78%2060.05%2057.1%2060.66%2058.57%2060.89C60.05%2061.12%2061.43%2061.04%2062.72%2060.65C64%2060.26%2065.96%2058.58%2065.96%2058.58C65.96%2058.58%2070.98%2054.73%2070.98%2045.61C70.98%2036.5%2066.5%2032.5%2066.5%2032.5C66.5%2032.5%2065.28%2031.31%2063.5%2031C61.71%2030.68%2060.57%2030.98%2059.34%2031.33C49.11%2034.23%2037.62%2034.33%2027.42%2031.33C26.19%2030.98%2025.09%2030.93%2024.11%2031.17C23.13%2031.42%2022.29%2031.89%2021.58%2032.59C18.35%2035.81%2017.12%2041.06%2017%2045.61C16.87%2050.09%2018.03%2055.24%2021.06%2058.54C21.96%2059.52%2023.02%2060.22%2024.22%2060.63C25.41%2061.04%2026.68%2061.12%2028.01%2060.89C29.34%2060.66%2030.52%2060.05%2031.54%2059.06C31.98%2058.62%2032.61%2058.07%2033.43%2057.4C34.24%2056.73%2035.16%2056.08%2036.21%2055.44C37.25%2054.8%2038.38%2054.25%2039.61%2053.8C40.84%2053.35%2042.09%2053.13%2043.38%2053.13C44.64%2053.13%2045.84%2053.36%2047%2053.83C48.15%2054.29%2049.21%2054.84%2050.18%2055.48C51.14%2056.12%2052%2056.78%2052.74%2057.45C53.49%2058.11%2054.11%2058.65%2054.61%2059.06Z'%20fill='%23FFFFFF'%20fill-opacity='1.000000'%20fill-rule='nonzero'/%3e%3crect%20id='矩形%20840'%20x='58.016602'%20y='38.000046'%20rx='2.000000'%20width='3.999999'%20height='11.999996'%20transform='rotate(1.39597%2058.016602%2038.000046)'%20fill='%231476FF'%20fill-opacity='1.000000'/%3e%3cpath%20id='合并'%20d='M28.97%2038C28.17%2037.97%2027.38%2038.42%2027.01%2039.19L23.2%2047.11C22.71%2048.13%2023.15%2049.34%2024.18%2049.81C25.22%2050.28%2026.45%2049.83%2026.94%2048.8L28.97%2044.59L30.99%2048.81C31.48%2049.83%2032.72%2050.28%2033.75%2049.81C34.79%2049.34%2035.23%2048.13%2034.74%2047.11L30.93%2039.19C30.56%2038.42%2029.78%2037.98%2028.97%2038Z'%20fill='%231476FF'%20fill-opacity='1.000000'%20fill-rule='evenodd'/%3e%3c/g%3e%3c/svg%3e", S0 = "https://chat.opentiny.design", T0 = "https://ai.opentiny.design/next-remoter", E0 = L0, M0 = (e) => {
359
- const t = !!e.sessionId;
360
- return [
361
- {
362
- action: "qr-code",
363
- show: t,
364
- text: "扫码登录",
365
- desc: "使用手机遥控页面",
366
- icon: i0
367
- },
368
- {
369
- action: "ai-chat",
370
- show: !0,
371
- text: "打开对话框",
372
- desc: "支持在网页端操作AI",
373
- icon: t0
374
- },
375
- {
376
- action: "remote-url",
377
- show: t,
378
- text: "遥控器链接",
379
- desc: `${e.remoteUrl}`,
380
- active: !0,
381
- tip: e.remoteUrl,
382
- showCopyIcon: !0,
383
- icon: o0
384
- },
385
- {
386
- action: "remote-control",
387
- show: t,
388
- text: "识别码",
389
- desc: t ? `${e.sessionId.slice(-6)}` : "",
390
- know: !0,
391
- showCopyIcon: !0,
392
- icon: r0
393
- }
394
- ];
395
- };
396
- class P0 {
397
- constructor(t) {
398
- this.isExpanded = !1, this.closingTimer = 0, this.getImageUrl = (r) => {
399
- if (!r) return;
400
- const o = new Image();
401
- return o.src = r, o;
402
- }, this.renderItem = () => {
403
- this.menuItems.filter((r) => r.show !== !1).map((r) => {
404
- const o = document.getElementById(`tiny-remoter-icon-item-${r.action}`);
405
- if (!o) return;
406
- o.innerHTML = "";
407
- const n = this.getImageUrl(r.icon);
408
- n && o.appendChild(n);
409
- });
410
- }, this.readyTips = (r) => {
411
- const o = document.getElementById(r);
412
- o && new k0(o, {
413
- content: "复制",
414
- placement: "top",
415
- trigger: "hover"
416
- });
417
- }, this.options = {
418
- ...t,
419
- qrCodeUrl: t.qrCodeUrl || T0,
420
- remoteUrl: t.remoteUrl || S0,
421
- logoUrl: t.logoUrl || E0
422
- }, t.menuItems && t.menuItems.length === 0 ? this.menuItems = [] : this.menuItems = this.mergeMenuItems(t.menuItems), this.init();
423
- }
424
- // 计算 sessionPrefix 属性
425
- get sessionPrefix() {
426
- return this.options.qrCodeUrl?.includes("?") ? "&sessionId=" : "?sessionId=";
427
- }
428
- /**
429
- * 合并菜单项配置。
430
- * - 用户明确传入 menuItems:直接使用用户配置,不受 sessionId 限制;未传 icon 时自动补充默认图标
431
- * - 有 sessionId 且未传 menuItems:使用默认菜单
432
- * - 无 sessionId 且未传 menuItems:不渲染任何下拉菜单,仅保留点击浮标打开对话框的能力
433
- */
434
- mergeMenuItems(t) {
435
- const r = {
436
- "qr-code": i0,
437
- "ai-chat": t0,
438
- "remote-url": o0,
439
- "remote-control": r0
440
- };
441
- return t ? t.map((o) => ({
442
- ...o,
443
- icon: o.icon ?? r[o.action]
444
- })) : this.options.sessionId ? M0(this.options) : [];
445
- }
446
- init() {
447
- this.createFloatingBlock(), this.createDropdownMenu(), this.bindEvents(), this.addStyles();
448
- }
449
- // 创建主浮动块
450
- createFloatingBlock() {
451
- this.floatingBlock = document.createElement("div"), this.floatingBlock.className = "tiny-remoter-floating-block", this.floatingBlock.innerHTML = `
452
- <div class="tiny-remoter-floating-block__icon">
453
- <img style="display: block; width: 56px;" src="${this.options.logoUrl}" alt="icon" />
454
- </div>
455
- `, document.body.appendChild(this.floatingBlock);
456
- }
457
- // 创建下拉菜单
458
- createDropdownMenu() {
459
- this.dropdownMenu = document.createElement("div"), this.dropdownMenu.className = "tiny-remoter-floating-dropdown";
460
- const t = this.menuItems.filter((r) => r.show !== !1).map(
461
- (r) => `
462
- <div class="tiny-remoter-dropdown-item" data-action="${r.action}">
463
- <div id="tiny-remoter-icon-item-${r.action}" class="tiny-remoter-dropdown-item__icon">
464
- </div>
465
- <div class="tiny-remoter-dropdown-item__content">
466
- <div title="${r.tip}">${r.text}</div>
467
- <div class="tiny-remoter-dropdown-item__desc-wrapper">
468
- <div class="tiny-remoter-dropdown-item__desc ${r.active ? "tiny-remoter-dropdown-item__desc--active" : ""} ${r.know ? "tiny-remoter-dropdown-item__desc--know" : ""}">${r.desc ?? ""}</div>
469
- <div>
470
- ${r.showCopyIcon ? `
471
- <div class="tiny-remoter-copy-icon" id="${r.action}" data-action="${r.action}">
472
- <img src="${$0}"/>
473
- </div>
474
- ` : ""}
475
- </div>
476
- </div>
477
- </div>
478
- </div>
479
- `
480
- ).join("");
481
- this.dropdownMenu.innerHTML = t, document.body.appendChild(this.dropdownMenu), this.renderItem(), this.readyTips("remote-control"), this.readyTips("remote-url");
482
- }
483
- bindEvents() {
484
- this.floatingBlock.addEventListener("click", () => {
485
- this.showAIChat();
486
- }), this.floatingBlock.addEventListener("mouseenter", () => {
487
- this.openDropdown(), this.closingTimer && (window.clearTimeout(this.closingTimer), this.closingTimer = 0);
488
- }), this.floatingBlock.addEventListener("mouseleave", () => {
489
- this.shouldCloseDropdown();
490
- }), this.dropdownMenu.addEventListener("mouseenter", (t) => {
491
- this.closingTimer && (window.clearTimeout(this.closingTimer), this.closingTimer = 0);
492
- }), this.dropdownMenu.addEventListener("mouseleave", (t) => {
493
- this.shouldCloseDropdown();
494
- }), this.dropdownMenu.addEventListener("click", (t) => {
495
- const r = t.target, o = r.closest(".tiny-remoter-copy-icon");
496
- if (o) {
497
- t.stopPropagation();
498
- const i = o.dataset.action;
499
- i && this.handleAction(i);
500
- return;
501
- }
502
- const s = r.closest(".tiny-remoter-dropdown-item")?.dataset.action;
503
- s && this.handleAction(s);
504
- }), document.addEventListener("click", (t) => {
505
- const r = t.target;
506
- !this.floatingBlock.contains(r) && !this.dropdownMenu.contains(r) && this.closeDropdown();
507
- }), document.addEventListener("keydown", (t) => {
508
- t.key === "Escape" && this.closeDropdown();
509
- });
510
- }
511
- openDropdown() {
512
- !this.menuItems || this.menuItems && this.menuItems.length === 0 || (this.isExpanded = !0, this.floatingBlock.classList.add("expanded"), this.dropdownMenu.classList.add("show"));
513
- }
514
- shouldCloseDropdown() {
515
- this.closingTimer = window.setTimeout(() => {
516
- this.closeDropdown();
517
- }, 300);
518
- }
519
- /** 真正的立即关闭 */
520
- closeDropdown() {
521
- this.isExpanded = !1, this.floatingBlock.classList.remove("expanded"), this.dropdownMenu.classList.remove("show");
522
- }
523
- handleAction(t) {
524
- switch (t) {
525
- case "qr-code":
526
- this.showQRCode();
527
- break;
528
- case "ai-chat":
529
- this.showAIChat();
530
- break;
531
- case "remote-control":
532
- this.copyRemoteControl();
533
- break;
534
- case "remote-url":
535
- this.copyRemoteURL();
536
- break;
537
- }
538
- this.closeDropdown();
539
- }
540
- copyRemoteControl() {
541
- const t = this.menuItems.find((o) => o.action === "remote-control"), r = t?.desc || t?.text || (this.options.sessionId ? this.options.sessionId.slice(-6) : "");
542
- r && this.copyToClipboard(r);
543
- }
544
- copyRemoteURL() {
545
- const t = this.menuItems.find((s) => s.action === "remote-url"), r = this.options.sessionId ? this.options.remoteUrl + this.sessionPrefix + this.options.sessionId : "", n = (t?.desc && t.desc !== this.options.remoteUrl ? t.desc : void 0) || r || t?.text || "";
546
- n && this.copyToClipboard(n);
547
- }
548
- // 实现复制到剪贴板功能
549
- async copyToClipboard(t) {
550
- try {
551
- if (navigator.clipboard && window.isSecureContext)
552
- await navigator.clipboard.writeText(t), this.showCopyFeedback(!0);
553
- else {
554
- const r = document.createElement("textarea");
555
- r.value = t, r.style.position = "fixed", r.style.left = "-999999px", r.style.top = "-999999px", document.body.appendChild(r), r.focus(), r.select();
556
- const o = document.execCommand("copy");
557
- document.body.removeChild(r), o ? this.showCopyFeedback(!0) : this.showCopyFeedback(!1);
558
- }
559
- } catch (r) {
560
- console.error("复制失败:", r), this.showCopyFeedback(!1);
561
- }
562
- }
563
- // 显示复制反馈提示
564
- showCopyFeedback(t) {
565
- const r = t ? "复制成功!" : "复制失败,请手动复制", o = document.createElement("div");
566
- o.className = `tiny-remoter-copy-feedback ${t ? "success" : "error"}`, o.textContent = r, document.body.appendChild(o), setTimeout(() => o.classList.add("show"), 10), setTimeout(() => {
567
- o.classList.remove("show"), setTimeout(() => {
568
- o.parentNode && o.parentNode.removeChild(o);
569
- }, 300);
570
- }, 1500);
571
- }
572
- // 创建二维码弹窗(无 sessionId 时不展示)
573
- async showQRCode() {
574
- if (!this.options.sessionId) return;
575
- const r = await new v0((this.options.qrCodeUrl || "") + this.sessionPrefix + this.options.sessionId, {}).toDataURL(), o = this.createModal(
576
- "扫码前往智能遥控器",
577
- `
578
- <div style="text-align: center; padding: 32px;">
579
- <!-- 二维码容器 - 添加渐变背景和阴影效果 -->
580
- <div style="
581
- width: 240px;
582
- height: 240px;
583
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
584
- margin: 0 auto 24px;
585
- display: flex;
586
- align-items: center;
587
- justify-content: center;
588
- border-radius: 20px;
589
- box-shadow: 0 20px 40px rgba(102, 126, 234, 0.3);
590
- position: relative;
591
- overflow: hidden;
592
- ">
593
- <!-- 装饰性背景元素 -->
594
- <div style="
595
- position: absolute;
596
- top: -50%;
597
- left: -50%;
598
- width: 200%;
599
- height: 200%;
600
- background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
601
- animation: rotate 20s linear infinite;
602
- "></div>
603
-
604
- <!-- 二维码图片容器 -->
605
- <div style="
606
- width: 200px;
607
- height: 200px;
608
- background: white;
609
- border-radius: 16px;
610
- padding: 16px;
611
- box-shadow: 0 8px 32px rgba(0,0,0,0.1);
612
- position: relative;
613
- z-index: 1;
614
- ">
615
- <img src="${r}" alt="二维码" style="
616
- width: 100%;
617
- height: 100%;
618
- object-fit: contain;
619
- border-radius: 8px;
620
- ">
621
- </div>
622
- </div>
623
-
624
- <!-- 标题文字 -->
625
- <h3 style="
626
- color: #333;
627
- margin: 0 0 12px 0;
628
- font-size: 20px;
629
- font-weight: 600;
630
- letter-spacing: 0.5px;
631
- ">扫描二维码</h3>
632
-
633
- <!-- 描述文字 -->
634
- <p style="
635
- color: #666;
636
- margin: 0 auto;
637
- margin-bottom: 20px;
638
- font-size: 14px;
639
- line-height: 1.6;
640
- max-width: 280px;
641
- ">请使用手机微信或者浏览器扫描二维码跳转到智能遥控器</p>
642
-
643
- <!-- 提示图标和文字 -->
644
- <div style="
645
- display: flex;
646
- align-items: center;
647
- justify-content: center;
648
- gap: 8px;
649
- color: #999;
650
- font-size: 12px;
651
- ">
652
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" style="opacity: 0.7;">
653
- <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" fill="currentColor"/>
654
- </svg>
655
- <span>支持微信、浏览器等多种方式</span>
656
- </div>
657
- </div>
658
- `
659
- );
660
- this.showModal(o);
661
- }
662
- // 创建AI对话弹窗--- 暂时调 “用户函数”
663
- showAIChat() {
664
- this.options.onShowAIChat?.();
665
- }
666
- createModal(t, r) {
667
- const o = document.createElement("div");
668
- o.className = "tiny-remoter-floating-modal", o.innerHTML = `
669
- <div class="tiny-remoter-modal-overlay"></div>
670
- <div class="tiny-remoter-modal-content">
671
- <div class="tiny-remoter-modal-header">
672
- <h3>${t}</h3>
673
- <button class="tiny-remoter-modal-close">&times;</button>
674
- </div>
675
- <div class="tiny-remoter-modal-body">
676
- ${r}
677
- </div>
678
- </div>
679
- `;
680
- const n = o.querySelector(".tiny-remoter-modal-close"), s = o.querySelector(".tiny-remoter-modal-overlay");
681
- return n.addEventListener("click", () => this.hideModal(o)), s.addEventListener("click", () => this.hideModal(o)), o;
682
- }
683
- showModal(t) {
684
- document.body.appendChild(t), setTimeout(() => t.classList.add("show"), 10);
685
- }
686
- hideModal(t) {
687
- t.classList.remove("show"), setTimeout(() => {
688
- t.parentNode && t.parentNode.removeChild(t);
689
- }, 100);
690
- }
691
- // 创建样式表
692
- addStyles() {
693
- const t = document.createElement("style");
694
- t.textContent = `
695
- /* 浮动块样式 */
696
- .tiny-remoter-floating-block {
697
- position: fixed;
698
- bottom: 30px;
699
- right: 30px;
700
- width: 60px;
701
- height: 60px;
702
- cursor: pointer;
703
- display: flex;
704
- align-items: center;
705
- justify-content: center;
706
- color: white;
707
- transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
708
- z-index: 99;
709
- overflow: hidden;
710
- border-radius: 50%;
711
- }
712
-
713
- .tiny-remoter-floating-block__icon {
714
- transform: scale(0.8);
715
- transition: transform 0.3s ease;
716
- }
717
-
718
- .tiny-remoter-floating-block__icon:hover {
719
- transform: scale(1.1);
720
- }
721
-
722
- .tiny-remoter-floating-block.expanded .tiny-remoter-floating-block__icon {
723
- transform: scale(1.1);
724
- }
725
-
726
- /* 下拉菜单样式 */
727
- .tiny-remoter-floating-dropdown {
728
- position: fixed;
729
- bottom: 100px;
730
- right: 30px;
731
- background: white;
732
- border-radius: 18px;
733
- box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
734
- padding: 24px 24px 0px 24px;
735
- opacity: 0;
736
- visibility: hidden;
737
- transform: translateY(20px) scale(0.95);
738
- transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
739
- z-index: 999;
740
- min-width: 200px;
741
- width: 223px;
742
- height: auto;
743
- }
744
-
745
- .tiny-remoter-floating-dropdown.show {
746
- opacity: 1;
747
- visibility: visible;
748
- transform: translateY(0) scale(1);
749
- }
750
-
751
- .tiny-remoter-dropdown-item {
752
- display: flex;
753
- align-items: center;
754
- border-radius: 12px;
755
- cursor: pointer;
756
- transition: all 0.2s ease;
757
- color: #333;
758
- margin-bottom: 24px;
759
- height: 40px;
760
- }
761
-
762
- .tiny-remoter-dropdown-item:last-child {
763
- margin-bottom: 32px;
764
- }
765
-
766
- .tiny-remoter-dropdown-item > span {
767
- flex: 1;
768
- overflow: hidden;
769
- max-width: 120px;
770
- text-overflow: ellipsis;
771
- white-space: nowrap;
772
- }
773
-
774
- .tiny-remoter-dropdown-item__icon {
775
- display: flex;
776
- align-items: center;
777
- justify-content: center;
778
- width: 40px;
779
- height: 40px;
780
- background: #f8f9fa;
781
- border-radius: 8px;
782
- color: #667eea;
783
- }
784
-
785
- .tiny-remoter-dropdown-item__content {
786
- flex: 1;
787
- display: flex;
788
- flex-direction: column;
789
- gap: 4px;
790
- overflow: hidden;
791
- font-size: 12px;
792
- margin-left: 16px;
793
- }
794
-
795
- .tiny-remoter-dropdown-item__desc-wrapper {
796
- display: flex;
797
- align-items: center;
798
- gap: 4px;
799
- }
800
-
801
- .tiny-remoter-dropdown-item__desc {
802
- color: #808080;
803
- overflow: hidden;
804
- white-space: nowrap;
805
- text-overflow: ellipsis;
806
- }
807
-
808
- .tiny-remoter-dropdown-item__desc--active {
809
- color: #1476ff;
810
- }
811
-
812
- .tiny-remoter-dropdown-item__desc--know {
813
- color: #191919;
814
- }
815
-
816
- /* 复制图标样式 */
817
- .tiny-remoter-copy-icon {
818
- display: flex;
819
- align-items: center;
820
- justify-content: center;
821
- width: 24px;
822
- height: 24px;
823
- background: #f0f0f0;
824
- border-radius: 6px;
825
- color: #666;
826
- cursor: pointer;
827
- transition: all 0.2s ease;
828
- opacity: 0.7;
829
- margin-left: auto;
830
- }
831
-
832
- .tiny-remoter-copy-icon:hover {
833
- background: #e0e0e0;
834
- color: #333;
835
- opacity: 1;
836
- transform: scale(1.1);
837
- }
838
-
839
- .tiny-remoter-copy-icon:active {
840
- transform: scale(0.95);
841
- }
842
-
843
- /* 弹窗样式 */
844
- .tiny-remoter-floating-modal {
845
- position: fixed;
846
- top: 0;
847
- left: 0;
848
- width: 100%;
849
- height: 100%;
850
- z-index: 2000;
851
- display: flex;
852
- align-items: center;
853
- justify-content: center;
854
- }
855
-
856
- .tiny-remoter-modal-overlay {
857
- position: absolute;
858
- top: 0;
859
- left: 0;
860
- width: 100%;
861
- height: 100%;
862
- background: rgba(0, 0, 0, 0.5);
863
- backdrop-filter: blur(4px);
864
- opacity: 0;
865
- transition: opacity 0.3s ease;
866
- }
867
-
868
- .tiny-remoter-modal-content {
869
- background: white;
870
- border-radius: 16px;
871
- box-shadow: 0 25px 80px rgba(0, 0, 0, 0.2);
872
- max-width: 500px;
873
- width: 90%;
874
- max-height: 80vh;
875
- overflow: hidden;
876
- transform: scale(0.9) translateY(20px);
877
- transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
878
- }
879
-
880
- .tiny-remoter-floating-modal.show .tiny-remoter-modal-overlay {
881
- opacity: 1;
882
- }
883
-
884
- .tiny-remoter-floating-modal.show .tiny-remoter-modal-content {
885
- transform: scale(1) translateY(0);
886
- }
887
-
888
- .tiny-remoter-modal-header {
889
- display: flex;
890
- align-items: center;
891
- justify-content: space-between;
892
- padding: 20px 24px;
893
- border-bottom: 1px solid #f0f0f0;
894
- }
895
-
896
- .tiny-remoter-modal-header h3 {
897
- margin: 0;
898
- font-size: 18px;
899
- font-weight: 600;
900
- color: #333;
901
- }
902
-
903
- .tiny-remoter-modal-close {
904
- background: none;
905
- border: none;
906
- font-size: 24px;
907
- cursor: pointer;
908
- color: #999;
909
- padding: 0;
910
- width: 32px;
911
- height: 32px;
912
- border-radius: 50%;
913
- display: flex;
914
- align-items: center;
915
- justify-content: center;
916
- transition: all 0.2s ease;
917
- }
918
-
919
- .tiny-remoter-modal-close:hover {
920
- background: #f5f5f5;
921
- color: #666;
922
- }
923
-
924
- .tiny-remoter-modal-body {
925
- padding: 24px;
926
- }
927
-
928
- /* 二维码弹窗动画 */
929
- @keyframes rotate {
930
- from {
931
- transform: rotate(0deg);
932
- }
933
- to {
934
- transform: rotate(360deg);
935
- }
936
- }
937
-
938
- /* 响应式设计 */
939
- @media (max-width: 768px) {
940
- .tiny-remoter-floating-block {
941
- bottom: 20px;
942
- right: 20px;
943
- width: 56px;
944
- height: 56px;
945
- }
946
-
947
- .tiny-remoter-floating-dropdown {
948
- bottom: 90px;
949
- right: 20px;
950
- min-width: 180px;
951
- }
952
-
953
- .tiny-remoter-modal-content {
954
- width: 95%;
955
- margin: 20px;
956
- }
957
- }
958
-
959
- /* 复制反馈提示样式 */
960
- .tiny-remoter-copy-feedback {
961
- position: fixed;
962
- top: 50%;
963
- left: 50%;
964
- transform: translate(-50%, -50%);
965
- background: rgba(0, 0, 0, 0.8);
966
- color: white;
967
- padding: 12px 24px;
968
- border-radius: 8px;
969
- font-size: 14px;
970
- font-weight: 500;
971
- z-index: 10000;
972
- opacity: 0;
973
- visibility: hidden;
974
- transition: all 0.3s ease;
975
- backdrop-filter: blur(4px);
976
- box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
977
- }
978
-
979
- .tiny-remoter-copy-feedback.show {
980
- opacity: 1;
981
- visibility: visible;
982
- transform: translate(-50%, -50%) scale(1);
983
- }
984
-
985
- .tiny-remoter-copy-feedback.success {
986
- background: rgba(34, 197, 94, 0.9);
987
- }
988
-
989
- .tiny-remoter-copy-feedback.error {
990
- background: rgba(239, 68, 68, 0.9);
991
- }
992
-
993
- /* 深色主题支持 */
994
- @media (prefers-color-scheme: dark) {
995
- .tiny-remoter-floating-dropdown {
996
- background: #1a1a1a;
997
- color: white;
998
- }
999
-
1000
- .tiny-remoter-dropdown-item {
1001
- color: white;
1002
- }
1003
-
1004
-
1005
- .tiny-remoter-copy-icon {
1006
- background: #2a2a2a;
1007
- color: #ccc;
1008
- }
1009
-
1010
- .tiny-remoter-copy-icon:hover {
1011
- background: #3a3a3a;
1012
- color: white;
1013
- }
1014
-
1015
- .tiny-remoter-modal-content {
1016
- background: #1a1a1a;
1017
- color: white;
1018
- }
1019
-
1020
- .tiny-remoter-modal-header {
1021
- border-bottom-color: #333;
1022
- }
1023
-
1024
- .tiny-remoter-modal-header h3 {
1025
- color: white;
1026
- }
1027
- }
1028
- `, document.head.appendChild(t);
1029
- }
1030
- // 销毁组件
1031
- destroy() {
1032
- this.floatingBlock.parentNode && this.floatingBlock.parentNode.removeChild(this.floatingBlock), this.dropdownMenu.parentNode && this.dropdownMenu.parentNode.removeChild(this.dropdownMenu);
1033
- }
1034
- // 隐藏组件
1035
- hide() {
1036
- this.floatingBlock && (this.floatingBlock.style.display = "none"), this.closeDropdown();
1037
- }
1038
- // 显示组件
1039
- show() {
1040
- this.floatingBlock && (this.floatingBlock.style.display = "flex");
1041
- }
1042
- }
1043
- const tt = (e = {}) => new P0(e), O = () => typeof window < "u" && typeof navigator < "u", I0 = () => O() && typeof document < "u";
1044
- let I = null, d2 = null, G2 = null, l2 = 0;
1045
- const O0 = "next-sdk-tool-body-glow";
1046
- function K() {
1047
- return I0();
1048
- }
1049
- function N0() {
1050
- if (!K() || G2) return;
1051
- const e = document.createElement("style");
1052
- e.textContent = `
1053
- .${O0} {
1054
- position: relative;
1055
- }
1056
-
1057
- .next-sdk-tool-overlay {
1058
- position: fixed;
1059
- inset: 0;
1060
- z-index: 999999;
1061
- pointer-events: none;
1062
- display: flex;
1063
- align-items: flex-end;
1064
- justify-content: flex-start;
1065
- padding: 0 0 18px 18px;
1066
- background: transparent;
1067
- animation: next-sdk-overlay-fade-in 260ms ease-out;
1068
- }
1069
-
1070
- .next-sdk-tool-overlay--exit {
1071
- animation: next-sdk-overlay-fade-out 220ms ease-in forwards;
1072
- }
1073
-
1074
- .next-sdk-tool-overlay__glow-ring {
1075
- display: none;
1076
- }
1077
-
1078
- .next-sdk-tool-overlay__panel {
1079
- position: relative;
1080
- min-width: min(320px, 78vw);
1081
- max-width: min(420px, 82vw);
1082
- padding: 10px 14px;
1083
- border-radius: 999px;
1084
- background:
1085
- linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(17, 24, 39, 0.9)),
1086
- radial-gradient(circle at top left, rgba(96, 165, 250, 0.25), transparent 55%),
1087
- radial-gradient(circle at bottom right, rgba(45, 212, 191, 0.22), transparent 60%);
1088
- box-shadow:
1089
- 0 12px 28px rgba(15, 23, 42, 0.78),
1090
- 0 0 0 1px rgba(148, 163, 184, 0.26);
1091
- display: flex;
1092
- align-items: center;
1093
- gap: 10px;
1094
- pointer-events: none;
1095
- transform-origin: center;
1096
- animation: next-sdk-panel-pop-in 260ms cubic-bezier(0.18, 0.89, 0.32, 1.28);
1097
- color: #e5e7eb;
1098
- font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
1099
- }
1100
-
1101
- .next-sdk-tool-overlay__indicator {
1102
- width: 26px;
1103
- height: 26px;
1104
- border-radius: 999px;
1105
- background: radial-gradient(circle at 30% 10%, #f9fafb, #93c5fd);
1106
- box-shadow:
1107
- 0 0 0 1px rgba(191, 219, 254, 0.6),
1108
- 0 8px 18px rgba(37, 99, 235, 0.8),
1109
- 0 0 28px rgba(56, 189, 248, 0.9);
1110
- position: relative;
1111
- flex-shrink: 0;
1112
- display: flex;
1113
- align-items: center;
1114
- justify-content: center;
1115
- overflow: hidden;
1116
- }
1117
-
1118
- .next-sdk-tool-overlay__indicator-orbit {
1119
- position: absolute;
1120
- inset: 2px;
1121
- border-radius: inherit;
1122
- border: 1px solid rgba(248, 250, 252, 0.6);
1123
- box-sizing: border-box;
1124
- opacity: 0.9;
1125
- }
1126
-
1127
- .next-sdk-tool-overlay__indicator-orbit::before {
1128
- content: '';
1129
- position: absolute;
1130
- width: 6px;
1131
- height: 6px;
1132
- border-radius: 999px;
1133
- background: #f9fafb;
1134
- box-shadow:
1135
- 0 0 12px rgba(248, 250, 252, 0.9),
1136
- 0 0 24px rgba(250, 249, 246, 0.9);
1137
- top: 0;
1138
- left: 50%;
1139
- transform: translate(-50%, -50%);
1140
- transform-origin: 50% 18px;
1141
- animation: next-sdk-indicator-orbit 1.4s linear infinite;
1142
- }
1143
-
1144
- .next-sdk-tool-overlay__indicator-core {
1145
- width: 14px;
1146
- height: 14px;
1147
- border-radius: inherit;
1148
- background: radial-gradient(circle at 30% 20%, #f9fafb, #bfdbfe);
1149
- box-shadow:
1150
- 0 0 12px rgba(248, 250, 252, 0.9),
1151
- 0 0 32px rgba(191, 219, 254, 0.8);
1152
- opacity: 0.96;
1153
- }
1154
-
1155
- .next-sdk-tool-overlay__content {
1156
- display: flex;
1157
- flex-direction: column;
1158
- gap: 1px;
1159
- min-width: 0;
1160
- }
1161
-
1162
- .next-sdk-tool-overlay__title {
1163
- font-size: 11px;
1164
- letter-spacing: 0.08em;
1165
- text-transform: uppercase;
1166
- color: rgba(156, 163, 175, 0.96);
1167
- display: flex;
1168
- align-items: center;
1169
- gap: 6px;
1170
- }
1171
-
1172
- .next-sdk-tool-overlay__title-dot {
1173
- width: 6px;
1174
- height: 6px;
1175
- border-radius: 999px;
1176
- background: #22c55e;
1177
- box-shadow:
1178
- 0 0 8px rgba(34, 197, 94, 0.9),
1179
- 0 0 14px rgba(22, 163, 74, 0.9);
1180
- }
1181
-
1182
- .next-sdk-tool-overlay__label {
1183
- font-size: 12px;
1184
- font-weight: 500;
1185
- color: #e5e7eb;
1186
- white-space: nowrap;
1187
- text-overflow: ellipsis;
1188
- overflow: hidden;
1189
- }
1190
-
1191
- @keyframes next-sdk-overlay-fade-in {
1192
- from { opacity: 0; }
1193
- to { opacity: 1; }
1194
- }
1195
-
1196
- @keyframes next-sdk-overlay-fade-out {
1197
- from { opacity: 1; }
1198
- to { opacity: 0; }
1199
- }
1200
-
1201
- @keyframes next-sdk-indicator-orbit {
1202
- from {
1203
- transform: translate(-50%, -50%) rotate(0deg) translateY(0);
1204
- }
1205
- to {
1206
- transform: translate(-50%, -50%) rotate(360deg) translateY(0);
1207
- }
1208
- }
1209
-
1210
- @keyframes next-sdk-panel-pop-in {
1211
- 0% {
1212
- opacity: 0;
1213
- transform: scale(0.92) translateY(10px);
1214
- }
1215
- 100% {
1216
- opacity: 1;
1217
- transform: scale(1) translateY(0);
1218
- }
1219
- }
1220
- `, document.head.appendChild(e), G2 = e;
1221
- }
1222
- function R0() {
1223
- if (!K() || I) return;
1224
- N0();
1225
- const e = document.createElement("div");
1226
- e.className = "next-sdk-tool-overlay";
1227
- const t = document.createElement("div");
1228
- t.className = "next-sdk-tool-overlay__glow-ring";
1229
- const r = document.createElement("div");
1230
- r.className = "next-sdk-tool-overlay__panel";
1231
- const o = document.createElement("div");
1232
- o.className = "next-sdk-tool-overlay__indicator";
1233
- const n = document.createElement("div");
1234
- n.className = "next-sdk-tool-overlay__indicator-orbit";
1235
- const s = document.createElement("div");
1236
- s.className = "next-sdk-tool-overlay__indicator-core";
1237
- const i = document.createElement("div");
1238
- i.className = "next-sdk-tool-overlay__content";
1239
- const a = document.createElement("div");
1240
- a.className = "next-sdk-tool-overlay__title", a.textContent = "AI 正在调用页面工具";
1241
- const l = document.createElement("span");
1242
- l.className = "next-sdk-tool-overlay__title-dot";
1243
- const h = document.createElement("div");
1244
- h.className = "next-sdk-tool-overlay__label", a.prepend(l), i.appendChild(a), i.appendChild(h), o.appendChild(n), o.appendChild(s), r.appendChild(o), r.appendChild(i), e.appendChild(t), e.appendChild(r), document.body.appendChild(e), I = e, d2 = h;
1245
- }
1246
- function z0(e) {
1247
- K() && (R0(), !(!I || !d2) && (I.classList.remove("next-sdk-tool-overlay--exit"), d2.textContent = e.label));
1248
- }
1249
- function A0() {
1250
- if (!I) return;
1251
- I.classList.add("next-sdk-tool-overlay--exit");
1252
- const e = I;
1253
- let t = !1, r;
1254
- const o = () => {
1255
- t || (t = !0, r !== void 0 && (clearTimeout(r), r = void 0), e.parentNode && e.parentNode.removeChild(e), I === e && (I = null, d2 = null), e.removeEventListener("animationend", o));
1256
- };
1257
- e.addEventListener("animationend", o), r = setTimeout(o, 500);
1258
- }
1259
- function F0(e) {
1260
- K() && (l2 += 1, z0(e));
1261
- }
1262
- function j0() {
1263
- !K() || l2 <= 0 || (l2 -= 1, l2 === 0 && A0());
1264
- }
1265
- function n0(e, t, r) {
1266
- if (!r) return;
1267
- const o = t || e;
1268
- return typeof r == "boolean" ? r ? { label: o } : void 0 : {
1269
- label: r.label || o
1270
- };
1271
- }
1272
- const s0 = "next-sdk:tool-call", $2 = "next-sdk:tool-response", Z = "next-sdk:tool-registered", M2 = "next-sdk:tool-unregistered", D0 = "next-sdk:remoter-ready", L2 = /* @__PURE__ */ new Map(), G = (e) => e.replace(/\/+$/, "") || "/", P2 = /* @__PURE__ */ new Set();
1273
- function U0() {
1274
- O() && P2.add({ win: window, origin: window.location.origin || "*" });
1275
- }
1276
- U0();
1277
- function F(e) {
1278
- if (!O()) return;
1279
- const t = { type: e };
1280
- P2.forEach(({ win: r, origin: o }) => {
1281
- try {
1282
- r.postMessage(t, o);
1283
- } catch {
1284
- }
1285
- });
1286
- }
1287
- function Z0() {
1288
- O() && window.addEventListener("message", (e) => {
1289
- if (e.data?.type !== D0 || !e.source || e.origin !== window.location.origin) return;
1290
- const t = e.source;
1291
- P2.add({ win: t, origin: e.origin || "*" });
1292
- });
1293
- }
1294
- Z0();
1295
- function _2(e) {
1296
- if (!e) return;
1297
- const t = e;
1298
- try {
1299
- typeof t.sendToolListChanged == "function" ? t.sendToolListChanged() : t.server && typeof t.server.sendToolListChanged == "function" && t.server.sendToolListChanged();
1300
- } catch {
1301
- }
1302
- }
1303
- function V2(e, t) {
1304
- const r = L2.get(e);
1305
- return !!r && r.has(t);
1306
- }
1307
- let V = null;
1308
- function rt(e) {
1309
- V = e;
1310
- }
1311
- function B0(e) {
1312
- if (!O()) return !1;
1313
- const t = G(e);
1314
- return G(window.location.pathname) === t;
1315
- }
1316
- function q0(e) {
1317
- return O() ? new Promise((t) => {
1318
- let r = !1;
1319
- const o = () => {
1320
- r || (r = !0, window.removeEventListener("message", n), t());
1321
- }, n = (s) => {
1322
- s.source === window && s.data?.type === Z && o();
1323
- };
1324
- window.addEventListener("message", n), setTimeout(o, e);
1325
- }) : Promise.resolve();
1326
- }
1327
- function ot(e, t) {
1328
- const r = t?.name ?? "navigate_to_page", o = t?.title ?? "页面跳转", n = t?.description ?? '当需要的工具在当前页面不可用时,使用此工具跳转到特定页面。例如:要查询订单时跳转到 "/orders",要创建价保时跳转到 "/price-protection"。', s = t?.timeoutMs ?? 5e3, i = {
1329
- type: "object",
1330
- properties: {
1331
- path: {
1332
- type: "string",
1333
- description: '目标页面的路由地址,例如 "/orders"、"/inventory"、"/price-protection" 等。'
1334
- }
1335
- },
1336
- required: ["path"]
1337
- }, a = async ({
1338
- path: l
1339
- }) => {
1340
- if (!O())
1341
- return {
1342
- content: [{ type: "text", text: "当前环境不支持页面跳转(window 不存在)。" }]
1343
- };
1344
- if (!V)
1345
- return {
1346
- content: [
1347
- {
1348
- type: "text",
1349
- text: "页面跳转失败:尚未在应用入口调用 setNavigator 注册导航函数,无法执行路由跳转。"
1350
- }
1351
- ]
1352
- };
1353
- try {
1354
- if (B0(l))
1355
- return {
1356
- content: [{ type: "text", text: `当前已在页面:${l}。请继续你的下一步操作。` }]
1357
- };
1358
- const h = q0(s);
1359
- return await V(l) !== !0 && (await h, await new Promise((v) => setTimeout(v, 500))), {
1360
- content: [{ type: "text", text: `已成功跳转至页面:${l}。请继续你的下一步操作。` }]
1361
- };
1362
- } catch (h) {
1363
- return {
1364
- content: [
1365
- {
1366
- type: "text",
1367
- text: `页面跳转失败:${h instanceof Error ? h.message : String(h)}。`
1368
- }
1369
- ]
1370
- };
1371
- }
1372
- };
1373
- if (e && typeof e.registerTool == "function")
1374
- return e.__isNextSdkBridgeSetup ? e.registerTool({
1375
- name: r,
1376
- title: o,
1377
- description: n,
1378
- inputSchema: i,
1379
- execute: a
1380
- }) : e.registerTool(
1381
- r,
1382
- {
1383
- title: o,
1384
- description: n,
1385
- inputSchema: i
1386
- },
1387
- a
1388
- );
1389
- throw new Error("Failed to register navigate tool: invalid server instance.");
1390
- }
1391
- function a0(e, t, r = 3e4, o) {
1392
- return (n) => {
1393
- const s = E2();
1394
- return new Promise((i, a) => {
1395
- let l, h;
1396
- const p = () => {
1397
- clearTimeout(l), window.removeEventListener("message", v), h && window.removeEventListener("message", h), o && j0();
1398
- };
1399
- l = setTimeout(() => {
1400
- p(), a(new Error(`工具 [${e}] 调用超时 (${r}ms),请检查目标页面是否正确调用了 registerPageTool`));
1401
- }, r);
1402
- const v = (w) => {
1403
- w.source === window && w.data?.type === $2 && w.data.callId === s && (p(), w.data.error ? a(new Error(w.data.error)) : i(w.data.result));
1404
- };
1405
- window.addEventListener("message", v);
1406
- const N = () => {
1407
- window.postMessage({ type: s0, callId: s, toolName: e, route: t, input: n }, window.location.origin || "*");
1408
- };
1409
- let S = !1;
1410
- const x = () => {
1411
- S || (S = !0, N());
1412
- };
1413
- (async () => {
1414
- try {
1415
- if (o && F0(o), V2(t, e)) {
1416
- x();
1417
- return;
1418
- }
1419
- if (h = (w) => {
1420
- w.source !== window || w.data?.type !== Z || (window.removeEventListener("message", h), x());
1421
- }, window.addEventListener("message", h), V && await V(t) === !0) {
1422
- h && window.removeEventListener("message", h), x();
1423
- return;
1424
- }
1425
- V2(t, e) && (window.removeEventListener("message", h), x());
1426
- } catch (w) {
1427
- p(), a(w instanceof Error ? w : new Error(String(w)));
1428
- }
1429
- })();
1430
- });
1431
- };
1432
- }
1433
- function it(e) {
1434
- const t = /* @__PURE__ */ new Map(), r = (o, n, s = !1) => {
1435
- const i = t.get(n), a = !!i;
1436
- if (t.delete(n), i)
1437
- try {
1438
- i.remove();
1439
- } catch {
1440
- }
1441
- return !s && a && (_2(o), F(M2)), !!i;
1442
- };
1443
- return new Proxy(e, {
1444
- get(o, n, s) {
1445
- return n === "unregisterTool" ? (i) => r(o, i, !1) : n === "registerTool" ? (i, a, l) => {
1446
- r(o, i, !0);
1447
- const h = o.registerTool.bind(o);
1448
- if (typeof l == "function") {
1449
- const j = h(i, a, l);
1450
- return t.set(i, j), _2(o), F(Z), j;
1451
- }
1452
- const { route: p, timeout: v, invokeEffect: N } = l, S = G(p), x = n0(i, a?.title, N), $ = a0(i, S, v, x), w = h(i, a, $);
1453
- return t.set(i, w), _2(o), F(Z), w;
1454
- } : Reflect.get(o, n, s);
1455
- }
1456
- });
1457
- }
1458
- function nt(e) {
1459
- const { route: t, handlers: r } = e, o = G(t ?? window.location.pathname), n = Object.keys(r), s = async (i) => {
1460
- if (i.source !== window || i.data?.type !== s0 || !(i.data.toolName in r))
1461
- return;
1462
- const { callId: a, toolName: l, input: h } = i.data;
1463
- try {
1464
- const p = r[l];
1465
- if (!p) throw new Error(`Tool "${l}" handler not found.`);
1466
- const v = await p(h);
1467
- window.postMessage({ type: $2, callId: a, result: v }, window.location.origin || "*");
1468
- } catch (p) {
1469
- window.postMessage(
1470
- {
1471
- type: $2,
1472
- callId: a,
1473
- error: p instanceof Error ? p.message : String(p)
1474
- },
1475
- window.location.origin || "*"
1476
- );
1477
- }
1478
- };
1479
- return L2.set(o, new Set(n)), window.addEventListener("message", s), F(Z), () => {
1480
- L2.delete(o), window.removeEventListener("message", s), F(M2);
1481
- };
1482
- }
1483
- function W0() {
1484
- if (typeof navigator > "u") return;
1485
- const t = navigator.modelContext;
1486
- if (!t || t.__isNextSdkBridgeSetup) return;
1487
- const r = t.registerTool?.bind(t), o = t.unregisterTool?.bind(t);
1488
- typeof r == "function" && (t.registerTool = (n) => {
1489
- const s = n.name, i = { ...n }, a = i.routeConfig && typeof i.routeConfig == "object" && "route" in i.routeConfig ? i.routeConfig : null;
1490
- if (a) {
1491
- const l = G(a.route), h = n0(s, i.title, a.invokeEffect), p = a0(s, l, a.timeout, h);
1492
- i.execute = p, delete i.routeConfig;
1493
- }
1494
- try {
1495
- r(i), F(Z);
1496
- } catch {
1497
- }
1498
- }), typeof o == "function" && (t.unregisterTool = (n) => {
1499
- try {
1500
- o(n), F(M2);
1501
- } catch {
1502
- }
1503
- }), t.__isNextSdkBridgeSetup = !0;
1504
- }
1505
- const l0 = /^\.\/[^/]+\/SKILL\.md$/, H0 = /^---\s*\n([\s\S]+?)\s*\n---/;
1506
- async function d0(e) {
1507
- if (typeof e != "string" && typeof e != "function") return null;
1508
- const r = (typeof e == "string" ? e : await e()).match(H0);
1509
- if (!r?.[1]) return null;
1510
- const o = r[1], n = o.match(/^name:\s*(.+)$/m), s = o.match(/^description:\s*(.+)$/m), i = n?.[1]?.trim(), a = s?.[1]?.trim();
1511
- return i && a ? { name: i, description: a } : null;
1512
- }
1513
- async function Y(e) {
1514
- const t = {};
1515
- for (const [r, o] of Object.entries(e)) {
1516
- const n = r.replace(/\\/g, "/"), s = n.lastIndexOf("skills/"), i = s >= 0 ? n.slice(s + 7) : n, a = i.startsWith("./") ? i : `./${i}`, l = typeof o == "string" ? o : await o();
1517
- t[a] = l;
1518
- }
1519
- return t;
1520
- }
1521
- async function J0(e) {
1522
- const t = await Y(e);
1523
- return Object.keys(t).filter((r) => l0.test(r));
1524
- }
1525
- async function st(e) {
1526
- const t = await Y(e), r = Object.keys(t).filter((n) => l0.test(n)), o = [];
1527
- for (const n of r) {
1528
- const s = t[n];
1529
- if (!s) continue;
1530
- const i = await d0(s);
1531
- i && o.push({
1532
- name: i.name,
1533
- description: i.description,
1534
- path: n
1535
- });
1536
- }
1537
- return o;
1538
- }
1539
- function at(e) {
1540
- return e.length === 0 ? "" : `## 可用技能
1541
-
1542
- ${e.map((r) => `- **${r.name}**: ${r.description}`).join(`
1543
- `)}
1544
-
1545
- 当需要用到某技能时,请使用 get_skill_content 工具获取该技能的完整文档内容。`;
1546
- }
1547
- async function k2(e, t) {
1548
- const r = await Y(e), o = r[t];
1549
- if (o) return o;
1550
- const n = t.replace(/^\.?\//, "/"), s = Object.keys(r).find((i) => i.endsWith(n));
1551
- return s ? r[s] : void 0;
1552
- }
1553
- async function G0(e, t) {
1554
- const r = await Y(e), o = await J0(r), n = o.find((s) => s.startsWith(`./${t}/SKILL.md`));
1555
- if (n) return n;
1556
- for (const s of o) {
1557
- const i = r[s];
1558
- if (i) {
1559
- const a = await d0(i);
1560
- if (a && a.name === t)
1561
- return s;
1562
- }
1563
- }
1564
- }
1565
- const V0 = n2.object({
1566
- skillName: n2.string().optional().describe(
1567
- '进入某个技能的主入口名称。优先匹配技能的目录名(如 ecommerce),或者技能的中文名称(如"客户价保单创建及审核")。'
1568
- ),
1569
- path: n2.string().optional().describe("你想查阅的文档的路径。如 ./calculator/SKILL.md 或从其他文档里看到的相对路径 ./reference/inventory.md。"),
1570
- currentPath: n2.string().optional().describe(
1571
- "你当前正在阅读的文档路径(如果有)。比如你刚刚读取了 ./ecommerce/SKILL.md,请把这个路径原样传回来,这样系统才能根据你的相对路径准确找到下一份文件。"
1572
- )
1573
- });
1574
- function lt(e) {
1575
- let t = !1, r;
1576
- return {
1577
- get_skill_content: b0({
1578
- description: "根据技能名称或文档路径获取该技能的完整文档内容。如果你想根据相对路径查阅文件,请务必同时提供你当前所在的文件路径 currentPath。",
1579
- inputSchema: V0,
1580
- execute: async (n) => {
1581
- t || (r = await Y(e), t = !0);
1582
- const s = r, { skillName: i, path: a, currentPath: l } = n;
1583
- let h, p = "";
1584
- if (a) {
1585
- let v = ".";
1586
- if (l) {
1587
- const x = l.lastIndexOf("/");
1588
- x >= 0 && (v = l.slice(0, x));
1589
- }
1590
- const N = `http://localhost/${v}/`;
1591
- if (p = "." + new URL(a, N).pathname, h = await k2(s, p), h === void 0 && (a.startsWith("./") || a.startsWith("../")) && l) {
1592
- const x = l.split("/");
1593
- if (x.length >= 2) {
1594
- const w = `http://localhost/${x[1]}/`, B = "." + new URL(a, w).pathname;
1595
- h = await k2(s, B), h && (p = B);
1596
- }
1597
- }
1598
- if (h && !s[p]) {
1599
- const x = p.replace(/^\.?\//, "/"), $ = Object.keys(s).find((w) => w.endsWith(x));
1600
- $ && (p = $);
1601
- }
1602
- } else if (i) {
1603
- const v = await G0(s, i);
1604
- v && (p = v, h = await k2(s, v));
1605
- }
1606
- return h === void 0 ? {
1607
- error: "未找到对应技能文档",
1608
- skillName: i,
1609
- path: a,
1610
- providedCurrentPath: l,
1611
- attemptedPath: p
1612
- } : { content: h, path: p };
1613
- }
1614
- })
1615
- };
1616
- }
1617
- function J(e, t) {
1618
- const r = typeof e;
1619
- if (r !== typeof t)
1620
- return !1;
1621
- if (Array.isArray(e)) {
1622
- if (!Array.isArray(t))
1623
- return !1;
1624
- const o = e.length;
1625
- if (o !== t.length)
1626
- return !1;
1627
- for (let n = 0; n < o; n++)
1628
- if (!J(e[n], t[n]))
1629
- return !1;
1630
- return !0;
1631
- }
1632
- if (r === "object") {
1633
- if (!e || !t)
1634
- return e === t;
1635
- const o = Object.keys(e), n = Object.keys(t);
1636
- if (o.length !== n.length)
1637
- return !1;
1638
- for (const i of o)
1639
- if (!J(e[i], t[i]))
1640
- return !1;
1641
- return !0;
1642
- }
1643
- return e === t;
1644
- }
1645
- function L(e) {
1646
- return encodeURI(K0(e));
1647
- }
1648
- function K0(e) {
1649
- return e.replace(/~/g, "~0").replace(/\//g, "~1");
1650
- }
1651
- const Y0 = {
1652
- prefixItems: !0,
1653
- items: !0,
1654
- allOf: !0,
1655
- anyOf: !0,
1656
- oneOf: !0
1657
- }, X0 = {
1658
- $defs: !0,
1659
- definitions: !0,
1660
- properties: !0,
1661
- patternProperties: !0,
1662
- dependentSchemas: !0
1663
- }, Q0 = {
1664
- id: !0,
1665
- $id: !0,
1666
- $ref: !0,
1667
- $schema: !0,
1668
- $anchor: !0,
1669
- $vocabulary: !0,
1670
- $comment: !0,
1671
- default: !0,
1672
- enum: !0,
1673
- const: !0,
1674
- required: !0,
1675
- type: !0,
1676
- maximum: !0,
1677
- minimum: !0,
1678
- exclusiveMaximum: !0,
1679
- exclusiveMinimum: !0,
1680
- multipleOf: !0,
1681
- maxLength: !0,
1682
- minLength: !0,
1683
- pattern: !0,
1684
- format: !0,
1685
- maxItems: !0,
1686
- minItems: !0,
1687
- uniqueItems: !0,
1688
- maxProperties: !0,
1689
- minProperties: !0
1690
- };
1691
- let ee = typeof self < "u" && self.location && self.location.origin !== "null" ? new URL(self.location.origin + self.location.pathname + location.search) : new URL("https://github.com/cfworker");
1692
- function A(e, t = /* @__PURE__ */ Object.create(null), r = ee, o = "") {
1693
- if (e && typeof e == "object" && !Array.isArray(e)) {
1694
- const s = e.$id || e.id;
1695
- if (s) {
1696
- const i = new URL(s, r.href);
1697
- i.hash.length > 1 ? t[i.href] = e : (i.hash = "", o === "" ? r = i : A(e, t, r));
1698
- }
1699
- } else if (e !== !0 && e !== !1)
1700
- return t;
1701
- const n = r.href + (o ? "#" + o : "");
1702
- if (t[n] !== void 0)
1703
- throw new Error(`Duplicate schema URI "${n}".`);
1704
- if (t[n] = e, e === !0 || e === !1)
1705
- return t;
1706
- if (e.__absolute_uri__ === void 0 && Object.defineProperty(e, "__absolute_uri__", {
1707
- enumerable: !1,
1708
- value: n
1709
- }), e.$ref && e.__absolute_ref__ === void 0) {
1710
- const s = new URL(e.$ref, r.href);
1711
- s.hash = s.hash, Object.defineProperty(e, "__absolute_ref__", {
1712
- enumerable: !1,
1713
- value: s.href
1714
- });
1715
- }
1716
- if (e.$recursiveRef && e.__absolute_recursive_ref__ === void 0) {
1717
- const s = new URL(e.$recursiveRef, r.href);
1718
- s.hash = s.hash, Object.defineProperty(e, "__absolute_recursive_ref__", {
1719
- enumerable: !1,
1720
- value: s.href
1721
- });
1722
- }
1723
- if (e.$anchor) {
1724
- const s = new URL("#" + e.$anchor, r.href);
1725
- t[s.href] = e;
1726
- }
1727
- for (let s in e) {
1728
- if (Q0[s])
1729
- continue;
1730
- const i = `${o}/${L(s)}`, a = e[s];
1731
- if (Array.isArray(a)) {
1732
- if (Y0[s]) {
1733
- const l = a.length;
1734
- for (let h = 0; h < l; h++)
1735
- A(a[h], t, r, `${i}/${h}`);
1736
- }
1737
- } else if (X0[s])
1738
- for (let l in a)
1739
- A(a[l], t, r, `${i}/${L(l)}`);
1740
- else
1741
- A(a, t, r, i);
1742
- }
1743
- return t;
1744
- }
1745
- const te = /^(\d\d\d\d)-(\d\d)-(\d\d)$/, re = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], oe = /^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i, ie = /^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i, ne = /^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i, se = /^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i, ae = /^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu, le = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i, de = /^(?:\/(?:[^~/]|~0|~1)*)*$/, ce = /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i, fe = /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/, pe = (e) => {
1746
- if (e[0] === '"')
1747
- return !1;
1748
- const [t, r, ...o] = e.split("@");
1749
- return !t || !r || o.length !== 0 || t.length > 64 || r.length > 253 || t[0] === "." || t.endsWith(".") || t.includes("..") || !/^[a-z0-9.-]+$/i.test(r) || !/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(t) ? !1 : r.split(".").every((n) => /^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(n));
1750
- }, ue = /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/, he = /^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i, me = (e) => e.length > 1 && e.length < 80 && (/^P\d+([.,]\d+)?W$/.test(e) || /^P[\dYMDTHS]*(\d[.,]\d+)?[YMDHS]$/.test(e) && /^P([.,\d]+Y)?([.,\d]+M)?([.,\d]+D)?(T([.,\d]+H)?([.,\d]+M)?([.,\d]+S)?)?$/.test(e));
1751
- function T(e) {
1752
- return e.test.bind(e);
1753
- }
1754
- const K2 = {
1755
- date: c0,
1756
- time: f0.bind(void 0, !1),
1757
- "date-time": Ce,
1758
- duration: me,
1759
- uri: be,
1760
- "uri-reference": T(ne),
1761
- "uri-template": T(se),
1762
- url: T(ae),
1763
- email: pe,
1764
- hostname: T(ie),
1765
- ipv4: T(ue),
1766
- ipv6: T(he),
1767
- regex: _e,
1768
- uuid: T(le),
1769
- "json-pointer": T(de),
1770
- "json-pointer-uri-fragment": T(ce),
1771
- "relative-json-pointer": T(fe)
1772
- };
1773
- function ge(e) {
1774
- return e % 4 === 0 && (e % 100 !== 0 || e % 400 === 0);
1775
- }
1776
- function c0(e) {
1777
- const t = e.match(te);
1778
- if (!t)
1779
- return !1;
1780
- const r = +t[1], o = +t[2], n = +t[3];
1781
- return o >= 1 && o <= 12 && n >= 1 && n <= (o == 2 && ge(r) ? 29 : re[o]);
1782
- }
1783
- function f0(e, t) {
1784
- const r = t.match(oe);
1785
- if (!r)
1786
- return !1;
1787
- const o = +r[1], n = +r[2], s = +r[3], i = !!r[5];
1788
- return (o <= 23 && n <= 59 && s <= 59 || o == 23 && n == 59 && s == 60) && (!e || i);
1789
- }
1790
- const ye = /t|\s/i;
1791
- function Ce(e) {
1792
- const t = e.split(ye);
1793
- return t.length == 2 && c0(t[0]) && f0(!0, t[1]);
1794
- }
1795
- const we = /\/|:/, xe = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
1796
- function be(e) {
1797
- return we.test(e) && xe.test(e);
1798
- }
1799
- const ve = /[^\\]\\Z/;
1800
- function _e(e) {
1801
- if (ve.test(e))
1802
- return !1;
1803
- try {
1804
- return new RegExp(e, "u"), !0;
1805
- } catch {
1806
- return !1;
1807
- }
1808
- }
1809
- function ke(e) {
1810
- let t = 0, r = e.length, o = 0, n;
1811
- for (; o < r; )
1812
- t++, n = e.charCodeAt(o++), n >= 55296 && n <= 56319 && o < r && (n = e.charCodeAt(o), (n & 64512) == 56320 && o++);
1813
- return t;
1814
- }
1815
- function b(e, t, r = "2019-09", o = A(t), n = !0, s = null, i = "#", a = "#", l = /* @__PURE__ */ Object.create(null)) {
1816
- if (t === !0)
1817
- return { valid: !0, errors: [] };
1818
- if (t === !1)
1819
- return {
1820
- valid: !1,
1821
- errors: [
1822
- {
1823
- instanceLocation: i,
1824
- keyword: "false",
1825
- keywordLocation: i,
1826
- error: "False boolean schema."
1827
- }
1828
- ]
1829
- };
1830
- const h = typeof e;
1831
- let p;
1832
- switch (h) {
1833
- case "boolean":
1834
- case "number":
1835
- case "string":
1836
- p = h;
1837
- break;
1838
- case "object":
1839
- e === null ? p = "null" : Array.isArray(e) ? p = "array" : p = "object";
1840
- break;
1841
- default:
1842
- throw new Error(`Instances of "${h}" type are not supported.`);
1843
- }
1844
- const { $ref: v, $recursiveRef: N, $recursiveAnchor: S, type: x, const: $, enum: w, required: j, not: B, anyOf: f2, allOf: p2, oneOf: I2, if: O2, then: N2, else: R2, format: X, properties: u2, patternProperties: h2, additionalProperties: z2, unevaluatedProperties: A2, minProperties: m2, maxProperties: g2, propertyNames: F2, dependentRequired: y2, dependentSchemas: C2, dependencies: w2, prefixItems: x2, items: q, additionalItems: j2, unevaluatedItems: D2, contains: U2, minContains: P, maxContains: Q, minItems: b2, maxItems: v2, uniqueItems: y0, minimum: R, maximum: z, exclusiveMinimum: W, exclusiveMaximum: H, multipleOf: e2, minLength: t2, maxLength: r2, pattern: Z2, __absolute_ref__: o2, __absolute_recursive_ref__: C0 } = t, c = [];
1845
- if (S === !0 && s === null && (s = t), N === "#") {
1846
- const m = s === null ? o[C0] : s, u = `${a}/$recursiveRef`, C = b(e, s === null ? t : s, r, o, n, m, i, u, l);
1847
- C.valid || c.push({
1848
- instanceLocation: i,
1849
- keyword: "$recursiveRef",
1850
- keywordLocation: u,
1851
- error: "A subschema had errors."
1852
- }, ...C.errors);
1853
- }
1854
- if (v !== void 0) {
1855
- const u = o[o2 || v];
1856
- if (u === void 0) {
1857
- let d = `Unresolved $ref "${v}".`;
1858
- throw o2 && o2 !== v && (d += ` Absolute URI "${o2}".`), d += `
1859
- Known schemas:
1860
- - ${Object.keys(o).join(`
1861
- - `)}`, new Error(d);
1862
- }
1863
- const C = `${a}/$ref`, f = b(e, u, r, o, n, s, i, C, l);
1864
- if (f.valid || c.push({
1865
- instanceLocation: i,
1866
- keyword: "$ref",
1867
- keywordLocation: C,
1868
- error: "A subschema had errors."
1869
- }, ...f.errors), r === "4" || r === "7")
1870
- return { valid: c.length === 0, errors: c };
1871
- }
1872
- if (Array.isArray(x)) {
1873
- let m = x.length, u = !1;
1874
- for (let C = 0; C < m; C++)
1875
- if (p === x[C] || x[C] === "integer" && p === "number" && e % 1 === 0 && e === e) {
1876
- u = !0;
1877
- break;
1878
- }
1879
- u || c.push({
1880
- instanceLocation: i,
1881
- keyword: "type",
1882
- keywordLocation: `${a}/type`,
1883
- error: `Instance type "${p}" is invalid. Expected "${x.join('", "')}".`
1884
- });
1885
- } else x === "integer" ? (p !== "number" || e % 1 || e !== e) && c.push({
1886
- instanceLocation: i,
1887
- keyword: "type",
1888
- keywordLocation: `${a}/type`,
1889
- error: `Instance type "${p}" is invalid. Expected "${x}".`
1890
- }) : x !== void 0 && p !== x && c.push({
1891
- instanceLocation: i,
1892
- keyword: "type",
1893
- keywordLocation: `${a}/type`,
1894
- error: `Instance type "${p}" is invalid. Expected "${x}".`
1895
- });
1896
- if ($ !== void 0 && (p === "object" || p === "array" ? J(e, $) || c.push({
1897
- instanceLocation: i,
1898
- keyword: "const",
1899
- keywordLocation: `${a}/const`,
1900
- error: `Instance does not match ${JSON.stringify($)}.`
1901
- }) : e !== $ && c.push({
1902
- instanceLocation: i,
1903
- keyword: "const",
1904
- keywordLocation: `${a}/const`,
1905
- error: `Instance does not match ${JSON.stringify($)}.`
1906
- })), w !== void 0 && (p === "object" || p === "array" ? w.some((m) => J(e, m)) || c.push({
1907
- instanceLocation: i,
1908
- keyword: "enum",
1909
- keywordLocation: `${a}/enum`,
1910
- error: `Instance does not match any of ${JSON.stringify(w)}.`
1911
- }) : w.some((m) => e === m) || c.push({
1912
- instanceLocation: i,
1913
- keyword: "enum",
1914
- keywordLocation: `${a}/enum`,
1915
- error: `Instance does not match any of ${JSON.stringify(w)}.`
1916
- })), B !== void 0) {
1917
- const m = `${a}/not`;
1918
- b(e, B, r, o, n, s, i, m).valid && c.push({
1919
- instanceLocation: i,
1920
- keyword: "not",
1921
- keywordLocation: m,
1922
- error: 'Instance matched "not" schema.'
1923
- });
1924
- }
1925
- let i2 = [];
1926
- if (f2 !== void 0) {
1927
- const m = `${a}/anyOf`, u = c.length;
1928
- let C = !1;
1929
- for (let f = 0; f < f2.length; f++) {
1930
- const d = f2[f], y = Object.create(l), g = b(e, d, r, o, n, S === !0 ? s : null, i, `${m}/${f}`, y);
1931
- c.push(...g.errors), C = C || g.valid, g.valid && i2.push(y);
1932
- }
1933
- C ? c.length = u : c.splice(u, 0, {
1934
- instanceLocation: i,
1935
- keyword: "anyOf",
1936
- keywordLocation: m,
1937
- error: "Instance does not match any subschemas."
1938
- });
1939
- }
1940
- if (p2 !== void 0) {
1941
- const m = `${a}/allOf`, u = c.length;
1942
- let C = !0;
1943
- for (let f = 0; f < p2.length; f++) {
1944
- const d = p2[f], y = Object.create(l), g = b(e, d, r, o, n, S === !0 ? s : null, i, `${m}/${f}`, y);
1945
- c.push(...g.errors), C = C && g.valid, g.valid && i2.push(y);
1946
- }
1947
- C ? c.length = u : c.splice(u, 0, {
1948
- instanceLocation: i,
1949
- keyword: "allOf",
1950
- keywordLocation: m,
1951
- error: "Instance does not match every subschema."
1952
- });
1953
- }
1954
- if (I2 !== void 0) {
1955
- const m = `${a}/oneOf`, u = c.length, C = I2.filter((f, d) => {
1956
- const y = Object.create(l), g = b(e, f, r, o, n, S === !0 ? s : null, i, `${m}/${d}`, y);
1957
- return c.push(...g.errors), g.valid && i2.push(y), g.valid;
1958
- }).length;
1959
- C === 1 ? c.length = u : c.splice(u, 0, {
1960
- instanceLocation: i,
1961
- keyword: "oneOf",
1962
- keywordLocation: m,
1963
- error: `Instance does not match exactly one subschema (${C} matches).`
1964
- });
1965
- }
1966
- if ((p === "object" || p === "array") && Object.assign(l, ...i2), O2 !== void 0) {
1967
- const m = `${a}/if`;
1968
- if (b(e, O2, r, o, n, s, i, m, l).valid) {
1969
- if (N2 !== void 0) {
1970
- const C = b(e, N2, r, o, n, s, i, `${a}/then`, l);
1971
- C.valid || c.push({
1972
- instanceLocation: i,
1973
- keyword: "if",
1974
- keywordLocation: m,
1975
- error: 'Instance does not match "then" schema.'
1976
- }, ...C.errors);
1977
- }
1978
- } else if (R2 !== void 0) {
1979
- const C = b(e, R2, r, o, n, s, i, `${a}/else`, l);
1980
- C.valid || c.push({
1981
- instanceLocation: i,
1982
- keyword: "if",
1983
- keywordLocation: m,
1984
- error: 'Instance does not match "else" schema.'
1985
- }, ...C.errors);
1986
- }
1987
- }
1988
- if (p === "object") {
1989
- if (j !== void 0)
1990
- for (const f of j)
1991
- f in e || c.push({
1992
- instanceLocation: i,
1993
- keyword: "required",
1994
- keywordLocation: `${a}/required`,
1995
- error: `Instance does not have required property "${f}".`
1996
- });
1997
- const m = Object.keys(e);
1998
- if (m2 !== void 0 && m.length < m2 && c.push({
1999
- instanceLocation: i,
2000
- keyword: "minProperties",
2001
- keywordLocation: `${a}/minProperties`,
2002
- error: `Instance does not have at least ${m2} properties.`
2003
- }), g2 !== void 0 && m.length > g2 && c.push({
2004
- instanceLocation: i,
2005
- keyword: "maxProperties",
2006
- keywordLocation: `${a}/maxProperties`,
2007
- error: `Instance does not have at least ${g2} properties.`
2008
- }), F2 !== void 0) {
2009
- const f = `${a}/propertyNames`;
2010
- for (const d in e) {
2011
- const y = `${i}/${L(d)}`, g = b(d, F2, r, o, n, s, y, f);
2012
- g.valid || c.push({
2013
- instanceLocation: i,
2014
- keyword: "propertyNames",
2015
- keywordLocation: f,
2016
- error: `Property name "${d}" does not match schema.`
2017
- }, ...g.errors);
2018
- }
2019
- }
2020
- if (y2 !== void 0) {
2021
- const f = `${a}/dependantRequired`;
2022
- for (const d in y2)
2023
- if (d in e) {
2024
- const y = y2[d];
2025
- for (const g of y)
2026
- g in e || c.push({
2027
- instanceLocation: i,
2028
- keyword: "dependentRequired",
2029
- keywordLocation: f,
2030
- error: `Instance has "${d}" but does not have "${g}".`
2031
- });
2032
- }
2033
- }
2034
- if (C2 !== void 0)
2035
- for (const f in C2) {
2036
- const d = `${a}/dependentSchemas`;
2037
- if (f in e) {
2038
- const y = b(e, C2[f], r, o, n, s, i, `${d}/${L(f)}`, l);
2039
- y.valid || c.push({
2040
- instanceLocation: i,
2041
- keyword: "dependentSchemas",
2042
- keywordLocation: d,
2043
- error: `Instance has "${f}" but does not match dependant schema.`
2044
- }, ...y.errors);
2045
- }
2046
- }
2047
- if (w2 !== void 0) {
2048
- const f = `${a}/dependencies`;
2049
- for (const d in w2)
2050
- if (d in e) {
2051
- const y = w2[d];
2052
- if (Array.isArray(y))
2053
- for (const g of y)
2054
- g in e || c.push({
2055
- instanceLocation: i,
2056
- keyword: "dependencies",
2057
- keywordLocation: f,
2058
- error: `Instance has "${d}" but does not have "${g}".`
2059
- });
2060
- else {
2061
- const g = b(e, y, r, o, n, s, i, `${f}/${L(d)}`);
2062
- g.valid || c.push({
2063
- instanceLocation: i,
2064
- keyword: "dependencies",
2065
- keywordLocation: f,
2066
- error: `Instance has "${d}" but does not match dependant schema.`
2067
- }, ...g.errors);
2068
- }
2069
- }
2070
- }
2071
- const u = /* @__PURE__ */ Object.create(null);
2072
- let C = !1;
2073
- if (u2 !== void 0) {
2074
- const f = `${a}/properties`;
2075
- for (const d in u2) {
2076
- if (!(d in e))
2077
- continue;
2078
- const y = `${i}/${L(d)}`, g = b(e[d], u2[d], r, o, n, s, y, `${f}/${L(d)}`);
2079
- if (g.valid)
2080
- l[d] = u[d] = !0;
2081
- else if (C = n, c.push({
2082
- instanceLocation: i,
2083
- keyword: "properties",
2084
- keywordLocation: f,
2085
- error: `Property "${d}" does not match schema.`
2086
- }, ...g.errors), C)
2087
- break;
2088
- }
2089
- }
2090
- if (!C && h2 !== void 0) {
2091
- const f = `${a}/patternProperties`;
2092
- for (const d in h2) {
2093
- const y = new RegExp(d, "u"), g = h2[d];
2094
- for (const k in e) {
2095
- if (!y.test(k))
2096
- continue;
2097
- const B2 = `${i}/${L(k)}`, q2 = b(e[k], g, r, o, n, s, B2, `${f}/${L(d)}`);
2098
- q2.valid ? l[k] = u[k] = !0 : (C = n, c.push({
2099
- instanceLocation: i,
2100
- keyword: "patternProperties",
2101
- keywordLocation: f,
2102
- error: `Property "${k}" matches pattern "${d}" but does not match associated schema.`
2103
- }, ...q2.errors));
2104
- }
2105
- }
2106
- }
2107
- if (!C && z2 !== void 0) {
2108
- const f = `${a}/additionalProperties`;
2109
- for (const d in e) {
2110
- if (u[d])
2111
- continue;
2112
- const y = `${i}/${L(d)}`, g = b(e[d], z2, r, o, n, s, y, f);
2113
- g.valid ? l[d] = !0 : (C = n, c.push({
2114
- instanceLocation: i,
2115
- keyword: "additionalProperties",
2116
- keywordLocation: f,
2117
- error: `Property "${d}" does not match additional properties schema.`
2118
- }, ...g.errors));
2119
- }
2120
- } else if (!C && A2 !== void 0) {
2121
- const f = `${a}/unevaluatedProperties`;
2122
- for (const d in e)
2123
- if (!l[d]) {
2124
- const y = `${i}/${L(d)}`, g = b(e[d], A2, r, o, n, s, y, f);
2125
- g.valid ? l[d] = !0 : c.push({
2126
- instanceLocation: i,
2127
- keyword: "unevaluatedProperties",
2128
- keywordLocation: f,
2129
- error: `Property "${d}" does not match unevaluated properties schema.`
2130
- }, ...g.errors);
2131
- }
2132
- }
2133
- } else if (p === "array") {
2134
- v2 !== void 0 && e.length > v2 && c.push({
2135
- instanceLocation: i,
2136
- keyword: "maxItems",
2137
- keywordLocation: `${a}/maxItems`,
2138
- error: `Array has too many items (${e.length} > ${v2}).`
2139
- }), b2 !== void 0 && e.length < b2 && c.push({
2140
- instanceLocation: i,
2141
- keyword: "minItems",
2142
- keywordLocation: `${a}/minItems`,
2143
- error: `Array has too few items (${e.length} < ${b2}).`
2144
- });
2145
- const m = e.length;
2146
- let u = 0, C = !1;
2147
- if (x2 !== void 0) {
2148
- const f = `${a}/prefixItems`, d = Math.min(x2.length, m);
2149
- for (; u < d; u++) {
2150
- const y = b(e[u], x2[u], r, o, n, s, `${i}/${u}`, `${f}/${u}`);
2151
- if (l[u] = !0, !y.valid && (C = n, c.push({
2152
- instanceLocation: i,
2153
- keyword: "prefixItems",
2154
- keywordLocation: f,
2155
- error: "Items did not match schema."
2156
- }, ...y.errors), C))
2157
- break;
2158
- }
2159
- }
2160
- if (q !== void 0) {
2161
- const f = `${a}/items`;
2162
- if (Array.isArray(q)) {
2163
- const d = Math.min(q.length, m);
2164
- for (; u < d; u++) {
2165
- const y = b(e[u], q[u], r, o, n, s, `${i}/${u}`, `${f}/${u}`);
2166
- if (l[u] = !0, !y.valid && (C = n, c.push({
2167
- instanceLocation: i,
2168
- keyword: "items",
2169
- keywordLocation: f,
2170
- error: "Items did not match schema."
2171
- }, ...y.errors), C))
2172
- break;
2173
- }
2174
- } else
2175
- for (; u < m; u++) {
2176
- const d = b(e[u], q, r, o, n, s, `${i}/${u}`, f);
2177
- if (l[u] = !0, !d.valid && (C = n, c.push({
2178
- instanceLocation: i,
2179
- keyword: "items",
2180
- keywordLocation: f,
2181
- error: "Items did not match schema."
2182
- }, ...d.errors), C))
2183
- break;
2184
- }
2185
- if (!C && j2 !== void 0) {
2186
- const d = `${a}/additionalItems`;
2187
- for (; u < m; u++) {
2188
- const y = b(e[u], j2, r, o, n, s, `${i}/${u}`, d);
2189
- l[u] = !0, y.valid || (C = n, c.push({
2190
- instanceLocation: i,
2191
- keyword: "additionalItems",
2192
- keywordLocation: d,
2193
- error: "Items did not match additional items schema."
2194
- }, ...y.errors));
2195
- }
2196
- }
2197
- }
2198
- if (U2 !== void 0)
2199
- if (m === 0 && P === void 0)
2200
- c.push({
2201
- instanceLocation: i,
2202
- keyword: "contains",
2203
- keywordLocation: `${a}/contains`,
2204
- error: "Array is empty. It must contain at least one item matching the schema."
2205
- });
2206
- else if (P !== void 0 && m < P)
2207
- c.push({
2208
- instanceLocation: i,
2209
- keyword: "minContains",
2210
- keywordLocation: `${a}/minContains`,
2211
- error: `Array has less items (${m}) than minContains (${P}).`
2212
- });
2213
- else {
2214
- const f = `${a}/contains`, d = c.length;
2215
- let y = 0;
2216
- for (let g = 0; g < m; g++) {
2217
- const k = b(e[g], U2, r, o, n, s, `${i}/${g}`, f);
2218
- k.valid ? (l[g] = !0, y++) : c.push(...k.errors);
2219
- }
2220
- y >= (P || 0) && (c.length = d), P === void 0 && Q === void 0 && y === 0 ? c.splice(d, 0, {
2221
- instanceLocation: i,
2222
- keyword: "contains",
2223
- keywordLocation: f,
2224
- error: "Array does not contain item matching schema."
2225
- }) : P !== void 0 && y < P ? c.push({
2226
- instanceLocation: i,
2227
- keyword: "minContains",
2228
- keywordLocation: `${a}/minContains`,
2229
- error: `Array must contain at least ${P} items matching schema. Only ${y} items were found.`
2230
- }) : Q !== void 0 && y > Q && c.push({
2231
- instanceLocation: i,
2232
- keyword: "maxContains",
2233
- keywordLocation: `${a}/maxContains`,
2234
- error: `Array may contain at most ${Q} items matching schema. ${y} items were found.`
2235
- });
2236
- }
2237
- if (!C && D2 !== void 0) {
2238
- const f = `${a}/unevaluatedItems`;
2239
- for (u; u < m; u++) {
2240
- if (l[u])
2241
- continue;
2242
- const d = b(e[u], D2, r, o, n, s, `${i}/${u}`, f);
2243
- l[u] = !0, d.valid || c.push({
2244
- instanceLocation: i,
2245
- keyword: "unevaluatedItems",
2246
- keywordLocation: f,
2247
- error: "Items did not match unevaluated items schema."
2248
- }, ...d.errors);
2249
- }
2250
- }
2251
- if (y0)
2252
- for (let f = 0; f < m; f++) {
2253
- const d = e[f], y = typeof d == "object" && d !== null;
2254
- for (let g = 0; g < m; g++) {
2255
- if (f === g)
2256
- continue;
2257
- const k = e[g];
2258
- (d === k || y && (typeof k == "object" && k !== null) && J(d, k)) && (c.push({
2259
- instanceLocation: i,
2260
- keyword: "uniqueItems",
2261
- keywordLocation: `${a}/uniqueItems`,
2262
- error: `Duplicate items at indexes ${f} and ${g}.`
2263
- }), f = Number.MAX_SAFE_INTEGER, g = Number.MAX_SAFE_INTEGER);
2264
- }
2265
- }
2266
- } else if (p === "number") {
2267
- if (r === "4" ? (R !== void 0 && (W === !0 && e <= R || e < R) && c.push({
2268
- instanceLocation: i,
2269
- keyword: "minimum",
2270
- keywordLocation: `${a}/minimum`,
2271
- error: `${e} is less than ${W ? "or equal to " : ""} ${R}.`
2272
- }), z !== void 0 && (H === !0 && e >= z || e > z) && c.push({
2273
- instanceLocation: i,
2274
- keyword: "maximum",
2275
- keywordLocation: `${a}/maximum`,
2276
- error: `${e} is greater than ${H ? "or equal to " : ""} ${z}.`
2277
- })) : (R !== void 0 && e < R && c.push({
2278
- instanceLocation: i,
2279
- keyword: "minimum",
2280
- keywordLocation: `${a}/minimum`,
2281
- error: `${e} is less than ${R}.`
2282
- }), z !== void 0 && e > z && c.push({
2283
- instanceLocation: i,
2284
- keyword: "maximum",
2285
- keywordLocation: `${a}/maximum`,
2286
- error: `${e} is greater than ${z}.`
2287
- }), W !== void 0 && e <= W && c.push({
2288
- instanceLocation: i,
2289
- keyword: "exclusiveMinimum",
2290
- keywordLocation: `${a}/exclusiveMinimum`,
2291
- error: `${e} is less than ${W}.`
2292
- }), H !== void 0 && e >= H && c.push({
2293
- instanceLocation: i,
2294
- keyword: "exclusiveMaximum",
2295
- keywordLocation: `${a}/exclusiveMaximum`,
2296
- error: `${e} is greater than or equal to ${H}.`
2297
- })), e2 !== void 0) {
2298
- const m = e % e2;
2299
- Math.abs(0 - m) >= 11920929e-14 && Math.abs(e2 - m) >= 11920929e-14 && c.push({
2300
- instanceLocation: i,
2301
- keyword: "multipleOf",
2302
- keywordLocation: `${a}/multipleOf`,
2303
- error: `${e} is not a multiple of ${e2}.`
2304
- });
2305
- }
2306
- } else if (p === "string") {
2307
- const m = t2 === void 0 && r2 === void 0 ? 0 : ke(e);
2308
- t2 !== void 0 && m < t2 && c.push({
2309
- instanceLocation: i,
2310
- keyword: "minLength",
2311
- keywordLocation: `${a}/minLength`,
2312
- error: `String is too short (${m} < ${t2}).`
2313
- }), r2 !== void 0 && m > r2 && c.push({
2314
- instanceLocation: i,
2315
- keyword: "maxLength",
2316
- keywordLocation: `${a}/maxLength`,
2317
- error: `String is too long (${m} > ${r2}).`
2318
- }), Z2 !== void 0 && !new RegExp(Z2, "u").test(e) && c.push({
2319
- instanceLocation: i,
2320
- keyword: "pattern",
2321
- keywordLocation: `${a}/pattern`,
2322
- error: "String does not match pattern."
2323
- }), X !== void 0 && K2[X] && !K2[X](e) && c.push({
2324
- instanceLocation: i,
2325
- keyword: "format",
2326
- keywordLocation: `${a}/format`,
2327
- error: `String does not match format "${X}".`
2328
- });
2329
- }
2330
- return { valid: c.length === 0, errors: c };
2331
- }
2332
- class $e {
2333
- schema;
2334
- draft;
2335
- shortCircuit;
2336
- lookup;
2337
- constructor(t, r = "2019-09", o = !0) {
2338
- this.schema = t, this.draft = r, this.shortCircuit = o, this.lookup = A(t);
2339
- }
2340
- validate(t) {
2341
- return b(t, this.schema, this.draft, this.lookup, this.shortCircuit);
2342
- }
2343
- addSchema(t, r) {
2344
- r && (t = { ...t, $id: r }), A(t, this.lookup);
2345
- }
2346
- }
2347
- const Y2 = "Failed to parse input arguments", c2 = "Tool was executed but the invocation failed. For example, the script function threw an error", S2 = "Tool was cancelled", s2 = {
2348
- type: "object",
2349
- properties: {}
2350
- }, Le = ["draft-2020-12", "draft-07"], Se = "__isWebMCPPolyfill", p0 = Symbol("standardValidator"), E = {
2351
- installed: !1,
2352
- previousModelContextDescriptor: void 0,
2353
- previousModelContextTestingDescriptor: void 0
2354
- };
2355
- var Te = class {
2356
- tools = /* @__PURE__ */ new Map();
2357
- toolsChangedCallback = null;
2358
- provideContextDeprecationWarned = !1;
2359
- clearContextDeprecationWarned = !1;
2360
- provideContext(e = {}) {
2361
- this.warnProvideContextDeprecationOnce();
2362
- const t = /* @__PURE__ */ new Map();
2363
- for (const r of e.tools ?? []) {
2364
- const o = X2(r, t);
2365
- t.set(o.name, o);
2366
- }
2367
- this.tools = t, this.notifyToolsChanged();
2368
- }
2369
- clearContext() {
2370
- this.warnClearContextDeprecationOnce(), this.tools.clear(), this.notifyToolsChanged();
2371
- }
2372
- registerTool(e) {
2373
- const t = X2(e, this.tools);
2374
- this.tools.set(t.name, t), this.notifyToolsChanged();
2375
- }
2376
- unregisterTool(e) {
2377
- const t = Me(e);
2378
- this.tools.delete(t) && this.notifyToolsChanged();
2379
- }
2380
- getTestingShim() {
2381
- return {
2382
- listTools: () => [...this.tools.values()].map((e) => {
2383
- const t = {
2384
- name: e.name,
2385
- description: e.description
2386
- };
2387
- try {
2388
- t.inputSchema = JSON.stringify(e.inputSchema);
2389
- } catch {
2390
- }
2391
- return t;
2392
- }),
2393
- executeTool: (e, t, r) => this.executeToolForTesting(e, t, r),
2394
- registerToolsChangedCallback: (e) => {
2395
- if (typeof e != "function") throw new TypeError("Failed to execute 'registerToolsChangedCallback' on 'ModelContextTesting': parameter 1 is not of type 'Function'.");
2396
- this.toolsChangedCallback = e;
2397
- },
2398
- getCrossDocumentScriptToolResult: async () => "[]"
2399
- };
2400
- }
2401
- async executeToolForTesting(e, t, r) {
2402
- if (r?.signal?.aborted) throw M(S2);
2403
- const o = this.tools.get(e);
2404
- if (!o) throw M(`Tool not found: ${e}`);
2405
- const n = Ee(t), s = await Fe(n, o);
2406
- if (s) throw M(s);
2407
- let i = !0;
2408
- const a = { requestUserInteraction: async (l) => {
2409
- if (!i) throw new Error(`ModelContextClient for tool "${e}" is no longer active after execute() resolved`);
2410
- if (typeof l != "function") throw new TypeError("requestUserInteraction(callback) requires a function callback");
2411
- return l();
2412
- } };
2413
- try {
2414
- const l = o.execute(n, a);
2415
- return We(Be(await He(Promise.resolve(l), r?.signal)));
2416
- } catch (l) {
2417
- throw M(l instanceof Error ? `${c2}: ${l.message}` : c2);
2418
- } finally {
2419
- i = !1;
2420
- }
2421
- }
2422
- notifyToolsChanged() {
2423
- this.toolsChangedCallback && queueMicrotask(() => {
2424
- try {
2425
- this.toolsChangedCallback?.();
2426
- } catch (e) {
2427
- console.warn("[WebMCPPolyfill] toolsChanged callback threw:", e);
2428
- }
2429
- });
2430
- }
2431
- warnProvideContextDeprecationOnce() {
2432
- this.provideContextDeprecationWarned || (this.provideContextDeprecationWarned = !0, console.warn("[WebMCPPolyfill] navigator.modelContext.provideContext() is deprecated and will be removed in the next major version. Register tools individually with registerTool() instead."));
2433
- }
2434
- warnClearContextDeprecationOnce() {
2435
- this.clearContextDeprecationWarned || (this.clearContextDeprecationWarned = !0, console.warn("[WebMCPPolyfill] navigator.modelContext.clearContext() is deprecated and will be removed in the next major version. Unregister individual tools instead."));
2436
- }
2437
- };
2438
- function M(e) {
2439
- try {
2440
- return new DOMException(e, "UnknownError");
2441
- } catch {
2442
- const t = new Error(e);
2443
- return t.name = "UnknownError", t;
2444
- }
2445
- }
2446
- function Ee(e) {
2447
- let t;
2448
- try {
2449
- t = JSON.parse(e);
2450
- } catch {
2451
- throw M(Y2);
2452
- }
2453
- if (!t || typeof t != "object" || Array.isArray(t)) throw M(Y2);
2454
- return t;
2455
- }
2456
- function Me(e) {
2457
- if (typeof e == "string") return e;
2458
- if (_(e) && typeof e.name == "string") return e.name;
2459
- throw new TypeError("Failed to execute 'unregisterTool' on 'ModelContext': parameter 1 must be a string or an object with a string name.");
2460
- }
2461
- function _(e) {
2462
- return !!e && typeof e == "object" && !Array.isArray(e);
2463
- }
2464
- function u0(e) {
2465
- if (!_(e)) return null;
2466
- const t = e["~standard"];
2467
- return _(t) ? t : null;
2468
- }
2469
- function Pe(e) {
2470
- const t = u0(e);
2471
- return !!(t && t.version === 1 && typeof t.validate == "function");
2472
- }
2473
- function Ie(e) {
2474
- const t = u0(e);
2475
- return !t || t.version !== 1 || !_(t.jsonSchema) ? !1 : typeof t.jsonSchema.input == "function";
2476
- }
2477
- function a2(e) {
2478
- return { "~standard": {
2479
- version: 1,
2480
- vendor: "@mcp-b/webmcp-polyfill-json-schema",
2481
- validate(t) {
2482
- if (!_(t)) return { issues: [{ message: "expected object arguments" }] };
2483
- const r = Re(t, e);
2484
- return r ? { issues: [r] } : { value: t };
2485
- }
2486
- } };
2487
- }
2488
- function Oe(e) {
2489
- for (const t of Le) try {
2490
- const r = e["~standard"].jsonSchema.input({ target: t });
2491
- return h0(r), r;
2492
- } catch (r) {
2493
- console.warn(`[WebMCPPolyfill] Standard JSON Schema conversion failed for target "${t}":`, r);
2494
- }
2495
- throw new Error("Failed to convert Standard JSON Schema inputSchema to a JSON Schema object");
2496
- }
2497
- function Ne(e) {
2498
- if (e === void 0) {
2499
- const r = s2;
2500
- return {
2501
- inputSchema: r,
2502
- standardValidator: a2(r)
2503
- };
2504
- }
2505
- if (Ie(e)) {
2506
- const r = Oe(e);
2507
- return {
2508
- inputSchema: r,
2509
- standardValidator: a2(r)
2510
- };
2511
- }
2512
- if (Pe(e)) return {
2513
- inputSchema: s2,
2514
- standardValidator: e
2515
- };
2516
- if (h0(e), Object.keys(e).length === 0) return {
2517
- inputSchema: s2,
2518
- standardValidator: a2(s2)
2519
- };
2520
- const t = e.type === void 0 ? {
2521
- type: "object",
2522
- ...e
2523
- } : e;
2524
- return {
2525
- inputSchema: t,
2526
- standardValidator: a2(t)
2527
- };
2528
- }
2529
- function h0(e) {
2530
- if (!_(e)) throw new Error("inputSchema must be a JSON Schema object");
2531
- D(e, "$");
2532
- }
2533
- function D(e, t) {
2534
- const r = e.type;
2535
- if (r !== void 0 && typeof r != "string" && !(Array.isArray(r) && r.every((a) => typeof a == "string" && a.length > 0))) throw new Error(`Invalid JSON Schema at ${t}: "type" must be a string or string[]`);
2536
- const o = e.required;
2537
- if (o !== void 0 && !(Array.isArray(o) && o.every((a) => typeof a == "string"))) throw new Error(`Invalid JSON Schema at ${t}: "required" must be an array of strings`);
2538
- const n = e.properties;
2539
- if (n !== void 0) {
2540
- if (!_(n)) throw new Error(`Invalid JSON Schema at ${t}: "properties" must be an object`);
2541
- for (const [a, l] of Object.entries(n)) {
2542
- if (!_(l)) throw new Error(`Invalid JSON Schema at ${t}.properties.${a}: expected object schema`);
2543
- D(l, `${t}.properties.${a}`);
2544
- }
2545
- }
2546
- const s = e.items;
2547
- if (s !== void 0) if (Array.isArray(s)) for (const [a, l] of s.entries()) {
2548
- if (!_(l)) throw new Error(`Invalid JSON Schema at ${t}.items[${a}]: expected object schema`);
2549
- D(l, `${t}.items[${a}]`);
2550
- }
2551
- else if (_(s)) D(s, `${t}.items`);
2552
- else throw new Error(`Invalid JSON Schema at ${t}: "items" must be an object or object[]`);
2553
- for (const a of [
2554
- "allOf",
2555
- "anyOf",
2556
- "oneOf"
2557
- ]) {
2558
- const l = e[a];
2559
- if (l !== void 0) {
2560
- if (!Array.isArray(l)) throw new Error(`Invalid JSON Schema at ${t}: "${a}" must be an array`);
2561
- for (const [h, p] of l.entries()) {
2562
- if (!_(p)) throw new Error(`Invalid JSON Schema at ${t}.${a}[${h}]: expected object schema`);
2563
- D(p, `${t}.${a}[${h}]`);
2564
- }
2565
- }
2566
- }
2567
- const i = e.not;
2568
- if (i !== void 0) {
2569
- if (!_(i)) throw new Error(`Invalid JSON Schema at ${t}: "not" must be an object schema`);
2570
- D(i, `${t}.not`);
2571
- }
2572
- try {
2573
- JSON.stringify(e);
2574
- } catch {
2575
- throw new Error(`Invalid JSON Schema at ${t}: schema must be JSON-serializable`);
2576
- }
2577
- }
2578
- function X2(e, t) {
2579
- if (!e || typeof e != "object") throw new TypeError("registerTool(tool) requires a tool object");
2580
- if (typeof e.name != "string" || e.name.length === 0) throw new TypeError('Tool "name" must be a non-empty string');
2581
- if (typeof e.description != "string" || e.description.length === 0) throw new TypeError('Tool "description" must be a non-empty string');
2582
- if (typeof e.execute != "function") throw new TypeError('Tool "execute" must be a function');
2583
- if (t.has(e.name)) throw new Error(`Tool already registered: ${e.name}`);
2584
- const r = Ne(e.inputSchema), o = e.annotations, n = o ? {
2585
- ...o,
2586
- ...o.readOnlyHint === "true" ? { readOnlyHint: !0 } : o.readOnlyHint === "false" ? { readOnlyHint: !1 } : {},
2587
- ...o.destructiveHint === "true" ? { destructiveHint: !0 } : o.destructiveHint === "false" ? { destructiveHint: !1 } : {},
2588
- ...o.idempotentHint === "true" ? { idempotentHint: !0 } : o.idempotentHint === "false" ? { idempotentHint: !1 } : {},
2589
- ...o.openWorldHint === "true" ? { openWorldHint: !0 } : o.openWorldHint === "false" ? { openWorldHint: !1 } : {}
2590
- } : void 0;
2591
- return {
2592
- ...e,
2593
- ...n ? { annotations: n } : {},
2594
- inputSchema: r.inputSchema,
2595
- [p0]: r.standardValidator
2596
- };
2597
- }
2598
- function Re(e, t) {
2599
- const r = new $e(t, "2020-12", !0).validate(e);
2600
- if (r.valid) return null;
2601
- const o = r.errors[r.errors.length - 1];
2602
- return o ? { message: o.error } : { message: "Input validation failed" };
2603
- }
2604
- function ze(e) {
2605
- if (!e || e.length === 0) return null;
2606
- const t = e.map((r) => _(r) && "key" in r ? r.key : r).map((r) => String(r)).filter((r) => r.length > 0);
2607
- return t.length === 0 ? null : t.join(".");
2608
- }
2609
- async function Ae(e, t) {
2610
- let r;
2611
- try {
2612
- r = await Promise.resolve(t["~standard"].validate(e));
2613
- } catch (s) {
2614
- const i = s instanceof Error ? `: ${s.message}` : "";
2615
- return console.error("[WebMCPPolyfill] Standard Schema validation threw unexpectedly:", s), `Input validation error: schema validation failed${i}`;
2616
- }
2617
- if (!r.issues || r.issues.length === 0) return null;
2618
- const o = r.issues[0];
2619
- if (!o) return "Input validation error";
2620
- const n = ze(o?.path);
2621
- return n ? `Input validation error: ${o.message} at ${n}` : `Input validation error: ${o.message}`;
2622
- }
2623
- async function Fe(e, t) {
2624
- return Ae(e, t[p0]);
2625
- }
2626
- function je(e) {
2627
- return _(e) && Array.isArray(e.content);
2628
- }
2629
- function De(e) {
2630
- return e === null || typeof e == "string" || typeof e == "number" || typeof e == "boolean";
2631
- }
2632
- function T2(e) {
2633
- return De(e) ? Number.isFinite(e) || typeof e != "number" : Array.isArray(e) ? e.every((t) => T2(t)) : _(e) ? Object.values(e).every((t) => T2(t)) : !1;
2634
- }
2635
- function Ue(e) {
2636
- if (!(!_(e) || !T2(e)))
2637
- return e;
2638
- }
2639
- function Ze(e) {
2640
- if (typeof e == "string") return e;
2641
- try {
2642
- return JSON.stringify(e) ?? String(e);
2643
- } catch {
2644
- return String(e);
2645
- }
2646
- }
2647
- function Be(e) {
2648
- if (je(e)) return e;
2649
- const t = Ue(e);
2650
- return {
2651
- content: [{
2652
- type: "text",
2653
- text: Ze(e)
2654
- }],
2655
- ...t ? { structuredContent: t } : {},
2656
- isError: !1
2657
- };
2658
- }
2659
- function qe(e) {
2660
- for (const t of e.content ?? []) if (t.type === "text" && "text" in t && typeof t.text == "string") return t.text;
2661
- return null;
2662
- }
2663
- function We(e) {
2664
- if (e.isError) throw M(qe(e)?.replace(/^Error:\s*/i, "").trim() || c2);
2665
- const t = e.metadata;
2666
- if (t && typeof t == "object" && t.willNavigate) return null;
2667
- try {
2668
- return JSON.stringify(e);
2669
- } catch {
2670
- throw M(c2);
2671
- }
2672
- }
2673
- function He(e, t) {
2674
- return t ? t.aborted ? Promise.reject(M(S2)) : new Promise((r, o) => {
2675
- const n = () => {
2676
- s(), o(M(S2));
2677
- }, s = () => {
2678
- t.removeEventListener("abort", n);
2679
- };
2680
- t.addEventListener("abort", n, { once: !0 }), e.then((i) => {
2681
- s(), r(i);
2682
- }, (i) => {
2683
- s(), o(i);
2684
- });
2685
- }) : e;
2686
- }
2687
- function m0() {
2688
- return typeof navigator < "u" ? navigator : null;
2689
- }
2690
- function Q2(e, t, r) {
2691
- Object.defineProperty(e, t, {
2692
- configurable: !0,
2693
- enumerable: !0,
2694
- writable: !1,
2695
- value: r
2696
- });
2697
- }
2698
- function g0(e) {
2699
- const t = m0();
2700
- if (!t || t.modelContext) return;
2701
- E.installed && Je();
2702
- const r = new Te(), o = r;
2703
- o[Se] = !0, E.previousModelContextDescriptor = Object.getOwnPropertyDescriptor(t, "modelContext"), E.previousModelContextTestingDescriptor = Object.getOwnPropertyDescriptor(t, "modelContextTesting"), Q2(t, "modelContext", o);
2704
- const n = e?.installTestingShim ?? "if-missing", s = !!t.modelContextTesting;
2705
- (n === "always" || (n === !0 || n === "if-missing") && !s) && Q2(t, "modelContextTesting", r.getTestingShim()), E.installed = !0;
2706
- }
2707
- function Je() {
2708
- const e = m0();
2709
- if (!e || !E.installed) return;
2710
- const t = (r, o) => {
2711
- if (o) {
2712
- Object.defineProperty(e, r, o);
2713
- return;
2714
- }
2715
- delete e[r];
2716
- };
2717
- t("modelContext", E.previousModelContextDescriptor), t("modelContextTesting", E.previousModelContextTestingDescriptor), E.installed = !1, E.previousModelContextDescriptor = void 0, E.previousModelContextTestingDescriptor = void 0;
2718
- }
2719
- if (typeof window < "u" && typeof document < "u") {
2720
- const e = window.__webMCPPolyfillOptions;
2721
- if (e?.autoInitialize !== !1) try {
2722
- g0(e);
2723
- } catch (t) {
2724
- console.error("[WebMCPPolyfill] Auto-initialization failed:", t);
2725
- }
2726
- }
2727
- const dt = () => {
2728
- if (O())
2729
- try {
2730
- g0(), W0();
2731
- } catch (e) {
2732
- console.warn("[next-sdk] 自动注入 modelContext polyfill 和桥接同步失败:", e);
2733
- }
2734
- };
1
+ import { default as r } from "ajv";
2
+ import { z as t } from "zod";
3
+ import { AuthClientProvider as l } from "@opentiny/next";
4
+ import { ResourceTemplate as n } from "@modelcontextprotocol/sdk/server/mcp.js";
5
+ import { UriTemplate as T } from "@modelcontextprotocol/sdk/shared/uriTemplate.js";
6
+ import { completable as M } from "@modelcontextprotocol/sdk/server/completable.js";
7
+ import { getDisplayName as m } from "@modelcontextprotocol/sdk/shared/metadataUtils.js";
8
+ import { InMemoryTransport as c } from "@modelcontextprotocol/sdk/inMemory.js";
9
+ import { A as f, p as v, M as x, o as b, e as d, W as h, u as E, j as R, a as k, c as y, f as A, h as W, g as u, i as O, v as _, v as D, n as G, d as N, m as z, b as I, x as j, k as w, l as B, r as F, q as H, s as L, t as Q, y as U, w as q } from "./initialize-builtin-WebMCP-rALfqS-o.js";
10
+ import { Q as Y, e as J, d as V, f as X, c as Z, b as $, a as ee, g as ae, p as re, r as se } from "./index-CXK8CcKq.js";
2735
11
  export {
2736
- Tt as AgentModelProvider,
2737
- pt as Ajv,
2738
- gt as AuthClientProvider,
2739
- et as ContentScriptServerTransport,
2740
- Et as ExtensionClientTransport,
2741
- Qe as ExtensionPageServerTransport,
2742
- Lt as InMemoryTransport,
2743
- D0 as MSG_REMOTER_READY,
2744
- Z as MSG_TOOL_REGISTERED,
2745
- M2 as MSG_TOOL_UNREGISTERED,
2746
- v0 as QrCode,
2747
- Ct as ResourceTemplate,
2748
- xt as UriTemplate,
2749
- Mt as WebMcpClient,
2750
- Pt as WebMcpServer,
2751
- Je as cleanupWebMCPPolyfill,
2752
- vt as completable,
2753
- It as createMessageChannelClientTransport,
2754
- Ot as createMessageChannelPairTransport,
2755
- Nt as createMessageChannelServerTransport,
2756
- tt as createRemoter,
2757
- Rt as createSSEClientTransport,
2758
- lt as createSkillTools,
2759
- zt as createStreamableHTTPClientTransport,
2760
- at as formatSkillsForSystemPrompt,
2761
- At as getAISDKTools,
2762
- kt as getDisplayName,
2763
- G0 as getMainSkillPathByName,
2764
- J0 as getMainSkillPaths,
2765
- k2 as getSkillMdContent,
2766
- st as getSkillOverviews,
2767
- dt as initializeBuiltinWebMCP,
2768
- g0 as initializeWebMCPPolyfill,
2769
- g0 as initializeWebModelContextPolyfill,
2770
- Ft as isMcpClient,
2771
- jt as isMcpServer,
2772
- Dt as isMessageChannelClientTransport,
2773
- Ut as isMessageChannelServerTransport,
2774
- _ as isPlainObject,
2775
- Zt as isSSEClientTransport,
2776
- Bt as isStreamableHTTPClientTransport,
2777
- d0 as parseSkillFrontMatter,
2778
- ot as registerNavigateTool,
2779
- nt as registerPageTool,
2780
- rt as setNavigator,
2781
- W0 as setupModelContextBridge,
2782
- Re as validateArgsWithSchema,
2783
- it as withPageTools,
2784
- ht as z
12
+ f as AgentModelProvider,
13
+ r as Ajv,
14
+ l as AuthClientProvider,
15
+ c as InMemoryTransport,
16
+ v as MSG_REMOTER_READY,
17
+ x as MSG_TOOL_REGISTERED,
18
+ b as MSG_TOOL_UNREGISTERED,
19
+ Y as QrCode,
20
+ n as ResourceTemplate,
21
+ T as UriTemplate,
22
+ d as WebMcpClient,
23
+ h as WebMcpServer,
24
+ E as cleanupWebMCPPolyfill,
25
+ M as completable,
26
+ R as createMessageChannelClientTransport,
27
+ k as createMessageChannelPairTransport,
28
+ y as createMessageChannelServerTransport,
29
+ J as createRemoter,
30
+ A as createSSEClientTransport,
31
+ V as createSkillTools,
32
+ W as createStreamableHTTPClientTransport,
33
+ X as formatSkillsForSystemPrompt,
34
+ u as getAISDKTools,
35
+ m as getDisplayName,
36
+ Z as getMainSkillPathByName,
37
+ $ as getMainSkillPaths,
38
+ ee as getSkillMdContent,
39
+ ae as getSkillOverviews,
40
+ O as initializeBuiltinWebMCP,
41
+ _ as initializeWebMCPPolyfill,
42
+ D as initializeWebModelContextPolyfill,
43
+ G as isMcpClient,
44
+ N as isMcpServer,
45
+ z as isMessageChannelClientTransport,
46
+ I as isMessageChannelServerTransport,
47
+ j as isPlainObject,
48
+ w as isSSEClientTransport,
49
+ B as isStreamableHTTPClientTransport,
50
+ re as parseSkillFrontMatter,
51
+ F as registerNavigateTool,
52
+ se as registerPageAgentTool,
53
+ H as registerPageTool,
54
+ L as setNavigator,
55
+ Q as setupModelContextBridge,
56
+ U as validateArgsWithSchema,
57
+ q as withPageTools,
58
+ t as z
2785
59
  };