@scayle/storefront-devtools 0.2.0-alpha.7 → 0.2.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/_chunks/{coalesce-Ch1sV7RN.mjs → coalesce-CwMA7h7B.mjs} +181 -181
- package/dist/group.d.ts +0 -11
- package/dist/group.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +31 -42
- package/dist/inertia/client/index.mjs +1 -1
- package/dist/orpc/client/index.mjs +1 -1
- package/dist/ui/assets/{App-B2ZZO0Ti.js → App-B6SN0ADu.js} +1 -1
- package/dist/ui/assets/{App-6RVVFLEC.js → App-BCLweKyw.js} +1 -1
- package/dist/ui/assets/{App-eWdxlybE.js → App-Dhq_Z2uF.js} +1 -1
- package/dist/ui/assets/{HeadersTab-BQDnjNCw.js → HeadersTab-D0wqoySp.js} +1 -1
- package/dist/ui/assets/_plugin-vue_export-helper-DW0ntR6Z.js +2 -0
- package/dist/ui/assets/{panels-oi-DKWXr.js → panels-DCvZ4R84.js} +2 -2
- package/dist/ui/assets/store-BsnLWNGS.js +1 -0
- package/dist/ui/panels/index.html +1 -1
- package/package.json +8 -9
- package/dist/ui/assets/_plugin-vue_export-helper-DnlXueOW.js +0 -2
- package/dist/ui/assets/store-CCDY0y91.js +0 -1
|
@@ -87,7 +87,7 @@ function d(e) {
|
|
|
87
87
|
for (let [n, r] of Object.entries(e)) l(n) || (t[n] = r);
|
|
88
88
|
return t;
|
|
89
89
|
}
|
|
90
|
-
// ../../../node_modules/.pnpm/devframe@1.
|
|
90
|
+
// ../../../node_modules/.pnpm/devframe@1.4.0_@devframes+agentic@1.4.0_cac@7.1.0_crossws@0.4.17_srvx@1.0.6__srvx@1.0.6/node_modules/devframe/dist/utils/colors.mjs
|
|
91
91
|
function f(e, t) {
|
|
92
92
|
let n = `\x1B[${e}m`, r = `\x1B[${t}m`;
|
|
93
93
|
return ((e, ...t) => {
|
|
@@ -111,22 +111,16 @@ var p = {
|
|
|
111
111
|
reset: f(0, 0),
|
|
112
112
|
underline: f(4, 24)
|
|
113
113
|
};
|
|
114
|
-
// ../../../node_modules/.pnpm/nostics@1.
|
|
114
|
+
// ../../../node_modules/.pnpm/nostics@1.4.0/node_modules/nostics/dist/index.mjs
|
|
115
115
|
function m(e, ...t) {
|
|
116
116
|
return typeof e == "function" ? e(...t) : e;
|
|
117
117
|
}
|
|
118
118
|
var h = Error.captureStackTrace, g = class e extends Error {
|
|
119
|
-
name;
|
|
120
|
-
code;
|
|
121
|
-
docs;
|
|
122
|
-
fix;
|
|
123
|
-
sources;
|
|
124
|
-
data;
|
|
125
119
|
get why() {
|
|
126
120
|
return this.message;
|
|
127
121
|
}
|
|
128
122
|
constructor(t, n = e) {
|
|
129
|
-
super(t.why, { cause: t.cause }), this.code = this.name = t.code, this.
|
|
123
|
+
super(t.why, { cause: t.cause }), this.code = this.name = t.code, this.docs = t.docs, this.fix = t.fix, this.sources = t.sources, this.data = t.data, h?.(this, n);
|
|
130
124
|
}
|
|
131
125
|
toJSON() {
|
|
132
126
|
return {
|
|
@@ -144,28 +138,30 @@ var h = Error.captureStackTrace, g = class e extends Error {
|
|
|
144
138
|
function _(e, t) {
|
|
145
139
|
return typeof e == "string" ? `${e}/${t.toLowerCase()}` : e?.(t);
|
|
146
140
|
}
|
|
141
|
+
var v = (e) => (t) => t instanceof g && e in t;
|
|
147
142
|
/* @__NO_SIDE_EFFECTS__ */
|
|
148
|
-
function
|
|
149
|
-
let t = e.reporters ?? [], n = {}, { docsBase:
|
|
150
|
-
for (let
|
|
151
|
-
let
|
|
152
|
-
let
|
|
153
|
-
code:
|
|
154
|
-
why: m(
|
|
155
|
-
fix: m(
|
|
156
|
-
docs:
|
|
143
|
+
function y(e) {
|
|
144
|
+
let t = e.reporters ?? [], n = Symbol(), r = Object.defineProperty({}, "is", { value: v(n) }), { docsBase: i } = e;
|
|
145
|
+
for (let a of Object.keys(e.codes)) {
|
|
146
|
+
let o = e.codes[a], s = o.docs === !1 ? void 0 : o.docs || _(i, a), c = (e = {}, r = {}) => {
|
|
147
|
+
let i = new g({
|
|
148
|
+
code: a,
|
|
149
|
+
why: m(o.why, e),
|
|
150
|
+
fix: m(o.fix, e),
|
|
151
|
+
docs: s,
|
|
157
152
|
cause: e.cause,
|
|
158
153
|
sources: e.sources,
|
|
159
|
-
data: m(
|
|
160
|
-
},
|
|
161
|
-
|
|
162
|
-
|
|
154
|
+
data: m(o.data, e)
|
|
155
|
+
}, c);
|
|
156
|
+
i[n] = 1;
|
|
157
|
+
for (let e of t) e(i, r);
|
|
158
|
+
return i;
|
|
163
159
|
};
|
|
164
|
-
|
|
160
|
+
c.is = (e) => r.is(e) && e.code === a, r[a] = c;
|
|
165
161
|
}
|
|
166
|
-
return
|
|
162
|
+
return r;
|
|
167
163
|
}
|
|
168
|
-
// ../../../node_modules/.pnpm/nostics@1.
|
|
164
|
+
// ../../../node_modules/.pnpm/nostics@1.4.0/node_modules/nostics/dist/formatters/ansi.mjs
|
|
169
165
|
/* @__NO_SIDE_EFFECTS__ */
|
|
170
166
|
function ee(e) {
|
|
171
167
|
return (t) => {
|
|
@@ -173,8 +169,8 @@ function ee(e) {
|
|
|
173
169
|
return t.fix && r.push(`${e.dim("fix:")} ${t.fix}`), t.sources?.length && r.push(`${e.dim("sources:")} ${t.sources.join(", ")}`), t.docs && r.push(`${e.dim("see:")} ${e.cyan(t.docs)}`), r.length === 0 ? n : [n, ...r.map((t, n) => `${e.dim(n < r.length - 1 ? "├▶" : "╰▶")} ${t}`)].join("\n");
|
|
174
170
|
};
|
|
175
171
|
}
|
|
176
|
-
// ../../../node_modules/.pnpm/devframe@1.
|
|
177
|
-
var
|
|
172
|
+
// ../../../node_modules/.pnpm/devframe@1.4.0_@devframes+agentic@1.4.0_cac@7.1.0_crossws@0.4.17_srvx@1.0.6__srvx@1.0.6/node_modules/devframe/dist/tool-input-BG4O-RyL.mjs
|
|
173
|
+
var te = {
|
|
178
174
|
bus: {
|
|
179
175
|
agentManifestChanged: "agent:manifest:changed",
|
|
180
176
|
agentToolRegistered: "agent:tool:registered",
|
|
@@ -197,6 +193,8 @@ var y = {
|
|
|
197
193
|
streamingEnd: "devframe:streaming:end",
|
|
198
194
|
streamingUploadCancel: "devframe:streaming:upload-cancel"
|
|
199
195
|
},
|
|
196
|
+
sharedState: { tracingChannels: "devframe:tracing:channels" },
|
|
197
|
+
stream: { tracing: "devframe:tracing" },
|
|
200
198
|
inPageChannel: {
|
|
201
199
|
panelStateUpdated: "devframe:in-page:panel-state:updated",
|
|
202
200
|
panelStatePatch: "devframe:in-page:panel-state:patch"
|
|
@@ -205,17 +203,17 @@ var y = {
|
|
|
205
203
|
remoteAssetsError: "devframe:remote-assets-error",
|
|
206
204
|
inPageChannel: "devframe:in-page-channel"
|
|
207
205
|
}
|
|
208
|
-
},
|
|
209
|
-
function
|
|
210
|
-
console[t](
|
|
206
|
+
}, ne = /* @__PURE__ */ ee(p);
|
|
207
|
+
function re(e, { method: t = "warn" } = {}) {
|
|
208
|
+
console[t](ne(e));
|
|
211
209
|
}
|
|
212
|
-
function
|
|
213
|
-
return /* @__PURE__ */
|
|
210
|
+
function ie(e) {
|
|
211
|
+
return /* @__PURE__ */ y({
|
|
214
212
|
...e,
|
|
215
|
-
reporters: [
|
|
213
|
+
reporters: [re, ...e.reporters ?? []]
|
|
216
214
|
});
|
|
217
215
|
}
|
|
218
|
-
function
|
|
216
|
+
function ae() {
|
|
219
217
|
let e, t;
|
|
220
218
|
return {
|
|
221
219
|
promise: new Promise((n, r) => {
|
|
@@ -225,15 +223,15 @@ function ie() {
|
|
|
225
223
|
reject: t
|
|
226
224
|
};
|
|
227
225
|
}
|
|
228
|
-
var
|
|
229
|
-
function
|
|
226
|
+
var oe = Math.random.bind(Math), se = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
227
|
+
function ce(e = 21) {
|
|
230
228
|
let t = "", n = e;
|
|
231
|
-
for (; n--;) t += oe
|
|
229
|
+
for (; n--;) t += se[oe() * 64 | 0];
|
|
232
230
|
return t;
|
|
233
231
|
}
|
|
234
|
-
var
|
|
235
|
-
function
|
|
236
|
-
let { post: n, on: r, off: i = () => {}, eventNames: a = [], serialize: o =
|
|
232
|
+
var le = 6e4, ue = (e) => e, de = ue, { clearTimeout: fe, setTimeout: pe } = globalThis;
|
|
233
|
+
function me(e, t) {
|
|
234
|
+
let { post: n, on: r, off: i = () => {}, eventNames: a = [], serialize: o = ue, deserialize: s = de, resolver: c, bind: l = "rpc", timeout: u = le, proxify: d = !0 } = t, f = !1, p = /* @__PURE__ */ new Map(), m, h;
|
|
237
235
|
async function g(e, r, i, a) {
|
|
238
236
|
if (f) throw Error(`[birpc] rpc is closed, cannot call "${e}"`);
|
|
239
237
|
let s = {
|
|
@@ -252,11 +250,11 @@ function pe(e, t) {
|
|
|
252
250
|
} finally {
|
|
253
251
|
m = void 0;
|
|
254
252
|
}
|
|
255
|
-
let { promise: l, resolve: d, reject: g } =
|
|
253
|
+
let { promise: l, resolve: d, reject: g } = ae(), _ = ce();
|
|
256
254
|
s.i = _;
|
|
257
255
|
let v;
|
|
258
|
-
async function
|
|
259
|
-
return u >= 0 && (v =
|
|
256
|
+
async function y(n = s) {
|
|
257
|
+
return u >= 0 && (v = pe(() => {
|
|
260
258
|
try {
|
|
261
259
|
if (t.onTimeoutError?.call(h, e, r) !== !0) throw Error(`[birpc] timeout on calling "${e}"`);
|
|
262
260
|
} catch (e) {
|
|
@@ -271,12 +269,12 @@ function pe(e, t) {
|
|
|
271
269
|
}), await c(n), l;
|
|
272
270
|
}
|
|
273
271
|
try {
|
|
274
|
-
t.onRequest ? await t.onRequest.call(h, s,
|
|
272
|
+
t.onRequest ? await t.onRequest.call(h, s, y, d) : await y();
|
|
275
273
|
} catch (e) {
|
|
276
274
|
if (t.onGeneralError?.call(h, e) !== !0) throw e;
|
|
277
275
|
return;
|
|
278
276
|
} finally {
|
|
279
|
-
|
|
277
|
+
fe(v), p.delete(_);
|
|
280
278
|
}
|
|
281
279
|
return l;
|
|
282
280
|
}
|
|
@@ -285,7 +283,7 @@ function pe(e, t) {
|
|
|
285
283
|
$callOptional: (e, ...t) => g(e, t, !1, !0),
|
|
286
284
|
$callEvent: (e, ...t) => g(e, t, !0),
|
|
287
285
|
$callRaw: (e) => g(e.method, e.args, e.event, e.optional),
|
|
288
|
-
$rejectPendingCalls:
|
|
286
|
+
$rejectPendingCalls: y,
|
|
289
287
|
get $closed() {
|
|
290
288
|
return f;
|
|
291
289
|
},
|
|
@@ -308,16 +306,16 @@ function pe(e, t) {
|
|
|
308
306
|
let r = /* @__PURE__ */ Error(`[birpc] rpc is closed, cannot call "${n}"`);
|
|
309
307
|
if (e) return e.cause ??= r, t(e);
|
|
310
308
|
t(r);
|
|
311
|
-
}), p.clear(), i(
|
|
309
|
+
}), p.clear(), i(ee);
|
|
312
310
|
}
|
|
313
|
-
function
|
|
311
|
+
function y(e) {
|
|
314
312
|
let t = Array.from(p.values()).map(({ method: t, reject: n }) => e ? e({
|
|
315
313
|
method: t,
|
|
316
314
|
reject: n
|
|
317
315
|
}) : n(/* @__PURE__ */ Error(`[birpc]: rejected pending call "${t}".`)));
|
|
318
316
|
return p.clear(), t;
|
|
319
317
|
}
|
|
320
|
-
async function
|
|
318
|
+
async function ee(r, ...i) {
|
|
321
319
|
let a;
|
|
322
320
|
try {
|
|
323
321
|
a = s(r);
|
|
@@ -357,28 +355,28 @@ function pe(e, t) {
|
|
|
357
355
|
}
|
|
358
356
|
} else {
|
|
359
357
|
let { i: e, r: t, e: n } = a, r = p.get(e);
|
|
360
|
-
r && (
|
|
358
|
+
r && (fe(r.timeoutId), n ? r.reject(n) : r.resolve(t)), p.delete(e);
|
|
361
359
|
}
|
|
362
360
|
}
|
|
363
|
-
return m = r(
|
|
361
|
+
return m = r(ee), h;
|
|
364
362
|
}
|
|
365
|
-
function
|
|
363
|
+
function he(e, t) {
|
|
366
364
|
return t.safety ? t.safety : e === "static" || e === "query" || e == null ? "read" : "action";
|
|
367
365
|
}
|
|
368
|
-
var
|
|
366
|
+
var ge = Object.freeze({
|
|
369
367
|
type: "object",
|
|
370
368
|
additionalProperties: !0
|
|
371
369
|
});
|
|
372
|
-
function
|
|
370
|
+
function _e(e) {
|
|
373
371
|
let t = e["~standard"];
|
|
374
372
|
if (t.jsonSchema) try {
|
|
375
373
|
return t.jsonSchema.input({ target: "draft-2020-12" });
|
|
376
374
|
} catch {
|
|
377
|
-
return
|
|
375
|
+
return ge;
|
|
378
376
|
}
|
|
379
|
-
return
|
|
377
|
+
return ge;
|
|
380
378
|
}
|
|
381
|
-
function
|
|
379
|
+
function ve(e) {
|
|
382
380
|
if (!e || e.length === 0) return {
|
|
383
381
|
type: "object",
|
|
384
382
|
properties: {}
|
|
@@ -386,7 +384,7 @@ function _e(e) {
|
|
|
386
384
|
let t = {}, n = [];
|
|
387
385
|
for (let r = 0; r < e.length; r++) {
|
|
388
386
|
let i = `arg${r}`;
|
|
389
|
-
t[i] =
|
|
387
|
+
t[i] = _e(e[r]), n.push(i);
|
|
390
388
|
}
|
|
391
389
|
return {
|
|
392
390
|
type: "object",
|
|
@@ -395,7 +393,7 @@ function _e(e) {
|
|
|
395
393
|
additionalProperties: !1
|
|
396
394
|
};
|
|
397
395
|
}
|
|
398
|
-
function
|
|
396
|
+
function ye(e, t) {
|
|
399
397
|
if (Array.isArray(e)) return e;
|
|
400
398
|
if (e == null) return [];
|
|
401
399
|
if (typeof e != "object") return;
|
|
@@ -408,32 +406,32 @@ function ve(e, t) {
|
|
|
408
406
|
}
|
|
409
407
|
return Object.keys(n).length === 0 ? [] : void 0;
|
|
410
408
|
}
|
|
411
|
-
function
|
|
412
|
-
return
|
|
409
|
+
function be(e, t) {
|
|
410
|
+
return ye(e, t) ?? [e];
|
|
413
411
|
}
|
|
414
|
-
// ../../../node_modules/.pnpm/devframe@1.
|
|
415
|
-
var
|
|
412
|
+
// ../../../node_modules/.pnpm/devframe@1.4.0_@devframes+agentic@1.4.0_cac@7.1.0_crossws@0.4.17_srvx@1.0.6__srvx@1.0.6/node_modules/devframe/dist/browser-agent-DmAotroz.mjs
|
|
413
|
+
var xe = Symbol.for("devframe:browser-agent-registry"), { tools: Se, listeners: Ce } = globalThis[xe] ??= {
|
|
416
414
|
tools: /* @__PURE__ */ new Map(),
|
|
417
415
|
listeners: /* @__PURE__ */ new Set()
|
|
418
416
|
};
|
|
419
|
-
function
|
|
420
|
-
for (let e of
|
|
417
|
+
function we() {
|
|
418
|
+
for (let e of Ce) e();
|
|
421
419
|
}
|
|
422
|
-
function
|
|
420
|
+
function Te(e) {
|
|
423
421
|
let t = Symbol(e.id);
|
|
424
|
-
return
|
|
425
|
-
|
|
422
|
+
return Se.set(t, e), we(), () => {
|
|
423
|
+
Se.delete(t) && we();
|
|
426
424
|
};
|
|
427
425
|
}
|
|
428
|
-
// ../../../node_modules/.pnpm/devframe@1.
|
|
429
|
-
var
|
|
426
|
+
// ../../../node_modules/.pnpm/devframe@1.4.0_@devframes+agentic@1.4.0_cac@7.1.0_crossws@0.4.17_srvx@1.0.6__srvx@1.0.6/node_modules/devframe/dist/utils/nanoid.mjs
|
|
427
|
+
var Ee = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
430
428
|
function b(e = 21) {
|
|
431
429
|
let t = "", n = e;
|
|
432
|
-
for (; n--;) t +=
|
|
430
|
+
for (; n--;) t += Ee[Math.random() * 64 | 0];
|
|
433
431
|
return t;
|
|
434
432
|
}
|
|
435
|
-
// ../../../node_modules/.pnpm/devframe@1.
|
|
436
|
-
function
|
|
433
|
+
// ../../../node_modules/.pnpm/devframe@1.4.0_@devframes+agentic@1.4.0_cac@7.1.0_crossws@0.4.17_srvx@1.0.6__srvx@1.0.6/node_modules/devframe/dist/utils/events.mjs
|
|
434
|
+
function De() {
|
|
437
435
|
let e = {};
|
|
438
436
|
function t(t, ...n) {
|
|
439
437
|
let r = e[t] || [];
|
|
@@ -462,8 +460,8 @@ function Ee() {
|
|
|
462
460
|
once: i
|
|
463
461
|
};
|
|
464
462
|
}
|
|
465
|
-
// ../../../node_modules/.pnpm/devframe@1.
|
|
466
|
-
var
|
|
463
|
+
// ../../../node_modules/.pnpm/devframe@1.4.0_@devframes+agentic@1.4.0_cac@7.1.0_crossws@0.4.17_srvx@1.0.6__srvx@1.0.6/node_modules/devframe/dist/shared-state-DiAsLHP8.mjs
|
|
464
|
+
var Oe = Symbol.for("immer-nothing"), x = Symbol.for("immer-draftable"), S = Symbol.for("immer-state"), ke = [
|
|
467
465
|
function(e) {
|
|
468
466
|
return `The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`;
|
|
469
467
|
},
|
|
@@ -493,24 +491,24 @@ var De = Symbol.for("immer-nothing"), x = Symbol.for("immer-draftable"), S = Sym
|
|
|
493
491
|
];
|
|
494
492
|
function C(e, ...t) {
|
|
495
493
|
{
|
|
496
|
-
let n =
|
|
494
|
+
let n = ke[e], r = V(n) ? n.apply(null, t) : n;
|
|
497
495
|
throw Error(`[Immer] ${r}`);
|
|
498
496
|
}
|
|
499
497
|
}
|
|
500
|
-
var w = Object, T = w.getPrototypeOf, E = "constructor", D = "prototype",
|
|
498
|
+
var w = Object, T = w.getPrototypeOf, E = "constructor", D = "prototype", Ae = "configurable", je = "enumerable", O = "writable", k = "value", A = (e) => !!e && !!e[S];
|
|
501
499
|
function j(e) {
|
|
502
|
-
return e ?
|
|
500
|
+
return e ? Pe(e) || L(e) || !!e[x] || !!e[E]?.[x] || R(e) || z(e) : !1;
|
|
503
501
|
}
|
|
504
|
-
var
|
|
505
|
-
function
|
|
502
|
+
var Me = w[D][E].toString(), Ne = /* @__PURE__ */ new WeakMap();
|
|
503
|
+
function Pe(e) {
|
|
506
504
|
if (!e || !B(e)) return !1;
|
|
507
505
|
let t = T(e);
|
|
508
506
|
if (t === null || t === w[D]) return !0;
|
|
509
507
|
let n = w.hasOwnProperty.call(t, E) && t[E];
|
|
510
508
|
if (n === Object) return !0;
|
|
511
509
|
if (!V(n)) return !1;
|
|
512
|
-
let r =
|
|
513
|
-
return r === void 0 && (r = Function.toString.call(n),
|
|
510
|
+
let r = Ne.get(n);
|
|
511
|
+
return r === void 0 && (r = Function.toString.call(n), Ne.set(n, r)), r === Me;
|
|
514
512
|
}
|
|
515
513
|
function M(e, t, n = !0) {
|
|
516
514
|
N(e) === 0 ? (n ? Reflect.ownKeys(e) : w.keys(e)).forEach((n) => {
|
|
@@ -524,30 +522,30 @@ function N(e) {
|
|
|
524
522
|
var P = (e, t, n = N(e)) => n === 2 ? e.has(t) : w[D].hasOwnProperty.call(e, t), F = (e, t, n = N(e)) => n === 2 ? e.get(t) : e[t], I = (e, t, n, r = N(e)) => {
|
|
525
523
|
r === 2 ? e.set(t, n) : r === 3 ? e.add(n) : e[t] = n;
|
|
526
524
|
};
|
|
527
|
-
function
|
|
525
|
+
function Fe(e, t) {
|
|
528
526
|
return e === t ? e !== 0 || 1 / e == 1 / t : e !== e && t !== t;
|
|
529
527
|
}
|
|
530
|
-
var L = Array.isArray, R = (e) => e instanceof Map, z = (e) => e instanceof Set, B = (e) => typeof e == "object", V = (e) => typeof e == "function",
|
|
531
|
-
function
|
|
528
|
+
var L = Array.isArray, R = (e) => e instanceof Map, z = (e) => e instanceof Set, B = (e) => typeof e == "object", V = (e) => typeof e == "function", Ie = (e) => typeof e == "boolean";
|
|
529
|
+
function Le(e) {
|
|
532
530
|
let t = +e;
|
|
533
531
|
return Number.isInteger(t) && String(t) === e;
|
|
534
532
|
}
|
|
535
|
-
var
|
|
536
|
-
function
|
|
533
|
+
var Re = (e) => B(e) ? e?.[S] : null, H = (e) => e.copy_ || e.base_, ze = (e) => e.modified_ ? e.copy_ : e.base_;
|
|
534
|
+
function Be(e, t) {
|
|
537
535
|
if (R(e)) return new Map(e);
|
|
538
536
|
if (z(e)) return new Set(e);
|
|
539
537
|
if (L(e)) return Array[D].slice.call(e);
|
|
540
|
-
let n =
|
|
538
|
+
let n = Pe(e);
|
|
541
539
|
if (t === !0 || t === "class_only" && !n) {
|
|
542
540
|
let t = w.getOwnPropertyDescriptors(e);
|
|
543
541
|
delete t[S];
|
|
544
542
|
let n = Reflect.ownKeys(t);
|
|
545
543
|
for (let r = 0; r < n.length; r++) {
|
|
546
544
|
let i = n[r], a = t[i];
|
|
547
|
-
a[
|
|
548
|
-
[ke]: !0,
|
|
545
|
+
a[O] === !1 && (a[O] = !0, a[Ae] = !0), (a.get || a.set) && (t[i] = {
|
|
549
546
|
[Ae]: !0,
|
|
550
|
-
[O]:
|
|
547
|
+
[O]: !0,
|
|
548
|
+
[je]: a[je],
|
|
551
549
|
[k]: e[i]
|
|
552
550
|
});
|
|
553
551
|
}
|
|
@@ -560,33 +558,33 @@ function ze(e, t) {
|
|
|
560
558
|
return w.assign(r, e);
|
|
561
559
|
}
|
|
562
560
|
}
|
|
563
|
-
function
|
|
561
|
+
function Ve(e, t = !1) {
|
|
564
562
|
return W(e) || A(e) || !j(e) || (N(e) > 1 && w.defineProperties(e, {
|
|
565
563
|
set: U,
|
|
566
564
|
add: U,
|
|
567
565
|
clear: U,
|
|
568
566
|
delete: U
|
|
569
567
|
}), w.freeze(e), t && M(e, (e, t) => {
|
|
570
|
-
|
|
568
|
+
Ve(t, !0);
|
|
571
569
|
}, !1)), e;
|
|
572
570
|
}
|
|
573
|
-
function
|
|
571
|
+
function He() {
|
|
574
572
|
C(2);
|
|
575
573
|
}
|
|
576
|
-
var U = { [k]:
|
|
574
|
+
var U = { [k]: He };
|
|
577
575
|
function W(e) {
|
|
578
576
|
return e === null || !B(e) || w.isFrozen(e);
|
|
579
577
|
}
|
|
580
|
-
var G = "MapSet", K = "Patches",
|
|
581
|
-
function
|
|
582
|
-
let t =
|
|
578
|
+
var G = "MapSet", K = "Patches", Ue = "ArrayMethods", q = {};
|
|
579
|
+
function J(e) {
|
|
580
|
+
let t = q[e];
|
|
583
581
|
return t || C(0, e), t;
|
|
584
582
|
}
|
|
585
|
-
var We = (e) => !!
|
|
583
|
+
var We = (e) => !!q[e];
|
|
586
584
|
function Ge(e, t) {
|
|
587
|
-
|
|
585
|
+
q[e] || (q[e] = t);
|
|
588
586
|
}
|
|
589
|
-
var
|
|
587
|
+
var Y, Ke = () => Y, qe = (e, t) => ({
|
|
590
588
|
drafts_: [],
|
|
591
589
|
parent_: e,
|
|
592
590
|
immer_: t,
|
|
@@ -594,19 +592,19 @@ var J, Ke = () => J, qe = (e, t) => ({
|
|
|
594
592
|
unfinalizedDrafts_: 0,
|
|
595
593
|
handledSet_: /* @__PURE__ */ new Set(),
|
|
596
594
|
processedForPatches_: /* @__PURE__ */ new Set(),
|
|
597
|
-
mapSetPlugin_: We(G) ?
|
|
598
|
-
arrayMethodsPlugin_: We(
|
|
595
|
+
mapSetPlugin_: We(G) ? J(G) : void 0,
|
|
596
|
+
arrayMethodsPlugin_: We(Ue) ? J(Ue) : void 0
|
|
599
597
|
});
|
|
600
598
|
function Je(e, t) {
|
|
601
|
-
t && (e.patchPlugin_ =
|
|
599
|
+
t && (e.patchPlugin_ = J(K), e.patches_ = [], e.inversePatches_ = [], e.patchListener_ = t);
|
|
602
600
|
}
|
|
603
601
|
function Ye(e) {
|
|
604
602
|
Xe(e), e.drafts_.forEach(Qe), e.drafts_ = null;
|
|
605
603
|
}
|
|
606
604
|
function Xe(e) {
|
|
607
|
-
e ===
|
|
605
|
+
e === Y && (Y = e.parent_);
|
|
608
606
|
}
|
|
609
|
-
var Ze = (e) =>
|
|
607
|
+
var Ze = (e) => Y = qe(Y, e);
|
|
610
608
|
function Qe(e) {
|
|
611
609
|
let t = e[S];
|
|
612
610
|
t.type_ === 0 || t.type_ === 1 ? t.revoke_() : t.revoked_ = !0;
|
|
@@ -619,7 +617,7 @@ function $e(e, t) {
|
|
|
619
617
|
let { patchPlugin_: r } = t;
|
|
620
618
|
r && r.generateReplacementPatches_(n[S].base_, e, t);
|
|
621
619
|
} else e = et(t, n);
|
|
622
|
-
return tt(t, e, !0), Ye(t), t.patches_ && t.patchListener_(t.patches_, t.inversePatches_), e ===
|
|
620
|
+
return tt(t, e, !0), Ye(t), t.patches_ && t.patchListener_(t.patches_, t.inversePatches_), e === Oe ? void 0 : e;
|
|
623
621
|
}
|
|
624
622
|
function et(e, t) {
|
|
625
623
|
if (W(t)) return t;
|
|
@@ -635,7 +633,7 @@ function et(e, t) {
|
|
|
635
633
|
return n.copy_;
|
|
636
634
|
}
|
|
637
635
|
function tt(e, t, n = !1) {
|
|
638
|
-
!e.parent_ && e.immer_.autoFreeze_ && e.canAutoFreeze_ &&
|
|
636
|
+
!e.parent_ && e.immer_.autoFreeze_ && e.canAutoFreeze_ && Ve(t, n);
|
|
639
637
|
}
|
|
640
638
|
function nt(e) {
|
|
641
639
|
e.finalized_ = !0, e.scope_.unfinalizedDrafts_--;
|
|
@@ -664,7 +662,7 @@ function ot(e, t, n) {
|
|
|
664
662
|
let i = t;
|
|
665
663
|
if (!i || !rt(i, r)) return;
|
|
666
664
|
r.mapSetPlugin_?.fixSetContents(i);
|
|
667
|
-
let a =
|
|
665
|
+
let a = ze(i);
|
|
668
666
|
at(e, i.draft_ ?? i, a, n), st(i, r);
|
|
669
667
|
});
|
|
670
668
|
}
|
|
@@ -683,7 +681,7 @@ function ct(e, t, n) {
|
|
|
683
681
|
if (A(n)) {
|
|
684
682
|
let i = n[S];
|
|
685
683
|
rt(i, r) && i.callbacks_.push(function() {
|
|
686
|
-
_t(e), at(e, n,
|
|
684
|
+
_t(e), at(e, n, ze(i), t);
|
|
687
685
|
});
|
|
688
686
|
} else j(n) && e.callbacks_.push(function() {
|
|
689
687
|
let i = H(e);
|
|
@@ -694,7 +692,7 @@ function lt(e, t, n) {
|
|
|
694
692
|
return !n.immer_.autoFreeze_ && n.unfinalizedDrafts_ < 1 || A(e) || t.has(e) || !j(e) || W(e) || (t.add(e), M(e, (r, i) => {
|
|
695
693
|
if (A(i)) {
|
|
696
694
|
let t = i[S];
|
|
697
|
-
rt(t, n) && (I(e, r,
|
|
695
|
+
rt(t, n) && (I(e, r, ze(t), e.type_), nt(t));
|
|
698
696
|
} else j(i) && lt(i, t, n);
|
|
699
697
|
})), e;
|
|
700
698
|
}
|
|
@@ -713,7 +711,7 @@ function ut(e, t) {
|
|
|
713
711
|
isManual_: !1,
|
|
714
712
|
callbacks_: void 0
|
|
715
713
|
}, i = r, a = dt;
|
|
716
|
-
n && (i = [r], a =
|
|
714
|
+
n && (i = [r], a = X);
|
|
717
715
|
let { revoke: o, proxy: s } = Proxy.revocable(i, a);
|
|
718
716
|
return r.draft_ = s, r.revoke_ = o, [s, r];
|
|
719
717
|
}
|
|
@@ -725,7 +723,7 @@ var dt = {
|
|
|
725
723
|
let i = H(e);
|
|
726
724
|
if (!P(i, t, e.type_)) return mt(e, i, t);
|
|
727
725
|
let a = i[t];
|
|
728
|
-
if (e.finalized_ || !j(a) || r && e.operationMethod && n?.isMutatingArrayMethod(e.operationMethod) &&
|
|
726
|
+
if (e.finalized_ || !j(a) || r && e.operationMethod && n?.isMutatingArrayMethod(e.operationMethod) && Le(t)) return a;
|
|
729
727
|
if (a === ft(e.base_, t) || pt(e, t, a)) {
|
|
730
728
|
_t(e);
|
|
731
729
|
let n = e.type_ === 1 ? +t : t, r = yt(e.scope_, a, e, n);
|
|
@@ -745,7 +743,7 @@ var dt = {
|
|
|
745
743
|
if (!e.modified_) {
|
|
746
744
|
let r = ft(H(e), t), i = r?.[S];
|
|
747
745
|
if (i && i.base_ === n) return e.copy_[t] = n, e.assigned_.delete(t), !0;
|
|
748
|
-
if (
|
|
746
|
+
if (Fe(n, r) && (n !== void 0 || P(e.base_, t, e.type_))) return !0;
|
|
749
747
|
_t(e), gt(e);
|
|
750
748
|
}
|
|
751
749
|
return e.copy_[t] === n && (n !== void 0 || P(e.copy_, t, e.type_)) || Number.isNaN(n) && Number.isNaN(e.copy_[t]) || (e.copy_[t] = n, e.assigned_.set(t, !0), ct(e, t, n)), !0;
|
|
@@ -756,9 +754,9 @@ var dt = {
|
|
|
756
754
|
getOwnPropertyDescriptor(e, t) {
|
|
757
755
|
let n = H(e), r = Reflect.getOwnPropertyDescriptor(n, t);
|
|
758
756
|
return r && {
|
|
759
|
-
[
|
|
760
|
-
[
|
|
761
|
-
[
|
|
757
|
+
[O]: !0,
|
|
758
|
+
[Ae]: e.type_ !== 1 || t !== "length",
|
|
759
|
+
[je]: r[je],
|
|
762
760
|
[k]: n[t]
|
|
763
761
|
};
|
|
764
762
|
},
|
|
@@ -771,17 +769,17 @@ var dt = {
|
|
|
771
769
|
setPrototypeOf() {
|
|
772
770
|
C(12);
|
|
773
771
|
}
|
|
774
|
-
},
|
|
772
|
+
}, X = {};
|
|
775
773
|
for (let e in dt) {
|
|
776
774
|
let t = dt[e];
|
|
777
|
-
|
|
775
|
+
X[e] = function() {
|
|
778
776
|
let e = arguments;
|
|
779
777
|
return e[0] = e[0][0], t.apply(this, e);
|
|
780
778
|
};
|
|
781
779
|
}
|
|
782
|
-
|
|
783
|
-
return isNaN(parseInt(t)) && C(13),
|
|
784
|
-
},
|
|
780
|
+
X.deleteProperty = function(e, t) {
|
|
781
|
+
return isNaN(parseInt(t)) && C(13), X.set.call(this, e, t, void 0);
|
|
782
|
+
}, X.set = function(e, t, n) {
|
|
785
783
|
return t !== "length" && isNaN(parseInt(t)) && C(14), dt.set.call(this, e[0], t, n, e[0]);
|
|
786
784
|
};
|
|
787
785
|
function ft(e, t) {
|
|
@@ -808,7 +806,7 @@ function gt(e) {
|
|
|
808
806
|
e.modified_ || (e.modified_ = !0, e.parent_ && gt(e.parent_));
|
|
809
807
|
}
|
|
810
808
|
function _t(e) {
|
|
811
|
-
e.copy_ ||= (e.assigned_ = /* @__PURE__ */ new Map(),
|
|
809
|
+
e.copy_ ||= (e.assigned_ = /* @__PURE__ */ new Map(), Be(e.base_, e.scope_.immer_.useStrictShallowCopy_));
|
|
812
810
|
}
|
|
813
811
|
var vt = class {
|
|
814
812
|
constructor(e) {
|
|
@@ -833,9 +831,9 @@ var vt = class {
|
|
|
833
831
|
return Je(i, n), $e(r, i);
|
|
834
832
|
}
|
|
835
833
|
if (!e || !B(e)) {
|
|
836
|
-
if (r = t(e), r === void 0 && (r = e), r ===
|
|
834
|
+
if (r = t(e), r === void 0 && (r = e), r === Oe && (r = void 0), this.autoFreeze_ && Ve(r, !0), n) {
|
|
837
835
|
let t = [], i = [];
|
|
838
|
-
|
|
836
|
+
J(K).generateReplacementPatches_(e, r, {
|
|
839
837
|
patches_: t,
|
|
840
838
|
inversePatches_: i
|
|
841
839
|
}), n(t, i);
|
|
@@ -853,7 +851,9 @@ var vt = class {
|
|
|
853
851
|
n,
|
|
854
852
|
r
|
|
855
853
|
];
|
|
856
|
-
},
|
|
854
|
+
}, Ie(e?.autoFreeze) && this.setAutoFreeze(e.autoFreeze);
|
|
855
|
+
let t = e?.useStrictShallowCopy;
|
|
856
|
+
(Ie(t) || t === "class_only") && this.setUseStrictShallowCopy(t), Ie(e?.useStrictIteration) && this.setUseStrictIteration(e.useStrictIteration);
|
|
857
857
|
}
|
|
858
858
|
createDraft(e) {
|
|
859
859
|
j(e) || C(8), A(e) && (e = bt(e));
|
|
@@ -888,12 +888,12 @@ var vt = class {
|
|
|
888
888
|
}
|
|
889
889
|
}
|
|
890
890
|
n > -1 && (t = t.slice(n + 1));
|
|
891
|
-
let r =
|
|
891
|
+
let r = J(K).applyPatches_;
|
|
892
892
|
return A(e) ? r(e, t) : this.produce(e, (e) => r(e, t));
|
|
893
893
|
}
|
|
894
894
|
};
|
|
895
895
|
function yt(e, t, n, r) {
|
|
896
|
-
let [i, a] = R(t) ?
|
|
896
|
+
let [i, a] = R(t) ? J(G).proxyMap_(t, n) : z(t) ? J(G).proxySet_(t, n) : ut(t, n);
|
|
897
897
|
return (n?.scope_ ?? Ke()).drafts_.push(i), a.callbacks_ = n?.callbacks_ ?? [], a.key_ = r, n && r !== void 0 ? ot(n, a, r) : a.callbacks_.push(function(e) {
|
|
898
898
|
e.mapSetPlugin_?.fixSetContents(a);
|
|
899
899
|
let { patchPlugin_: t } = e;
|
|
@@ -908,22 +908,22 @@ function xt(e) {
|
|
|
908
908
|
let t = e[S], n, r = !0;
|
|
909
909
|
if (t) {
|
|
910
910
|
if (!t.modified_) return t.base_;
|
|
911
|
-
t.finalized_ = !0, n =
|
|
912
|
-
} else n =
|
|
911
|
+
t.finalized_ = !0, n = Be(e, t.scope_.immer_.useStrictShallowCopy_), r = t.scope_.immer_.shouldUseStrictIteration();
|
|
912
|
+
} else n = Be(e, !0);
|
|
913
913
|
let i = n;
|
|
914
914
|
return z(n) && (n = /* @__PURE__ */ new Set()), M(i, (e, t) => {
|
|
915
915
|
I(n, e, xt(t));
|
|
916
916
|
}, r), t && (t.finalized_ = !1), n;
|
|
917
917
|
}
|
|
918
918
|
function St() {
|
|
919
|
-
|
|
919
|
+
ke.push("Sets cannot have \"replace\" patches.", function(e) {
|
|
920
920
|
return "Unsupported patch operation: " + e;
|
|
921
921
|
}, function(e) {
|
|
922
922
|
return "Cannot apply patch, path doesn't resolve: " + e;
|
|
923
923
|
}, "Patching reserved attributes like __proto__, prototype and constructor is not allowed");
|
|
924
924
|
function e(n, r = []) {
|
|
925
925
|
if (n.key_ !== void 0) {
|
|
926
|
-
let e = n.parent_.copy_ ?? n.parent_.base_, t =
|
|
926
|
+
let e = n.parent_.copy_ ?? n.parent_.base_, t = Re(F(e, n.key_)), i = F(e, n.key_);
|
|
927
927
|
if (i === void 0 || i !== n.draft_ && i !== n.copy_ || t != null && t.base_ !== n.base_) return null;
|
|
928
928
|
let a = n.parent_.type_ === 3, o;
|
|
929
929
|
if (a) {
|
|
@@ -1063,7 +1063,7 @@ function St() {
|
|
|
1063
1063
|
i.push({
|
|
1064
1064
|
op: n,
|
|
1065
1065
|
path: [],
|
|
1066
|
-
value: t ===
|
|
1066
|
+
value: t === Oe ? void 0 : t
|
|
1067
1067
|
}), a.push({
|
|
1068
1068
|
op: n,
|
|
1069
1069
|
path: [],
|
|
@@ -1120,7 +1120,7 @@ function St() {
|
|
|
1120
1120
|
});
|
|
1121
1121
|
}
|
|
1122
1122
|
globalThis.Iterator?.from;
|
|
1123
|
-
var
|
|
1123
|
+
var Z = new vt(), Ct = Z.produce, wt = /* @__PURE__ */ Z.produceWithPatches.bind(Z), Tt = /* @__PURE__ */ Z.applyPatches.bind(Z), Et = 1e3;
|
|
1124
1124
|
function Dt(e, t) {
|
|
1125
1125
|
if (e.add(t), e.size > Et) {
|
|
1126
1126
|
let t = e.values().next().value;
|
|
@@ -1130,7 +1130,7 @@ function Dt(e, t) {
|
|
|
1130
1130
|
function Ot(e) {
|
|
1131
1131
|
let { enablePatches: t = !1 } = e;
|
|
1132
1132
|
t && St();
|
|
1133
|
-
let n =
|
|
1133
|
+
let n = De(), r = e.initialValue, i = /* @__PURE__ */ new Set();
|
|
1134
1134
|
return {
|
|
1135
1135
|
on: n.on,
|
|
1136
1136
|
value: () => r,
|
|
@@ -1153,8 +1153,8 @@ function Ot(e) {
|
|
|
1153
1153
|
syncIds: i
|
|
1154
1154
|
};
|
|
1155
1155
|
}
|
|
1156
|
-
// ../../../node_modules/.pnpm/devframe@1.
|
|
1157
|
-
var kt = /* #__PURE__ */
|
|
1156
|
+
// ../../../node_modules/.pnpm/devframe@1.4.0_@devframes+agentic@1.4.0_cac@7.1.0_crossws@0.4.17_srvx@1.0.6__srvx@1.0.6/node_modules/devframe/dist/in-page-channel/index.mjs
|
|
1157
|
+
var kt = /* #__PURE__ */ ie({
|
|
1158
1158
|
docsBase: "https://devfra.me/errors",
|
|
1159
1159
|
codes: {
|
|
1160
1160
|
DF0077: {
|
|
@@ -1166,7 +1166,7 @@ var kt = /* #__PURE__ */ re({
|
|
|
1166
1166
|
fix: "Remove `jsonSerializable: false`, or remove `agent` to keep it channel-only."
|
|
1167
1167
|
}
|
|
1168
1168
|
}
|
|
1169
|
-
}), At =
|
|
1169
|
+
}), At = te.postMessage.inPageChannel;
|
|
1170
1170
|
function jt(e) {
|
|
1171
1171
|
return !!e && typeof e == "object" && "__dfIpc" in e;
|
|
1172
1172
|
}
|
|
@@ -1201,7 +1201,7 @@ function Rt(e) {
|
|
|
1201
1201
|
...e
|
|
1202
1202
|
};
|
|
1203
1203
|
}
|
|
1204
|
-
var
|
|
1204
|
+
var Q = class extends Error {
|
|
1205
1205
|
code;
|
|
1206
1206
|
name = "InPageChannelError";
|
|
1207
1207
|
constructor(e, t, n) {
|
|
@@ -1230,7 +1230,7 @@ function Ut(e, t, n) {
|
|
|
1230
1230
|
}
|
|
1231
1231
|
function Wt(e, t, n) {
|
|
1232
1232
|
let r = Ut(e, t, /* @__PURE__ */ new Set());
|
|
1233
|
-
if (r) throw new
|
|
1233
|
+
if (r) throw new Q("not-serializable", `in-page function "${n}" is declared jsonSerializable, but ${r}`);
|
|
1234
1234
|
}
|
|
1235
1235
|
function Gt(e) {
|
|
1236
1236
|
return e.map((e) => {
|
|
@@ -1243,20 +1243,20 @@ async function Kt(e, t, n) {
|
|
|
1243
1243
|
let i = t[r];
|
|
1244
1244
|
if (!i) continue;
|
|
1245
1245
|
let a = await i["~standard"].validate(n[r]);
|
|
1246
|
-
if (a.issues) throw new
|
|
1246
|
+
if (a.issues) throw new Q("invalid-args", `in-page function "${e}" rejected argument ${r}: ${Gt(a.issues)}`);
|
|
1247
1247
|
}
|
|
1248
1248
|
}
|
|
1249
|
-
function
|
|
1249
|
+
function qt(e, t) {
|
|
1250
1250
|
return e.serialize ? t.map(e.serialize) : t;
|
|
1251
1251
|
}
|
|
1252
|
-
function
|
|
1252
|
+
function Jt(e, t) {
|
|
1253
1253
|
return e.deserialize && t !== void 0 ? e.deserialize(t) : t;
|
|
1254
1254
|
}
|
|
1255
1255
|
function $(e, t) {
|
|
1256
1256
|
return `devframe:in-page:${e === "event" ? "event" : "function"}:${t}`;
|
|
1257
1257
|
}
|
|
1258
|
-
var
|
|
1259
|
-
function
|
|
1258
|
+
var Yt = $("function", "");
|
|
1259
|
+
function Xt(e) {
|
|
1260
1260
|
let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
|
|
1261
1261
|
return {
|
|
1262
1262
|
definitions: t,
|
|
@@ -1291,46 +1291,46 @@ function Yt(e) {
|
|
|
1291
1291
|
}
|
|
1292
1292
|
};
|
|
1293
1293
|
}
|
|
1294
|
-
function
|
|
1294
|
+
function Zt(e, t) {
|
|
1295
1295
|
for (let n of t) {
|
|
1296
1296
|
let t = n(e);
|
|
1297
1297
|
if (t) return t;
|
|
1298
1298
|
}
|
|
1299
|
-
if (e.startsWith(
|
|
1300
|
-
throw kt.DF0077({ name: e.slice(
|
|
1299
|
+
if (e.startsWith(Yt)) return () => {
|
|
1300
|
+
throw kt.DF0077({ name: e.slice(Yt.length) });
|
|
1301
1301
|
};
|
|
1302
1302
|
}
|
|
1303
|
-
function
|
|
1303
|
+
function Qt(e, t) {
|
|
1304
1304
|
let n = [];
|
|
1305
1305
|
for (let r of t.definitions.values()) {
|
|
1306
1306
|
if (r.type === "event" || !("agent" in r) || !r.agent) continue;
|
|
1307
1307
|
let i = r.agent;
|
|
1308
|
-
n.push(
|
|
1308
|
+
n.push(Te({
|
|
1309
1309
|
id: `${e}:${r.name}`,
|
|
1310
1310
|
title: i.title ?? r.name,
|
|
1311
1311
|
description: i.description,
|
|
1312
|
-
safety:
|
|
1312
|
+
safety: he(r.type, i),
|
|
1313
1313
|
tags: i.tags,
|
|
1314
|
-
inputSchema:
|
|
1314
|
+
inputSchema: ve(r.args),
|
|
1315
1315
|
invoke: (e) => {
|
|
1316
|
-
let n =
|
|
1316
|
+
let n = be(e, r.args?.length);
|
|
1317
1317
|
return t.resolve($(r.type, r.name))(...n);
|
|
1318
1318
|
}
|
|
1319
1319
|
}));
|
|
1320
1320
|
}
|
|
1321
1321
|
return () => n.forEach((e) => e());
|
|
1322
1322
|
}
|
|
1323
|
-
function
|
|
1324
|
-
return e instanceof DOMException && e.name === "DataCloneError" ? new
|
|
1323
|
+
function $t(e) {
|
|
1324
|
+
return e instanceof DOMException && e.name === "DataCloneError" ? new Q("not-cloneable", `a payload could not be structured-cloned across the in-page channel: ${e.message}. Strip non-cloneable values (functions, DOM nodes, framework reactivity proxies) before sending: declare the function \`jsonSerializable: true\` for a precise error, or provide a \`serialize\` hook.`, { cause: e }) : e;
|
|
1325
1325
|
}
|
|
1326
|
-
function
|
|
1326
|
+
function en(e, t) {
|
|
1327
1327
|
let n, r = !1, i = {
|
|
1328
|
-
rpc:
|
|
1328
|
+
rpc: me({}, {
|
|
1329
1329
|
post: (t) => {
|
|
1330
1330
|
try {
|
|
1331
1331
|
e.postMessage(t);
|
|
1332
1332
|
} catch (e) {
|
|
1333
|
-
throw
|
|
1333
|
+
throw $t(e);
|
|
1334
1334
|
}
|
|
1335
1335
|
},
|
|
1336
1336
|
on: (e) => {
|
|
@@ -1352,7 +1352,7 @@ function $t(e, t) {
|
|
|
1352
1352
|
dispose(t) {
|
|
1353
1353
|
if (r) return;
|
|
1354
1354
|
r = !0, t?.bye && i.postControl("bye");
|
|
1355
|
-
let n = new
|
|
1355
|
+
let n = new Q("closed", `in-page channel call dropped: ${t?.reason ?? "the in-page channel port was closed"}`);
|
|
1356
1356
|
i.rpc.$rejectPendingCalls(({ reject: e }) => e(n)), i.rpc.$close(), e.removeEventListener("message", a), e.removeEventListener("close", o);
|
|
1357
1357
|
try {
|
|
1358
1358
|
e.close();
|
|
@@ -1369,9 +1369,9 @@ function $t(e, t) {
|
|
|
1369
1369
|
}
|
|
1370
1370
|
return e.addEventListener("message", a), e.addEventListener("close", o), e.start?.(), i;
|
|
1371
1371
|
}
|
|
1372
|
-
function
|
|
1372
|
+
function tn(e, t, n) {
|
|
1373
1373
|
return t <= 0 ? e : new Promise((r, i) => {
|
|
1374
|
-
let a = setTimeout(() => i(new
|
|
1374
|
+
let a = setTimeout(() => i(new Q("timeout", n())), t);
|
|
1375
1375
|
e.then((e) => {
|
|
1376
1376
|
clearTimeout(a), r(e);
|
|
1377
1377
|
}, (e) => {
|
|
@@ -1379,28 +1379,28 @@ function en(e, t, n) {
|
|
|
1379
1379
|
});
|
|
1380
1380
|
});
|
|
1381
1381
|
}
|
|
1382
|
-
var
|
|
1382
|
+
var nn = {
|
|
1383
1383
|
subscribe: "devframe:in-page:page-state:subscribe",
|
|
1384
1384
|
set: "devframe:in-page:page-state:set",
|
|
1385
1385
|
patch: "devframe:in-page:page-state:patch"
|
|
1386
1386
|
};
|
|
1387
|
-
function
|
|
1387
|
+
function rn(e) {
|
|
1388
1388
|
let t = /* @__PURE__ */ new Map();
|
|
1389
1389
|
return {
|
|
1390
1390
|
get: async (n, r) => {
|
|
1391
1391
|
let i = t.get(n);
|
|
1392
1392
|
if (i) return i;
|
|
1393
|
-
if (r?.initialValue === void 0) throw new
|
|
1393
|
+
if (r?.initialValue === void 0) throw new Q("state-uninitialized", `in-page shared state "${n}" was accessed before initialization; the page script is the authority, so its first \`sharedState.get("${n}")\` must provide \`initialValue\``);
|
|
1394
1394
|
let a = Ot({
|
|
1395
1395
|
initialValue: r.initialValue,
|
|
1396
1396
|
enablePatches: !0
|
|
1397
1397
|
});
|
|
1398
1398
|
return t.set(n, a), a.on("updated", (t, r, i) => {
|
|
1399
|
-
for (let a of e()) a.subscribedStates.has(n) && (r ? a.callEventRaw(
|
|
1399
|
+
for (let a of e()) a.subscribedStates.has(n) && (r ? a.callEventRaw(te.inPageChannel.panelStatePatch, [
|
|
1400
1400
|
n,
|
|
1401
1401
|
r,
|
|
1402
1402
|
i
|
|
1403
|
-
]) : a.callEventRaw(
|
|
1403
|
+
]) : a.callEventRaw(te.inPageChannel.panelStateUpdated, [
|
|
1404
1404
|
n,
|
|
1405
1405
|
t,
|
|
1406
1406
|
i
|
|
@@ -1409,23 +1409,23 @@ function nn(e) {
|
|
|
1409
1409
|
},
|
|
1410
1410
|
createPeerHandlers(e) {
|
|
1411
1411
|
return {
|
|
1412
|
-
[
|
|
1413
|
-
[
|
|
1412
|
+
[nn.subscribe]: (n) => (e.subscribedStates.add(n), t.get(n)?.value()),
|
|
1413
|
+
[nn.set]: (e, n, r) => {
|
|
1414
1414
|
let i = t.get(e);
|
|
1415
1415
|
i && !i.syncIds.has(r) && i.mutate(() => n, r);
|
|
1416
1416
|
},
|
|
1417
|
-
[
|
|
1417
|
+
[nn.patch]: (e, n, r) => {
|
|
1418
1418
|
t.get(e)?.patch(n, r);
|
|
1419
1419
|
}
|
|
1420
1420
|
};
|
|
1421
1421
|
}
|
|
1422
1422
|
};
|
|
1423
1423
|
}
|
|
1424
|
-
function
|
|
1424
|
+
function an(e) {
|
|
1425
1425
|
let { name: t } = e, n = e.callTimeoutMs ?? 15e3, r = e.window === !1 ? void 0 : e.window ?? (typeof window > "u" ? void 0 : window), i = It(e.allowedOrigins, r), a = Ft(r), o = Rt(e.heartbeat), s = {
|
|
1426
1426
|
serialize: e.serialize,
|
|
1427
1427
|
deserialize: e.deserialize
|
|
1428
|
-
}, c =
|
|
1428
|
+
}, c = De(), l = /* @__PURE__ */ new Map(), u = !1, d, f = Xt(s);
|
|
1429
1429
|
for (let [t, n] of Object.entries(e.functions)) f.register({
|
|
1430
1430
|
...n,
|
|
1431
1431
|
name: t
|
|
@@ -1435,13 +1435,13 @@ function rn(e) {
|
|
|
1435
1435
|
name: t,
|
|
1436
1436
|
type: "event"
|
|
1437
1437
|
});
|
|
1438
|
-
let p =
|
|
1438
|
+
let p = Qt(t, f), m = rn(function* () {
|
|
1439
1439
|
for (let e of l.values()) yield {
|
|
1440
1440
|
subscribedStates: e.subscribedStates,
|
|
1441
1441
|
callEventRaw: (t, n) => {
|
|
1442
1442
|
e.attached.rpc.$callRaw({
|
|
1443
1443
|
method: t,
|
|
1444
|
-
args:
|
|
1444
|
+
args: qt(s, n),
|
|
1445
1445
|
event: !0,
|
|
1446
1446
|
optional: !0
|
|
1447
1447
|
}).catch(() => {});
|
|
@@ -1463,23 +1463,23 @@ function rn(e) {
|
|
|
1463
1463
|
callEventRaw: (e, t) => {
|
|
1464
1464
|
i.attached.rpc.$callRaw({
|
|
1465
1465
|
method: e,
|
|
1466
|
-
args:
|
|
1466
|
+
args: qt(s, t),
|
|
1467
1467
|
event: !0,
|
|
1468
1468
|
optional: !0
|
|
1469
1469
|
}).catch(() => {});
|
|
1470
1470
|
}
|
|
1471
1471
|
});
|
|
1472
|
-
let a =
|
|
1472
|
+
let a = Xt(s);
|
|
1473
1473
|
for (let [e, t] of Object.entries(i.internalHandlers)) a.registerInternal(e, t);
|
|
1474
|
-
return i.attached =
|
|
1475
|
-
resolveLocal: (e) =>
|
|
1474
|
+
return i.attached = en(e, {
|
|
1475
|
+
resolveLocal: (e) => Zt(e, [a.resolve, f.resolve]),
|
|
1476
1476
|
onControl: (e) => {
|
|
1477
1477
|
e === "ping" && i.attached.postControl("pong");
|
|
1478
1478
|
},
|
|
1479
1479
|
onPeerClosed: () => h(r, { reason: "the panel disconnected" })
|
|
1480
1480
|
}), i.peer = {
|
|
1481
1481
|
id: r,
|
|
1482
|
-
call: (e, ...a) =>
|
|
1482
|
+
call: (e, ...a) => tn(i.attached.rpc.$call($("function", e), ...qt(s, a)).then((e) => Jt(s, e)), n, () => `in-page channel "${t}": call "${e}" to panel "${r}" timed out after ${n}ms`),
|
|
1483
1483
|
close: () => h(r, {
|
|
1484
1484
|
bye: !0,
|
|
1485
1485
|
reason: "the page script closed this panel"
|
|
@@ -1531,7 +1531,7 @@ function rn(e) {
|
|
|
1531
1531
|
once: c.once
|
|
1532
1532
|
},
|
|
1533
1533
|
emit: (e, ...t) => {
|
|
1534
|
-
let n =
|
|
1534
|
+
let n = qt(s, t);
|
|
1535
1535
|
for (let t of l.values()) t.attached.rpc.$callRaw({
|
|
1536
1536
|
method: $("event", e),
|
|
1537
1537
|
args: n,
|
|
@@ -1554,7 +1554,7 @@ function rn(e) {
|
|
|
1554
1554
|
};
|
|
1555
1555
|
}
|
|
1556
1556
|
// src/shared/coalesce.ts
|
|
1557
|
-
function
|
|
1557
|
+
function on(e, t) {
|
|
1558
1558
|
let n;
|
|
1559
1559
|
return () => {
|
|
1560
1560
|
n === void 0 && (n = setTimeout(() => {
|
|
@@ -1562,4 +1562,4 @@ function an(e, t) {
|
|
|
1562
1562
|
}, t));
|
|
1563
1563
|
};
|
|
1564
1564
|
}
|
|
1565
|
-
export { d as a, e as c, l as i,
|
|
1565
|
+
export { d as a, e as c, l as i, an as n, a as o, u as r, o as s, on as t };
|