@seedprotocol/publish 0.4.26 → 0.4.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,25 +1,24 @@
1
- import { getGetAdditionalSyncAddresses as ca, getAttesterForSeed as da, getVersionsForSeedUid as la, getMetadataAttestationUidsForSeedUid as ua, isValidEasAttestationUid as kt, VERSION_SCHEMA_UID_OPTIMISM_SEPOLIA as pa, updateSeedRevokedAt as ma, setGetPublisherForNewSeeds as fa, setRevokeExecutor as ha, setAdditionalSyncAddresses as ga, DEFAULT_ARWEAVE_GRAPHQL_URL as ya, BaseArweaveClient as wa, Item as le, prepareHtmlEmbeddedImagesForPublish as ba, rewriteHtmlEmbeddedImagesOnDisk as Aa, getSegmentedItemProperties as It, getCorrectId as yn, ModelPropertyDataTypes as va, BaseFileManager as K, BaseDb as B, htmlEmbeddedImageCoPublish as Ht, setSchemaUidForModel as Qe, setSchemaUidForSchemaDefinition as ge, INTERNAL_DATA_TYPES as Sa, getEasSchemaForItemProperty as Ea, getRelatedItemsForPublish as Ia, getUploadPipelineTransactionStatus as Pa, arweaveL1FinalizeJobs as We, resolvePublishPayloadValues as $t, updateVersionUid as wn, applyPropertyAttestationUidsFromPublish as bn, getItemPropertiesFromEas as Ua, itemHasPublishUploadCandidates as Ta, isItemOwned as An, validateItemForPublish as Da, publishProcesses as I, client as wt, uploadProcesses as _a } from "@seedprotocol/sdk";
2
- import { prepareContractCall as M, readContract as O, getContract as J, createThirdwebClient as Ca, sendTransaction as W, waitForReceipt as j, parseEventLogs as Oe, prepareEvent as Z, deploySmartAccount as Ra } from "thirdweb";
3
- import { createWallet as je, inAppWallet as vn } from "thirdweb/wallets";
4
- import { useActiveAccount as Sn, ThirdwebProvider as La, useActiveWallet as xa, useActiveWalletConnectionStatus as Ma, useIsAutoConnecting as Na, ConnectButton as Oa, darkTheme as Fa } from "thirdweb/react";
5
- import { isContractDeployed as bt } from "thirdweb/utils";
6
- import { useState as Me, useRef as xe, useEffect as ee, createContext as Ba, useContext as ka, useCallback as Ha, useMemo as re } from "react";
1
+ import { getGetAdditionalSyncAddresses as la, getAttesterForSeed as ua, getVersionsForSeedUid as pa, getMetadataAttestationUidsForSeedUid as ma, isValidEasAttestationUid as Ht, VERSION_SCHEMA_UID_OPTIMISM_SEPOLIA as fa, updateSeedRevokedAt as ha, setGetPublisherForNewSeeds as ga, setRevokeExecutor as ya, setAdditionalSyncAddresses as wa, DEFAULT_ARWEAVE_GRAPHQL_URL as ba, BaseArweaveClient as Aa, Item as le, prepareHtmlEmbeddedImagesForPublish as va, rewriteHtmlEmbeddedImagesOnDisk as Sa, getSegmentedItemProperties as Pt, getCorrectId as bn, ModelPropertyDataTypes as Ea, BaseFileManager as K, BaseDb as B, htmlEmbeddedImageCoPublish as $t, setSchemaUidForModel as Xe, setSchemaUidForSchemaDefinition as ge, INTERNAL_DATA_TYPES as Ia, getEasSchemaForItemProperty as Pa, getRelatedItemsForPublish as Ua, getUploadPipelineTransactionStatus as Ta, arweaveL1FinalizeJobs as je, resolvePublishPayloadValues as Vt, updateVersionUid as An, applyPropertyAttestationUidsFromPublish as vn, getItemPropertiesFromEas as Da, itemHasPublishUploadCandidates as _a, isItemOwned as Sn, validateItemForPublish as Ca, publishProcesses as P, client as bt, uploadProcesses as Ra } from "@seedprotocol/sdk";
2
+ import { prepareContractCall as M, readContract as O, getContract as J, createThirdwebClient as La, sendTransaction as W, waitForReceipt as j, parseEventLogs as Oe, prepareEvent as Z, deploySmartAccount as xa } from "thirdweb";
3
+ import { createWallet as Ge, inAppWallet as En } from "thirdweb/wallets";
4
+ import { useActiveAccount as In, ThirdwebProvider as Ma, useActiveWallet as Na, useActiveWalletConnectionStatus as Oa, useIsAutoConnecting as Fa, ConnectButton as Ba, darkTheme as ka } from "thirdweb/react";
5
+ import { isContractDeployed as At } from "thirdweb/utils";
6
+ import { useState as Me, useRef as xe, useEffect as ee, createContext as Ha, useContext as $a, useCallback as Va, useMemo as re } from "react";
7
7
  import { optimismSepolia as E } from "thirdweb/chains";
8
8
  import te from "debug";
9
- import { encodeAbiParameters as En, decodeAbiParameters as $a, zeroAddress as Va } from "viem";
10
- import { jsx as ve, jsxs as qa } from "react/jsx-runtime";
11
- import { SeedProvider as Wa, useLiveQuery as pe } from "@seedprotocol/react";
9
+ import { encodeAbiParameters as Pn, decodeAbiParameters as qa, zeroAddress as Wa } from "viem";
10
+ import { jsx as ve, jsxs as ja } from "react/jsx-runtime";
11
+ import { SeedProvider as Ga, useLiveQuery as pe } from "@seedprotocol/react";
12
12
  import { SeedProvider as Tc } from "@seedprotocol/react";
13
- import { getInstalledModules as ja, installModule as Ga } from "thirdweb/modules";
14
- import { assign as A, fromPromise as se, fromCallback as Pe, setup as In, enqueueActions as Ye, createActor as At } from "xstate";
15
- import Ya from "arweave";
16
- import { eq as H, and as Pt, desc as ue, notInArray as Pn, inArray as za } from "drizzle-orm";
13
+ import { getInstalledModules as Ya, installModule as za } from "thirdweb/modules";
14
+ import { assign as A, fromPromise as se, fromCallback as Pe, setup as Un, enqueueActions as ze, createActor as vt } from "xstate";
15
+ import Ja from "arweave";
16
+ import { eq as H, and as Ut, desc as ue, notInArray as Tn, inArray as Ka } from "drizzle-orm";
17
17
  import { ethers as G } from "ethers";
18
- import { readFile as Ja, stat as Ka } from "node:fs/promises";
19
- import { SchemaEncoder as Za, ZERO_BYTES32 as Qa, NO_EXPIRATION as Xa, SchemaRegistry as Xe, ZERO_ADDRESS as vt } from "@ethereum-attestation-service/eas-sdk";
18
+ import { SchemaEncoder as Za, ZERO_BYTES32 as Qa, NO_EXPIRATION as Xa, SchemaRegistry as et, ZERO_ADDRESS as St } from "@ethereum-attestation-service/eas-sdk";
20
19
  import { getRpcClient as er, eth_getBlockByNumber as tr } from "thirdweb/rpc";
21
20
  import { useSelector as nr } from "@xstate/react";
22
- const Un = "0x4200000000000000000000000000000000000020", ar = "0x44d562ac1d7cd77e232978687fea027ace48f719cf1d58c7888e509663bb87fc", Tn = "0x76f47d88bfaf670f5208911181fcdc0e160cb16d", Ut = "0x4200000000000000000000000000000000000021", rr = "0xcd8c945872df8e664e55cf8885c85ea3ea8f2148", ai = rr, k = {
21
+ const Dn = "0x4200000000000000000000000000000000000020", ar = "0x44d562ac1d7cd77e232978687fea027ace48f719cf1d58c7888e509663bb87fc", _n = "0x76f47d88bfaf670f5208911181fcdc0e160cb16d", Tt = "0x4200000000000000000000000000000000000021", rr = "0xcd8c945872df8e664e55cf8885c85ea3ea8f2148", ai = rr, k = {
23
22
  SUCCESS: "success",
24
23
  FAILURE: "failure"
25
24
  }, sr = [
@@ -76,40 +75,40 @@ function cr(e) {
76
75
  params: [e.admin, e.data]
77
76
  });
78
77
  }
79
- const dr = te("permaPress:helpers:thirdweb"), et = "seedProtocol:inAppPublish:";
80
- let tt = null;
81
- function Dn() {
82
- return tt || (tt = {
83
- getItem: async (e) => typeof window > "u" ? null : localStorage.getItem(et + e),
78
+ const dr = te("permaPress:helpers:thirdweb"), tt = "seedProtocol:inAppPublish:";
79
+ let nt = null;
80
+ function Cn() {
81
+ return nt || (nt = {
82
+ getItem: async (e) => typeof window > "u" ? null : localStorage.getItem(tt + e),
84
83
  setItem: async (e, t) => {
85
- typeof window > "u" || localStorage.setItem(et + e, t);
84
+ typeof window > "u" || localStorage.setItem(tt + e, t);
86
85
  },
87
86
  removeItem: async (e) => {
88
- typeof window > "u" || localStorage.removeItem(et + e);
87
+ typeof window > "u" || localStorage.removeItem(tt + e);
89
88
  }
90
- }), tt;
89
+ }), nt;
91
90
  }
92
- let nt = null;
91
+ let at = null;
93
92
  function x() {
94
- if (!nt) {
93
+ if (!at) {
95
94
  const { thirdwebClientId: e } = L();
96
- nt = Ca({ clientId: e });
95
+ at = La({ clientId: e });
97
96
  }
98
- return nt;
97
+ return at;
99
98
  }
100
99
  const ri = [
101
100
  // embeddedWallet(),
102
- je("io.metamask")
101
+ Ge("io.metamask")
103
102
  // createWallet("com.coinbase.wallet"),
104
103
  // createWallet("me.rainbow"),
105
104
  ], si = () => {
106
105
  const [e, t] = Me(null);
107
- return je("io.metamask"), xe(!1), ee(() => {
106
+ return Ge("io.metamask"), xe(!1), ee(() => {
108
107
  (async () => {
109
108
  })();
110
109
  }, []), e;
111
110
  }, oi = () => {
112
- const e = Sn(), [t, n] = Me(null);
111
+ const e = In(), [t, n] = Me(null);
113
112
  return ee(() => {
114
113
  !e || !e.address || n(J({
115
114
  client: x(),
@@ -117,7 +116,7 @@ const ri = [
117
116
  address: e.address
118
117
  }));
119
118
  }, [e]), t;
120
- }, _n = () => {
119
+ }, Rn = () => {
121
120
  const { thirdwebAccountFactoryAddress: e } = L();
122
121
  return J({
123
122
  client: x(),
@@ -125,8 +124,8 @@ const ri = [
125
124
  address: e
126
125
  });
127
126
  };
128
- async function Cn(e, t = "0x") {
129
- const n = _n();
127
+ async function Ln(e, t = "0x") {
128
+ const n = Rn();
130
129
  return ir({
131
130
  contract: n,
132
131
  adminSigner: e,
@@ -139,21 +138,21 @@ async function Ee(e) {
139
138
  chain: E,
140
139
  address: e
141
140
  });
142
- return bt(t);
141
+ return At(t);
143
142
  }
144
143
  async function lr(e) {
145
144
  if (!e)
146
145
  return { needsDeploy: !0 };
147
146
  if (await Ee(e.address))
148
147
  return { address: e.address, account: e };
149
- const n = await Cn(e.address);
148
+ const n = await Ln(e.address);
150
149
  return await Ee(n) ? { address: n, account: e } : { needsDeploy: !0 };
151
150
  }
152
151
  const ii = [
153
- je("io.metamask"),
154
- je("me.rainbow")
152
+ Ge("io.metamask"),
153
+ Ge("me.rainbow")
155
154
  ], ur = async (e) => {
156
- const t = _n(), n = cr({
155
+ const t = Rn(), n = cr({
157
156
  contract: t,
158
157
  admin: e.address,
159
158
  data: "0x"
@@ -175,15 +174,15 @@ const ii = [
175
174
  description: "Seed Protocol",
176
175
  url: "https://seedprotocol.io"
177
176
  };
178
- async function Tt(e = E) {
179
- const t = ze();
177
+ async function Dt(e = E) {
178
+ const t = Je();
180
179
  await t.autoConnect({ client: x(), chain: e });
181
180
  const n = t.getAccount();
182
181
  if (!n)
183
182
  throw new Error("Failed to get managed account");
184
183
  return n.address;
185
184
  }
186
- async function Rn() {
185
+ async function xn() {
187
186
  try {
188
187
  const e = Fe();
189
188
  return await e.autoConnect({ client: x(), chain: E }), e.getAccount() ?? null;
@@ -192,11 +191,11 @@ async function Rn() {
192
191
  }
193
192
  }
194
193
  async function pr() {
195
- return Rn();
194
+ return xn();
196
195
  }
197
- let at = null;
198
- const ze = () => (at || (at = vn({
199
- storage: Dn(),
196
+ let rt = null;
197
+ const Je = () => (rt || (rt = En({
198
+ storage: Cn(),
200
199
  auth: {
201
200
  options: [
202
201
  "farcaster",
@@ -209,7 +208,7 @@ const ze = () => (at || (at = vn({
209
208
  mode: "EIP4337",
210
209
  smartAccount: {
211
210
  chain: E,
212
- factoryAddress: Tn,
211
+ factoryAddress: _n,
213
212
  gasless: !0
214
213
  }
215
214
  }
@@ -288,10 +287,10 @@ const ze = () => (at || (at = vn({
288
287
  // },
289
288
  // }
290
289
  // }
291
- })), at);
292
- let rt = null;
293
- const Fe = () => (rt || (rt = vn({
294
- storage: Dn(),
290
+ })), rt);
291
+ let st = null;
292
+ const Fe = () => (st || (st = En({
293
+ storage: Cn(),
295
294
  auth: {
296
295
  options: [
297
296
  "farcaster",
@@ -304,9 +303,9 @@ const Fe = () => (rt || (rt = vn({
304
303
  mode: "EIP7702",
305
304
  sponsorGas: !0
306
305
  }
307
- })), rt);
308
- let st = null;
309
- const mr = () => (st || (st = [Fe()]), st), fr = [
306
+ })), st);
307
+ let ot = null;
308
+ const mr = () => (ot || (ot = [Fe()]), ot), fr = [
310
309
  { type: "error", name: "AccessDenied", inputs: [] },
311
310
  { type: "error", name: "AlreadyRevoked", inputs: [] },
312
311
  { type: "error", name: "InvalidRevocation", inputs: [] },
@@ -320,7 +319,7 @@ const mr = () => (st || (st = [Fe()]), st), fr = [
320
319
  ], hr = () => Z({
321
320
  signature: "event Attested(address indexed recipient, address indexed attester, bytes32 uid, bytes32 indexed schemaUID)"
322
321
  }), gr = "0x0000000000000000000000000000000000000000", Y = "0x" + "0".repeat(64);
323
- function Vt(e, t, n) {
322
+ function qt(e, t, n) {
324
323
  const { easContractAddress: a } = L(), r = J({
325
324
  client: e,
326
325
  chain: t,
@@ -356,13 +355,13 @@ function yr(e, t, n) {
356
355
  params: [n]
357
356
  });
358
357
  }
359
- function ot(e) {
360
- return En([{ type: "bytes32" }], [e]);
358
+ function it(e) {
359
+ return Pn([{ type: "bytes32" }], [e]);
361
360
  }
362
- function qt(e, t) {
363
- return Ln(e, t)[0]?.uid;
361
+ function Wt(e, t) {
362
+ return Mn(e, t)[0]?.uid;
364
363
  }
365
- function Ln(e, t) {
364
+ function Mn(e, t) {
366
365
  if (!e.logs?.length) return [];
367
366
  const n = t.toLowerCase(), a = e.logs.filter((r) => r.address && r.address.toLowerCase() === n);
368
367
  if (!a.length) return [];
@@ -406,7 +405,7 @@ async function br(e) {
406
405
  const { account: t, attester: n } = e;
407
406
  if (!n || t.address.toLowerCase() === n.toLowerCase())
408
407
  return t;
409
- const a = ca();
408
+ const a = la();
410
409
  if (a) {
411
410
  const r = await a(), s = n.toLowerCase();
412
411
  if (r?.some((o) => o?.toLowerCase() === s))
@@ -415,9 +414,9 @@ async function br(e) {
415
414
  );
416
415
  }
417
416
  try {
418
- const r = await Cn(t.address), s = n.toLowerCase(), o = r.toLowerCase();
417
+ const r = await Ln(t.address), s = n.toLowerCase(), o = r.toLowerCase();
419
418
  if (s === o && await Ee(r)) {
420
- const c = ze();
419
+ const c = Je();
421
420
  await c.autoConnect({
422
421
  client: x(),
423
422
  chain: E
@@ -431,15 +430,15 @@ async function br(e) {
431
430
  return t;
432
431
  }
433
432
  async function Ar(e) {
434
- const { seedLocalId: t, seedUid: n, seedSchemaUid: a } = e, r = await Rn();
433
+ const { seedLocalId: t, seedUid: n, seedSchemaUid: a } = e, r = await xn();
435
434
  if (!r)
436
435
  throw new Error("No wallet connected. Connect a wallet to revoke attestations.");
437
- const s = await da({ seedLocalId: t, seedUid: n }), o = await br({ account: r, attester: s }), i = x(), [c, u] = await Promise.all([
438
- la(n),
439
- ua(n)
440
- ]), p = c.map((l) => l.uid).filter((l) => kt(l)), f = /* @__PURE__ */ new Map();
436
+ const s = await ua({ seedLocalId: t, seedUid: n }), o = await br({ account: r, attester: s }), i = x(), [c, u] = await Promise.all([
437
+ pa(n),
438
+ ma(n)
439
+ ]), p = c.map((l) => l.uid).filter((l) => Ht(l)), f = /* @__PURE__ */ new Map();
441
440
  for (const { uid: l, schemaUid: g } of u) {
442
- if (!kt(l)) continue;
441
+ if (!Ht(l)) continue;
443
442
  const h = f.get(g) ?? [];
444
443
  h.push(l), f.set(g, h);
445
444
  }
@@ -450,7 +449,7 @@ async function Ar(e) {
450
449
  data: g.map((h) => ({ uid: h }))
451
450
  });
452
451
  p.length > 0 && d.push({
453
- schema: pa,
452
+ schema: fa,
454
453
  data: p.map((l) => ({ uid: l }))
455
454
  }), d.push({
456
455
  schema: a,
@@ -478,38 +477,38 @@ async function Ar(e) {
478
477
  }
479
478
  }
480
479
  const m = Math.floor(Date.now() / 1e3);
481
- await ma({ seedLocalId: t, revokedAt: m });
480
+ await ha({ seedLocalId: t, revokedAt: m });
482
481
  }
483
- let Dt = null;
482
+ let _t = null;
484
483
  function vr(e) {
485
- Dt = e;
484
+ _t = e;
486
485
  }
487
486
  function Sr() {
488
- return Dt;
487
+ return _t;
489
488
  }
490
- function xn(e) {
491
- vr(e), fa(async () => {
489
+ function Nn(e) {
490
+ vr(e), ga(async () => {
492
491
  try {
493
- return await Tt(E);
492
+ return await Dt(E);
494
493
  } catch {
495
494
  return;
496
495
  }
497
- }), ha(Ar), import("./worker-ylKtaCCV.js").then((t) => {
496
+ }), ya(Ar), import("./worker-ylKtaCCV.js").then((t) => {
498
497
  t.startArweaveL1FinalizeWorker();
499
- }), ga(async () => e.useModularExecutor && e.modularAccountModuleContract ? [e.modularAccountModuleContract] : []);
498
+ }), wa(async () => e.useModularExecutor && e.modularAccountModuleContract ? [e.modularAccountModuleContract] : []);
500
499
  }
501
- const di = xn;
500
+ const di = Nn;
502
501
  function L() {
503
- const e = Dt;
502
+ const e = _t;
504
503
  if (!e)
505
504
  throw new Error(
506
505
  "@seedprotocol/publish: Call initPublish() or ensure PublishProvider is mounted with config before using the publish package"
507
506
  );
508
- const t = e.useArweaveBundler ?? !1, n = e.arweaveUploadVerificationBaseUrl ?? e.uploadApiBaseUrl, a = e.arweaveGraphqlUrl ?? ya, r = e.useModularExecutor ?? !1;
507
+ const t = e.useArweaveBundler ?? !1, n = e.arweaveUploadVerificationBaseUrl ?? e.uploadApiBaseUrl, a = e.arweaveGraphqlUrl ?? ba, r = e.useModularExecutor ?? !1;
509
508
  return {
510
509
  ...e,
511
- thirdwebAccountFactoryAddress: Tn,
512
- easContractAddress: Ut,
510
+ thirdwebAccountFactoryAddress: _n,
511
+ easContractAddress: Tt,
513
512
  useIntegerLocalIds: e.useIntegerLocalIds ?? !1,
514
513
  useDirectEas: e.useDirectEas ?? !1,
515
514
  modularAccountModuleData: e.modularAccountModuleData ?? "0x",
@@ -524,12 +523,12 @@ function L() {
524
523
  function Er(e, t) {
525
524
  return e.autoDeployEip7702ModularAccount === !0 ? !0 : e.autoDeployEip7702ModularAccount === !1 ? !1 : t;
526
525
  }
527
- class Mn extends Error {
526
+ class On extends Error {
528
527
  constructor(t, n, a, r, s = "METADATA_PROPERTIES_MISSING") {
529
528
  super(t), this.seedLocalId = n, this.expectedSchemas = a, this.foundSchemas = r, this.code = s, this.name = "AttestationVerificationError";
530
529
  }
531
530
  }
532
- function _t(e, t = 700) {
531
+ function Ct(e, t = 700) {
533
532
  if (e == null) return "";
534
533
  if (e instanceof Error) {
535
534
  const n = e.cause instanceof Error ? ` | cause: ${e.cause.message}` : "";
@@ -548,13 +547,13 @@ function _t(e, t = 700) {
548
547
  }
549
548
  class z extends Error {
550
549
  constructor(t, n, a, r) {
551
- const s = r != null && r !== "" ? ` (${_t(r)})` : "";
550
+ const s = r != null && r !== "" ? ` (${Ct(r)})` : "";
552
551
  super(t + s), this.code = n, this.managedAddress = a, this.name = "ManagedAccountPublishError", this.underlyingCause = r;
553
552
  }
554
553
  /** Original error when connection or deployment failed (avoids shadowing `Error.cause`). */
555
554
  underlyingCause;
556
555
  }
557
- function Wt(e) {
556
+ function jt(e) {
558
557
  if (e instanceof z) return !0;
559
558
  if (typeof e != "object" || e === null) return !1;
560
559
  const t = e;
@@ -562,7 +561,7 @@ function Wt(e) {
562
561
  }
563
562
  class Re extends Error {
564
563
  constructor(t, n, a, r) {
565
- const s = r != null && r !== "" ? ` (${_t(r)})` : "";
564
+ const s = r != null && r !== "" ? ` (${Ct(r)})` : "";
566
565
  super(t + s), this.code = n, this.modularAddress = a, this.name = "Eip7702ModularAccountPublishError", this.underlyingCause = r;
567
566
  }
568
567
  underlyingCause;
@@ -580,11 +579,11 @@ function li(e) {
580
579
  return t.name === "Eip7702ModularAccountPublishError" && typeof t.code == "string" && Ir.includes(t.code);
581
580
  }
582
581
  function Pr(e) {
583
- return /Router:\s*function does not exist/i.test(_t(e));
582
+ return /Router:\s*function does not exist/i.test(Ct(e));
584
583
  }
585
- const Nn = Ba(null);
584
+ const Fn = Ha(null);
586
585
  function Ur() {
587
- const e = ka(Nn);
586
+ const e = $a(Fn);
588
587
  if (!e)
589
588
  throw new Error("usePublishConfig must be used within PublishProvider");
590
589
  return e;
@@ -595,9 +594,9 @@ const ui = ({
595
594
  queryClient: n,
596
595
  queryClientRef: a
597
596
  }) => (ee(() => {
598
- t && xn(t);
599
- }, [t]), /* @__PURE__ */ ve(Nn.Provider, { value: t ?? Sr(), children: /* @__PURE__ */ ve(La, { children: /* @__PURE__ */ ve(Wa, { queryClient: n, queryClientRef: a, children: e }) }) })), Tr = "The executor module could not be installed on your publishing account on Optimism Sepolia. Reconnect and try again, or contact support if this persists.";
600
- async function St(e, t, n) {
597
+ t && Nn(t);
598
+ }, [t]), /* @__PURE__ */ ve(Fn.Provider, { value: t ?? Sr(), children: /* @__PURE__ */ ve(Ma, { children: /* @__PURE__ */ ve(Ga, { queryClient: n, queryClientRef: a, children: e }) }) })), Tr = "The executor module could not be installed on your publishing account on Optimism Sepolia. Reconnect and try again, or contact support if this persists.";
599
+ async function Et(e, t, n) {
601
600
  const { modularAccountModuleContract: a } = n;
602
601
  if (!a) return;
603
602
  const r = J({
@@ -606,14 +605,14 @@ async function St(e, t, n) {
606
605
  address: e
607
606
  });
608
607
  try {
609
- const s = await ja({ contract: r }), o = a.toLowerCase();
608
+ const s = await Ya({ contract: r }), o = a.toLowerCase();
610
609
  if (s.some(
611
610
  (p) => p.implementation?.toLowerCase() === o
612
611
  )) return;
613
- const c = Ga({
612
+ const c = za({
614
613
  contract: r,
615
614
  moduleContract: a,
616
- data: En([{ type: "address" }], [Ut])
615
+ data: Pn([{ type: "address" }], [Tt])
617
616
  }), u = await W({ transaction: c, account: t });
618
617
  await j({
619
618
  client: x(),
@@ -640,7 +639,7 @@ const Dr = A(({ context: e, event: t }) => {
640
639
  )
641
640
  };
642
641
  }), Ie = () => {
643
- const e = wa.getHost(), t = Ya;
642
+ const e = Aa.getHost(), t = Ja;
644
643
  return Object.keys(t).includes("default") && t.default ? t.default.init({
645
644
  host: e,
646
645
  protocol: "https"
@@ -665,7 +664,7 @@ const Dr = A(({ context: e, event: t }) => {
665
664
  }, 200);
666
665
  });
667
666
  };
668
- function On(e) {
667
+ function Bn(e) {
669
668
  if (!e || typeof e != "object") return;
670
669
  const t = e;
671
670
  if (Array.isArray(t.data_root))
@@ -675,7 +674,7 @@ function On(e) {
675
674
  proofs: (t.proofs ?? []).map((n) => ({ ...n, proof: new Uint8Array(n.proof ?? []) }))
676
675
  };
677
676
  }
678
- function Fn(e) {
677
+ function kn(e) {
679
678
  return {
680
679
  data_root: Array.from(e.data_root),
681
680
  chunks: e.chunks.map((t) => ({ ...t, dataHash: Array.from(t.dataHash) })),
@@ -710,7 +709,7 @@ const _r = se(
710
709
  u.push({
711
710
  transaction: {
712
711
  ...h,
713
- chunks: g.chunks ? Fn(g.chunks) : void 0
712
+ chunks: g.chunks ? kn(g.chunks) : void 0
714
713
  },
715
714
  versionId: l.versionLocalId,
716
715
  modelName: l.itemPropertyName
@@ -723,7 +722,7 @@ const _r = se(
723
722
  const p = Ie();
724
723
  return {
725
724
  arweaveTransactions: u.map((d) => {
726
- const { chunks: m, ...l } = d.transaction, g = { ...l }, h = On(m);
725
+ const { chunks: m, ...l } = d.transaction, g = { ...l }, h = Bn(m);
727
726
  return h && (g.chunks = h), {
728
727
  transaction: p.transactions.fromRaw(g),
729
728
  versionId: d.versionId,
@@ -761,7 +760,7 @@ const _r = se(
761
760
  u.push({
762
761
  transaction: {
763
762
  ...h,
764
- chunks: g.chunks ? Fn(g.chunks) : void 0
763
+ chunks: g.chunks ? kn(g.chunks) : void 0
765
764
  },
766
765
  versionId: l.versionLocalId,
767
766
  modelName: l.itemPropertyName
@@ -774,7 +773,7 @@ const _r = se(
774
773
  const p = Ie();
775
774
  return {
776
775
  arweaveTransactions: u.map((d) => {
777
- const { chunks: m, ...l } = d.transaction, g = { ...l }, h = On(m);
776
+ const { chunks: m, ...l } = d.transaction, g = { ...l }, h = Bn(m);
778
777
  return h && (g.chunks = h), {
779
778
  transaction: p.transactions.fromRaw(g),
780
779
  versionId: d.versionId,
@@ -787,7 +786,7 @@ const _r = se(
787
786
  ), Rr = se(
788
787
  async ({ input: { context: e } }) => {
789
788
  const t = e.htmlEmbeddedDataUriPolicy ?? "materialize";
790
- return { deferredHtmlSeedLocalIds: (await ba(e.item, t)).deferredHtmlSeedLocalIds };
789
+ return { deferredHtmlSeedLocalIds: (await va(e.item, t)).deferredHtmlSeedLocalIds };
791
790
  }
792
791
  );
793
792
  function Lr(e, t) {
@@ -804,12 +803,12 @@ const xr = se(
804
803
  e.htmlEmbeddedPhase1ArweaveTransactions,
805
804
  e.htmlEmbeddedPhase1PublishUploads
806
805
  );
807
- await Aa(e.item.seedLocalId, t);
806
+ await Sa(e.item.seedLocalId, t);
808
807
  }
809
- ), Ct = (e, t, n) => {
808
+ ), Rt = (e, t, n) => {
810
809
  const a = [];
811
810
  return e && a.push({ name: "Content-SHA-256", value: e }), t && a.push({ name: "Content-Type", value: t }), n?.length && a.push(...n), a;
812
- }, Rt = async (e) => {
811
+ }, Lt = async (e) => {
813
812
  const t = e instanceof Uint8Array ? new Uint8Array(e) : new Uint8Array(e), n = await crypto.subtle.digest("SHA-256", t);
814
813
  return Array.from(new Uint8Array(n)).map((a) => a.toString(16).padStart(2, "0")).join("");
815
814
  }, Mr = {
@@ -823,10 +822,10 @@ const xr = se(
823
822
  htm: "text/html",
824
823
  json: "application/json",
825
824
  txt: "text/plain"
826
- }, Bn = (e) => {
825
+ }, Hn = (e) => {
827
826
  const t = e.split(".").pop()?.toLowerCase();
828
827
  return t ? Mr[t] : void 0;
829
- }, Et = async (e) => typeof Blob < "u" && e instanceof Blob ? new Uint8Array(await e.arrayBuffer()) : new Uint8Array(e), Nr = (e) => {
828
+ }, It = async (e) => typeof Blob < "u" && e instanceof Blob ? new Uint8Array(await e.arrayBuffer()) : new Uint8Array(e), Nr = (e) => {
830
829
  switch (e) {
831
830
  case "Image":
832
831
  return K.getFilesPath("images");
@@ -865,10 +864,10 @@ const Br = async (e, t, n, a) => {
865
864
  if (m && !m.endsWith("undefined") && await K.pathExists(m))
866
865
  try {
867
866
  const g = await K.readFileAsBuffer(m);
868
- i = await Et(g);
867
+ i = await It(g);
869
868
  } catch {
870
869
  const g = await K.getFs();
871
- i = await Et(g.readFileSync(m));
870
+ i = await It(g.readFileSync(m));
872
871
  }
873
872
  }
874
873
  if (o.length > 0) {
@@ -887,43 +886,43 @@ const Br = async (e, t, n, a) => {
887
886
  i = typeof document < "u" ? new TextEncoder().encode(l) : new Uint8Array(Buffer.from(l));
888
887
  }
889
888
  if (!i) return t;
890
- const c = new Uint8Array(i), u = await Rt(c);
889
+ const c = new Uint8Array(i), u = await Lt(c);
891
890
  let p;
892
- o.length === 0 && n?.localStoragePath ? p = Bn(n.localStoragePath) : o.length > 0 && (p = "application/octet-stream");
891
+ o.length === 0 && n?.localStoragePath ? p = Hn(n.localStoragePath) : o.length > 0 && (p = "application/octet-stream");
893
892
  const f = n ? n.localId : s.localId, d = n ? n.propertyName : s.propertyName;
894
893
  return t.push({
895
894
  data: c,
896
895
  contentHash: u,
897
896
  contentType: p,
898
- tags: Ct(u, p, r),
897
+ tags: Rt(u, p, r),
899
898
  itemPropertyName: d,
900
899
  itemPropertyLocalId: f,
901
900
  seedLocalId: s.seedLocalId,
902
901
  versionLocalId: s.versionLocalId
903
902
  }), t;
904
- }, jt = async (e, t) => {
903
+ }, Gt = async (e, t) => {
905
904
  const n = [], a = t?.arweaveUploadTags;
906
905
  for (const r of e) {
907
906
  const s = r.getService().getSnapshot(), o = "context" in s ? s.context : null;
908
907
  if (!o) continue;
909
908
  const i = o.propertyValue, c = o.refResolvedValue;
910
909
  if (!c) continue;
911
- const { localId: u } = yn(i ?? "");
910
+ const { localId: u } = bn(i ?? "");
912
911
  if (!u) continue;
913
912
  const p = r.propertyDef?.refValueType ?? r.propertyDef?.dataType ?? "Image";
914
- if (p === va.Html) {
913
+ if (p === Ea.Html) {
915
914
  if (t?.deferHtmlStorageSeedLocalIds?.includes(u) || t?.onlyHtmlStorageSeedLocalIds?.length && !t.onlyHtmlStorageSeedLocalIds.includes(u))
916
915
  continue;
917
916
  } else if (t?.onlyHtmlStorageSeedLocalIds?.length)
918
917
  continue;
919
918
  const d = `${Nr(p)}/${c}`;
920
919
  if (!await K.pathExists(d)) continue;
921
- const l = await K.readFileAsBuffer(d), g = await Et(l), h = await Rt(g), b = Bn(c);
920
+ const l = await K.readFileAsBuffer(d), g = await It(l), h = await Lt(g), b = Hn(c);
922
921
  n.push({
923
922
  data: g,
924
923
  contentHash: h,
925
924
  contentType: b,
926
- tags: Ct(h, b, a),
925
+ tags: Rt(h, b, a),
927
926
  itemPropertyName: r.propertyName,
928
927
  itemPropertyLocalId: r.localId,
929
928
  seedLocalId: u,
@@ -935,7 +934,7 @@ const Br = async (e, t, n, a) => {
935
934
  async function kr(e, t, n) {
936
935
  const a = B.getAppDb();
937
936
  if (!a || n?.onlyHtmlStorageSeedLocalIds?.length) return t;
938
- const r = await a.select().from(Ht).where(H(Ht.parentSeedLocalId, e.seedLocalId)), s = new Set(t.map((o) => o.seedLocalId));
937
+ const r = await a.select().from($t).where(H($t.parentSeedLocalId, e.seedLocalId)), s = new Set(t.map((o) => o.seedLocalId));
939
938
  for (const o of r) {
940
939
  if (s.has(o.imageSeedLocalId)) continue;
941
940
  const i = await le.find({ seedLocalId: o.imageSeedLocalId, modelName: "Image" });
@@ -943,12 +942,12 @@ async function kr(e, t, n) {
943
942
  const c = i.internalProperties.storageTransactionId ?? i.allProperties.storageTransactionId, u = c?.getService().getSnapshot(), p = u && "context" in u ? u.context : void 0, f = typeof p?.propertyValue == "string" ? p.propertyValue ?? "" : "", d = Fr(f);
944
943
  let m = [];
945
944
  if (d && c && c.localId && c.versionLocalId) {
946
- const l = await Rt(d.bytes);
945
+ const l = await Lt(d.bytes);
947
946
  m = [{
948
947
  data: d.bytes,
949
948
  contentHash: l,
950
949
  contentType: d.mimeType,
951
- tags: Ct(l, d.mimeType, n?.arweaveUploadTags),
950
+ tags: Rt(l, d.mimeType, n?.arweaveUploadTags),
952
951
  itemPropertyName: c.propertyName,
953
952
  itemPropertyLocalId: c.localId,
954
953
  seedLocalId: i.seedLocalId,
@@ -960,10 +959,10 @@ async function kr(e, t, n) {
960
959
  }
961
960
  return t;
962
961
  }
963
- const Lt = async (e, t = [], n, a) => {
964
- const { itemUploadProperties: r, itemRelationProperties: s, itemImageProperties: o } = await It(e);
962
+ const xt = async (e, t = [], n, a) => {
963
+ const { itemUploadProperties: r, itemRelationProperties: s, itemImageProperties: o } = await Pt(e);
965
964
  if (!n && a?.onlyHtmlStorageSeedLocalIds?.length) {
966
- const c = await jt(o, a);
965
+ const c = await Gt(o, a);
967
966
  return t.push(...c), t;
968
967
  }
969
968
  for (const c of r)
@@ -973,7 +972,7 @@ const Lt = async (e, t = [], n, a) => {
973
972
  n,
974
973
  a
975
974
  );
976
- const i = await jt(o, a);
975
+ const i = await Gt(o, a);
977
976
  if (t.push(...i), !n && !a?.onlyHtmlStorageSeedLocalIds?.length && (t = await kr(e, t, a)), a?.skipRelationRecursion)
978
977
  return t;
979
978
  for (const c of s) {
@@ -981,13 +980,13 @@ const Lt = async (e, t = [], n, a) => {
981
980
  if (!p) continue;
982
981
  const f = p.propertyValue;
983
982
  if (!f || c.uid) continue;
984
- const { localId: d, uid: m } = yn(f), l = await le.find({ seedLocalId: d, seedUid: m });
983
+ const { localId: d, uid: m } = bn(f), l = await le.find({ seedLocalId: d, seedUid: m });
985
984
  if (!l)
986
985
  throw new Error(`No relatedItem found for ${c.propertyName}`);
987
- t = await Lt(l, t, c, a);
986
+ t = await xt(l, t, c, a);
988
987
  }
989
988
  return t;
990
- }, xt = 3, he = 65, Gt = new TextEncoder().encode("seed-recovery"), it = 32, Hr = 0xffffffffffffffffn;
989
+ }, Mt = 3, he = 65, Yt = new TextEncoder().encode("seed-recovery"), ct = 32, Hr = 0xffffffffffffffffn;
991
990
  function $r(e, t, n) {
992
991
  const a = G.solidityPackedKeccak256(
993
992
  ["uint256", "address", "uint64"],
@@ -995,11 +994,11 @@ function $r(e, t, n) {
995
994
  );
996
995
  return G.getBytes(a);
997
996
  }
998
- function Yt(e) {
997
+ function zt(e) {
999
998
  if (e.length === 0) return new Uint8Array([0]);
1000
- if (e.length !== it)
1001
- throw new Error(`ANS-104 target/anchor must be empty or ${it} bytes, got ${e.length}`);
1002
- const t = new Uint8Array(1 + it);
999
+ if (e.length !== ct)
1000
+ throw new Error(`ANS-104 target/anchor must be empty or ${ct} bytes, got ${e.length}`);
1001
+ const t = new Uint8Array(1 + ct);
1003
1002
  return t[0] = 1, t.set(e, 1), t;
1004
1003
  }
1005
1004
  function Vr(e) {
@@ -1013,7 +1012,7 @@ function qr(e, t, n) {
1013
1012
  } while (r);
1014
1013
  return s - n;
1015
1014
  }
1016
- const Mt = (e) => {
1015
+ const Nt = (e) => {
1017
1016
  if (!e?.length) return new Uint8Array(0);
1018
1017
  const t = new TextEncoder(), n = new Uint8Array(16), a = [], r = (c) => {
1019
1018
  const u = qr(c, n, 0);
@@ -1030,7 +1029,7 @@ const Mt = (e) => {
1030
1029
  for (const c of a)
1031
1030
  o.set(c, i), i += c.length;
1032
1031
  return o;
1033
- }, zt = (e) => {
1032
+ }, Jt = (e) => {
1034
1033
  const t = new Uint8Array(8), n = new DataView(t.buffer);
1035
1034
  return n.setUint32(0, e & 4294967295, !0), n.setUint32(4, Math.floor(e / 4294967296), !0), t;
1036
1035
  };
@@ -1043,13 +1042,13 @@ function ke(e, t) {
1043
1042
  const n = new Uint8Array(e.length + t.length);
1044
1043
  return n.set(e, 0), n.set(t, e.length), n;
1045
1044
  }
1046
- async function kn(e) {
1045
+ async function $n(e) {
1047
1046
  const t = new TextEncoder();
1048
1047
  if (Array.isArray(e)) {
1049
1048
  const s = ke(t.encode("list"), t.encode(e.length.toString()));
1050
1049
  let o = await Te(s);
1051
1050
  for (const i of e) {
1052
- const c = await kn(i);
1051
+ const c = await $n(i);
1053
1052
  o = await Te(ke(o, c));
1054
1053
  }
1055
1054
  return o;
@@ -1057,12 +1056,12 @@ async function kn(e) {
1057
1056
  const n = ke(t.encode("blob"), t.encode(e.byteLength.toString())), a = await Te(n), r = await Te(e);
1058
1057
  return Te(ke(a, r));
1059
1058
  }
1060
- async function Nt(e, t, n, a, r) {
1059
+ async function Ot(e, t, n, a, r) {
1061
1060
  const s = new TextEncoder();
1062
- return kn([
1061
+ return $n([
1063
1062
  s.encode("dataitem"),
1064
1063
  s.encode("1"),
1065
- s.encode(xt.toString()),
1064
+ s.encode(Mt.toString()),
1066
1065
  e,
1067
1066
  t,
1068
1067
  n,
@@ -1070,8 +1069,8 @@ async function Nt(e, t, n, a, r) {
1070
1069
  r
1071
1070
  ]);
1072
1071
  }
1073
- function Hn(e, t, n, a, r) {
1074
- const s = Mt(t), o = zt(t.length), i = zt(s.length), c = Yt(a), u = Yt(r), p = [
1072
+ function Vn(e, t, n, a, r) {
1073
+ const s = Nt(t), o = Jt(t.length), i = Jt(s.length), c = zt(a), u = zt(r), p = [
1075
1074
  e,
1076
1075
  c,
1077
1076
  u,
@@ -1085,27 +1084,27 @@ function Hn(e, t, n, a, r) {
1085
1084
  d.set(l, m), m += l.length;
1086
1085
  return d;
1087
1086
  }
1088
- async function $n(e, t) {
1087
+ async function qn(e, t) {
1089
1088
  const n = new Uint8Array(2);
1090
- new DataView(n.buffer).setUint16(0, xt, !0);
1089
+ new DataView(n.buffer).setUint16(0, Mt, !0);
1091
1090
  const a = 2 + he + t.length, r = new Uint8Array(a);
1092
1091
  r.set(n, 0), r.set(e, 2), r.set(t, 2 + he);
1093
1092
  const s = await crypto.subtle.digest("SHA-256", new Uint8Array(e));
1094
1093
  return { id: Jr(new Uint8Array(s)), raw: r };
1095
1094
  }
1096
1095
  const Wr = async (e, t, n, a = new Uint8Array(0)) => {
1097
- const r = G.SigningKey.computePublicKey(t.privateKey, !1), s = G.getBytes(r), o = Mt(n), i = new Uint8Array(0), c = await Nt(
1096
+ const r = G.SigningKey.computePublicKey(t.privateKey, !1), s = G.getBytes(r), o = Nt(n), i = new Uint8Array(0), c = await Ot(
1098
1097
  s,
1099
1098
  i,
1100
1099
  a,
1101
1100
  o,
1102
1101
  e
1103
- ), u = G.getBytes(await t.signMessage(c)), p = Hn(s, n, e, i, a);
1104
- return $n(u, p);
1102
+ ), u = G.getBytes(await t.signMessage(c)), p = Vn(s, n, e, i, a);
1103
+ return qn(u, p);
1105
1104
  }, jr = async (e, t, n, a = new Uint8Array(0)) => {
1106
- const r = G.hexlify(Gt), s = await t.signMessage({
1105
+ const r = G.hexlify(Yt), s = await t.signMessage({
1107
1106
  message: { raw: r }
1108
- }), o = G.hashMessage(Gt), i = G.SigningKey.recoverPublicKey(o, s), c = G.getBytes(i), u = Mt(n), p = new Uint8Array(0), f = await Nt(
1107
+ }), o = G.hashMessage(Yt), i = G.SigningKey.recoverPublicKey(o, s), c = G.getBytes(i), u = Nt(n), p = new Uint8Array(0), f = await Ot(
1109
1108
  c,
1110
1109
  p,
1111
1110
  a,
@@ -1113,11 +1112,11 @@ const Wr = async (e, t, n, a = new Uint8Array(0)) => {
1113
1112
  e
1114
1113
  ), d = G.hexlify(f), m = await t.signMessage({
1115
1114
  message: { raw: d }
1116
- }), l = G.getBytes(m), g = Hn(c, n, e, p, a);
1117
- return $n(l, g);
1118
- }, Ot = 65;
1115
+ }), l = G.getBytes(m), g = Vn(c, n, e, p, a);
1116
+ return qn(l, g);
1117
+ }, Ft = 65;
1119
1118
  function Gr(e) {
1120
- const t = 2 + he + Ot;
1119
+ const t = 2 + he + Ft;
1121
1120
  if (e.length < t + 1) return null;
1122
1121
  const n = e[t];
1123
1122
  if (n !== 0 && n !== 1) return null;
@@ -1133,7 +1132,7 @@ function Gr(e) {
1133
1132
  function Yr(e) {
1134
1133
  const t = Gr(e);
1135
1134
  if (t == null) return null;
1136
- const n = 2 + he + Ot, a = e[n] === 1, r = a ? e.slice(n + 1, n + 33) : new Uint8Array(0), s = n + (a ? 33 : 1), i = e[s] === 1 ? e.slice(s + 1, s + 33) : new Uint8Array(0);
1135
+ const n = 2 + he + Ft, a = e[n] === 1, r = a ? e.slice(n + 1, n + 33) : new Uint8Array(0), s = n + (a ? 33 : 1), i = e[s] === 1 ? e.slice(s + 1, s + 33) : new Uint8Array(0);
1137
1136
  return { rawTarget: r, rawAnchor: i, tagsStart: t };
1138
1137
  }
1139
1138
  async function zr(e) {
@@ -1142,21 +1141,21 @@ async function zr(e) {
1142
1141
  const { rawTarget: n, rawAnchor: a, tagsStart: r } = t, s = r + 16;
1143
1142
  if (e.length < s) return !1;
1144
1143
  const o = new DataView(e.buffer, e.byteOffset, e.byteLength);
1145
- if (o.getUint16(0, !0) !== xt) return !1;
1146
- const c = e.slice(2, 2 + he), u = e.slice(2 + he, 2 + he + Ot), p = Number(
1144
+ if (o.getUint16(0, !0) !== Mt) return !1;
1145
+ const c = e.slice(2, 2 + he), u = e.slice(2 + he, 2 + he + Ft), p = Number(
1147
1146
  o.getUint32(r + 8, !0) + o.getUint32(r + 12, !0) * 4294967296
1148
1147
  ), f = r + 16 + p;
1149
1148
  if (e.length < f) return !1;
1150
1149
  const d = e.slice(r + 16, f), m = e.slice(f);
1151
1150
  try {
1152
- const l = await Nt(
1151
+ const l = await Ot(
1153
1152
  u,
1154
1153
  n,
1155
1154
  a,
1156
1155
  d,
1157
1156
  m
1158
- ), g = G.hashMessage(l), h = G.hexlify(c), b = G.SigningKey.recoverPublicKey(g, h), U = G.getBytes(b);
1159
- return U.length === u.length && U.every((v, y) => v === u[y]);
1157
+ ), g = G.hashMessage(l), h = G.hexlify(c), b = G.SigningKey.recoverPublicKey(g, h), T = G.getBytes(b);
1158
+ return T.length === u.length && T.every((v, y) => v === u[y]);
1160
1159
  } catch {
1161
1160
  return !1;
1162
1161
  }
@@ -1167,7 +1166,7 @@ const Jr = (e) => {
1167
1166
  t += String.fromCharCode(n);
1168
1167
  return btoa(t).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
1169
1168
  }, Kr = te("seedProtocol:createArweaveDataItems");
1170
- async function Vn(e, t, n) {
1169
+ async function Wn(e, t, n) {
1171
1170
  let a, r;
1172
1171
  if (t)
1173
1172
  a = (await t(e)).map((i) => ({
@@ -1217,13 +1216,13 @@ const Zr = se(
1217
1216
  e.arweaveUploadTags?.length && (n.arweaveUploadTags = e.arweaveUploadTags);
1218
1217
  const a = e.htmlEmbeddedDeferredHtmlSeedLocalIds;
1219
1218
  a?.length && (n.deferHtmlStorageSeedLocalIds = a);
1220
- const r = await Lt(
1219
+ const r = await xt(
1221
1220
  t,
1222
1221
  [],
1223
1222
  void 0,
1224
1223
  Object.keys(n).length ? n : void 0
1225
1224
  ), s = L(), o = e.signDataItems ?? s.signDataItems, i = e.dataItemSigner ?? s.dataItemSigner;
1226
- return Vn(r, o, i);
1225
+ return Wn(r, o, i);
1227
1226
  }
1228
1227
  );
1229
1228
  async function Qr(e) {
@@ -1233,7 +1232,7 @@ async function Qr(e) {
1233
1232
  e.arweaveUploadTags?.length && (n.arweaveUploadTags = e.arweaveUploadTags);
1234
1233
  const a = e.htmlEmbeddedDeferredHtmlSeedLocalIds;
1235
1234
  a?.length && (n.onlyHtmlStorageSeedLocalIds = a, n.skipRelationRecursion = !0);
1236
- const r = await Lt(
1235
+ const r = await xt(
1237
1236
  t,
1238
1237
  [],
1239
1238
  void 0,
@@ -1243,16 +1242,16 @@ async function Qr(e) {
1243
1242
  arweaveTransactions: [],
1244
1243
  publishUploads: [],
1245
1244
  signedDataItems: void 0
1246
- } : Vn(r, o, i);
1245
+ } : Wn(r, o, i);
1247
1246
  }
1248
1247
  const Xr = se(
1249
1248
  async ({ input: { context: e } }) => Qr(e)
1250
- ), Jt = 8192;
1249
+ ), Kt = 8192;
1251
1250
  function es(e) {
1252
1251
  const t = new Uint8Array(e);
1253
1252
  let n = "";
1254
- for (let a = 0; a < t.length; a += Jt) {
1255
- const r = t.subarray(a, Math.min(a + Jt, t.length));
1253
+ for (let a = 0; a < t.length; a += Kt) {
1254
+ const r = t.subarray(a, Math.min(a + Kt, t.length));
1256
1255
  n += String.fromCharCode.apply(null, r);
1257
1256
  }
1258
1257
  return btoa(n);
@@ -1310,8 +1309,8 @@ const ss = se(
1310
1309
  o.append(`${d.id}-data`, h, `${d.id}-data`);
1311
1310
  const b = new Blob([JSON.stringify(l)], { type: "application/json" });
1312
1311
  o.append(`${d.id}-chunks`, b, `${d.id}-chunks`);
1313
- const U = new Blob([JSON.stringify(g)], { type: "application/json" });
1314
- o.append(`${d.id}-json`, U, `${d.id}-json`);
1312
+ const T = new Blob([JSON.stringify(g)], { type: "application/json" });
1313
+ o.append(`${d.id}-json`, T, `${d.id}-json`);
1315
1314
  }
1316
1315
  const { uploadApiBaseUrl: i } = L(), c = `${i}/api/upload/arweave/start`, { status: u, body: p, message: f } = await rs(
1317
1316
  c,
@@ -1390,7 +1389,21 @@ const cs = Pe(
1390
1389
  e({ type: "uploadError", error: u });
1391
1390
  });
1392
1391
  }
1393
- ), Kt = 12e4, ds = Pe(
1392
+ ), Zt = 12e4, ds = new Function("s", "return import(s)");
1393
+ let He = null;
1394
+ const Qt = async () => {
1395
+ if (He) return He;
1396
+ if (typeof window < "u") return null;
1397
+ try {
1398
+ const e = `node:${["fs", "promises"].join("/")}`, t = await ds(e);
1399
+ return He = {
1400
+ readFile: t.readFile,
1401
+ stat: t.stat
1402
+ }, He;
1403
+ } catch {
1404
+ return null;
1405
+ }
1406
+ }, ls = Pe(
1394
1407
  ({ sendBack: e, input: { context: t } }) => {
1395
1408
  const { signedDataItems: n } = t, { uploadApiBaseUrl: a, useArweaveBundler: r } = L();
1396
1409
  if (!r || !a) {
@@ -1409,15 +1422,21 @@ const cs = Pe(
1409
1422
  }
1410
1423
  (async () => {
1411
1424
  const i = n, c = i.length, u = new Array(c).fill(null), p = async (y, _) => {
1412
- const P = y;
1413
- if (P.raw != null && (P.raw instanceof Uint8Array || Buffer.isBuffer(P.raw)))
1414
- return P.raw.byteLength;
1415
- if (typeof P.getRaw == "function") {
1416
- const w = P.getRaw(), S = w instanceof Promise ? await w : w, T = Buffer.isBuffer(S) ? S : Buffer.from(S);
1417
- return u[_] = T, T.length;
1425
+ const U = y;
1426
+ if (U.raw != null && (U.raw instanceof Uint8Array || Buffer.isBuffer(U.raw)))
1427
+ return U.raw.byteLength;
1428
+ if (typeof U.getRaw == "function") {
1429
+ const w = U.getRaw(), S = w instanceof Promise ? await w : w, I = Buffer.isBuffer(S) ? S : Buffer.from(S);
1430
+ return u[_] = I, I.length;
1431
+ }
1432
+ if (U.filename != null) {
1433
+ const w = await Qt();
1434
+ if (!w)
1435
+ throw new Error(
1436
+ "DataItem.filename requires Node.js fs access. In browser runtime, provide DataItem.raw or DataItem.getRaw()."
1437
+ );
1438
+ return (await w.stat(U.filename)).size;
1418
1439
  }
1419
- if (P.filename != null)
1420
- return (await Ka(P.filename)).size;
1421
1440
  throw new Error("Cannot get raw bytes from DataItem");
1422
1441
  };
1423
1442
  let f = 4;
@@ -1430,9 +1449,9 @@ const cs = Pe(
1430
1449
  let l = 0;
1431
1450
  m.writeUInt32BE(c, l), l += 4;
1432
1451
  for (let y = 0; y < c; y++) {
1433
- const _ = d[y], P = u[y];
1434
- if (P) {
1435
- m.writeUInt32BE(_, l), l += 4, P.copy(m, l), l += _;
1452
+ const _ = d[y], U = u[y];
1453
+ if (U) {
1454
+ m.writeUInt32BE(_, l), l += 4, U.copy(m, l), l += _;
1436
1455
  continue;
1437
1456
  }
1438
1457
  const w = i[y];
@@ -1441,13 +1460,18 @@ const cs = Pe(
1441
1460
  continue;
1442
1461
  }
1443
1462
  if (w.filename != null) {
1444
- const S = await Ja(w.filename);
1445
- m.writeUInt32BE(S.length, l), l += 4, S.copy(m, l), l += S.length;
1463
+ const S = await Qt();
1464
+ if (!S)
1465
+ throw new Error(
1466
+ "DataItem.filename requires Node.js fs access. In browser runtime, provide DataItem.raw or DataItem.getRaw()."
1467
+ );
1468
+ const I = await S.readFile(w.filename);
1469
+ m.writeUInt32BE(I.length, l), l += 4, I.copy(m, l), l += I.length;
1446
1470
  continue;
1447
1471
  }
1448
1472
  throw new Error("Cannot get raw bytes from DataItem");
1449
1473
  }
1450
- const g = new AbortController(), h = setTimeout(() => g.abort(), Kt);
1474
+ const g = new AbortController(), h = setTimeout(() => g.abort(), Zt);
1451
1475
  let b;
1452
1476
  try {
1453
1477
  b = await fetch(s, {
@@ -1458,71 +1482,71 @@ const cs = Pe(
1458
1482
  });
1459
1483
  } catch (y) {
1460
1484
  throw clearTimeout(h), y instanceof Error && y.name === "AbortError" ? new Error(
1461
- `Arweave batch upload timed out after ${Kt / 1e3}s (upload API did not respond). Check uploadApiBaseUrl and network.`
1485
+ `Arweave batch upload timed out after ${Zt / 1e3}s (upload API did not respond). Check uploadApiBaseUrl and network.`
1462
1486
  ) : y;
1463
1487
  }
1464
1488
  if (clearTimeout(h), !b.ok)
1465
1489
  throw new Error(`Batch upload failed: ${b.status}`);
1466
- const U = await b.json().catch(() => ({})), v = typeof U.failed == "number" ? U.failed : 0;
1490
+ const T = await b.json().catch(() => ({})), v = typeof T.failed == "number" ? T.failed : 0;
1467
1491
  if (v > 0) {
1468
- const y = U.total ?? "?", _ = U.succeeded ?? 0;
1492
+ const y = T.total ?? "?", _ = T.succeeded ?? 0;
1469
1493
  throw new Error(
1470
1494
  `Arweave batch upload failed: ${v} of ${y} item(s) failed (${_} succeeded)`
1471
1495
  );
1472
1496
  }
1473
1497
  })().then(() => e({ type: "uploadComplete", result: "done" })).catch((i) => e({ type: "uploadError", error: i }));
1474
1498
  }
1475
- ), qn = "Could not connect the managed publishing account on Optimism Sepolia. Reconnect with the same sign-in method and try again.", ls = "Your publishing smart account is not deployed on Optimism Sepolia yet. Complete wallet setup, enable autoDeployManagedAccount in config if appropriate, then try again.", us = "The managed account could not be confirmed on Optimism Sepolia after deployment. Wait a moment and retry, or check your network connection.", Wn = "Automatic deployment of the managed publishing account failed on Optimism Sepolia. Retry or deploy the account through your wallet provider.";
1476
- async function Zt() {
1499
+ ), jn = "Could not connect the managed publishing account on Optimism Sepolia. Reconnect with the same sign-in method and try again.", us = "Your publishing smart account is not deployed on Optimism Sepolia yet. Complete wallet setup, enable autoDeployManagedAccount in config if appropriate, then try again.", ps = "The managed account could not be confirmed on Optimism Sepolia after deployment. Wait a moment and retry, or check your network connection.", Gn = "Automatic deployment of the managed publishing account failed on Optimism Sepolia. Retry or deploy the account through your wallet provider.";
1500
+ async function Xt() {
1477
1501
  const { useModularExecutor: e } = L();
1478
1502
  if (!e)
1479
1503
  return { kind: "skip" };
1480
1504
  let t;
1481
1505
  try {
1482
- t = await Tt(E);
1506
+ t = await Dt(E);
1483
1507
  } catch (a) {
1484
1508
  return { kind: "unavailable", cause: a };
1485
1509
  }
1486
1510
  return await Ee(t) ? { kind: "ready", managedAddress: t } : { kind: "not_deployed", managedAddress: t };
1487
1511
  }
1488
- async function jn() {
1489
- const e = ze();
1512
+ async function Yn() {
1513
+ const e = Je();
1490
1514
  await e.autoConnect({ client: x(), chain: E });
1491
1515
  const t = e.getAccount();
1492
1516
  if (!t)
1493
- throw new z(qn, "MANAGED_ACCOUNT_UNAVAILABLE");
1517
+ throw new z(jn, "MANAGED_ACCOUNT_UNAVAILABLE");
1494
1518
  return t;
1495
1519
  }
1496
- async function ps() {
1497
- const e = await jn();
1520
+ async function ms() {
1521
+ const e = await Yn();
1498
1522
  try {
1499
1523
  await ur(e);
1500
1524
  } catch (t) {
1501
- throw new z(Wn, "MANAGED_ACCOUNT_NOT_DEPLOYED", e.address, t);
1525
+ throw new z(Gn, "MANAGED_ACCOUNT_NOT_DEPLOYED", e.address, t);
1502
1526
  }
1503
1527
  }
1504
- async function Gn() {
1528
+ async function zn() {
1505
1529
  const e = L();
1506
1530
  if (!e.useModularExecutor)
1507
1531
  throw new Error("runModularExecutorPublishPrep: useModularExecutor is false");
1508
- let t = await Zt();
1532
+ let t = await Xt();
1509
1533
  if (t.kind === "unavailable")
1510
1534
  return {
1511
1535
  ok: !1,
1512
- error: new z(qn, "MANAGED_ACCOUNT_UNAVAILABLE", void 0, t.cause)
1536
+ error: new z(jn, "MANAGED_ACCOUNT_UNAVAILABLE", void 0, t.cause)
1513
1537
  };
1514
1538
  if (t.kind === "not_deployed")
1515
1539
  if (e.autoDeployManagedAccount) {
1516
1540
  try {
1517
- await ps();
1541
+ await ms();
1518
1542
  } catch (n) {
1519
- return { ok: !1, error: Wt(n) ? n : new z(Wn, "MANAGED_ACCOUNT_NOT_DEPLOYED", t.managedAddress, n) };
1543
+ return { ok: !1, error: jt(n) ? n : new z(Gn, "MANAGED_ACCOUNT_NOT_DEPLOYED", t.managedAddress, n) };
1520
1544
  }
1521
- if (t = await Zt(), t.kind !== "ready")
1545
+ if (t = await Xt(), t.kind !== "ready")
1522
1546
  return {
1523
1547
  ok: !1,
1524
1548
  error: new z(
1525
- us,
1549
+ ps,
1526
1550
  "MANAGED_ACCOUNT_NOT_DEPLOYED",
1527
1551
  t.kind === "not_deployed" ? t.managedAddress : void 0
1528
1552
  )
@@ -1530,15 +1554,15 @@ async function Gn() {
1530
1554
  } else
1531
1555
  return {
1532
1556
  ok: !1,
1533
- error: new z(ls, "MANAGED_ACCOUNT_NOT_DEPLOYED", t.managedAddress)
1557
+ error: new z(us, "MANAGED_ACCOUNT_NOT_DEPLOYED", t.managedAddress)
1534
1558
  };
1535
1559
  if (t.kind === "ready") {
1536
1560
  if (e.modularAccountModuleContract)
1537
1561
  try {
1538
- const n = await jn();
1539
- await St(t.managedAddress, n, e);
1562
+ const n = await Yn();
1563
+ await Et(t.managedAddress, n, e);
1540
1564
  } catch (n) {
1541
- return Wt(n) ? { ok: !1, error: n } : {
1565
+ return jt(n) ? { ok: !1, error: n } : {
1542
1566
  ok: !1,
1543
1567
  error: new z(
1544
1568
  "Executor module setup failed on Optimism Sepolia.",
@@ -1574,7 +1598,7 @@ function hi() {
1574
1598
  signature: "event ContractURIUpdated(string prevURI, string newURI)"
1575
1599
  });
1576
1600
  }
1577
- function Ft() {
1601
+ function Bt() {
1578
1602
  return Z({
1579
1603
  signature: "event CreatedAttestation((bytes32 schemaUid, bytes32 attestationUid) result)"
1580
1604
  });
@@ -1595,7 +1619,7 @@ function wi(e = {}) {
1595
1619
  filters: e
1596
1620
  });
1597
1621
  }
1598
- function ms() {
1622
+ function fs() {
1599
1623
  return Z({
1600
1624
  signature: "event SeedPublished(bytes returnedDataFromEAS)"
1601
1625
  });
@@ -2144,7 +2168,7 @@ async function Oi(e) {
2144
2168
  params: []
2145
2169
  });
2146
2170
  }
2147
- async function fs(e) {
2171
+ async function hs(e) {
2148
2172
  return O({
2149
2173
  contract: e.contract,
2150
2174
  method: [
@@ -2597,7 +2621,7 @@ function Qi(e) {
2597
2621
  params: [e.seedUid, e.versionSchemaUid]
2598
2622
  });
2599
2623
  }
2600
- function Qt(e) {
2624
+ function en(e) {
2601
2625
  return M({
2602
2626
  contract: e.contract,
2603
2627
  method: [
@@ -2862,7 +2886,7 @@ function tc(e) {
2862
2886
  params: []
2863
2887
  });
2864
2888
  }
2865
- function hs(e) {
2889
+ function gs(e) {
2866
2890
  return M({
2867
2891
  contract: e.contract,
2868
2892
  method: [
@@ -2898,24 +2922,24 @@ function nc(e) {
2898
2922
  params: [e.newOwner]
2899
2923
  });
2900
2924
  }
2901
- const gs = te("seedProtocol:services:publish:actors:persistSeedUid"), Xt = "0x" + "0".repeat(64), ys = 15e3;
2902
- function Yn(e, t) {
2903
- const n = e.seedLocalId, a = n ? t.find((s) => s?.localId === n) : void 0, r = a?.seedUid && a.seedUid !== Xt ? a.seedUid : t[0]?.seedUid;
2904
- r && r !== Xt && (e.seedUid = r);
2925
+ const ys = te("seedProtocol:services:publish:actors:persistSeedUid"), tn = "0x" + "0".repeat(64), ws = 15e3;
2926
+ function Jn(e, t) {
2927
+ const n = e.seedLocalId, a = n ? t.find((s) => s?.localId === n) : void 0, r = a?.seedUid && a.seedUid !== tn ? a.seedUid : t[0]?.seedUid;
2928
+ r && r !== tn && (e.seedUid = r);
2905
2929
  }
2906
- async function zn(e, t, n) {
2930
+ async function Kn(e, t, n) {
2907
2931
  const a = e.persistSeedUid;
2908
2932
  if (typeof a != "function") return;
2909
2933
  const r = new Promise(
2910
- (s, o) => setTimeout(() => o(new Error("persistSeedUid timed out")), ys)
2934
+ (s, o) => setTimeout(() => o(new Error("persistSeedUid timed out")), ws)
2911
2935
  );
2912
2936
  try {
2913
2937
  await Promise.race([a.call(e, t, n), r]);
2914
2938
  } catch (s) {
2915
- gs("persistSeedUid failed (attestations already on-chain):", s);
2939
+ ys("persistSeedUid failed (attestations already on-chain):", s);
2916
2940
  }
2917
2941
  }
2918
- const ws = [
2942
+ const bs = [
2919
2943
  {
2920
2944
  inputs: [{ internalType: "bytes32", name: "uid", type: "bytes32" }],
2921
2945
  name: "getSchema",
@@ -2946,39 +2970,39 @@ const ws = [
2946
2970
  stateMutability: "nonpayable",
2947
2971
  type: "function"
2948
2972
  }
2949
- ], bs = "0x" + "0".repeat(64);
2950
- function As(e, t) {
2973
+ ], As = "0x" + "0".repeat(64);
2974
+ function vs(e, t) {
2951
2975
  return J({
2952
2976
  client: e,
2953
2977
  chain: t,
2954
- address: Un,
2955
- abi: ws
2978
+ address: Dn,
2979
+ abi: bs
2956
2980
  });
2957
2981
  }
2958
- const vs = "function getSchema(bytes32 uid) view returns ((bytes32 uid, address resolver, bool revocable, string schema))";
2959
- async function He(e, t, n) {
2982
+ const Ss = "function getSchema(bytes32 uid) view returns ((bytes32 uid, address resolver, bool revocable, string schema))";
2983
+ async function $e(e, t, n) {
2960
2984
  const a = J({
2961
2985
  client: e,
2962
2986
  chain: t,
2963
- address: Un
2987
+ address: Dn
2964
2988
  // No ABI - use string method so thirdweb parses the exact signature and produces correct selector
2965
2989
  }), r = await O({
2966
2990
  contract: a,
2967
- method: vs,
2991
+ method: Ss,
2968
2992
  params: [n]
2969
2993
  });
2970
- return !r || r.uid === bs ? null : r;
2994
+ return !r || r.uid === As ? null : r;
2971
2995
  }
2972
- function ct(e, t, n) {
2973
- const a = As(e, t);
2996
+ function dt(e, t, n) {
2997
+ const a = vs(e, t);
2974
2998
  return M({
2975
2999
  contract: a,
2976
3000
  method: "register",
2977
3001
  params: [n.schema, n.resolverAddress, n.revocable]
2978
3002
  });
2979
3003
  }
2980
- const Ss = "0x0000000000000000000000000000000000000000";
2981
- function dt(e, t, n) {
3004
+ const Es = "0x0000000000000000000000000000000000000000";
3005
+ function lt(e, t, n) {
2982
3006
  const r = new Za("bytes32 schemaId,string name").encodeData([
2983
3007
  { name: "schemaId", value: n.schemaUid, type: "bytes32" },
2984
3008
  { name: "name", value: n.schemaName, type: "string" }
@@ -2995,7 +3019,7 @@ function dt(e, t, n) {
2995
3019
  {
2996
3020
  schema: ar,
2997
3021
  data: {
2998
- recipient: Ss,
3022
+ recipient: Es,
2999
3023
  expirationTime: BigInt(Xa),
3000
3024
  revocable: !0,
3001
3025
  refUID: Qa,
@@ -3007,11 +3031,11 @@ function dt(e, t, n) {
3007
3031
  });
3008
3032
  }
3009
3033
  const ye = "0x0000000000000000000000000000000000000000", we = !0;
3010
- function lt(e) {
3034
+ function ut(e) {
3011
3035
  return e.replace(/([a-z])([A-Z])/g, "$1_$2").toLowerCase();
3012
3036
  }
3013
- async function Es(e) {
3014
- const { itemRelationProperties: t, itemImageProperties: n, itemListProperties: a } = await It(e), r = /* @__PURE__ */ new Set();
3037
+ async function Is(e) {
3038
+ const { itemRelationProperties: t, itemImageProperties: n, itemListProperties: a } = await Pt(e), r = /* @__PURE__ */ new Set();
3015
3039
  e.modelName && r.add(e.modelName);
3016
3040
  for (const s of t) {
3017
3041
  const o = s.propertyDef?.ref;
@@ -3027,29 +3051,29 @@ async function Es(e) {
3027
3051
  }
3028
3052
  return r;
3029
3053
  }
3030
- async function Je(e, t, n, a) {
3031
- const { itemBasicProperties: r, itemRelationProperties: s, itemImageProperties: o, itemListProperties: i } = await It(e), c = [
3054
+ async function Ke(e, t, n, a) {
3055
+ const { itemBasicProperties: r, itemRelationProperties: s, itemImageProperties: o, itemListProperties: i } = await Pt(e), c = [
3032
3056
  ...r,
3033
3057
  ...s,
3034
3058
  ...o,
3035
3059
  ...i
3036
- ], u = /* @__PURE__ */ new Set(), p = await Es(e), f = /* @__PURE__ */ new Set();
3060
+ ], u = /* @__PURE__ */ new Set(), p = await Is(e), f = /* @__PURE__ */ new Set();
3037
3061
  for (const h of p) {
3038
- const b = `bytes32 ${lt(h)}`, U = Xe.getSchemaUID(
3062
+ const b = `bytes32 ${ut(h)}`, T = et.getSchemaUID(
3039
3063
  b,
3040
3064
  ye,
3041
3065
  we
3042
3066
  );
3043
- if (await He(n, a, U)) {
3044
- Qe({ modelName: h, schemaUid: U });
3067
+ if (await $e(n, a, T)) {
3068
+ Xe({ modelName: h, schemaUid: T });
3045
3069
  continue;
3046
3070
  }
3047
- if (f.has(U)) {
3048
- Qe({ modelName: h, schemaUid: U });
3071
+ if (f.has(T)) {
3072
+ Xe({ modelName: h, schemaUid: T });
3049
3073
  continue;
3050
3074
  }
3051
3075
  try {
3052
- const y = ct(n, a, {
3076
+ const y = dt(n, a, {
3053
3077
  schema: b,
3054
3078
  resolverAddress: ye,
3055
3079
  revocable: we
@@ -3068,9 +3092,9 @@ async function Je(e, t, n, a) {
3068
3092
  );
3069
3093
  }
3070
3094
  try {
3071
- const y = dt(n, a, {
3072
- schemaUid: U,
3073
- schemaName: lt(h)
3095
+ const y = lt(n, a, {
3096
+ schemaUid: T,
3097
+ schemaName: ut(h)
3074
3098
  }), _ = await W({
3075
3099
  account: t,
3076
3100
  transaction: y
@@ -3085,27 +3109,27 @@ async function Je(e, t, n, a) {
3085
3109
  `Failed to name EAS schema for model ${h}: ${y instanceof Error ? y.message : String(y)}`
3086
3110
  );
3087
3111
  }
3088
- f.add(U), Qe({ modelName: h, schemaUid: U });
3112
+ f.add(T), Xe({ modelName: h, schemaUid: T });
3089
3113
  }
3090
- const d = "string storage_transaction_id", m = Xe.getSchemaUID(
3114
+ const d = "string storage_transaction_id", m = et.getSchemaUID(
3091
3115
  d,
3092
3116
  ye,
3093
3117
  we
3094
3118
  );
3095
- if (await He(n, a, m))
3119
+ if (await $e(n, a, m))
3096
3120
  ge({ text: d, schemaUid: m });
3097
3121
  else if (!u.has(m) && (p.has("Image") || p.has("File") || p.has("Html"))) {
3098
3122
  try {
3099
- const h = ct(n, a, {
3123
+ const h = dt(n, a, {
3100
3124
  schema: d,
3101
3125
  resolverAddress: ye,
3102
3126
  revocable: we
3103
3127
  }), b = await W({ account: t, transaction: h });
3104
3128
  await j({ client: n, chain: a, transactionHash: b.transactionHash });
3105
- const U = dt(n, a, {
3129
+ const T = lt(n, a, {
3106
3130
  schemaUid: m,
3107
3131
  schemaName: "storage_transaction_id"
3108
- }), v = await W({ account: t, transaction: U });
3132
+ }), v = await W({ account: t, transaction: T });
3109
3133
  await j({ client: n, chain: a, transactionHash: v.transactionHash });
3110
3134
  } catch (h) {
3111
3135
  throw new Error(
@@ -3116,7 +3140,7 @@ async function Je(e, t, n, a) {
3116
3140
  }
3117
3141
  for (const h of c) {
3118
3142
  if (!h.propertyDef) continue;
3119
- const b = Sa[h.propertyDef.dataType]?.eas ?? "string", U = h, v = U.storagePropertyName && U.storagePropertyName.length > 0 ? U.storagePropertyName : h.propertyName, y = lt(v), _ = `${b} ${y}`, w = [
3143
+ const b = Ia[h.propertyDef.dataType]?.eas ?? "string", T = h, v = T.storagePropertyName && T.storagePropertyName.length > 0 ? T.storagePropertyName : h.propertyName, y = ut(v), _ = `${b} ${y}`, w = [
3120
3144
  "string",
3121
3145
  "address",
3122
3146
  "bool",
@@ -3129,29 +3153,29 @@ async function Je(e, t, n, a) {
3129
3153
  "uint128",
3130
3154
  "uint256"
3131
3155
  ].includes(b) ? b : void 0;
3132
- let S = await Ea({
3156
+ let S = await Pa({
3133
3157
  schemaUid: h.schemaUid,
3134
3158
  propertyName: v,
3135
3159
  easDataType: w
3136
3160
  });
3137
3161
  if (S) {
3138
- const D = await He(n, a, S.id);
3162
+ const D = await $e(n, a, S.id);
3139
3163
  if (D && D.schema === _) {
3140
3164
  ge({ text: _, schemaUid: S.id });
3141
3165
  continue;
3142
3166
  }
3143
3167
  }
3144
- const T = Xe.getSchemaUID(_, ye, we);
3145
- if (await He(n, a, T)) {
3146
- ge({ text: _, schemaUid: T });
3168
+ const I = et.getSchemaUID(_, ye, we);
3169
+ if (await $e(n, a, I)) {
3170
+ ge({ text: _, schemaUid: I });
3147
3171
  continue;
3148
3172
  }
3149
- if (u.has(T)) {
3150
- ge({ text: _, schemaUid: T });
3173
+ if (u.has(I)) {
3174
+ ge({ text: _, schemaUid: I });
3151
3175
  continue;
3152
3176
  }
3153
3177
  try {
3154
- const D = ct(n, a, {
3178
+ const D = dt(n, a, {
3155
3179
  schema: _,
3156
3180
  resolverAddress: ye,
3157
3181
  revocable: we
@@ -3170,8 +3194,8 @@ async function Je(e, t, n, a) {
3170
3194
  );
3171
3195
  }
3172
3196
  try {
3173
- const D = dt(n, a, {
3174
- schemaUid: T,
3197
+ const D = lt(n, a, {
3198
+ schemaUid: I,
3175
3199
  schemaName: y
3176
3200
  }), R = await W({
3177
3201
  account: t,
@@ -3187,17 +3211,17 @@ async function Je(e, t, n, a) {
3187
3211
  `Failed to name EAS schema for property ${h.propertyName}: ${D instanceof Error ? D.message : String(D)}`
3188
3212
  );
3189
3213
  }
3190
- u.add(T), ge({ text: _, schemaUid: T });
3214
+ u.add(I), ge({ text: _, schemaUid: I });
3191
3215
  }
3192
- const g = await Ia(e);
3216
+ const g = await Ua(e);
3193
3217
  for (const h of g)
3194
- await Je(h, t, n, a);
3218
+ await Ke(h, t, n, a);
3195
3219
  }
3196
- async function Jn(e) {
3220
+ async function Zn(e) {
3197
3221
  if (e.length === 0) return;
3198
3222
  const { arweaveUploadVerificationBaseUrl: t } = L(), n = await Promise.all(
3199
3223
  e.map(
3200
- (a) => Pa(t, a)
3224
+ (a) => Ta(t, a)
3201
3225
  )
3202
3226
  );
3203
3227
  for (let a = 0; a < e.length; a++) {
@@ -3216,12 +3240,12 @@ async function Jn(e) {
3216
3240
  }
3217
3241
  }
3218
3242
  }
3219
- function Bt() {
3243
+ function kt() {
3220
3244
  return Z({
3221
3245
  signature: "event CreatedAttestation((bytes32 schemaUid, bytes32 attestationUid) result)"
3222
3246
  });
3223
3247
  }
3224
- function Is() {
3248
+ function Ps() {
3225
3249
  return Z({
3226
3250
  signature: "event SeedPublished(bytes32 seedUid, bytes32 versionUid)"
3227
3251
  });
@@ -3229,11 +3253,11 @@ function Is() {
3229
3253
  function oe(e) {
3230
3254
  return e == null || e === "" ? N : ("0x" + (e.startsWith("0x") ? e.slice(2) : e).replace(/[^0-9a-fA-F]/g, "0").padStart(64, "0").slice(-64)).toLowerCase();
3231
3255
  }
3232
- function en(e, t, n) {
3256
+ function nn(e, t, n) {
3233
3257
  if (!t || !e.logs?.length) return;
3234
3258
  const a = oe(t);
3235
3259
  if (a === N) return;
3236
- const r = n ? Bt : Ft;
3260
+ const r = n ? kt : Bt;
3237
3261
  try {
3238
3262
  const s = Oe({
3239
3263
  logs: e.logs,
@@ -3250,23 +3274,23 @@ function en(e, t, n) {
3250
3274
  } catch {
3251
3275
  }
3252
3276
  }
3253
- function Kn(e, t, n, a) {
3277
+ function Qn(e, t, n, a) {
3254
3278
  const r = t.toLowerCase(), s = e.logs?.filter((o) => o.address && o.address.toLowerCase() === r);
3255
3279
  if (!s?.length) return {};
3256
3280
  try {
3257
3281
  const c = Oe({
3258
3282
  logs: s,
3259
- events: [(a ? Is : ms)()],
3283
+ events: [(a ? Ps : fs)()],
3260
3284
  strict: !1
3261
3285
  })[0];
3262
3286
  if (!c) return {};
3263
3287
  if (a) {
3264
- const U = c.args, v = U?.seedUid && oe(U.seedUid) !== N ? U.seedUid : void 0, y = U?.versionUid && oe(U.versionUid) !== N ? U.versionUid : void 0;
3288
+ const T = c.args, v = T?.seedUid && oe(T.seedUid) !== N ? T.seedUid : void 0, y = T?.versionUid && oe(T.versionUid) !== N ? T.versionUid : void 0;
3265
3289
  return { seedUid: v, versionUid: y };
3266
3290
  }
3267
3291
  const p = c.args?.returnedDataFromEAS;
3268
3292
  if (!p || p === "0x") return {};
3269
- const d = $a([{ type: "bytes32[]" }], p)[0];
3293
+ const d = qa([{ type: "bytes32[]" }], p)[0];
3270
3294
  if (!d?.length) return {};
3271
3295
  const m = n, l = d[m], g = d[m + 1];
3272
3296
  return { seedUid: l && l !== N ? l : d.length === 1 && d[0] && d[0] !== N ? d[0] : void 0, versionUid: g && g !== N ? g : void 0 };
@@ -3274,19 +3298,19 @@ function Kn(e, t, n, a) {
3274
3298
  return {};
3275
3299
  }
3276
3300
  }
3277
- function tn(e, t, n, a) {
3278
- return Kn(
3301
+ function an(e, t, n, a) {
3302
+ return Qn(
3279
3303
  e,
3280
3304
  t,
3281
3305
  n,
3282
3306
  a
3283
3307
  ).seedUid;
3284
3308
  }
3285
- function Zn(e, t, n) {
3309
+ function Xn(e, t, n) {
3286
3310
  if (!t || !e.logs?.length) return;
3287
3311
  const a = oe(t);
3288
3312
  if (a === N) return;
3289
- const r = n ? Bt : Ft;
3313
+ const r = n ? kt : Bt;
3290
3314
  try {
3291
3315
  const s = Oe({
3292
3316
  logs: e.logs,
@@ -3303,9 +3327,9 @@ function Zn(e, t, n) {
3303
3327
  } catch {
3304
3328
  }
3305
3329
  }
3306
- function Ps(e, t) {
3330
+ function Us(e, t) {
3307
3331
  if (!e.logs?.length) return [];
3308
- const n = t ? Bt : Ft;
3332
+ const n = t ? kt : Bt;
3309
3333
  try {
3310
3334
  const a = Oe({
3311
3335
  logs: e.logs,
@@ -3344,7 +3368,7 @@ const be = 64, F = (e) => {
3344
3368
  return "0x" + Array.from(t).map((a) => a.toString(16).padStart(2, "0")).join("").padStart(be, "0").slice(-be);
3345
3369
  }
3346
3370
  return "0x" + "0".repeat(be);
3347
- }, Us = (e) => {
3371
+ }, Ts = (e) => {
3348
3372
  if (e == null || typeof e == "string" && (e === "" || e === "0x")) return "0x";
3349
3373
  if (typeof e == "string") {
3350
3374
  const n = (e.startsWith("0x") ? e.slice(2) : e).replace(/[^0-9a-fA-F]/g, "0");
@@ -3356,7 +3380,7 @@ const be = 64, F = (e) => {
3356
3380
  }
3357
3381
  return "0x";
3358
3382
  };
3359
- function Ts(e) {
3383
+ function Ds(e) {
3360
3384
  const t = new Set(
3361
3385
  e.map((n) => n?.localId).filter((n) => !!n)
3362
3386
  );
@@ -3367,20 +3391,20 @@ function Ts(e) {
3367
3391
  })
3368
3392
  );
3369
3393
  }
3370
- function Ds(e, t) {
3394
+ function _s(e, t) {
3371
3395
  return (e ?? []).filter(
3372
3396
  (n) => n.publishLocalId && t.has(n.publishLocalId)
3373
3397
  );
3374
3398
  }
3375
- const _s = {
3376
- recipient: vt,
3399
+ const Cs = {
3400
+ recipient: St,
3377
3401
  expirationTime: BigInt(0),
3378
3402
  revocable: !0,
3379
3403
  refUID: N,
3380
3404
  data: N,
3381
3405
  value: BigInt(0)
3382
3406
  };
3383
- function ut(e) {
3407
+ function pt(e) {
3384
3408
  const t = (e?.listOfAttestations ?? []).map((a) => {
3385
3409
  const r = Array.isArray(a?.data) ? a.data : [];
3386
3410
  return {
@@ -3388,7 +3412,7 @@ function ut(e) {
3388
3412
  data: r.map((s) => ({
3389
3413
  ...s,
3390
3414
  refUID: F(s?.refUID),
3391
- data: Us(s?.data),
3415
+ data: Ts(s?.data),
3392
3416
  expirationTime: s?.expirationTime != null ? BigInt(s.expirationTime) : BigInt(0),
3393
3417
  value: s?.value != null ? BigInt(s.value) : BigInt(0)
3394
3418
  })),
@@ -3409,7 +3433,7 @@ function ut(e) {
3409
3433
  propertiesToUpdate: n
3410
3434
  };
3411
3435
  }
3412
- function nn(e, t) {
3436
+ function rn(e, t) {
3413
3437
  for (const n of e)
3414
3438
  for (const a of n?.propertiesToUpdate ?? []) {
3415
3439
  const r = a?.publishLocalId, s = F(a?.propertySchemaUid);
@@ -3419,11 +3443,11 @@ function nn(e, t) {
3419
3443
  const i = o.listOfAttestations.find(
3420
3444
  (c) => F(c?.schema)?.toLowerCase() === s?.toLowerCase()
3421
3445
  );
3422
- i && (!Array.isArray(i.data) || i.data.length === 0) && (i.data = [{ ..._s, refUID: N }]);
3446
+ i && (!Array.isArray(i.data) || i.data.length === 0) && (i.data = [{ ...Cs, refUID: N }]);
3423
3447
  }
3424
3448
  }
3425
- const Cs = "pending_l1";
3426
- async function Qn(e) {
3449
+ const Rs = "pending_l1";
3450
+ async function ea(e) {
3427
3451
  const { useArweaveBundler: t } = L();
3428
3452
  if (!t) return;
3429
3453
  const n = e.arweaveTransactions ?? [], a = e.publishUploads ?? [];
@@ -3437,12 +3461,12 @@ async function Qn(e) {
3437
3461
  const u = i.transaction?.id;
3438
3462
  if (!(!u || typeof u != "string"))
3439
3463
  try {
3440
- await r.insert(We).values({
3464
+ await r.insert(je).values({
3441
3465
  seedLocalId: c.seedLocalId,
3442
3466
  dataItemId: u,
3443
3467
  versionLocalId: c.versionLocalId ?? null,
3444
3468
  itemPropertyName: c.itemPropertyName ?? null,
3445
- phase: Cs,
3469
+ phase: Rs,
3446
3470
  createdAt: s,
3447
3471
  updatedAt: s
3448
3472
  }).onConflictDoNothing();
@@ -3450,27 +3474,27 @@ async function Qn(e) {
3450
3474
  }
3451
3475
  }
3452
3476
  }
3453
- const Rs = "Modular (EIP-7702) wallet is not connected. Sign in with the same method and try again.", Ls = "Your modular account is not upgraded to an EIP-7702 smart account on Optimism Sepolia yet. Enable autoDeployEip7702ModularAccount in publish config or complete wallet setup, then retry.", xs = "Automatic EIP-7702 smart account setup failed on Optimism Sepolia. Retry or reconnect your wallet.", Ms = "EIP-7702 upgrade was sent but on-chain bytecode was not detected yet. Wait a moment and retry.";
3454
- async function Xn() {
3477
+ const Ls = "Modular (EIP-7702) wallet is not connected. Sign in with the same method and try again.", xs = "Your modular account is not upgraded to an EIP-7702 smart account on Optimism Sepolia yet. Enable autoDeployEip7702ModularAccount in publish config or complete wallet setup, then retry.", Ms = "Automatic EIP-7702 smart account setup failed on Optimism Sepolia. Retry or reconnect your wallet.", Ns = "EIP-7702 upgrade was sent but on-chain bytecode was not detected yet. Wait a moment and retry.";
3478
+ async function ta() {
3455
3479
  const { autoDeployEip7702ModularAccount: e } = L(), t = Fe();
3456
3480
  await t.autoConnect({ client: x(), chain: E });
3457
3481
  const n = t.getAccount();
3458
3482
  if (!n)
3459
- throw new Re(Rs, "EIP7702_MODULAR_ACCOUNT_UNAVAILABLE");
3483
+ throw new Re(Ls, "EIP7702_MODULAR_ACCOUNT_UNAVAILABLE");
3460
3484
  const a = x(), r = J({
3461
3485
  client: a,
3462
3486
  chain: E,
3463
3487
  address: n.address
3464
3488
  });
3465
- if (!await bt(r)) {
3489
+ if (!await At(r)) {
3466
3490
  if (!e)
3467
3491
  throw new Re(
3468
- Ls,
3492
+ xs,
3469
3493
  "EIP7702_MODULAR_NOT_UPGRADED",
3470
3494
  n.address
3471
3495
  );
3472
3496
  try {
3473
- await Ra({
3497
+ await xa({
3474
3498
  smartAccount: n,
3475
3499
  chain: E,
3476
3500
  client: a,
@@ -3478,27 +3502,27 @@ async function Xn() {
3478
3502
  });
3479
3503
  } catch (s) {
3480
3504
  throw new Re(
3481
- xs,
3505
+ Ms,
3482
3506
  "EIP7702_MODULAR_DEPLOY_FAILED",
3483
3507
  n.address,
3484
3508
  s
3485
3509
  );
3486
3510
  }
3487
- if (!await bt(r))
3511
+ if (!await At(r))
3488
3512
  throw new Re(
3489
- Ms,
3513
+ Ns,
3490
3514
  "EIP7702_MODULAR_NOT_CONFIRMED",
3491
3515
  n.address
3492
3516
  );
3493
3517
  }
3494
3518
  }
3495
- const an = "Could not verify or set the EAS contract address on your publishing account on Optimism Sepolia.";
3496
- function pt(e) {
3519
+ const sn = "Could not verify or set the EAS contract address on your publishing account on Optimism Sepolia.";
3520
+ function mt(e) {
3497
3521
  return e.toLowerCase();
3498
3522
  }
3499
- async function Ns(e, t) {
3500
- const { easContractAddress: n } = L(), a = pt(n);
3501
- if (!a || a === pt(Va))
3523
+ async function Os(e, t) {
3524
+ const { easContractAddress: n } = L(), a = mt(n);
3525
+ if (!a || a === mt(Wa))
3502
3526
  throw new z(
3503
3527
  "Publish config is missing a valid easContractAddress.",
3504
3528
  "MANAGED_ACCOUNT_SET_EAS_FAILED",
@@ -3511,14 +3535,14 @@ async function Ns(e, t) {
3511
3535
  });
3512
3536
  let s;
3513
3537
  try {
3514
- const o = await fs({ contract: r });
3515
- s = pt(typeof o == "string" ? o : String(o));
3538
+ const o = await hs({ contract: r });
3539
+ s = mt(typeof o == "string" ? o : String(o));
3516
3540
  } catch (o) {
3517
- throw new z(an, "MANAGED_ACCOUNT_SET_EAS_FAILED", e, o);
3541
+ throw new z(sn, "MANAGED_ACCOUNT_SET_EAS_FAILED", e, o);
3518
3542
  }
3519
3543
  if (s !== a)
3520
3544
  try {
3521
- const o = hs({
3545
+ const o = gs({
3522
3546
  contract: r,
3523
3547
  eas: n
3524
3548
  }), i = await W({ transaction: o, account: t });
@@ -3528,11 +3552,11 @@ async function Ns(e, t) {
3528
3552
  chain: E
3529
3553
  });
3530
3554
  } catch (o) {
3531
- throw new z(an, "MANAGED_ACCOUNT_SET_EAS_FAILED", e, o);
3555
+ throw new z(sn, "MANAGED_ACCOUNT_SET_EAS_FAILED", e, o);
3532
3556
  }
3533
3557
  }
3534
- const rn = te("seedProtocol:services:publish:actors");
3535
- function sn(e) {
3558
+ const on = te("seedProtocol:services:publish:actors");
3559
+ function cn(e) {
3536
3560
  const {
3537
3561
  useModularExecutor: t,
3538
3562
  publisherAddress: n,
@@ -3552,7 +3576,7 @@ function sn(e) {
3552
3576
  contractAddressForEvents: n
3553
3577
  };
3554
3578
  }
3555
- async function on(e) {
3579
+ async function dn(e) {
3556
3580
  const {
3557
3581
  receipt: t,
3558
3582
  seedLocalId: n,
@@ -3563,11 +3587,11 @@ async function on(e) {
3563
3587
  publisherAddress: i
3564
3588
  } = e;
3565
3589
  if (!n) return;
3566
- const c = Zn(
3590
+ const c = Xn(
3567
3591
  t,
3568
3592
  a,
3569
3593
  o
3570
- ) ?? Kn(
3594
+ ) ?? Qn(
3571
3595
  t,
3572
3596
  r,
3573
3597
  s,
@@ -3575,37 +3599,37 @@ async function on(e) {
3575
3599
  ).versionUid, u = c ? F(c) : void 0;
3576
3600
  if (!u || u === N) return;
3577
3601
  const p = await Se(x(), E, t);
3578
- await wn({
3602
+ await An({
3579
3603
  seedLocalId: n,
3580
3604
  versionUid: u,
3581
3605
  publisher: i,
3582
3606
  attestationCreatedAt: p
3583
3607
  });
3584
3608
  }
3585
- function Os(e, t) {
3609
+ function Fs(e, t) {
3586
3610
  return !e || !t ? !1 : F(e).toLowerCase() === F(t).toLowerCase();
3587
3611
  }
3588
- function cn(e, t, n) {
3589
- return !n || t >= e.length ? t : Os(e[t]?.schemaUid, n) ? t + 1 : t;
3612
+ function ln(e, t, n) {
3613
+ return !n || t >= e.length ? t : Fs(e[t]?.schemaUid, n) ? t + 1 : t;
3590
3614
  }
3591
- async function dn(e) {
3592
- const { receipt: t, normalizedRequests: n, useModularExecutor: a } = e, r = Ps(t, a);
3615
+ async function un(e) {
3616
+ const { receipt: t, normalizedRequests: n, useModularExecutor: a } = e, r = Us(t, a);
3593
3617
  if (!r.length) return;
3594
3618
  const s = await Se(x(), E, t);
3595
3619
  let o = 0;
3596
3620
  for (const i of n) {
3597
3621
  const c = i.listOfAttestations ?? [];
3598
3622
  if (!c.length) continue;
3599
- (!i.seedUid || F(i.seedUid) === N) && (o = cn(r, o, i.seedSchemaUid)), o = cn(r, o, i.versionSchemaUid);
3623
+ (!i.seedUid || F(i.seedUid) === N) && (o = ln(r, o, i.seedSchemaUid)), o = ln(r, o, i.versionSchemaUid);
3600
3624
  const p = c.length, f = r.slice(o, o + p);
3601
3625
  if (o += p, !f.length) continue;
3602
3626
  const d = Math.min(f.length, p);
3603
3627
  let m = i.versionUid && F(i.versionUid) !== N ? F(i.versionUid) : void 0;
3604
- m || (m = Zn(
3628
+ m || (m = Xn(
3605
3629
  t,
3606
3630
  i.versionSchemaUid,
3607
3631
  a
3608
- )), await bn({
3632
+ )), await vn({
3609
3633
  seedLocalId: i.localId,
3610
3634
  attestationCreatedAtMs: s ?? null,
3611
3635
  versionUid: m && F(m) !== N ? F(m) : null,
@@ -3617,7 +3641,7 @@ async function dn(e) {
3617
3641
  });
3618
3642
  }
3619
3643
  }
3620
- const Fs = se(
3644
+ const Bs = se(
3621
3645
  async ({ input: { context: e } }) => {
3622
3646
  const { address: t, account: n } = e, a = e.arweaveTransactions ?? [], r = e.publishUploads ?? [];
3623
3647
  let { item: s } = e;
@@ -3640,11 +3664,11 @@ const Fs = se(
3640
3664
  throw new Error(
3641
3665
  "Attestation recovery failed: Arweave transaction data is missing or incomplete. Delete this publish record and try a full publish from the beginning."
3642
3666
  );
3643
- let f = sn({
3667
+ let f = cn({
3644
3668
  useModularExecutor: !1,
3645
3669
  publisherAddress: t
3646
3670
  }), d = n;
3647
- await Je(s, n, x(), E);
3671
+ await Ke(s, n, x(), E);
3648
3672
  const m = a.map(
3649
3673
  (w, S) => {
3650
3674
  const C = w.transaction?.id;
@@ -3657,13 +3681,13 @@ const Fs = se(
3657
3681
  return { ...D, txId: C };
3658
3682
  }
3659
3683
  );
3660
- await Jn(m.map((w) => w.txId));
3684
+ await Zn(m.map((w) => w.txId));
3661
3685
  const l = await s.getPublishPayload(m, { publishMode: e.publishMode ?? "patch" }), g = Array.isArray(l) ? l : [l];
3662
3686
  if (i) {
3663
- const w = await Gn();
3687
+ const w = await zn();
3664
3688
  if (!w.ok)
3665
3689
  throw w.error;
3666
- f = sn({
3690
+ f = cn({
3667
3691
  useModularExecutor: i,
3668
3692
  publisherAddress: t,
3669
3693
  modularAccountModuleContract: o,
@@ -3671,46 +3695,46 @@ const Fs = se(
3671
3695
  });
3672
3696
  const S = Fe();
3673
3697
  await S.autoConnect({ client: x(), chain: E });
3674
- const T = S.getAccount();
3675
- if (!T)
3698
+ const I = S.getAccount();
3699
+ if (!I)
3676
3700
  throw new Error("Failed to get modular account");
3677
- d = T, await Xn(), await Ns(w.managedAddress, T);
3701
+ d = I, await ta(), await Os(w.managedAddress, I);
3678
3702
  }
3679
3703
  const h = J({
3680
3704
  client: x(),
3681
3705
  chain: E,
3682
3706
  address: f.txTargetAddress
3683
- }), b = g.length > 1 && Ts(g);
3684
- let U, v = null;
3707
+ }), b = g.length > 1 && Ds(g);
3708
+ let T, v = null;
3685
3709
  if (b) {
3686
3710
  let w = structuredClone(g);
3687
3711
  const S = {};
3688
3712
  for (let C = 0; C < w.length; C++) {
3689
- w = await $t(w, S);
3713
+ w = await Vt(w, S);
3690
3714
  const D = w[C], R = /* @__PURE__ */ new Set([D.localId]), ne = {
3691
3715
  ...D,
3692
- propertiesToUpdate: Ds(D.propertiesToUpdate, R)
3693
- }, $ = ut(ne), me = /* @__PURE__ */ new Map([[$.localId, $]]);
3694
- nn([$], me);
3716
+ propertiesToUpdate: _s(D.propertiesToUpdate, R)
3717
+ }, $ = pt(ne), me = /* @__PURE__ */ new Map([[$.localId, $]]);
3718
+ rn([$], me);
3695
3719
  const fe = {
3696
- ...Qt({
3720
+ ...en({
3697
3721
  contract: h,
3698
3722
  requests: [$]
3699
3723
  }),
3700
3724
  gas: 5000000n
3701
- }, Ke = await W({
3725
+ }, Ze = await W({
3702
3726
  account: d,
3703
3727
  transaction: await Promise.resolve(fe)
3704
3728
  }), ie = await j({
3705
3729
  client: x(),
3706
3730
  chain: E,
3707
- transactionHash: Ke.transactionHash
3731
+ transactionHash: Ze.transactionHash
3708
3732
  });
3709
3733
  if (!ie)
3710
3734
  throw new Error("Failed to send transaction");
3711
3735
  v = ie;
3712
3736
  const Ue = $?.listOfAttestations?.length ?? 0;
3713
- await on({
3737
+ await dn({
3714
3738
  receipt: ie,
3715
3739
  seedLocalId: D.localId,
3716
3740
  versionSchemaUid: $.versionSchemaUid,
@@ -3719,17 +3743,17 @@ const Fs = se(
3719
3743
  useModularExecutor: i,
3720
3744
  publisherAddress: t
3721
3745
  });
3722
- const Q = !$.seedUid || F($.seedUid) === N, ia = $?.seedSchemaUid;
3746
+ const Q = !$.seedUid || F($.seedUid) === N, da = $?.seedSchemaUid;
3723
3747
  if (Q) {
3724
- const Ze = en(ie, ia, i) ?? tn(
3748
+ const Qe = nn(ie, da, i) ?? an(
3725
3749
  ie,
3726
3750
  f.contractAddressForEvents,
3727
3751
  Ue,
3728
3752
  i
3729
3753
  );
3730
- Ze && (S[D.localId] = Ze, w[C] = { ...w[C], seedUid: Ze });
3754
+ Qe && (S[D.localId] = Qe, w[C] = { ...w[C], seedUid: Qe });
3731
3755
  }
3732
- await dn({
3756
+ await un({
3733
3757
  receipt: ie,
3734
3758
  normalizedRequests: [$],
3735
3759
  useModularExecutor: i
@@ -3739,19 +3763,19 @@ const Fs = se(
3739
3763
  const D = C?.localId, R = C?.seedUid;
3740
3764
  D && R && F(R) !== N && (S[D] = F(R));
3741
3765
  }
3742
- U = (await $t(structuredClone(g), S)).map(
3743
- (C) => ut({
3766
+ T = (await Vt(structuredClone(g), S)).map(
3767
+ (C) => pt({
3744
3768
  ...C,
3745
3769
  seedUid: S[C.localId] ?? C.seedUid
3746
3770
  })
3747
3771
  );
3748
3772
  } else {
3749
- const w = g.map((Q) => ut(Q)), S = new Map(w.map((Q) => [Q?.localId, Q]));
3750
- nn(w, S);
3751
- const T = Array.isArray(l) ? w : [w[0]], C = {
3752
- ...Qt({
3773
+ const w = g.map((Q) => pt(Q)), S = new Map(w.map((Q) => [Q?.localId, Q]));
3774
+ rn(w, S);
3775
+ const I = Array.isArray(l) ? w : [w[0]], C = {
3776
+ ...en({
3753
3777
  contract: h,
3754
- requests: T
3778
+ requests: I
3755
3779
  }),
3756
3780
  gas: 5000000n
3757
3781
  };
@@ -3762,7 +3786,7 @@ const Fs = se(
3762
3786
  transaction: await Promise.resolve(C)
3763
3787
  });
3764
3788
  } catch (Q) {
3765
- throw rn("sendTransaction failed in non-sequential publish %O", Q), Q;
3789
+ throw on("sendTransaction failed in non-sequential publish %O", Q), Q;
3766
3790
  }
3767
3791
  const R = await j({
3768
3792
  client: x(),
@@ -3773,7 +3797,7 @@ const Fs = se(
3773
3797
  throw new Error("Failed to send transaction");
3774
3798
  v = R;
3775
3799
  const ne = w.find((Q) => Q?.localId === s.seedLocalId) ?? w[0];
3776
- await on({
3800
+ await dn({
3777
3801
  receipt: R,
3778
3802
  seedLocalId: ne?.localId,
3779
3803
  versionSchemaUid: ne?.versionSchemaUid,
@@ -3781,26 +3805,26 @@ const Fs = se(
3781
3805
  listOfAttestationsCount: ne?.listOfAttestations?.length ?? 0,
3782
3806
  useModularExecutor: i,
3783
3807
  publisherAddress: t
3784
- }), await dn({
3808
+ }), await un({
3785
3809
  receipt: R,
3786
- normalizedRequests: T,
3810
+ normalizedRequests: I,
3787
3811
  useModularExecutor: i
3788
3812
  });
3789
- const $ = w[0], me = $?.seedUid, fe = me === N || !me, Ke = $?.listOfAttestations?.length ?? 0, ie = $?.seedSchemaUid, Ue = fe ? en(R, ie, i) ?? tn(
3813
+ const $ = w[0], me = $?.seedUid, fe = me === N || !me, Ze = $?.listOfAttestations?.length ?? 0, ie = $?.seedSchemaUid, Ue = fe ? nn(R, ie, i) ?? an(
3790
3814
  R,
3791
3815
  f.contractAddressForEvents,
3792
- Ke,
3816
+ Ze,
3793
3817
  i
3794
3818
  ) : void 0;
3795
- U = Ue && w.length > 0 ? [{ ...w[0], seedUid: Ue }, ...w.slice(1)] : w;
3819
+ T = Ue && w.length > 0 ? [{ ...w[0], seedUid: Ue }, ...w.slice(1)] : w;
3796
3820
  }
3797
- Yn(s, U);
3798
- const y = s, P = U.find((w) => w?.localId === s.seedLocalId)?.seedUid;
3799
- if (P && P !== N) {
3821
+ Jn(s, T);
3822
+ const y = s, U = T.find((w) => w?.localId === s.seedLocalId)?.seedUid;
3823
+ if (U && U !== N) {
3800
3824
  const w = v ? await Se(x(), E, v) : void 0;
3801
- await zn(y, t, w);
3825
+ await Kn(y, t, w);
3802
3826
  }
3803
- rn("requestData", l), Qn(e);
3827
+ on("requestData", l), ea(e);
3804
3828
  try {
3805
3829
  const { clearHtmlEmbeddedImageCoPublishRows: w } = await import("@seedprotocol/sdk");
3806
3830
  await w(s.seedLocalId);
@@ -3808,31 +3832,31 @@ const Fs = se(
3808
3832
  }
3809
3833
  return { easPayload: l };
3810
3834
  }
3811
- ), ln = te("seedProtocol:services:publish:verifyAttestations"), Bs = "0x" + "0".repeat(64), $e = 64, un = (e) => e == null ? "0x" + "0".repeat($e) : typeof e == "string" ? "0x" + (e.startsWith("0x") ? e.slice(2) : e).replace(/[^0-9a-fA-F]/g, "0").padStart($e, "0").slice(-$e) : "0x" + "0".repeat($e), ks = 5e3, mt = 6;
3812
- async function Hs({
3835
+ ), pn = te("seedProtocol:services:publish:verifyAttestations"), ks = "0x" + "0".repeat(64), Ve = 64, mn = (e) => e == null ? "0x" + "0".repeat(Ve) : typeof e == "string" ? "0x" + (e.startsWith("0x") ? e.slice(2) : e).replace(/[^0-9a-fA-F]/g, "0").padStart(Ve, "0").slice(-Ve) : "0x" + "0".repeat(Ve), Hs = 5e3, ft = 6;
3836
+ async function $s({
3813
3837
  normalizedRequests: e,
3814
3838
  item: t
3815
3839
  }) {
3816
3840
  const n = t.seedLocalId;
3817
3841
  for (const a of e) {
3818
- if (a.listOfAttestations.length === 0 || a.versionUid === Bs) continue;
3842
+ if (a.listOfAttestations.length === 0 || a.versionUid === ks) continue;
3819
3843
  const r = a.listOfAttestations.map(
3820
- (p) => un(p.schema).toLowerCase()
3844
+ (p) => mn(p.schema).toLowerCase()
3821
3845
  );
3822
3846
  let s = [], o;
3823
- for (let p = 1; p <= mt; p++)
3847
+ for (let p = 1; p <= ft; p++)
3824
3848
  try {
3825
- p > 1 && await new Promise((f) => setTimeout(f, ks)), s = await Ua({
3849
+ p > 1 && await new Promise((f) => setTimeout(f, Hs)), s = await Da({
3826
3850
  versionUids: [a.versionUid]
3827
3851
  });
3828
3852
  break;
3829
3853
  } catch (f) {
3830
- if (o = f, ln("verifyAttestations attempt %d failed:", p, f), p === mt)
3831
- throw ln("verifyAttestations: giving up after %d attempts", mt), o;
3854
+ if (o = f, pn("verifyAttestations attempt %d failed:", p, f), p === ft)
3855
+ throw pn("verifyAttestations: giving up after %d attempts", ft), o;
3832
3856
  }
3833
- const i = s.map((p) => p.schemaId ? un(p.schemaId).toLowerCase() : "").filter(Boolean), c = new Set(i);
3857
+ const i = s.map((p) => p.schemaId ? mn(p.schemaId).toLowerCase() : "").filter(Boolean), c = new Set(i);
3834
3858
  if (r.filter((p) => !c.has(p)).length > 0)
3835
- throw new Mn(
3859
+ throw new On(
3836
3860
  `Publish verification failed: Seed and Version attestations were created, but property/metadata attestations are missing or incomplete. Expected ${r.length} property attestations for schema(s) ${r.join(", ")}; found ${i.length}. Use PublishManager.retryAttestations('${n}') to retry.`,
3837
3861
  n,
3838
3862
  r,
@@ -3850,7 +3874,7 @@ const De = te("seedProtocol:services:publish:createAttestationsDirectToEas"), Ae
3850
3874
  return "0x" + Array.from(t).map((a) => a.toString(16).padStart(2, "0")).join("").padStart(Ae, "0").slice(-Ae);
3851
3875
  }
3852
3876
  return "0x" + "0".repeat(Ae);
3853
- }, $s = (e) => {
3877
+ }, Vs = (e) => {
3854
3878
  if (e == null || typeof e == "string" && (e === "" || e === "0x")) return "0x";
3855
3879
  if (typeof e == "string") {
3856
3880
  const n = (e.startsWith("0x") ? e.slice(2) : e).replace(/[^0-9a-fA-F]/g, "0");
@@ -3861,7 +3885,7 @@ const De = te("seedProtocol:services:publish:createAttestationsDirectToEas"), Ae
3861
3885
  return "0x" + Array.from(t).map((n) => n.toString(16).padStart(2, "0")).join("");
3862
3886
  }
3863
3887
  return "0x";
3864
- }, Vs = async (e) => {
3888
+ }, qs = async (e) => {
3865
3889
  let t;
3866
3890
  try {
3867
3891
  t = await le.find({ seedLocalId: e });
@@ -3877,7 +3901,7 @@ const De = te("seedProtocol:services:publish:createAttestationsDirectToEas"), Ae
3877
3901
  }
3878
3902
  }, 200);
3879
3903
  });
3880
- }, qs = se(
3904
+ }, Ws = se(
3881
3905
  async ({ input: { context: e, event: t } }) => {
3882
3906
  const { address: n, account: a } = e, r = e.arweaveTransactions ?? [], s = e.publishUploads ?? [];
3883
3907
  let { item: o } = e;
@@ -3889,42 +3913,42 @@ const De = te("seedProtocol:services:publish:createAttestationsDirectToEas"), Ae
3889
3913
  throw new Error(
3890
3914
  "Attestation recovery failed: Item data is missing. Delete this publish record and try a full publish from the beginning."
3891
3915
  );
3892
- typeof o.getPublishUploads != "function" && (o = await Vs(o.seedLocalId));
3916
+ typeof o.getPublishUploads != "function" && (o = await qs(o.seedLocalId));
3893
3917
  const c = r.length, u = s.length;
3894
3918
  if (c !== u)
3895
3919
  throw new Error(
3896
3920
  "Attestation recovery failed: Arweave transaction data is missing or incomplete. Delete this publish record and try a full publish from the beginning."
3897
3921
  );
3898
- await Je(o, a, x(), E);
3922
+ await Ke(o, a, x(), E);
3899
3923
  const p = r.map(
3900
3924
  (v, y) => {
3901
- const P = v.transaction?.id;
3902
- if (!P || typeof P != "string")
3925
+ const U = v.transaction?.id;
3926
+ if (!U || typeof U != "string")
3903
3927
  throw new Error(
3904
3928
  "Attestation recovery failed: Arweave transaction data did not survive restore. Delete this publish record and try a full publish from the beginning."
3905
3929
  );
3906
3930
  const w = s[y];
3907
3931
  if (!w) throw new Error("Publish upload index mismatch");
3908
- return { ...w, txId: P };
3932
+ return { ...w, txId: U };
3909
3933
  }
3910
3934
  );
3911
- await Jn(p.map((v) => v.txId));
3935
+ await Zn(p.map((v) => v.txId));
3912
3936
  const f = await o.getPublishPayload(p, { publishMode: e.publishMode ?? "patch" }), m = (Array.isArray(f) ? f : [f]).map((v) => {
3913
- const y = (v?.listOfAttestations ?? []).map((P) => {
3914
- const w = Array.isArray(P?.data) ? P.data : [];
3937
+ const y = (v?.listOfAttestations ?? []).map((U) => {
3938
+ const w = Array.isArray(U?.data) ? U.data : [];
3915
3939
  return {
3916
- schema: X(P?.schema),
3940
+ schema: X(U?.schema),
3917
3941
  data: w.map((S) => ({
3918
3942
  ...S,
3919
3943
  refUID: X(S?.refUID),
3920
- data: $s(S?.data)
3944
+ data: Vs(S?.data)
3921
3945
  })),
3922
- ...typeof P?._propertyName == "string" && P._propertyName !== "" ? { _propertyName: P._propertyName } : {},
3923
- ...typeof P?._propertyNameForSchema == "string" && P._propertyNameForSchema !== "" ? { _propertyNameForSchema: P._propertyNameForSchema } : {}
3946
+ ...typeof U?._propertyName == "string" && U._propertyName !== "" ? { _propertyName: U._propertyName } : {},
3947
+ ...typeof U?._propertyNameForSchema == "string" && U._propertyNameForSchema !== "" ? { _propertyNameForSchema: U._propertyNameForSchema } : {}
3924
3948
  };
3925
- }), _ = (v?.propertiesToUpdate ?? []).map((P) => ({
3926
- ...P,
3927
- propertySchemaUid: X(P?.propertySchemaUid)
3949
+ }), _ = (v?.propertiesToUpdate ?? []).map((U) => ({
3950
+ ...U,
3951
+ propertySchemaUid: X(U?.propertySchemaUid)
3928
3952
  }));
3929
3953
  return {
3930
3954
  ...v,
@@ -3936,7 +3960,7 @@ const De = te("seedProtocol:services:publish:createAttestationsDirectToEas"), Ae
3936
3960
  propertiesToUpdate: _
3937
3961
  };
3938
3962
  }), l = new Map(m.map((v) => [v.localId, v])), g = {
3939
- recipient: vt,
3963
+ recipient: St,
3940
3964
  expirationTime: BigInt(0),
3941
3965
  revocable: !0,
3942
3966
  refUID: Y,
@@ -3945,12 +3969,12 @@ const De = te("seedProtocol:services:publish:createAttestationsDirectToEas"), Ae
3945
3969
  };
3946
3970
  for (const v of m)
3947
3971
  for (const y of v.propertiesToUpdate ?? []) {
3948
- const _ = y.publishLocalId, P = X(y.propertySchemaUid);
3949
- if (!_ || !P) continue;
3972
+ const _ = y.publishLocalId, U = X(y.propertySchemaUid);
3973
+ if (!_ || !U) continue;
3950
3974
  const w = l.get(_);
3951
3975
  if (!w?.listOfAttestations) continue;
3952
3976
  const S = w.listOfAttestations.find(
3953
- (T) => X(T?.schema)?.toLowerCase() === P?.toLowerCase()
3977
+ (I) => X(I?.schema)?.toLowerCase() === U?.toLowerCase()
3954
3978
  );
3955
3979
  S && (!Array.isArray(S.data) || S.data.length === 0) && (S.data = [{ ...g, refUID: Y }]);
3956
3980
  }
@@ -3958,87 +3982,87 @@ const De = te("seedProtocol:services:publish:createAttestationsDirectToEas"), Ae
3958
3982
  let b = Date.now();
3959
3983
  for (let v = 0; v < m.length; v++) {
3960
3984
  const y = m[v];
3961
- let _ = y.seedUid, P = y.versionUid;
3985
+ let _ = y.seedUid, U = y.versionUid;
3962
3986
  if (_ === Y) {
3963
- const S = Vt(h, E, {
3987
+ const S = qt(h, E, {
3964
3988
  schema: y.seedSchemaUid,
3965
3989
  data: {
3966
3990
  refUID: Y,
3967
- data: ot(y.seedSchemaUid),
3991
+ data: it(y.seedSchemaUid),
3968
3992
  revocable: y.seedIsRevocable
3969
3993
  }
3970
- }), T = await W({ account: a, transaction: S }), C = await j({
3994
+ }), I = await W({ account: a, transaction: S }), C = await j({
3971
3995
  client: h,
3972
3996
  chain: E,
3973
- transactionHash: T.transactionHash
3997
+ transactionHash: I.transactionHash
3974
3998
  });
3975
3999
  if (!C) throw new Error("Failed to create Seed attestation");
3976
4000
  b = await Se(h, E, C);
3977
- const { easContractAddress: D } = L(), R = qt(C, D);
4001
+ const { easContractAddress: D } = L(), R = Wt(C, D);
3978
4002
  if (!R || R === Y)
3979
4003
  throw new Error("Failed to get Seed UID from attestation receipt");
3980
4004
  _ = R, y.seedUid = R, De("created Seed attestation", _);
3981
4005
  }
3982
- if (_ !== Y && P === Y) {
3983
- const S = Vt(h, E, {
4006
+ if (_ !== Y && U === Y) {
4007
+ const S = qt(h, E, {
3984
4008
  schema: y.versionSchemaUid,
3985
4009
  data: {
3986
4010
  refUID: _,
3987
- data: ot(y.versionSchemaUid),
4011
+ data: it(y.versionSchemaUid),
3988
4012
  revocable: !0
3989
4013
  }
3990
- }), T = await W({ account: a, transaction: S }), C = await j({
4014
+ }), I = await W({ account: a, transaction: S }), C = await j({
3991
4015
  client: h,
3992
4016
  chain: E,
3993
- transactionHash: T.transactionHash
4017
+ transactionHash: I.transactionHash
3994
4018
  });
3995
4019
  if (!C) throw new Error("Failed to create Version attestation");
3996
4020
  b = await Se(h, E, C);
3997
- const { easContractAddress: D } = L(), R = qt(C, D);
4021
+ const { easContractAddress: D } = L(), R = Wt(C, D);
3998
4022
  if (!R || R === Y)
3999
4023
  throw new Error("Failed to get Version UID from attestation receipt");
4000
- P = R, y.versionUid = R, await wn({
4024
+ U = R, y.versionUid = R, await An({
4001
4025
  seedLocalId: y.localId,
4002
4026
  versionUid: R,
4003
4027
  publisher: n,
4004
4028
  attestationCreatedAt: b
4005
- }), De("created Version attestation", P);
4029
+ }), De("created Version attestation", U);
4006
4030
  }
4007
4031
  for (const S of y.listOfAttestations)
4008
- for (const T of S.data)
4009
- T.refUID = P;
4032
+ for (const I of S.data)
4033
+ I.refUID = U;
4010
4034
  for (const S of y.propertiesToUpdate ?? []) {
4011
- const T = l.get(S.publishLocalId);
4012
- if (!T?.listOfAttestations) continue;
4013
- const C = X(S.propertySchemaUid), D = T.listOfAttestations.find(
4035
+ const I = l.get(S.publishLocalId);
4036
+ if (!I?.listOfAttestations) continue;
4037
+ const C = X(S.propertySchemaUid), D = I.listOfAttestations.find(
4014
4038
  (R) => X(R?.schema)?.toLowerCase() === C?.toLowerCase()
4015
4039
  );
4016
- D?.data?.[0] && (D.data[0].data = ot(_));
4040
+ D?.data?.[0] && (D.data[0].data = it(_));
4017
4041
  }
4018
4042
  const w = y.listOfAttestations.map((S) => ({
4019
4043
  schema: S.schema,
4020
- data: S.data.map((T) => ({
4021
- recipient: T.recipient ?? vt,
4022
- expirationTime: T.expirationTime ?? 0n,
4023
- revocable: T.revocable ?? !0,
4024
- refUID: T.refUID ?? Y,
4025
- data: T.data ?? "0x",
4026
- value: T.value ?? 0n
4044
+ data: S.data.map((I) => ({
4045
+ recipient: I.recipient ?? St,
4046
+ expirationTime: I.expirationTime ?? 0n,
4047
+ revocable: I.revocable ?? !0,
4048
+ refUID: I.refUID ?? Y,
4049
+ data: I.data ?? "0x",
4050
+ value: I.value ?? 0n
4027
4051
  }))
4028
4052
  }));
4029
4053
  if (w.length > 0) {
4030
- const S = yr(h, E, w), T = await W({ account: a, transaction: S }), C = await j({
4054
+ const S = yr(h, E, w), I = await W({ account: a, transaction: S }), C = await j({
4031
4055
  client: h,
4032
4056
  chain: E,
4033
- transactionHash: T.transactionHash
4057
+ transactionHash: I.transactionHash
4034
4058
  });
4035
4059
  if (!C) throw new Error("Failed to create property attestations");
4036
4060
  b = await Se(h, E, C), De("created property attestations for request", v);
4037
- const { easContractAddress: D } = L(), R = Ln(C, D), ne = y.listOfAttestations, $ = R.length === ne.length;
4038
- await bn({
4061
+ const { easContractAddress: D } = L(), R = Mn(C, D), ne = y.listOfAttestations, $ = R.length === ne.length;
4062
+ await vn({
4039
4063
  seedLocalId: y.localId,
4040
4064
  attestationCreatedAtMs: b ?? null,
4041
- versionUid: P !== Y ? P : null,
4065
+ versionUid: U !== Y ? U : null,
4042
4066
  pairs: R.map((me, fe) => ({
4043
4067
  schemaUid: me.schemaUid,
4044
4068
  attestationUid: me.uid,
@@ -4047,15 +4071,15 @@ const De = te("seedProtocol:services:publish:createAttestationsDirectToEas"), Ae
4047
4071
  });
4048
4072
  }
4049
4073
  }
4050
- Yn(o, m);
4051
- const U = o;
4052
- m[0]?.seedUid && m[0].seedUid !== Y && await zn(U, n, b);
4074
+ Jn(o, m);
4075
+ const T = o;
4076
+ m[0]?.seedUid && m[0].seedUid !== Y && await Kn(T, n, b);
4053
4077
  try {
4054
- await Hs({ normalizedRequests: m, item: o });
4078
+ await $s({ normalizedRequests: m, item: o });
4055
4079
  } catch (v) {
4056
- throw v instanceof Mn || De("verifyAttestations failed (non-verification error):", v), v;
4080
+ throw v instanceof On || De("verifyAttestations failed (non-verification error):", v), v;
4057
4081
  }
4058
- De("direct EAS publish complete"), Qn(e);
4082
+ De("direct EAS publish complete"), ea(e);
4059
4083
  try {
4060
4084
  const { clearHtmlEmbeddedImageCoPublishRows: v } = await import("@seedprotocol/sdk");
4061
4085
  await v(o.seedLocalId);
@@ -4063,7 +4087,7 @@ const De = te("seedProtocol:services:publish:createAttestationsDirectToEas"), Ae
4063
4087
  }
4064
4088
  return { easPayload: f };
4065
4089
  }
4066
- ), Ws = async (e) => {
4090
+ ), js = async (e) => {
4067
4091
  let t;
4068
4092
  try {
4069
4093
  t = await le.find({ seedLocalId: e });
@@ -4078,20 +4102,20 @@ const De = te("seedProtocol:services:publish:createAttestationsDirectToEas"), Ae
4078
4102
  }, 200);
4079
4103
  });
4080
4104
  };
4081
- async function js(e) {
4082
- const n = typeof e.getPublishUploads == "function" ? e : await Ws(e.seedLocalId);
4083
- return await Ta(n);
4105
+ async function Gs(e) {
4106
+ const n = typeof e.getPublishUploads == "function" ? e : await js(e.seedLocalId);
4107
+ return await _a(n);
4084
4108
  }
4085
4109
  const de = /* @__PURE__ */ new Set();
4086
- async function Gs(e) {
4110
+ async function Ys(e) {
4087
4111
  const t = L();
4088
4112
  return t.useDirectEas ? "directEas" : t.useModularExecutor || await Ee(e) ? "multiPublish" : "directEas";
4089
4113
  }
4090
- const Ys = Pe(
4114
+ const zs = Pe(
4091
4115
  ({ sendBack: e, input: { context: t } }) => {
4092
4116
  const { item: n, account: a, publishMode: r, address: s } = t;
4093
4117
  return (async () => {
4094
- if (!await An(n)) {
4118
+ if (!await Sn(n)) {
4095
4119
  e({ type: "notOwner" });
4096
4120
  return;
4097
4121
  }
@@ -4103,8 +4127,8 @@ const Ys = Pe(
4103
4127
  }
4104
4128
  de.add(n.seedLocalId);
4105
4129
  try {
4106
- a && await Je(n, a, x(), E);
4107
- const c = await Da(n, [], {
4130
+ a && await Ke(n, a, x(), E);
4131
+ const c = await Ca(n, [], {
4108
4132
  publishMode: r ?? "patch"
4109
4133
  });
4110
4134
  if (!c.isValid) {
@@ -4120,7 +4144,7 @@ const Ys = Pe(
4120
4144
  }
4121
4145
  let u;
4122
4146
  try {
4123
- u = await Gs(s.trim());
4147
+ u = await Ys(s.trim());
4124
4148
  } catch (m) {
4125
4149
  de.delete(n.seedLocalId), e({
4126
4150
  type: "checkingFailed",
@@ -4131,7 +4155,7 @@ const Ys = Pe(
4131
4155
  });
4132
4156
  return;
4133
4157
  }
4134
- const p = await js(n), f = L().useArweaveBundler, d = { attestationStrategy: u };
4158
+ const p = await Gs(n), f = L().useArweaveBundler, d = { attestationStrategy: u };
4135
4159
  e(p ? f ? { type: "validPublishProcessBundler", ...d } : { type: "validPublishProcess", ...d } : { type: "skipArweave", ...d });
4136
4160
  } catch (c) {
4137
4161
  de.delete(n.seedLocalId), console.error("[checking] failed", c), e({
@@ -4149,7 +4173,7 @@ const Ys = Pe(
4149
4173
  };
4150
4174
  }
4151
4175
  ), {
4152
- SUCCESS: ft,
4176
+ SUCCESS: ht,
4153
4177
  FAILURE: ae
4154
4178
  } = k;
4155
4179
  function _e(e) {
@@ -4164,7 +4188,7 @@ function q(e) {
4164
4188
  const t = e;
4165
4189
  return t.error ?? t.data;
4166
4190
  }
4167
- const ea = In({
4191
+ const na = Un({
4168
4192
  types: {
4169
4193
  context: {},
4170
4194
  input: {}
@@ -4177,10 +4201,10 @@ const ea = In({
4177
4201
  sendReimbursementRequest: ss,
4178
4202
  pollForConfirmation: os,
4179
4203
  uploadData: cs,
4180
- uploadViaBundler: ds,
4181
- createAttestations: Fs,
4182
- createAttestationsDirectToEas: qs,
4183
- checking: Ys,
4204
+ uploadViaBundler: ls,
4205
+ createAttestations: Bs,
4206
+ createAttestationsDirectToEas: Ws,
4207
+ checking: zs,
4184
4208
  preparingHtmlEmbedded: Rr,
4185
4209
  rewritingHtmlEmbedded: xr
4186
4210
  },
@@ -4669,7 +4693,7 @@ ${n.map((s) => s.message).join(`
4669
4693
  src: "createAttestations",
4670
4694
  input: ({ context: e, event: t }) => ({ context: e, event: t }),
4671
4695
  onDone: {
4672
- target: ft,
4696
+ target: ht,
4673
4697
  actions: A({
4674
4698
  easPayload: ({ event: e }) => e.output?.easPayload
4675
4699
  })
@@ -4693,7 +4717,7 @@ ${n.map((s) => s.message).join(`
4693
4717
  src: "createAttestationsDirectToEas",
4694
4718
  input: ({ context: e, event: t }) => ({ context: e, event: t }),
4695
4719
  onDone: {
4696
- target: ft,
4720
+ target: ht,
4697
4721
  actions: A({
4698
4722
  easPayload: ({ event: e }) => e.output?.easPayload
4699
4723
  })
@@ -4718,7 +4742,7 @@ ${n.map((s) => s.message).join(`
4718
4742
  },
4719
4743
  type: "final"
4720
4744
  },
4721
- [ft]: {
4745
+ [ht]: {
4722
4746
  type: "final"
4723
4747
  },
4724
4748
  [ae]: {
@@ -4726,38 +4750,38 @@ ${n.map((s) => s.message).join(`
4726
4750
  }
4727
4751
  }
4728
4752
  });
4729
- let ta = null;
4730
- function zs(e) {
4731
- ta = e;
4753
+ let aa = null;
4754
+ function Js(e) {
4755
+ aa = e;
4732
4756
  }
4733
- function Js() {
4734
- return ta;
4757
+ function Ks() {
4758
+ return aa;
4735
4759
  }
4736
- const pn = te("seedProtocol:services:PublishManager:actors:subscribe");
4737
- function mn(e) {
4760
+ const fn = te("seedProtocol:services:PublishManager:actors:subscribe");
4761
+ function hn(e) {
4738
4762
  const t = e.value;
4739
4763
  return typeof t == "string" ? t : t && typeof t == "object" ? Object.keys(t)[0] ?? "" : "";
4740
4764
  }
4741
- function ht(e) {
4765
+ function gt(e) {
4742
4766
  return sr.includes(e);
4743
4767
  }
4744
- const na = Pe(
4768
+ const ra = Pe(
4745
4769
  ({ receive: e, input: { publishProcess: t, seedLocalId: n } }) => {
4746
- const a = Js();
4770
+ const a = Ks();
4747
4771
  let r = null;
4748
4772
  const s = () => {
4749
4773
  r != null && (clearInterval(r), r = null);
4750
4774
  }, o = (c) => {
4751
- const u = mn(c);
4752
- ht(u) && r == null && a ? r = setInterval(() => {
4775
+ const u = hn(c);
4776
+ gt(u) && r == null && a ? r = setInterval(() => {
4753
4777
  try {
4754
4778
  const p = t.getSnapshot();
4755
4779
  if (p.status === "done") {
4756
4780
  s();
4757
4781
  return;
4758
4782
  }
4759
- const f = mn(p);
4760
- if (!ht(f)) {
4783
+ const f = hn(p);
4784
+ if (!gt(f)) {
4761
4785
  s();
4762
4786
  return;
4763
4787
  }
@@ -4765,15 +4789,15 @@ const na = Pe(
4765
4789
  return;
4766
4790
  }
4767
4791
  a?.savePublish(n, t);
4768
- }, or) : ht(u) || s();
4792
+ }, or) : gt(u) || s();
4769
4793
  }, i = t.subscribe(async (c) => {
4770
- pn("Publish state:", c.value), a && (c.status === "done" ? (s(), a.savePublish(n, t, { triggerPublishDone: !0 })) : (a.savePublish(n, t), o(c)));
4794
+ fn("Publish state:", c.value), a && (c.status === "done" ? (s(), a.savePublish(n, t, { triggerPublishDone: !0 })) : (a.savePublish(n, t), o(c)));
4771
4795
  });
4772
4796
  e(({ type: c }) => {
4773
- c === "UNSUBSCRIBE" && (pn("Received UNSUBSCRIBE event"), s(), i.unsubscribe(), a?.removeSubscription(n));
4797
+ c === "UNSUBSCRIBE" && (fn("Received UNSUBSCRIBE event"), s(), i.unsubscribe(), a?.removeSubscription(n));
4774
4798
  });
4775
4799
  }
4776
- ), Ks = Ye(({ event: e, enqueue: t }) => {
4800
+ ), Zs = ze(({ event: e, enqueue: t }) => {
4777
4801
  const n = e, { item: a, address: r, account: s, options: o } = n;
4778
4802
  if (!(r != null && typeof r == "string" && r.trim().length > 0)) {
4779
4803
  console.warn("[createPublish] No valid wallet address; skipping spawn.");
@@ -4786,7 +4810,7 @@ const na = Pe(
4786
4810
  const f = typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `run_${Date.now()}_${Math.random().toString(36).slice(2, 11)}`, d = L(), m = [
4787
4811
  ...d.arweaveUploadTags ?? [],
4788
4812
  ...o?.arweaveUploadTags ?? []
4789
- ], l = u(ea, {
4813
+ ], l = u(na, {
4790
4814
  input: {
4791
4815
  item: a,
4792
4816
  address: r,
@@ -4812,14 +4836,14 @@ const na = Pe(
4812
4836
  return console.warn(`Publish process with seedLocalId "${a.seedLocalId}" does not exist.`), c;
4813
4837
  if (p && p.has(a.seedLocalId))
4814
4838
  return console.warn(`Subscription with seedLocalId "${a.seedLocalId}" already exists.`), c;
4815
- const m = u(na, {
4839
+ const m = u(ra, {
4816
4840
  input: { publishProcess: d, seedLocalId: a.seedLocalId }
4817
4841
  });
4818
4842
  return p.set(a.seedLocalId, m), {
4819
4843
  subscriptions: new Map(p)
4820
4844
  };
4821
4845
  });
4822
- }), Zs = ({
4846
+ }), Qs = ({
4823
4847
  context: e,
4824
4848
  event: t
4825
4849
  }) => {
@@ -4830,94 +4854,94 @@ const na = Pe(
4830
4854
  }
4831
4855
  s.send({ type: "retry", account: r });
4832
4856
  };
4833
- function Ge(e, t, n) {
4857
+ function Ye(e, t, n) {
4834
4858
  t._parent === e ? n.stopChild(t) : t.stop();
4835
4859
  }
4836
- const Le = te("seedProtocol:services:PublishManager:actors:savePublish"), fn = /* @__PURE__ */ new Map();
4837
- function aa(e, t) {
4838
- const a = (fn.get(e) ?? Promise.resolve()).then(t);
4839
- return fn.set(e, a.catch(() => {
4860
+ const Le = te("seedProtocol:services:PublishManager:actors:savePublish"), gn = /* @__PURE__ */ new Map();
4861
+ function sa(e, t) {
4862
+ const a = (gn.get(e) ?? Promise.resolve()).then(t);
4863
+ return gn.set(e, a.catch(() => {
4840
4864
  })), a;
4841
4865
  }
4842
- function Qs(e) {
4866
+ function Xs(e) {
4843
4867
  return e === "completed" || e === "failed" || e === "interrupted";
4844
4868
  }
4845
- function Xs(e) {
4869
+ function eo(e) {
4846
4870
  return e.status === "done" ? e.value === "success" ? "completed" : e.value === "failure" ? "failed" : "completed" : "in_progress";
4847
4871
  }
4848
- const eo = 500, Ve = 2e3;
4849
- function to(e) {
4872
+ const to = 500, qe = 2e3;
4873
+ function no(e) {
4850
4874
  return JSON.stringify(e, (t, n) => typeof n == "bigint" ? n.toString() : n);
4851
4875
  }
4852
- function hn(e) {
4876
+ function yn(e) {
4853
4877
  if (e == null || typeof e != "object") return;
4854
4878
  const t = e, n = t.snapshot, r = (t.context ?? n?.context)?.publishRunId;
4855
4879
  return typeof r == "string" && r.length > 0 ? r : void 0;
4856
4880
  }
4857
- function no(e, t) {
4881
+ function ao(e, t) {
4858
4882
  if (!e?.error) return {};
4859
4883
  if (t !== "failed" && t !== "in_progress") return {};
4860
- const n = e.error, a = n != null ? (n instanceof Error ? n.message : String(n)).slice(0, eo) : void 0, r = e.errorStep;
4884
+ const n = e.error, a = n != null ? (n instanceof Error ? n.message : String(n)).slice(0, to) : void 0, r = e.errorStep;
4861
4885
  let s;
4862
4886
  if (n instanceof Error && n.stack)
4863
- s = n.stack.slice(0, Ve);
4887
+ s = n.stack.slice(0, qe);
4864
4888
  else if (n != null && typeof n == "object")
4865
4889
  try {
4866
- s = JSON.stringify(n).slice(0, Ve);
4890
+ s = JSON.stringify(n).slice(0, qe);
4867
4891
  } catch {
4868
- s = String(n).slice(0, Ve);
4892
+ s = String(n).slice(0, qe);
4869
4893
  }
4870
- else n != null && (s = String(n).slice(0, Ve));
4894
+ else n != null && (s = String(n).slice(0, qe));
4871
4895
  return { errorMessage: a ?? void 0, errorStep: r, errorDetails: s };
4872
4896
  }
4873
- function ao(e) {
4874
- return aa(e, async () => {
4897
+ function ro(e) {
4898
+ return sa(e, async () => {
4875
4899
  const t = B.getAppDb();
4876
4900
  if (!t) {
4877
4901
  Le("markInProgressPublishInterrupted: DB not ready, skipping");
4878
4902
  return;
4879
4903
  }
4880
- const n = await t.select().from(I).where(Pt(H(I.seedLocalId, e), H(I.status, "in_progress"))).orderBy(ue(I.updatedAt)).limit(1);
4904
+ const n = await t.select().from(P).where(Ut(H(P.seedLocalId, e), H(P.status, "in_progress"))).orderBy(ue(P.updatedAt)).limit(1);
4881
4905
  if (n.length === 0)
4882
4906
  return;
4883
4907
  const a = Date.now();
4884
- await t.update(I).set({
4908
+ await t.update(P).set({
4885
4909
  status: "interrupted",
4886
4910
  completedAt: a,
4887
4911
  updatedAt: a,
4888
4912
  errorMessage: null,
4889
4913
  errorStep: null,
4890
4914
  errorDetails: null
4891
- }).where(H(I.id, n[0].id));
4915
+ }).where(H(P.id, n[0].id));
4892
4916
  });
4893
4917
  }
4894
- const ro = Pe(({ sendBack: e, input: { persistedSnapshot: t, seedLocalId: n, triggerPublishDone: a } }) => {
4918
+ const so = Pe(({ sendBack: e, input: { persistedSnapshot: t, seedLocalId: n, triggerPublishDone: a } }) => {
4895
4919
  Le("savePublish seedLocalId", n);
4896
4920
  const r = t;
4897
- aa(n, async () => {
4921
+ sa(n, async () => {
4898
4922
  const o = B.getAppDb();
4899
4923
  if (!o) {
4900
4924
  Le("savePublish: DB not ready, skipping"), e({ type: "SAVE_PUBLISH_DONE", seedLocalId: n, triggerPublishDone: a });
4901
4925
  return;
4902
4926
  }
4903
- const i = await o.select().from(I).where(Pt(H(I.seedLocalId, n), H(I.status, "in_progress"))).orderBy(ue(I.updatedAt)).limit(1), c = typeof t == "string" ? t : to(t), u = Xs(r), p = Date.now(), f = no(r.context, u);
4927
+ const i = await o.select().from(P).where(Ut(H(P.seedLocalId, n), H(P.status, "in_progress"))).orderBy(ue(P.updatedAt)).limit(1), c = typeof t == "string" ? t : no(t), u = eo(r), p = Date.now(), f = ao(r.context, u);
4904
4928
  if (i.length > 0) {
4905
4929
  const d = i[0];
4906
- await o.update(I).set({
4930
+ await o.update(P).set({
4907
4931
  persistedSnapshot: c,
4908
4932
  status: u,
4909
4933
  updatedAt: p,
4910
4934
  ...r.status === "done" && u !== "in_progress" ? { completedAt: p } : {},
4911
4935
  ...f
4912
- }).where(H(I.id, d.id));
4936
+ }).where(H(P.id, d.id));
4913
4937
  } else {
4914
- const d = hn(r);
4938
+ const d = yn(r);
4915
4939
  if (d != null && u === "in_progress" && r.status !== "done") {
4916
- const b = (await o.select().from(I).where(H(I.seedLocalId, n)).orderBy(ue(I.startedAt)).limit(1))[0];
4917
- if (b && Qs(b.status))
4940
+ const b = (await o.select().from(P).where(H(P.seedLocalId, n)).orderBy(ue(P.startedAt)).limit(1))[0];
4941
+ if (b && Xs(b.status))
4918
4942
  try {
4919
- const U = JSON.parse(b.persistedSnapshot);
4920
- if (hn(U) === d) {
4943
+ const T = JSON.parse(b.persistedSnapshot);
4944
+ if (yn(T) === d) {
4921
4945
  Le(
4922
4946
  "savePublish: skip stale insert — same publishRunId as latest terminal row",
4923
4947
  n,
@@ -4929,7 +4953,7 @@ const ro = Pe(({ sendBack: e, input: { persistedSnapshot: t, seedLocalId: n, tri
4929
4953
  }
4930
4954
  }
4931
4955
  const m = r.context?.item, l = r.context?.modelName ?? m?.modelName ?? "", g = r.context?.schemaId ?? m?.schemaId;
4932
- await o.insert(I).values({
4956
+ await o.insert(P).values({
4933
4957
  seedLocalId: n,
4934
4958
  modelName: l,
4935
4959
  schemaId: g ?? null,
@@ -4946,9 +4970,9 @@ const ro = Pe(({ sendBack: e, input: { persistedSnapshot: t, seedLocalId: n, tri
4946
4970
  }).catch((o) => {
4947
4971
  Le("savePublish error", o), e({ type: "SAVE_PUBLISH_DONE", seedLocalId: n, triggerPublishDone: a });
4948
4972
  });
4949
- }), so = Ye(({ context: e, event: t, enqueue: n, self: a }) => {
4973
+ }), oo = ze(({ context: e, event: t, enqueue: n, self: a }) => {
4950
4974
  const { publishProcesses: r, subscriptions: s } = e, { seedLocalId: o } = t;
4951
- ao(o).catch((f) => {
4975
+ ro(o).catch((f) => {
4952
4976
  console.warn(
4953
4977
  `[stopPublish] Failed to mark publish_processes row interrupted for "${o}":`,
4954
4978
  f
@@ -4959,9 +4983,9 @@ const ro = Pe(({ sendBack: e, input: { persistedSnapshot: t, seedLocalId: n, tri
4959
4983
  console.warn(`Publish process with seedLocalId "${o}" does not exist.`);
4960
4984
  return;
4961
4985
  }
4962
- Ge(a, i, n);
4986
+ Ye(a, i, n);
4963
4987
  const c = s.get(o);
4964
- c && Ge(a, c, n);
4988
+ c && Ye(a, c, n);
4965
4989
  const u = new Map(r);
4966
4990
  u.delete(o);
4967
4991
  const p = new Map(s);
@@ -4969,16 +4993,16 @@ const ro = Pe(({ sendBack: e, input: { persistedSnapshot: t, seedLocalId: n, tri
4969
4993
  publishProcesses: u,
4970
4994
  subscriptions: p
4971
4995
  });
4972
- }), oo = te("seedProtocol:PublishManager:index"), io = Ye(({ context: e, enqueue: t, self: n }) => {
4973
- oo("Stopping all actors..."), e.publishProcesses.forEach((a) => {
4974
- Ge(n, a, t);
4996
+ }), io = te("seedProtocol:PublishManager:index"), co = ze(({ context: e, enqueue: t, self: n }) => {
4997
+ io("Stopping all actors..."), e.publishProcesses.forEach((a) => {
4998
+ Ye(n, a, t);
4975
4999
  }), e.subscriptions.forEach((a) => {
4976
- Ge(n, a, t);
5000
+ Ye(n, a, t);
4977
5001
  }), t.assign({
4978
5002
  publishProcesses: /* @__PURE__ */ new Map(),
4979
5003
  subscriptions: /* @__PURE__ */ new Map()
4980
5004
  });
4981
- }), co = Ye(({ context: e, event: t, enqueue: n }) => {
5005
+ }), lo = ze(({ context: e, event: t, enqueue: n }) => {
4982
5006
  const { seedLocalId: a } = t, r = e.publishProcesses.get(a);
4983
5007
  if (!r) {
4984
5008
  console.warn(`Publish process with seedLocalId "${a}" does not exist.`);
@@ -4994,39 +5018,39 @@ const ro = Pe(({ sendBack: e, input: { persistedSnapshot: t, seedLocalId: n, tri
4994
5018
  publishProcesses: o,
4995
5019
  subscriptions: i
4996
5020
  });
4997
- }), lo = A(({ context: e, event: t }) => {
5021
+ }), uo = A(({ context: e, event: t }) => {
4998
5022
  const { subscriptions: n } = e, { seedLocalId: a, newSubscription: r } = t;
4999
5023
  return r && n.set(a, r), {
5000
5024
  subscriptions: new Map(n)
5001
5025
  };
5002
- }), uo = ["signedDataItems", "arweaveUploadData"];
5003
- function gn(e) {
5026
+ }), po = ["signedDataItems", "arweaveUploadData"];
5027
+ function wn(e) {
5004
5028
  if (e == null || typeof e != "object") return e;
5005
5029
  const t = { ...e };
5006
- for (const n of uo)
5030
+ for (const n of po)
5007
5031
  delete t[n];
5008
5032
  return t;
5009
5033
  }
5010
- function gt(e) {
5034
+ function yt(e) {
5011
5035
  if (e == null || typeof e != "object") return e;
5012
5036
  const t = e, n = { ...t };
5013
- t.context != null && typeof t.context == "object" && (n.context = gn(t.context));
5037
+ t.context != null && typeof t.context == "object" && (n.context = wn(t.context));
5014
5038
  const a = t.snapshot;
5015
5039
  if (a != null && typeof a == "object") {
5016
5040
  const r = a, s = { ...r };
5017
- r.context != null && typeof r.context == "object" && (s.context = gn(r.context)), n.snapshot = s;
5041
+ r.context != null && typeof r.context == "object" && (s.context = wn(r.context)), n.snapshot = s;
5018
5042
  }
5019
5043
  return n;
5020
5044
  }
5021
- function po(e) {
5045
+ function mo(e) {
5022
5046
  try {
5023
5047
  const t = e.getPersistedSnapshot?.() ?? e.getSnapshot();
5024
- return gt(t);
5048
+ return yt(t);
5025
5049
  } catch {
5026
5050
  const t = e.getSnapshot(), n = t.context;
5027
- if (!n?.item) return gt(t);
5051
+ if (!n?.item) return yt(t);
5028
5052
  const a = n.item;
5029
- return gt({
5053
+ return yt({
5030
5054
  ...t,
5031
5055
  context: {
5032
5056
  ...n,
@@ -5039,18 +5063,18 @@ function po(e) {
5039
5063
  });
5040
5064
  }
5041
5065
  }
5042
- const mo = A(({ context: e, event: t, spawn: n }) => {
5066
+ const fo = A(({ context: e, event: t, spawn: n }) => {
5043
5067
  const { publishProcesses: a } = e, { seedLocalId: r, publishProcess: s, triggerPublishDone: o } = t;
5044
5068
  if (!s)
5045
5069
  return e;
5046
5070
  const i = new Map(a);
5047
5071
  i.set(r, s);
5048
- const c = po(s);
5049
- return n(ro, {
5072
+ const c = mo(s);
5073
+ return n(so, {
5050
5074
  id: `savePublish_${r}_${Date.now()}`,
5051
5075
  input: { persistedSnapshot: c, seedLocalId: r, triggerPublishDone: o }
5052
5076
  }), { publishProcesses: i };
5053
- }), fo = A(({ context: e, event: t }) => {
5077
+ }), ho = A(({ context: e, event: t }) => {
5054
5078
  const { publishProcesses: n, subscriptions: a } = e, r = t.seedLocalId, s = a.get(r);
5055
5079
  s && s.send({ type: "UNSUBSCRIBE" });
5056
5080
  const o = new Map(n);
@@ -5060,26 +5084,26 @@ const mo = A(({ context: e, event: t, spawn: n }) => {
5060
5084
  publishProcesses: o,
5061
5085
  subscriptions: i
5062
5086
  };
5063
- }), ho = A(({ context: e, event: t }) => {
5087
+ }), go = A(({ context: e, event: t }) => {
5064
5088
  const { subscriptions: n } = e, a = t.seedLocalId, r = new Map(n);
5065
5089
  return r.delete(a), {
5066
5090
  subscriptions: r
5067
5091
  };
5068
- }), go = 6e4, yo = 2e3;
5069
- async function wo(e) {
5092
+ }), yo = 6e4, wo = 2e3;
5093
+ async function bo(e) {
5070
5094
  const t = Date.now() + e;
5071
5095
  for (; Date.now() < t; ) {
5072
5096
  if (B.PlatformClass && B.getAppDb()) return !0;
5073
- await new Promise((n) => setTimeout(n, yo));
5097
+ await new Promise((n) => setTimeout(n, wo));
5074
5098
  }
5075
5099
  return !1;
5076
5100
  }
5077
- function bo(e) {
5101
+ function Ao(e) {
5078
5102
  const t = e.value;
5079
5103
  return typeof t == "string" ? t : t && typeof t == "object" ? Object.keys(t)[0] ?? "" : "";
5080
5104
  }
5081
- function Ao(e) {
5082
- const t = bo(e);
5105
+ function vo(e) {
5106
+ const t = Ao(e);
5083
5107
  if (t === "pollingForConfirmation" && (!e.context?.reimbursementTransactionId || !e.context?.requestResponse))
5084
5108
  return !1;
5085
5109
  if (t === "uploadingData") {
@@ -5088,13 +5112,13 @@ function Ao(e) {
5088
5112
  }
5089
5113
  return !0;
5090
5114
  }
5091
- function vo(e) {
5115
+ function So(e) {
5092
5116
  return e !== null && typeof e == "object" && "xstate$$type" in e && e.xstate$$type === 1 && typeof e.id == "string";
5093
5117
  }
5094
- function So(e, t, n) {
5118
+ function Eo(e, t, n) {
5095
5119
  e.context = e.context ?? {};
5096
5120
  const a = e.context.item;
5097
- if (vo(a)) {
5121
+ if (So(a)) {
5098
5122
  e.context.item = {
5099
5123
  seedLocalId: t,
5100
5124
  modelName: e.context.modelName ?? n.modelName ?? "",
@@ -5109,16 +5133,16 @@ function So(e, t, n) {
5109
5133
  schemaId: a?.schemaId ?? e.context.schemaId ?? n.schemaId ?? void 0
5110
5134
  };
5111
5135
  }
5112
- const Eo = Pe(
5136
+ const Io = Pe(
5113
5137
  ({ sendBack: e, input: { context: t } }) => {
5114
5138
  (async () => {
5115
5139
  const a = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
5116
- if (!await wo(go))
5140
+ if (!await bo(yo))
5117
5141
  return e({ type: "RESTORE_FROM_DB_DONE", publishProcesses: a, subscriptions: r }), { newPublishProcesses: a, newSubscriptions: r };
5118
5142
  const o = B.getAppDb();
5119
5143
  if (!o)
5120
5144
  return e({ type: "RESTORE_FROM_DB_DONE", publishProcesses: a, subscriptions: r }), { newPublishProcesses: a, newSubscriptions: r };
5121
- const i = await o.select().from(I).where(H(I.status, "in_progress")), c = /* @__PURE__ */ new Map(), u = [...i].sort(
5145
+ const i = await o.select().from(P).where(H(P.status, "in_progress")), c = /* @__PURE__ */ new Map(), u = [...i].sort(
5122
5146
  (f, d) => (d.updatedAt ?? d.createdAt ?? 0) - (f.updatedAt ?? f.createdAt ?? 0)
5123
5147
  );
5124
5148
  for (const f of u)
@@ -5133,12 +5157,12 @@ const Eo = Pe(
5133
5157
  }
5134
5158
  if (d.status === "done") continue;
5135
5159
  const m = d.context?.item?.seedLocalId ?? f.seedLocalId;
5136
- if (!m || !Ao(d)) continue;
5137
- So(d, m, f);
5138
- const l = At(ea, {
5160
+ if (!m || !vo(d)) continue;
5161
+ Eo(d, m, f);
5162
+ const l = vt(na, {
5139
5163
  snapshot: d,
5140
5164
  input: void 0
5141
- }), g = At(na, {
5165
+ }), g = vt(ra, {
5142
5166
  input: {
5143
5167
  publishProcess: l,
5144
5168
  seedLocalId: m
@@ -5157,26 +5181,26 @@ const Eo = Pe(
5157
5181
  });
5158
5182
  });
5159
5183
  }
5160
- ), ra = te("seedProtocol:PublishManager:index"), Io = In({
5184
+ ), oa = te("seedProtocol:PublishManager:index"), Po = Un({
5161
5185
  types: {
5162
5186
  context: {},
5163
5187
  input: {},
5164
5188
  events: {}
5165
5189
  },
5166
5190
  actors: {
5167
- restoreFromDb: Eo
5191
+ restoreFromDb: Io
5168
5192
  },
5169
5193
  actions: {
5170
5194
  assignRestoreFromDb: Dr,
5171
- createPublish: Ks,
5172
- addSubscription: lo,
5173
- requestSavePublish: mo,
5174
- publishDone: fo,
5175
- removeSubscription: ho,
5176
- retryAttestations: Zs,
5177
- stopPublish: so,
5178
- stopAll: io,
5179
- query: co
5195
+ createPublish: Zs,
5196
+ addSubscription: uo,
5197
+ requestSavePublish: fo,
5198
+ publishDone: ho,
5199
+ removeSubscription: go,
5200
+ retryAttestations: Qs,
5201
+ stopPublish: oo,
5202
+ stopAll: co,
5203
+ query: lo
5180
5204
  }
5181
5205
  }).createMachine({
5182
5206
  id: "publishManager",
@@ -5236,13 +5260,13 @@ const Eo = Pe(
5236
5260
  }
5237
5261
  }
5238
5262
  }
5239
- }), V = At(Io, {
5263
+ }), V = vt(Po, {
5240
5264
  input: {
5241
5265
  publishProcesses: /* @__PURE__ */ new Map(),
5242
5266
  subscriptions: /* @__PURE__ */ new Map()
5243
5267
  }
5244
5268
  });
5245
- zs({
5269
+ Js({
5246
5270
  savePublish: (e, t, n) => {
5247
5271
  V.send({
5248
5272
  type: "REQUEST_SAVE_PUBLISH",
@@ -5258,13 +5282,13 @@ zs({
5258
5282
  V.send({ type: "REMOVE_SUBSCRIPTION", seedLocalId: e });
5259
5283
  }
5260
5284
  });
5261
- const Po = V.subscribe((e) => {
5262
- ra("PublishManager snapshot:", e);
5285
+ const Uo = V.subscribe((e) => {
5286
+ oa("PublishManager snapshot:", e);
5263
5287
  });
5264
5288
  typeof document < "u" && (V.start(), window.addEventListener("load", () => {
5265
- ra("PublishManager started");
5289
+ oa("PublishManager started");
5266
5290
  }), window.addEventListener("beforeunload", () => {
5267
- Po.unsubscribe(), V.stop();
5291
+ Uo.unsubscribe(), V.stop();
5268
5292
  }));
5269
5293
  const Ne = {
5270
5294
  getService: () => V,
@@ -5277,20 +5301,20 @@ const Ne = {
5277
5301
  savePublish: (e, t) => V.send({ type: "REQUEST_SAVE_PUBLISH", seedLocalId: e, publishProcess: t }),
5278
5302
  addSubscription: (e, t) => V.send({ type: "ADD_SUBSCRIPTION", seedLocalId: e, newSubscription: t }),
5279
5303
  removeSubscription: (e) => V.send({ type: "REMOVE_SUBSCRIPTION", seedLocalId: e })
5280
- }, yt = "seedProtocol:publish:userChoseWalletDisconnect";
5281
- function qe(e) {
5304
+ }, wt = "seedProtocol:publish:userChoseWalletDisconnect";
5305
+ function We(e) {
5282
5306
  console.error("[ConnectButton] Wallet setup / module install failed:", e), L().onWalletSetupWarning?.(e);
5283
5307
  }
5284
- function Uo() {
5285
- return wt.isInitialized() ? Promise.resolve() : new Promise((e) => {
5286
- wt.onReady(() => e());
5308
+ function To() {
5309
+ return bt.isInitialized() ? Promise.resolve() : new Promise((e) => {
5310
+ bt.onReady(() => e());
5287
5311
  });
5288
5312
  }
5289
- async function To(e, t, n) {
5313
+ async function Do(e, t, n) {
5290
5314
  if (n.modularAccountModuleContract) {
5291
5315
  if (n.useModularExecutor) {
5292
5316
  if (!t) {
5293
- qe(
5317
+ We(
5294
5318
  new Error(
5295
5319
  "Executor module: managed account address not available yet (managed wallet may still be syncing)."
5296
5320
  )
@@ -5298,28 +5322,28 @@ async function To(e, t, n) {
5298
5322
  return;
5299
5323
  }
5300
5324
  try {
5301
- const a = ze();
5325
+ const a = Je();
5302
5326
  await a.autoConnect({ client: x(), chain: E });
5303
5327
  const r = a.getAccount();
5304
5328
  if (!r) {
5305
- qe(new Error("Executor module: managed wallet has no account"));
5329
+ We(new Error("Executor module: managed wallet has no account"));
5306
5330
  return;
5307
5331
  }
5308
- await St(t, r, n);
5332
+ await Et(t, r, n);
5309
5333
  } catch (a) {
5310
- qe(a);
5334
+ We(a);
5311
5335
  }
5312
5336
  return;
5313
5337
  }
5314
5338
  try {
5315
- await St(e.address, e, n);
5339
+ await Et(e.address, e, n);
5316
5340
  } catch (a) {
5317
- qe(a);
5341
+ We(a);
5318
5342
  }
5319
5343
  }
5320
5344
  }
5321
5345
  const ac = () => {
5322
- const e = Ur(), t = xa(), n = Sn(), a = Ma(), r = Na(), s = xe(null), o = xe(!1), i = xe(!1);
5346
+ const e = Ur(), t = Na(), n = In(), a = Oa(), r = Fa(), s = xe(null), o = xe(!1), i = xe(!1);
5323
5347
  ee(() => {
5324
5348
  if (typeof window > "u") return;
5325
5349
  const f = o.current;
@@ -5333,25 +5357,25 @@ const ac = () => {
5333
5357
  if (d !== "reload") return;
5334
5358
  let m = !1;
5335
5359
  try {
5336
- m = sessionStorage.getItem(yt) === "1";
5360
+ m = sessionStorage.getItem(wt) === "1";
5337
5361
  } catch {
5338
5362
  m = !1;
5339
5363
  }
5340
5364
  m || !f || r || a !== "disconnected" || i.current || (i.current = !0, Fe().autoConnect({ client: x(), chain: E }).catch(() => {
5341
5365
  }));
5342
5366
  }, [a, r]);
5343
- const c = Ha(
5367
+ const c = Va(
5344
5368
  async (f) => {
5345
5369
  const d = f.getAccount();
5346
5370
  if (!d)
5347
5371
  return;
5348
- await Uo(), Ne.stopAll();
5372
+ await To(), Ne.stopAll();
5349
5373
  const m = /* @__PURE__ */ new Set([d.address.toLowerCase()]);
5350
5374
  let l;
5351
5375
  if (e.useModularExecutor) {
5352
5376
  const h = async () => {
5353
5377
  try {
5354
- return await Tt(E);
5378
+ return await Dt(E);
5355
5379
  } catch {
5356
5380
  return;
5357
5381
  }
@@ -5362,11 +5386,11 @@ const ac = () => {
5362
5386
  if (s.current !== g) {
5363
5387
  s.current = g;
5364
5388
  try {
5365
- await wt.setAddresses({ owned: [...m] });
5389
+ await bt.setAddresses({ owned: [...m] });
5366
5390
  } catch (h) {
5367
5391
  throw s.current = null, console.warn("[ConnectButton] Failed to set seed client addresses:", h), h;
5368
5392
  }
5369
- await To(d, l, e);
5393
+ await Do(d, l, e);
5370
5394
  }
5371
5395
  },
5372
5396
  [e]
@@ -5399,7 +5423,7 @@ const ac = () => {
5399
5423
  ]);
5400
5424
  const u = () => {
5401
5425
  try {
5402
- sessionStorage.setItem(yt, "1");
5426
+ sessionStorage.setItem(wt, "1");
5403
5427
  } catch {
5404
5428
  }
5405
5429
  Ne.stopAll();
@@ -5407,7 +5431,7 @@ const ac = () => {
5407
5431
  const m = f.getAccount();
5408
5432
  if (m) {
5409
5433
  try {
5410
- sessionStorage.removeItem(yt);
5434
+ sessionStorage.removeItem(wt);
5411
5435
  } catch {
5412
5436
  }
5413
5437
  console.log("[ConnectButton] Connected", m.address);
@@ -5418,7 +5442,7 @@ const ac = () => {
5418
5442
  }
5419
5443
  };
5420
5444
  return /* @__PURE__ */ ve(
5421
- Oa,
5445
+ Ba,
5422
5446
  {
5423
5447
  client: x(),
5424
5448
  wallets: mr(),
@@ -5427,7 +5451,7 @@ const ac = () => {
5427
5451
  chains: [E],
5428
5452
  onConnect: p,
5429
5453
  onDisconnect: u,
5430
- theme: Fa({
5454
+ theme: ka({
5431
5455
  colors: {
5432
5456
  primaryButtonBg: "#1D2939",
5433
5457
  primaryButtonText: "#FFFFFF",
@@ -5459,7 +5483,7 @@ const ac = () => {
5459
5483
  cursor: n ? "not-allowed" : "pointer",
5460
5484
  opacity: n ? 0.6 : 1
5461
5485
  });
5462
- return /* @__PURE__ */ qa("div", { role: "group", "aria-label": a, style: r, children: [
5486
+ return /* @__PURE__ */ ja("div", { role: "group", "aria-label": a, style: r, children: [
5463
5487
  /* @__PURE__ */ ve(
5464
5488
  "button",
5465
5489
  {
@@ -5485,14 +5509,14 @@ const ac = () => {
5485
5509
  function sc(e) {
5486
5510
  return e === "creatingAttestationsDirectToEas" ? "creatingAttestations" : e;
5487
5511
  }
5488
- function Do(e, t, n) {
5512
+ function _o(e, t, n) {
5489
5513
  if (e != null) return n;
5490
5514
  if (t?.status === "completed") return k.SUCCESS;
5491
5515
  if (t?.status === "failed") return k.FAILURE;
5492
5516
  if (t?.status !== "interrupted")
5493
5517
  return n;
5494
5518
  }
5495
- function _o(e) {
5519
+ function Co(e) {
5496
5520
  if (e) {
5497
5521
  if (e.status === "failed") return k.FAILURE;
5498
5522
  if (e.status === "completed") return k.SUCCESS;
@@ -5519,24 +5543,24 @@ function _o(e) {
5519
5543
  }
5520
5544
  }
5521
5545
  }
5522
- function Co(e) {
5546
+ function Ro(e) {
5523
5547
  return !e || e.status !== "done" ? !1 : e.value === k.SUCCESS || e.value === k.FAILURE;
5524
5548
  }
5525
- function Ro(e) {
5549
+ function Lo(e) {
5526
5550
  const t = Ne.getService(), n = nr(t, (l) => l?.context?.publishProcesses?.get(e) ?? null), a = xe(null);
5527
5551
  ee(() => {
5528
5552
  a.current = null;
5529
5553
  }, [e]);
5530
5554
  const [r, s] = Me(void 0), [o, i] = Me(null), c = B.getAppDb(), u = re(
5531
- () => e && c ? c.select().from(I).where(H(I.seedLocalId, e)).orderBy(ue(I.startedAt)).limit(1) : null,
5555
+ () => e && c ? c.select().from(P).where(H(P.seedLocalId, e)).orderBy(ue(P.startedAt)).limit(1) : null,
5532
5556
  [c, e]
5533
5557
  ), f = pe(u)?.[0], d = f?.status, m = re(() => {
5534
5558
  if (n != null)
5535
5559
  return r;
5536
5560
  if (o === "success" || o === "failure")
5537
5561
  return o;
5538
- const l = _o(f);
5539
- return l === k.SUCCESS || l === k.FAILURE ? l : Do(
5562
+ const l = Co(f);
5563
+ return l === k.SUCCESS || l === k.FAILURE ? l : _o(
5540
5564
  n,
5541
5565
  d != null ? { status: d } : void 0,
5542
5566
  r
@@ -5551,7 +5575,7 @@ function Ro(e) {
5551
5575
  }, [n]), ee(() => {
5552
5576
  if (!n) {
5553
5577
  const h = a.current;
5554
- Co(h) ? (s(h.value), h.value === k.SUCCESS ? i("success") : h.value === k.FAILURE && i("failure")) : s(void 0);
5578
+ Ro(h) ? (s(h.value), h.value === k.SUCCESS ? i("success") : h.value === k.FAILURE && i("failure")) : s(void 0);
5555
5579
  return;
5556
5580
  }
5557
5581
  const l = n.getSnapshot();
@@ -5574,12 +5598,12 @@ function oc(e) {
5574
5598
  n(!1);
5575
5599
  return;
5576
5600
  }
5577
- An(e).then(n).catch(() => n(!1));
5601
+ Sn(e).then(n).catch(() => n(!1));
5578
5602
  }, [e?.seedLocalId]), t;
5579
5603
  }
5580
- function Lo(e) {
5604
+ function xo(e) {
5581
5605
  const t = B.getAppDb(), n = re(
5582
- () => e && t ? t.select().from(We).where(H(We.seedLocalId, e)).orderBy(ue(We.updatedAt)) : null,
5606
+ () => e && t ? t.select().from(je).where(H(je.seedLocalId, e)).orderBy(ue(je.updatedAt)) : null,
5583
5607
  [t, e]
5584
5608
  ), r = pe(n) ?? [];
5585
5609
  return re(() => {
@@ -5593,8 +5617,8 @@ function Lo(e) {
5593
5617
  }, [r]);
5594
5618
  }
5595
5619
  function ic(e) {
5596
- const { publishProcess: t, value: n } = Ro(e ?? ""), a = Lo(e), r = B.getAppDb(), s = re(
5597
- () => e && r ? r.select().from(I).where(H(I.seedLocalId, e)).orderBy(ue(I.startedAt)).limit(1) : null,
5620
+ const { publishProcess: t, value: n } = Lo(e ?? ""), a = xo(e), r = B.getAppDb(), s = re(
5621
+ () => e && r ? r.select().from(P).where(H(P.seedLocalId, e)).orderBy(ue(P.startedAt)).limit(1) : null,
5598
5622
  [r, e]
5599
5623
  ), i = pe(s)?.[0], c = !!t || i?.status === "in_progress";
5600
5624
  return {
@@ -5607,85 +5631,85 @@ function ic(e) {
5607
5631
  arweaveL1Summary: a
5608
5632
  };
5609
5633
  }
5610
- function sa() {
5634
+ function ia() {
5611
5635
  const e = B.getAppDb();
5612
5636
  return re(
5613
- () => e ? e.select().from(I).orderBy(ue(I.startedAt)) : null,
5637
+ () => e ? e.select().from(P).orderBy(ue(P.startedAt)) : null,
5614
5638
  [e]
5615
5639
  );
5616
5640
  }
5617
- function oa(e) {
5641
+ function ca(e) {
5618
5642
  const t = B.getAppDb();
5619
5643
  return re(
5620
- () => t && e ? t.select().from(I).where(H(I.seedLocalId, e)).orderBy(ue(I.startedAt)) : null,
5644
+ () => t && e ? t.select().from(P).where(H(P.seedLocalId, e)).orderBy(ue(P.startedAt)) : null,
5621
5645
  [t, e]
5622
5646
  );
5623
5647
  }
5624
- function xo() {
5625
- const e = sa(), t = pe(e), n = re(
5648
+ function Mo() {
5649
+ const e = ia(), t = pe(e), n = re(
5626
5650
  () => t === void 0 ? void 0 : t.filter((a) => a.status !== "in_progress").length,
5627
5651
  [t]
5628
5652
  );
5629
5653
  return { records: t, nonActiveCount: n };
5630
5654
  }
5631
5655
  function cc() {
5632
- const e = sa();
5656
+ const e = ia();
5633
5657
  return pe(e);
5634
5658
  }
5635
5659
  function dc() {
5636
- return xo().nonActiveCount;
5660
+ return Mo().nonActiveCount;
5637
5661
  }
5638
5662
  function lc(e) {
5639
- const t = oa(e);
5663
+ const t = ca(e);
5640
5664
  return pe(t);
5641
5665
  }
5642
- function Mo(e) {
5643
- const t = oa(e), n = pe(t), a = re(
5666
+ function No(e) {
5667
+ const t = ca(e), n = pe(t), a = re(
5644
5668
  () => n === void 0 ? void 0 : n.filter((r) => r.status !== "in_progress").length,
5645
5669
  [n]
5646
5670
  );
5647
5671
  return { records: n, nonActiveCount: a };
5648
5672
  }
5649
5673
  function uc(e) {
5650
- return Mo(e).nonActiveCount;
5674
+ return No(e).nonActiveCount;
5651
5675
  }
5652
5676
  function pc(e) {
5653
5677
  const t = B.getAppDb(), n = re(
5654
- () => e != null && t ? t.select().from(I).where(H(I.id, e)).limit(1) : null,
5678
+ () => e != null && t ? t.select().from(P).where(H(P.id, e)).limit(1) : null,
5655
5679
  [t, e]
5656
5680
  ), a = pe(n), r = a === void 0;
5657
5681
  return { record: a && a.length > 0 ? a[0] : null, isLoading: r };
5658
5682
  }
5659
5683
  async function mc() {
5660
5684
  const e = B.getAppDb();
5661
- e && await e.delete(I).where(Pn(I.status, ["in_progress"]));
5685
+ e && await e.delete(P).where(Tn(P.status, ["in_progress"]));
5662
5686
  }
5663
5687
  async function fc(e) {
5664
5688
  const t = B.getAppDb();
5665
- t && await t.delete(I).where(
5666
- Pt(H(I.seedLocalId, e), Pn(I.status, ["in_progress"]))
5689
+ t && await t.delete(P).where(
5690
+ Ut(H(P.seedLocalId, e), Tn(P.status, ["in_progress"]))
5667
5691
  );
5668
5692
  }
5669
5693
  async function hc() {
5670
5694
  const e = B.getAppDb();
5671
- e && await e.delete(I);
5695
+ e && await e.delete(P);
5672
5696
  }
5673
5697
  async function gc() {
5674
5698
  const e = B.getAppDb();
5675
- e && await e.delete(_a);
5699
+ e && await e.delete(Ra);
5676
5700
  }
5677
5701
  async function yc(e) {
5678
5702
  const t = B.getAppDb();
5679
- t && await t.delete(I).where(H(I.seedLocalId, e));
5703
+ t && await t.delete(P).where(H(P.seedLocalId, e));
5680
5704
  }
5681
5705
  async function wc(e) {
5682
5706
  const t = B.getAppDb();
5683
- t && await t.delete(I).where(H(I.id, e));
5707
+ t && await t.delete(P).where(H(P.id, e));
5684
5708
  }
5685
5709
  async function bc(e) {
5686
5710
  if (e.length === 0) return;
5687
5711
  const t = B.getAppDb();
5688
- t && await t.delete(I).where(za(I.id, e));
5712
+ t && await t.delete(P).where(Ka(P.id, e));
5689
5713
  }
5690
5714
  function Ac(e) {
5691
5715
  try {
@@ -5727,22 +5751,22 @@ function Sc(e) {
5727
5751
  };
5728
5752
  });
5729
5753
  }
5730
- const No = "A connected wallet is required for publishing with the modular executor. Connect your wallet and try again.";
5754
+ const Oo = "A connected wallet is required for publishing with the modular executor. Connect your wallet and try again.";
5731
5755
  async function Ec(e, t, n, a) {
5732
5756
  const r = L(), s = await n();
5733
5757
  if (!s || !s.trim())
5734
5758
  return { outcome: "no_address" };
5735
5759
  if (r.useModularExecutor) {
5736
- const i = await Gn();
5760
+ const i = await zn();
5737
5761
  if (!i.ok)
5738
5762
  return { outcome: "managed_not_ready", error: i.error };
5739
5763
  const c = await pr();
5740
5764
  if (!c)
5741
5765
  return {
5742
5766
  outcome: "managed_not_ready",
5743
- error: new z(No, "MANAGED_ACCOUNT_UNAVAILABLE")
5767
+ error: new z(Oo, "MANAGED_ACCOUNT_UNAVAILABLE")
5744
5768
  };
5745
- await Xn();
5769
+ await ta();
5746
5770
  const u = i.managedAddress;
5747
5771
  return Ne.createPublish(e, u, c, {
5748
5772
  dataItemSigner: c,
@@ -5755,7 +5779,7 @@ async function Ec(e, t, n, a) {
5755
5779
  ...a
5756
5780
  }), { outcome: "started" }) : { outcome: "needs_deploy" };
5757
5781
  }
5758
- function Oo(e) {
5782
+ function Fo(e) {
5759
5783
  const t = /* @__PURE__ */ new Set();
5760
5784
  for (const n of e) {
5761
5785
  const a = n.trim().toLowerCase();
@@ -5764,11 +5788,11 @@ function Oo(e) {
5764
5788
  return [...t].sort().map((n) => n);
5765
5789
  }
5766
5790
  function Ic(e) {
5767
- const t = L(), n = [e, Ut];
5768
- return t.modularAccountModuleContract?.trim() && n.push(t.modularAccountModuleContract.trim()), Oo(n);
5791
+ const t = L(), n = [e, Tt];
5792
+ return t.modularAccountModuleContract?.trim() && n.push(t.modularAccountModuleContract.trim()), Fo(n);
5769
5793
  }
5770
5794
  export {
5771
- Mn as AttestationVerificationError,
5795
+ On as AttestationVerificationError,
5772
5796
  ac as ConnectButton,
5773
5797
  Re as Eip7702ModularAccountPublishError,
5774
5798
  ii as ExternalWalletsForDeploy,
@@ -5792,7 +5816,7 @@ export {
5792
5816
  hi as contractURIUpdatedEvent,
5793
5817
  Zi as createSeed,
5794
5818
  Qi as createVersion,
5795
- Ft as createdAttestationEvent,
5819
+ Bt as createdAttestationEvent,
5796
5820
  Ic as defaultApprovedTargetsForModularPublish,
5797
5821
  wc as deletePublishProcessById,
5798
5822
  bc as deletePublishProcessesByIds,
@@ -5800,11 +5824,11 @@ export {
5800
5824
  ur as deploySmartWalletContract,
5801
5825
  gi as eIP712DomainChangedEvent,
5802
5826
  Oi as eip712Domain,
5803
- Je as ensureEasSchemasForItem,
5804
- Xn as ensureEip7702ModularAccountReady,
5805
- St as ensureExecutorModuleInstalled,
5806
- Ns as ensureManagedAccountEasConfigured,
5807
- Zt as ensureManagedAccountReady,
5827
+ Ke as ensureEasSchemasForItem,
5828
+ ta as ensureEip7702ModularAccountReady,
5829
+ Et as ensureExecutorModuleInstalled,
5830
+ Os as ensureManagedAccountEasConfigured,
5831
+ Xt as ensureManagedAccountReady,
5808
5832
  Ec as ensureSmartWalletThenPublish,
5809
5833
  bi as entryPoint,
5810
5834
  Wi as execute,
@@ -5817,37 +5841,37 @@ export {
5817
5841
  Ie as getArweave,
5818
5842
  Ac as getArweaveTransactionIds,
5819
5843
  x as getClient,
5820
- Rn as getConnectedAccount,
5821
- Tt as getConnectedManagedAccountAddress,
5844
+ xn as getConnectedAccount,
5845
+ Dt as getConnectedManagedAccountAddress,
5822
5846
  pr as getConnectedModularAccount,
5823
5847
  sc as getDisplayStepId,
5824
- fs as getEas,
5848
+ hs as getEas,
5825
5849
  vc as getEasPayload,
5826
5850
  Pi as getImplementationForFunction,
5827
- _n as getManagedAccountFactoryContract,
5828
- ze as getManagedAccountWallet,
5851
+ Rn as getManagedAccountFactoryContract,
5852
+ Je as getManagedAccountWallet,
5829
5853
  xi as getMessageHash,
5830
5854
  Fe as getModularAccountWallet,
5831
5855
  Ui as getNonce,
5832
5856
  Ti as getPermissionsForSigner,
5833
5857
  L as getPublishConfig,
5834
- _o as getPublishMachineValueForUi,
5835
- Dn as getSharedPublishInAppWalletStorage,
5836
- Cn as getSmartWalletAddressForAdmin,
5858
+ Co as getPublishMachineValueForUi,
5859
+ Cn as getSharedPublishInAppWalletStorage,
5860
+ Ln as getSmartWalletAddressForAdmin,
5837
5861
  mr as getWalletsForConnectButton,
5838
- xn as initPublish,
5862
+ Nn as initPublish,
5839
5863
  Bi as initialize,
5840
5864
  mi as initializedEvent,
5841
5865
  Di as isActiveSigner,
5842
5866
  _i as isAdmin,
5843
5867
  li as isEip7702ModularAccountPublishError,
5844
- Wt as isManagedAccountPublishError,
5868
+ jt as isManagedAccountPublishError,
5845
5869
  Pr as isRouterNonModularCoreAccountError,
5846
5870
  Ee as isSmartWalletDeployed,
5847
5871
  Mi as isValidSignature,
5848
5872
  Ci as isValidSigner,
5849
5873
  yi as logEvent,
5850
- Qt as multiPublish,
5874
+ en as multiPublish,
5851
5875
  Xi as multiPublishWithIntegerIds,
5852
5876
  ki as multicall,
5853
5877
  Gi as onERC1155BatchReceived,
@@ -5856,36 +5880,36 @@ export {
5856
5880
  Fi as owner,
5857
5881
  wi as ownershipTransferredEvent,
5858
5882
  ec as publish,
5859
- ea as publishMachine,
5883
+ na as publishMachine,
5860
5884
  tc as renounceOwnership,
5861
- Do as resolvePublishDisplayValue,
5885
+ _o as resolvePublishDisplayValue,
5862
5886
  lr as resolveSmartWalletForPublish,
5863
- Gn as runModularExecutorPublishPrep,
5864
- ms as seedPublishedEvent,
5887
+ zn as runModularExecutorPublishPrep,
5888
+ fs as seedPublishedEvent,
5865
5889
  Ji as setContractURI,
5866
- hs as setEas,
5890
+ gs as setEas,
5867
5891
  Hi as setEntrypointOverride,
5868
5892
  $i as setPermissionsForSigner,
5869
5893
  fi as signerPermissionsUpdatedEvent,
5870
- _t as stringifyUnderlyingCause,
5894
+ Ct as stringifyUnderlyingCause,
5871
5895
  Ni as supportsInterface,
5872
5896
  nc as transferOwnership,
5873
5897
  Sc as transformPayloadToIntegerIds,
5874
- ps as tryDeployManagedAccount,
5898
+ ms as tryDeployManagedAccount,
5875
5899
  oi as useActiveSmartWalletContract,
5876
- Lo as useArweaveL1Finalize,
5900
+ xo as useArweaveL1Finalize,
5877
5901
  oc as useCanPublishItem,
5878
5902
  ic as useItemPublishStatus,
5879
5903
  si as useLocalWalletAccount,
5880
5904
  Ur as usePublishConfig,
5881
- Ro as usePublishProcess,
5905
+ Lo as usePublishProcess,
5882
5906
  pc as usePublishProcessById,
5883
5907
  cc as usePublishProcesses,
5884
5908
  lc as usePublishProcessesForSeed,
5885
5909
  dc as usePublishProcessesNonActiveCount,
5886
5910
  uc as usePublishProcessesNonActiveCountForSeed,
5887
- xo as usePublishProcessesState,
5888
- Mo as usePublishProcessesStateForSeed,
5911
+ Mo as usePublishProcessesState,
5912
+ No as usePublishProcessesStateForSeed,
5889
5913
  Vi as validateUserOp,
5890
5914
  zr as verifyDataItem,
5891
5915
  Ri as verifySignerPermissionRequest,