@pkcprotocol/pkc-js 0.0.63 → 0.0.65

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (239) hide show
  1. package/dist/browser/clients/base-client-manager.js +14 -14
  2. package/dist/browser/clients/base-client-manager.js.map +1 -1
  3. package/dist/browser/community/community-client-manager.js +9 -11
  4. package/dist/browser/community/community-client-manager.js.map +1 -1
  5. package/dist/browser/community/community-gateway-selection.js +4 -4
  6. package/dist/browser/community/community-gateway-selection.js.map +1 -1
  7. package/dist/browser/community/community-wire.js +3 -3
  8. package/dist/browser/community/community-wire.js.map +1 -1
  9. package/dist/browser/community/remote-community.d.ts +1 -1
  10. package/dist/browser/community/remote-community.js +10 -7
  11. package/dist/browser/community/remote-community.js.map +1 -1
  12. package/dist/browser/community/rpc-local-community.js +3 -3
  13. package/dist/browser/community/rpc-local-community.js.map +1 -1
  14. package/dist/browser/community/rpc-remote-community.js +5 -5
  15. package/dist/browser/community/rpc-remote-community.js.map +1 -1
  16. package/dist/browser/community/schema.js +5 -5
  17. package/dist/browser/community/schema.js.map +1 -1
  18. package/dist/browser/errors.d.ts +1 -0
  19. package/dist/browser/errors.js +1 -0
  20. package/dist/browser/errors.js.map +1 -1
  21. package/dist/browser/generated-version.d.ts +1 -1
  22. package/dist/browser/generated-version.js +1 -1
  23. package/dist/browser/helia/helia-for-pkc.js +52 -6
  24. package/dist/browser/helia/helia-for-pkc.js.map +1 -1
  25. package/dist/browser/helia/types.d.ts +2 -0
  26. package/dist/browser/helia/util.d.ts +18 -0
  27. package/dist/browser/helia/util.js +123 -0
  28. package/dist/browser/helia/util.js.map +1 -1
  29. package/dist/browser/pages/pages-client-manager.js +11 -15
  30. package/dist/browser/pages/pages-client-manager.js.map +1 -1
  31. package/dist/browser/pages/util.js +9 -9
  32. package/dist/browser/pages/util.js.map +1 -1
  33. package/dist/browser/pkc/pkc-client-manager.js +6 -6
  34. package/dist/browser/pkc/pkc-client-manager.js.map +1 -1
  35. package/dist/browser/pkc/pkc.js +7 -7
  36. package/dist/browser/pkc/pkc.js.map +1 -1
  37. package/dist/browser/pkc-error.d.ts +1 -1
  38. package/dist/browser/publications/comment/comment-client-manager.js +5 -5
  39. package/dist/browser/publications/comment/comment-client-manager.js.map +1 -1
  40. package/dist/browser/publications/comment/comment.js +15 -15
  41. package/dist/browser/publications/comment/comment.js.map +1 -1
  42. package/dist/browser/publications/comment/schema.js +17 -17
  43. package/dist/browser/publications/comment/schema.js.map +1 -1
  44. package/dist/browser/publications/comment-edit/schema.js +7 -7
  45. package/dist/browser/publications/comment-edit/schema.js.map +1 -1
  46. package/dist/browser/publications/comment-moderation/schema.js +11 -7
  47. package/dist/browser/publications/comment-moderation/schema.js.map +1 -1
  48. package/dist/browser/publications/community-edit/schema.js +6 -6
  49. package/dist/browser/publications/community-edit/schema.js.map +1 -1
  50. package/dist/browser/publications/publication-author.js +3 -3
  51. package/dist/browser/publications/publication-author.js.map +1 -1
  52. package/dist/browser/publications/publication-client-manager.js +4 -4
  53. package/dist/browser/publications/publication-client-manager.js.map +1 -1
  54. package/dist/browser/publications/publication.js +9 -9
  55. package/dist/browser/publications/publication.js.map +1 -1
  56. package/dist/browser/publications/vote/schema.js +11 -7
  57. package/dist/browser/publications/vote/schema.js.map +1 -1
  58. package/dist/browser/publications/vote/vote.js.map +1 -1
  59. package/dist/browser/pubsub-messages/schema.js +5 -5
  60. package/dist/browser/pubsub-messages/schema.js.map +1 -1
  61. package/dist/browser/rpc/src/index.js +12 -12
  62. package/dist/browser/rpc/src/index.js.map +1 -1
  63. package/dist/browser/runtime/browser/localforage-lru.js +2 -2
  64. package/dist/browser/runtime/browser/localforage-lru.js.map +1 -1
  65. package/dist/browser/runtime/node/addresses-rewriter-proxy-server.js +3 -3
  66. package/dist/browser/runtime/node/addresses-rewriter-proxy-server.js.map +1 -1
  67. package/dist/browser/runtime/node/community/challenges/index.js +3 -3
  68. package/dist/browser/runtime/node/community/challenges/index.js.map +1 -1
  69. package/dist/browser/runtime/node/community/challenges/pkc-js-challenges/publication-match.js +4 -4
  70. package/dist/browser/runtime/node/community/challenges/pkc-js-challenges/publication-match.js.map +1 -1
  71. package/dist/browser/runtime/node/community/db-handler.js +32 -32
  72. package/dist/browser/runtime/node/community/db-handler.js.map +1 -1
  73. package/dist/browser/runtime/node/community/local-community/challenges.js +7 -7
  74. package/dist/browser/runtime/node/community/local-community/challenges.js.map +1 -1
  75. package/dist/browser/runtime/node/community/local-community/comment-updates.js +5 -5
  76. package/dist/browser/runtime/node/community/local-community/comment-updates.js.map +1 -1
  77. package/dist/browser/runtime/node/community/local-community/db-state.js +8 -8
  78. package/dist/browser/runtime/node/community/local-community/db-state.js.map +1 -1
  79. package/dist/browser/runtime/node/community/local-community/editing.js +6 -6
  80. package/dist/browser/runtime/node/community/local-community/editing.js.map +1 -1
  81. package/dist/browser/runtime/node/community/local-community/ipns-publishing.js +10 -7
  82. package/dist/browser/runtime/node/community/local-community/ipns-publishing.js.map +1 -1
  83. package/dist/browser/runtime/node/community/local-community/lifecycle.js +4 -4
  84. package/dist/browser/runtime/node/community/local-community/lifecycle.js.map +1 -1
  85. package/dist/browser/runtime/node/community/local-community/publication-store.js +13 -19
  86. package/dist/browser/runtime/node/community/local-community/publication-store.js.map +1 -1
  87. package/dist/browser/runtime/node/community/local-community/publication-validation.js +10 -10
  88. package/dist/browser/runtime/node/community/local-community/publication-validation.js.map +1 -1
  89. package/dist/browser/runtime/node/community/local-community/reprovide-on-address-change.js +5 -5
  90. package/dist/browser/runtime/node/community/local-community/reprovide-on-address-change.js.map +1 -1
  91. package/dist/browser/runtime/node/community/local-community.js +7 -7
  92. package/dist/browser/runtime/node/community/local-community.js.map +1 -1
  93. package/dist/browser/runtime/node/community/page-generator.js +5 -7
  94. package/dist/browser/runtime/node/community/page-generator.js.map +1 -1
  95. package/dist/browser/runtime/node/setup-kubo-address-rewriter-and-http-router.js +2 -2
  96. package/dist/browser/runtime/node/setup-kubo-address-rewriter-and-http-router.js.map +1 -1
  97. package/dist/browser/runtime/node/sqlite-lru-cache.js +2 -2
  98. package/dist/browser/runtime/node/sqlite-lru-cache.js.map +1 -1
  99. package/dist/browser/runtime/node/util.js +8 -6
  100. package/dist/browser/runtime/node/util.js.map +1 -1
  101. package/dist/browser/schema/schema.js +3 -3
  102. package/dist/browser/schema/schema.js.map +1 -1
  103. package/dist/browser/signer/constants.d.ts +1 -2
  104. package/dist/browser/signer/constants.js +9 -1
  105. package/dist/browser/signer/constants.js.map +1 -1
  106. package/dist/browser/signer/signatures.js +14 -12
  107. package/dist/browser/signer/signatures.js.map +1 -1
  108. package/dist/browser/stats.js +5 -5
  109. package/dist/browser/stats.js.map +1 -1
  110. package/dist/browser/test/test-util.d.ts +9 -10
  111. package/dist/browser/test/test-util.js +25 -37
  112. package/dist/browser/test/test-util.js.map +1 -1
  113. package/dist/browser/util.js +18 -17
  114. package/dist/browser/util.js.map +1 -1
  115. package/dist/bundled/bundle-manifest.json +61 -190
  116. package/dist/bundled/chunks/{helia-for-pkc-C6vMsrJ-.js → helia-for-pkc-h-rjuHh7.js} +46 -3
  117. package/dist/bundled/chunks/{local-community-BQmiwsV4.js → local-community-DEWf2apw.js} +170 -121
  118. package/dist/bundled/chunks/{local-community-BoIoFZHk.js → local-community-DdDpaZqk.js} +1 -1
  119. package/dist/bundled/chunks/{node-G40jxRL2.js → node-CrnvA79m.js} +40 -37
  120. package/dist/bundled/chunks/{rpc-local-community-D4-NEPJb.js → rpc-local-community-CpN6R3ZN.js} +337 -108
  121. package/dist/bundled/chunks/{schema-SPGmy_14.js → schema-Db4geGeo.js} +248 -3900
  122. package/dist/bundled/chunks/{util-CJ6nXIW9.js → util-DrHyKxFe.js} +98 -2
  123. package/dist/bundled/index.js +1 -1
  124. package/dist/bundled/rpc/src/index.js +18 -22
  125. package/dist/node/clients/base-client-manager.js +14 -14
  126. package/dist/node/clients/base-client-manager.js.map +1 -1
  127. package/dist/node/community/community-client-manager.js +9 -11
  128. package/dist/node/community/community-client-manager.js.map +1 -1
  129. package/dist/node/community/community-gateway-selection.js +4 -4
  130. package/dist/node/community/community-gateway-selection.js.map +1 -1
  131. package/dist/node/community/community-wire.js +3 -3
  132. package/dist/node/community/community-wire.js.map +1 -1
  133. package/dist/node/community/remote-community.d.ts +1 -1
  134. package/dist/node/community/remote-community.js +10 -7
  135. package/dist/node/community/remote-community.js.map +1 -1
  136. package/dist/node/community/rpc-local-community.js +3 -3
  137. package/dist/node/community/rpc-local-community.js.map +1 -1
  138. package/dist/node/community/rpc-remote-community.js +5 -5
  139. package/dist/node/community/rpc-remote-community.js.map +1 -1
  140. package/dist/node/community/schema.js +5 -5
  141. package/dist/node/community/schema.js.map +1 -1
  142. package/dist/node/errors.d.ts +1 -0
  143. package/dist/node/errors.js +1 -0
  144. package/dist/node/errors.js.map +1 -1
  145. package/dist/node/generated-version.d.ts +1 -1
  146. package/dist/node/generated-version.js +1 -1
  147. package/dist/node/helia/helia-for-pkc.js +52 -6
  148. package/dist/node/helia/helia-for-pkc.js.map +1 -1
  149. package/dist/node/helia/types.d.ts +2 -0
  150. package/dist/node/helia/util.d.ts +18 -0
  151. package/dist/node/helia/util.js +123 -0
  152. package/dist/node/helia/util.js.map +1 -1
  153. package/dist/node/pages/pages-client-manager.js +11 -15
  154. package/dist/node/pages/pages-client-manager.js.map +1 -1
  155. package/dist/node/pages/util.js +9 -9
  156. package/dist/node/pages/util.js.map +1 -1
  157. package/dist/node/pkc/pkc-client-manager.js +6 -6
  158. package/dist/node/pkc/pkc-client-manager.js.map +1 -1
  159. package/dist/node/pkc/pkc.js +7 -7
  160. package/dist/node/pkc/pkc.js.map +1 -1
  161. package/dist/node/pkc-error.d.ts +1 -1
  162. package/dist/node/publications/comment/comment-client-manager.js +5 -5
  163. package/dist/node/publications/comment/comment-client-manager.js.map +1 -1
  164. package/dist/node/publications/comment/comment.js +15 -15
  165. package/dist/node/publications/comment/comment.js.map +1 -1
  166. package/dist/node/publications/comment/schema.js +17 -17
  167. package/dist/node/publications/comment/schema.js.map +1 -1
  168. package/dist/node/publications/comment-edit/schema.js +7 -7
  169. package/dist/node/publications/comment-edit/schema.js.map +1 -1
  170. package/dist/node/publications/comment-moderation/schema.js +11 -7
  171. package/dist/node/publications/comment-moderation/schema.js.map +1 -1
  172. package/dist/node/publications/community-edit/schema.js +6 -6
  173. package/dist/node/publications/community-edit/schema.js.map +1 -1
  174. package/dist/node/publications/publication-author.js +3 -3
  175. package/dist/node/publications/publication-author.js.map +1 -1
  176. package/dist/node/publications/publication-client-manager.js +4 -4
  177. package/dist/node/publications/publication-client-manager.js.map +1 -1
  178. package/dist/node/publications/publication.js +9 -9
  179. package/dist/node/publications/publication.js.map +1 -1
  180. package/dist/node/publications/vote/schema.js +11 -7
  181. package/dist/node/publications/vote/schema.js.map +1 -1
  182. package/dist/node/publications/vote/vote.js.map +1 -1
  183. package/dist/node/pubsub-messages/schema.js +5 -5
  184. package/dist/node/pubsub-messages/schema.js.map +1 -1
  185. package/dist/node/rpc/src/index.js +12 -12
  186. package/dist/node/rpc/src/index.js.map +1 -1
  187. package/dist/node/runtime/browser/localforage-lru.js +2 -2
  188. package/dist/node/runtime/browser/localforage-lru.js.map +1 -1
  189. package/dist/node/runtime/node/addresses-rewriter-proxy-server.js +3 -3
  190. package/dist/node/runtime/node/addresses-rewriter-proxy-server.js.map +1 -1
  191. package/dist/node/runtime/node/community/challenges/index.js +3 -3
  192. package/dist/node/runtime/node/community/challenges/index.js.map +1 -1
  193. package/dist/node/runtime/node/community/challenges/pkc-js-challenges/publication-match.js +4 -4
  194. package/dist/node/runtime/node/community/challenges/pkc-js-challenges/publication-match.js.map +1 -1
  195. package/dist/node/runtime/node/community/db-handler.js +32 -32
  196. package/dist/node/runtime/node/community/db-handler.js.map +1 -1
  197. package/dist/node/runtime/node/community/local-community/challenges.js +7 -7
  198. package/dist/node/runtime/node/community/local-community/challenges.js.map +1 -1
  199. package/dist/node/runtime/node/community/local-community/comment-updates.js +5 -5
  200. package/dist/node/runtime/node/community/local-community/comment-updates.js.map +1 -1
  201. package/dist/node/runtime/node/community/local-community/db-state.js +8 -8
  202. package/dist/node/runtime/node/community/local-community/db-state.js.map +1 -1
  203. package/dist/node/runtime/node/community/local-community/editing.js +6 -6
  204. package/dist/node/runtime/node/community/local-community/editing.js.map +1 -1
  205. package/dist/node/runtime/node/community/local-community/ipns-publishing.js +10 -7
  206. package/dist/node/runtime/node/community/local-community/ipns-publishing.js.map +1 -1
  207. package/dist/node/runtime/node/community/local-community/lifecycle.js +4 -4
  208. package/dist/node/runtime/node/community/local-community/lifecycle.js.map +1 -1
  209. package/dist/node/runtime/node/community/local-community/publication-store.js +13 -19
  210. package/dist/node/runtime/node/community/local-community/publication-store.js.map +1 -1
  211. package/dist/node/runtime/node/community/local-community/publication-validation.js +10 -10
  212. package/dist/node/runtime/node/community/local-community/publication-validation.js.map +1 -1
  213. package/dist/node/runtime/node/community/local-community/reprovide-on-address-change.js +5 -5
  214. package/dist/node/runtime/node/community/local-community/reprovide-on-address-change.js.map +1 -1
  215. package/dist/node/runtime/node/community/local-community.js +7 -7
  216. package/dist/node/runtime/node/community/local-community.js.map +1 -1
  217. package/dist/node/runtime/node/community/page-generator.js +5 -7
  218. package/dist/node/runtime/node/community/page-generator.js.map +1 -1
  219. package/dist/node/runtime/node/setup-kubo-address-rewriter-and-http-router.js +2 -2
  220. package/dist/node/runtime/node/setup-kubo-address-rewriter-and-http-router.js.map +1 -1
  221. package/dist/node/runtime/node/sqlite-lru-cache.js +2 -2
  222. package/dist/node/runtime/node/sqlite-lru-cache.js.map +1 -1
  223. package/dist/node/runtime/node/util.js +8 -6
  224. package/dist/node/runtime/node/util.js.map +1 -1
  225. package/dist/node/schema/schema.js +3 -3
  226. package/dist/node/schema/schema.js.map +1 -1
  227. package/dist/node/signer/constants.d.ts +1 -2
  228. package/dist/node/signer/constants.js +9 -1
  229. package/dist/node/signer/constants.js.map +1 -1
  230. package/dist/node/signer/signatures.js +14 -12
  231. package/dist/node/signer/signatures.js.map +1 -1
  232. package/dist/node/stats.js +5 -5
  233. package/dist/node/stats.js.map +1 -1
  234. package/dist/node/test/test-util.d.ts +9 -10
  235. package/dist/node/test/test-util.js +25 -37
  236. package/dist/node/test/test-util.js.map +1 -1
  237. package/dist/node/util.js +18 -17
  238. package/dist/node/util.js.map +1 -1
  239. package/package.json +2 -2
@@ -1,19 +1,70 @@
1
1
  import { i as __toESM, r as __require, t as __commonJSMin } from "./chunk-2rV9d50f.js";
2
- import { $ as pubsubTopicToDhtKey, At as trackStartedCommunity, Bt as CommunityEditPublicationPubsubReservedFields, C as contentContainsMarkdownAudio, Ct as findUpdatingCommunity, En as CommentUpdateSchema, F as getIpnsRecordInLocalKuboNode, Fn as CommentEditPubsubMessagePublicationSchema, Ft as untrackUpdatingCommunity, G as isLinkOfAudio, Gt as CommentModerationPubsubMessagePublicationSchema, In as CommentEditPubsubMessagePublicationWithFlexibleAuthorSchema, It as require_sha256, J as isLinkOfVideo, Jt as CommentModerationsTableRowSchema, K as isLinkOfImage, Kt as CommentModerationReservedFields, L as hideClassPrivateProps, Ln as CommentEditReservedFields, M as genToArray, Mt as trackUpdatingCommunity, N as getEquivalentCommunityAddresses, Nt as untrackStartedCommunity, O as derivePublicationFromChallengeRequest, On as CommentUpdateTableRowSchema, P as getErrorCodeFromMessage, Q as isStringDomain, R as ipnsNameToIpnsOverPubsubTopic, Rt as pTimeout, S as calculateStringSizeSameAsIpfsAddCidV0, T as contentContainsMarkdownVideos, Un as AuthorReservedFields, W as isLinkOfAnimatedImage, Xn as require_commonjs, Y as isLinkValid, Zn as require_retry, _t as timestamp, a as ChallengeRequestMessageSchema, ar as logger_default, at as removeNullUndefinedValues, b as areEquivalentCommunityAddresses, bt as findCommunityInRegistry, d as DecryptedChallengeRequestSchema, dt as retryKuboIpfsAddAndProvide, fn as VotePubsubMessagePublicationSchema, hn as VoteTablesRowSchema, ht as statMfsPathSafely, ir as messages, k as doesDomainAddressHaveCapitalLetter, kn as CommentsTableRowSchema, kt as syncCommunityRegistryEntry, lt as retryKuboBlockPutPinAndProvidePubsubTopic, mt as sleepUntilTimeoutOrAbort, nn as CommunityIpfsSchema, nt as removeBlocksFromKuboNode, pn as VotePubsubReservedFields, q as isLinkOfMedia, r as ChallengeMessageSchema, rn as CommunitySignedPropertyNames, rr as PKCError, rt as removeMfsFilesSafely, s as ChallengeVerificationMessageSchema, t as ChallengeAnswerMessageSchema, u as DecryptedChallengeRequestPublicationSchema, vn as CommentIpfsSchema, vr as ZodError, w as contentContainsMarkdownImages, x as calculateIpfsCidV0, xt as findStartedCommunity, y as version_default, yn as CommentPubsubMessageReservedFields, yt as writeKuboFilesWithTimeout, zn as CommentEditsTableRowSchema } from "./schema-SPGmy_14.js";
3
- import { A as deriveDbPosts, At as verifyCommunityEdit, Bt as getCommunityPublicKeyFromWire, C as BackupAbortError, Dt as verifyCommentPubsubMessage, E as calculateInlineRepliesBudget, Et as verifyCommentModeration, F as importSignerIntoKuboNode, Ft as getAuthorNameFromWire, G as REPLY_REPLIES_SORT_TYPES, Gt as getIpfsKeyFromPrivateKey, Ht as decode, Jn as require_lodash_merge, Jt as getPublicKeyFromPrivateKey, K as TIMEFRAMES_TO_SECONDS, Kn as stringify, Kt as getPKCAddressFromPublicKey, M as getDefaultCommunityDbConfig, Mt as buildRuntimeAuthor, Nt as cleanWireAuthor, O as deleteOldCommunityInWindows, Ot as verifyCommentUpdate, P as getThumbnailPropsOfLink, R as moveCommunityDbToDeletedDirectory, S as encryptEd25519AesGcmPublicKeyBuffer, St as verifyChallengeRequest, T as calculateExpectedSignatureSize, Tt as verifyCommentIpfs, U as POSTS_SORT_TYPES, Ut as encode, W as POST_REPLIES_SORT_TYPES, Yt as createSchemaRowParser, Z as iterateOverPageCidsToFindAllCids, _ as SignerWithPublicKeyAddress, _t as signCommunity, a as pkcJsChallenges, b as decryptEd25519AesGcmPublicKeyBuffer, bt as verifyChallengeAnswer, cn as parseCommunityIpfsSchemaPassthroughWithPKCErrorIfItFails, d as MAX_FILE_SIZE_BYTES_FOR_COMMUNITY_IPFS, dt as signChallengeVerification, f as KeyvBetterSqlite3, ft as signComment, gt as signCommentUpdateForChallengeVerification, ht as signCommentUpdate, i as getCommunityChallengeFromCommunityChallengeSettings, it as pLimit, j as deriveDbReplies, jt as verifyVote, k as deriveCommentIpfsFromCommentTableRow, kt as verifyCommunity, l as normalizeSelfAddrsForProvider, lt as signChallengeMessage, o as TrackedInstanceRegistry, on as parseCommunityEditOptionsSchemaWithPKCErrorIfItFails, pt as signCommentEdit, qn as STORAGE_KEYS, qt as getPKCAddressFromPublicKeySync, r as getChallengeVerification, s as LRUCache, st as cleanUpBeforePublishing, t as RpcLocalCommunity, vn as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, w as backupCommunityDb, wt as verifyCommentEdit, xn as parseJsonWithPKCErrorIfFails, z as resolveDbPostsCidRefs, zt as getCommunityNameFromWire } from "./rpc-local-community-D4-NEPJb.js";
2
+ import { $ as pubsubTopicToDhtKey, $n as t$7, At as trackStartedCommunity, Bt as CommunityEditPublicationPubsubReservedFields, C as contentContainsMarkdownAudio, Ct as findUpdatingCommunity, En as CommentUpdateSchema, F as getIpnsRecordInLocalKuboNode, Fn as CommentEditPubsubMessagePublicationSchema, Ft as untrackUpdatingCommunity, G as isLinkOfAudio, Gt as CommentModerationPubsubMessagePublicationSchema, In as CommentEditPubsubMessagePublicationWithFlexibleAuthorSchema, It as require_sha256, J as isLinkOfVideo, Jt as CommentModerationsTableRowSchema, K as isLinkOfImage, Kt as CommentModerationReservedFields, L as hideClassPrivateProps, Ln as CommentEditReservedFields, M as genToArray, Mr as ZodError, Mt as trackUpdatingCommunity, N as getEquivalentCommunityAddresses, Nt as untrackStartedCommunity, O as derivePublicationFromChallengeRequest, On as CommentUpdateTableRowSchema, P as getErrorCodeFromMessage, Q as isStringDomain, Qn as n$3, R as ipnsNameToIpnsOverPubsubTopic, Rt as pTimeout, S as calculateStringSizeSameAsIpfsAddCidV0, T as contentContainsMarkdownVideos, Un as AuthorReservedFields, W as isLinkOfAnimatedImage, Xn as n$4, Y as isLinkValid, Zn as t$8, _r as PKCError, _t as timestamp, a as ChallengeRequestMessageSchema, ar as t$4, at as removeNullUndefinedValues, b as areEquivalentCommunityAddresses, bt as findCommunityInRegistry, cr as t$5, d as DecryptedChallengeRequestSchema, dr as require_retry, dt as retryKuboIpfsAddAndProvide, er as t$6, fn as VotePubsubMessagePublicationSchema, hn as VoteTablesRowSchema, ht as statMfsPathSafely, ir as r$1, k as doesDomainAddressHaveCapitalLetter, kn as CommentsTableRowSchema, kt as syncCommunityRegistryEntry, lr as t$3, lt as retryKuboBlockPutPinAndProvidePubsubTopic, mt as sleepUntilTimeoutOrAbort, nn as CommunityIpfsSchema, nr as e$1, nt as removeBlocksFromKuboNode, pn as VotePubsubReservedFields, q as isLinkOfMedia, r as ChallengeMessageSchema, rn as CommunitySignedPropertyNames, rt as removeMfsFilesSafely, s as ChallengeVerificationMessageSchema, t as ChallengeAnswerMessageSchema, tr as e, u as DecryptedChallengeRequestPublicationSchema, vn as CommentIpfsSchema, vr as messages, w as contentContainsMarkdownImages, x as calculateIpfsCidV0, xt as findStartedCommunity, y as version_default, yn as CommentPubsubMessageReservedFields, yr as logger_default, yt as writeKuboFilesWithTimeout, zn as CommentEditsTableRowSchema } from "./schema-Db4geGeo.js";
3
+ import { $n as t$10, A as deriveDbPosts, At as verifyCommunityEdit, Bt as getCommunityPublicKeyFromWire, C as BackupAbortError, Dt as verifyCommentPubsubMessage, E as calculateInlineRepliesBudget, Et as verifyCommentModeration, F as importSignerIntoKuboNode, Ft as getAuthorNameFromWire, G as REPLY_REPLIES_SORT_TYPES, Gt as getIpfsKeyFromPrivateKey, Ht as decode, Jn as r$2, Jt as getPublicKeyFromPrivateKey, K as TIMEFRAMES_TO_SECONDS, Kn as t$9, Kt as getPKCAddressFromPublicKey, M as getDefaultCommunityDbConfig, Mt as buildRuntimeAuthor, Nt as cleanWireAuthor, O as deleteOldCommunityInWindows, Ot as verifyCommentUpdate, P as getThumbnailPropsOfLink, R as moveCommunityDbToDeletedDirectory, S as encryptEd25519AesGcmPublicKeyBuffer, St as verifyChallengeRequest, T as calculateExpectedSignatureSize, Tt as verifyCommentIpfs, U as POSTS_SORT_TYPES, Ut as encode, W as POST_REPLIES_SORT_TYPES, Xn as n$6, Yn as t$11, Yt as createSchemaRowParser, Z as iterateOverPageCidsToFindAllCids, Zn as n$5, _ as SignerWithPublicKeyAddress, _t as signCommunity, a as pkcJsChallenges, b as decryptEd25519AesGcmPublicKeyBuffer, bt as verifyChallengeAnswer, cn as parseCommunityIpfsSchemaPassthroughWithPKCErrorIfItFails, d as MAX_FILE_SIZE_BYTES_FOR_COMMUNITY_IPFS, dt as signChallengeVerification, er as stringify, f as KeyvBetterSqlite3, ft as signComment, gt as signCommentUpdateForChallengeVerification, ht as signCommentUpdate, i as getCommunityChallengeFromCommunityChallengeSettings, it as pLimit, j as deriveDbReplies, jt as verifyVote, k as deriveCommentIpfsFromCommentTableRow, kt as verifyCommunity, l as normalizeSelfAddrsForProvider, lt as signChallengeMessage, nr as require_lodash_merge, o as TrackedInstanceRegistry, on as parseCommunityEditOptionsSchemaWithPKCErrorIfItFails, pt as signCommentEdit, qn as t$12, qt as getPKCAddressFromPublicKeySync, r as getChallengeVerification, s as LRUCache, st as cleanUpBeforePublishing, t as RpcLocalCommunity, tr as STORAGE_KEYS, vn as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, w as backupCommunityDb, wt as verifyCommentEdit, xn as parseJsonWithPKCErrorIfFails, z as resolveDbPostsCidRefs, zt as getCommunityNameFromWire } from "./rpc-local-community-CpN6R3ZN.js";
4
4
  import { randomFillSync, randomUUID } from "node:crypto";
5
5
  import { fileURLToPath, pathToFileURL } from "node:url";
6
- import path from "node:path";
6
+ import Path from "node:path";
7
7
  import os from "os";
8
8
  import { existsSync, promises } from "node:fs";
9
- import path$1 from "path";
9
+ import path from "path";
10
10
  import assert from "assert";
11
11
  import fs from "fs";
12
12
  import Database from "better-sqlite3";
13
13
  import { CID } from "multiformats/cid";
14
14
  import { of } from "typestub-ipfs-only-hash";
15
+ //#region node_modules/remeda/dist/entries.js
16
+ function t$2(...t) {
17
+ return t$3(Object.entries, t);
18
+ }
19
+ //#endregion
20
+ //#region node_modules/remeda/dist/groupBy.js
21
+ function t$1(...t) {
22
+ return t$3(n$2, t);
23
+ }
24
+ const n$2 = (e, t) => {
25
+ let n = Object.create(null);
26
+ for (let r = 0; r < e.length; r++) {
27
+ let i = e[r], a = t(i, r, e);
28
+ if (a !== void 0) {
29
+ let e = n[a];
30
+ e === void 0 ? n[a] = [i] : e.push(i);
31
+ }
32
+ }
33
+ return Object.setPrototypeOf(n, Object.prototype), n;
34
+ };
35
+ //#endregion
36
+ //#region node_modules/remeda/dist/sumBy.js
37
+ function t(...t) {
38
+ return t$3(n$1, t);
39
+ }
40
+ const n$1 = (e, t) => {
41
+ let n = e.entries(), r = n.next();
42
+ if (`done` in r && r.done) return 0;
43
+ let { value: [, i] } = r, a = t(i, 0, e);
44
+ for (let [r, i] of n) {
45
+ let n = t(i, r, e);
46
+ a += n;
47
+ }
48
+ return a;
49
+ };
50
+ //#endregion
51
+ //#region node_modules/remeda/dist/uniqueBy.js
52
+ function n(...e) {
53
+ return t$4(r, e);
54
+ }
55
+ function r(t) {
56
+ let n = t, r = /* @__PURE__ */ new Set();
57
+ return (t, i, a) => {
58
+ let o = n(t, i, a);
59
+ return r.has(o) ? t$5 : (r.add(o), {
60
+ done: !1,
61
+ hasNext: !0,
62
+ next: t
63
+ });
64
+ };
65
+ }
66
+ //#endregion
15
67
  //#region dist/node/runtime/node/community/local-community/comment-updates.js
16
- var import_commonjs = /* @__PURE__ */ __toESM(require_commonjs(), 1);
17
68
  function pubsubTopicWithfallback(community) {
18
69
  return community.pubsubTopic || community.address;
19
70
  }
@@ -54,7 +105,7 @@ async function calculateNewCommentUpdate(community, comment) {
54
105
  if ("singlePreloadedPage" in generatedRepliesPages) commentUpdatePriorToSigning.replies = { pages: generatedRepliesPages.singlePreloadedPage };
55
106
  else if (generatedRepliesPages.pageCids) commentUpdatePriorToSigning.replies = {
56
107
  pageCids: generatedRepliesPages.pageCids,
57
- pages: import_commonjs.pick(generatedRepliesPages.pages, [preloadedRepliesPages])
108
+ pages: t$9(generatedRepliesPages.pages, [preloadedRepliesPages])
58
109
  };
59
110
  }
60
111
  const allPageCids = generatedRepliesPages && !("singlePreloadedPage" in generatedRepliesPages) ? generatedRepliesPages.allPageCids : void 0;
@@ -119,13 +170,13 @@ async function updateCommentsThatNeedToBeUpdated(community) {
119
170
  if (commentsToUpdate.length === 0) return [];
120
171
  community._communityUpdateTrigger = true;
121
172
  log(`Will update ${commentsToUpdate.length} comments in this update loop for community (${community.address})`);
122
- const commentsByPostCid = import_commonjs.groupBy.strict(commentsToUpdate, (x) => x.postCid);
173
+ const commentsByPostCid = t$1(commentsToUpdate, (x) => x.postCid);
123
174
  const allCommentUpdateRows = [];
124
175
  const postLimit = pLimit(10);
125
176
  const postProcessingPromises = Object.entries(commentsByPostCid).map(([postCid, commentsForPost]) => postLimit(async () => {
126
177
  try {
127
- const commentsByDepth = import_commonjs.groupBy.strict(commentsForPost, (x) => x.depth);
128
- const depthsKeySorted = import_commonjs.keys.strict(commentsByDepth).sort((a, b) => Number(b) - Number(a));
178
+ const commentsByDepth = t$1(commentsForPost, (x) => x.depth);
179
+ const depthsKeySorted = t$6(commentsByDepth).sort((a, b) => Number(b) - Number(a));
129
180
  const postUpdateRows = [];
130
181
  for (const depthKey of depthsKeySorted) {
131
182
  const commentsAtDepth = commentsByDepth[depthKey];
@@ -426,7 +477,7 @@ async function publishChallenges(community, challenges, request) {
426
477
  const pubsubClient = community._clientsManager.getDefaultKuboPubsubClient();
427
478
  community._clientsManager.updateKuboRpcPubsubState("publishing-challenge", pubsubClient.url);
428
479
  if (!community._challengeExchangesFromLocalPublishers[request.challengeRequestId.toString()]) await community._clientsManager.pubsubPublish(pubsubTopicWithfallback(community), challengeMessage);
429
- log(`Community ${community.address} with pubsub topic ${pubsubTopicWithfallback(community)} published ${challengeMessage.type} over pubsub: `, import_commonjs.pick(toSignChallenge, ["timestamp"]), toEncryptChallenge.challenges.map((challenge) => challenge.type));
480
+ log(`Community ${community.address} with pubsub topic ${pubsubTopicWithfallback(community)} published ${challengeMessage.type} over pubsub: `, t$9(toSignChallenge, ["timestamp"]), toEncryptChallenge.challenges.map((challenge) => challenge.type));
430
481
  community._clientsManager.updateKuboRpcPubsubState("waiting-challenge-answers", pubsubClient.url);
431
482
  community.emit("challenge", {
432
483
  ...challengeMessage,
@@ -454,7 +505,7 @@ async function publishFailedChallengeVerification(community, result, challengeRe
454
505
  };
455
506
  const pubsubClient = community._clientsManager.getDefaultKuboPubsubClient();
456
507
  community._clientsManager.updateKuboRpcPubsubState("publishing-challenge-verification", pubsubClient.url);
457
- log(`Will publish ${challengeVerification.type} over pubsub topic ${pubsubTopicWithfallback(community)} on community ${community.address}:`, import_commonjs.omit(toSignVerification, ["challengeRequestId"]));
508
+ log(`Will publish ${challengeVerification.type} over pubsub topic ${pubsubTopicWithfallback(community)} on community ${community.address}:`, n$3(toSignVerification, ["challengeRequestId"]));
458
509
  if (!community._challengeExchangesFromLocalPublishers[challengeRequestId.toString()]) await community._clientsManager.pubsubPublish(pubsubTopicWithfallback(community), challengeVerification);
459
510
  community._clientsManager.updateKuboRpcPubsubState("waiting-challenge-requests", pubsubClient.url);
460
511
  community.emit("challengeverification", challengeVerification);
@@ -604,7 +655,7 @@ async function publishChallengeVerification(community, challengeResult, request,
604
655
  community._ongoingChallengeExchanges.delete(request.challengeRequestId.toString());
605
656
  delete community._challengeExchangesFromLocalPublishers[request.challengeRequestId.toString()];
606
657
  cleanUpChallengeAnswerPromise(community, request.challengeRequestId.toString());
607
- log.trace(`Published ${challengeVerification.type} over pubsub topic ${pubsubTopicWithfallback(community)}:`, import_commonjs.omit(objectToEmit, [
658
+ log.trace(`Published ${challengeVerification.type} over pubsub topic ${pubsubTopicWithfallback(community)}:`, n$3(objectToEmit, [
608
659
  "signature",
609
660
  "encrypted",
610
661
  "challengeRequestId"
@@ -640,7 +691,7 @@ function buildRuntimeChallengeRequestPublication({ publication, authorCommunity
640
691
  };
641
692
  }
642
693
  function buildRuntimeChallengeRequest({ request, authorCommunity }) {
643
- const runtimeRequest = import_commonjs.clone(request);
694
+ const runtimeRequest = t$10(request);
644
695
  if (request.comment) runtimeRequest.comment = buildRuntimeChallengeRequestPublication({
645
696
  publication: request.comment,
646
697
  authorCommunity
@@ -665,7 +716,7 @@ function buildRuntimeChallengeRequest({ request, authorCommunity }) {
665
716
  }
666
717
  async function parseAndValidateChallengeRequest(community, request, log) {
667
718
  const decryptedRequest = await parseChallengeRequestPublicationOrRespondWithFailure(community, request, await decryptOrRespondWithFailure(community, request));
668
- const publicationFieldNames = import_commonjs.keys.strict(DecryptedChallengeRequestPublicationSchema.shape);
719
+ const publicationFieldNames = t$6(DecryptedChallengeRequestPublicationSchema.shape);
669
720
  let publication;
670
721
  try {
671
722
  publication = derivePublicationFromChallengeRequest(decryptedRequest);
@@ -789,7 +840,7 @@ async function handleChallengeRequest(community, request, isLocalPublisher) {
789
840
  request,
790
841
  validateTimestampRange: true
791
842
  });
792
- if (!requestSignatureValidation.valid) throw new PKCError(getErrorCodeFromMessage(requestSignatureValidation.reason), { challengeRequest: import_commonjs.omit(request, ["encrypted"]) });
843
+ if (!requestSignatureValidation.valid) throw new PKCError(getErrorCodeFromMessage(requestSignatureValidation.reason), { challengeRequest: n$3(request, ["encrypted"]) });
793
844
  const parsed = await parseAndValidateChallengeRequest(community, request, log);
794
845
  if (!parsed) return;
795
846
  const challengeVerification = await runChallengeExchangeIfNeeded(community, parsed, log);
@@ -886,7 +937,7 @@ async function handleChallengeExchange(community, pubsubMsg) {
886
937
  //#endregion
887
938
  //#region dist/node/runtime/node/community/local-community/publication-validation.js
888
939
  function isFlairInAllowedList(flair, allowedFlairs) {
889
- return allowedFlairs.some((allowed) => import_commonjs.isDeepEqual(allowed, flair));
940
+ return allowedFlairs.some((allowed) => t$11(allowed, flair));
890
941
  }
891
942
  async function isPublicationAuthorPartOfRoles(community, publication, rolesToCheckAgainst) {
892
943
  if (!community.roles) return false;
@@ -954,7 +1005,7 @@ async function checkWireFormatAndCommunityAuthor(community, publication, authorC
954
1005
  if (typeof authorCommunity?.banExpiresAt === "number" && authorCommunity.banExpiresAt > timestamp()) return messages.ERR_AUTHOR_IS_BANNED;
955
1006
  }
956
1007
  async function checkAuthorIdentity(community, publication, log) {
957
- if (publication.author && import_commonjs.intersection(import_commonjs.keys.strict(publication.author), AuthorReservedFields).length > 0) return messages.ERR_PUBLICATION_AUTHOR_HAS_RESERVED_FIELD;
1008
+ if (publication.author && r$2(t$6(publication.author), AuthorReservedFields).length > 0) return messages.ERR_PUBLICATION_AUTHOR_HAS_RESERVED_FIELD;
958
1009
  const authorName = getAuthorNameFromWire(publication.author);
959
1010
  if (authorName && !isStringDomain(authorName)) {
960
1011
  log("Rejecting publication: author.name is not a domain", authorName);
@@ -1011,7 +1062,7 @@ async function checkParentAndPostState(community, request, publication) {
1011
1062
  async function checkCommentPublication(community, request) {
1012
1063
  if (!request.comment) return void 0;
1013
1064
  const commentPublication = request.comment;
1014
- if (import_commonjs.intersection(import_commonjs.keys.strict(commentPublication), CommentPubsubMessageReservedFields).length > 0) return messages.ERR_COMMENT_HAS_RESERVED_FIELD;
1065
+ if (r$2(t$6(commentPublication), CommentPubsubMessageReservedFields).length > 0) return messages.ERR_COMMENT_HAS_RESERVED_FIELD;
1015
1066
  if (community.features?.requirePostLink && !commentPublication.parentCid && (!commentPublication.link || !community.features?.requirePostLinkIsMedia && !isLinkValid(commentPublication.link))) return messages.ERR_COMMENT_HAS_INVALID_LINK_FIELD;
1016
1067
  if (community.features?.requirePostLinkIsMedia && commentPublication.link && (!isLinkValid(commentPublication.link) || !isLinkOfMedia(commentPublication.link))) return messages.ERR_POST_LINK_IS_NOT_OF_MEDIA;
1017
1068
  if (community.features?.requireReplyLink && commentPublication.parentCid && (!commentPublication.link || !community.features?.requireReplyLinkIsMedia && !isLinkValid(commentPublication.link))) return messages.ERR_REPLY_HAS_INVALID_LINK_FIELD;
@@ -1068,7 +1119,7 @@ async function checkCommentPublication(community, request) {
1068
1119
  async function checkVotePublication(community, request) {
1069
1120
  if (!request.vote) return void 0;
1070
1121
  const votePublication = request.vote;
1071
- if (import_commonjs.intersection(VotePubsubReservedFields, import_commonjs.keys.strict(votePublication)).length > 0) return messages.ERR_VOTE_HAS_RESERVED_FIELD;
1122
+ if (r$2(VotePubsubReservedFields, t$6(votePublication)).length > 0) return messages.ERR_VOTE_HAS_RESERVED_FIELD;
1072
1123
  if (community.features?.noUpvotes && votePublication.vote === 1) return messages.ERR_NOT_ALLOWED_TO_PUBLISH_UPVOTES;
1073
1124
  if (community.features?.noDownvotes && votePublication.vote === -1) return messages.ERR_NOT_ALLOWED_TO_PUBLISH_DOWNVOTES;
1074
1125
  const commentToVoteOn = community._dbHandler.queryComment(request.vote.commentCid);
@@ -1082,7 +1133,7 @@ async function checkVotePublication(community, request) {
1082
1133
  async function checkCommentModerationPublication(community, request) {
1083
1134
  if (!request.commentModeration) return void 0;
1084
1135
  const commentModerationPublication = request.commentModeration;
1085
- if (import_commonjs.intersection(CommentModerationReservedFields, import_commonjs.keys.strict(commentModerationPublication)).length > 0) return messages.ERR_COMMENT_MODERATION_HAS_RESERVED_FIELD;
1136
+ if (r$2(CommentModerationReservedFields, t$6(commentModerationPublication)).length > 0) return messages.ERR_COMMENT_MODERATION_HAS_RESERVED_FIELD;
1086
1137
  const isAuthorMod = await isPublicationAuthorPartOfRoles(community, commentModerationPublication, [
1087
1138
  "owner",
1088
1139
  "moderator",
@@ -1099,18 +1150,18 @@ async function checkCommentModerationPublication(community, request) {
1099
1150
  async function checkCommunityEditPublication(community, request) {
1100
1151
  if (!request.communityEdit) return void 0;
1101
1152
  const communityEdit = request.communityEdit;
1102
- if (import_commonjs.intersection(CommunityEditPublicationPubsubReservedFields, import_commonjs.keys.strict(communityEdit)).length > 0) return messages.ERR_COMMUNITY_EDIT_HAS_RESERVED_FIELD;
1153
+ if (r$2(CommunityEditPublicationPubsubReservedFields, t$6(communityEdit)).length > 0) return messages.ERR_COMMUNITY_EDIT_HAS_RESERVED_FIELD;
1103
1154
  if (communityEdit.communityEdit.roles || communityEdit.communityEdit.address) {
1104
1155
  if (!await isPublicationAuthorPartOfRoles(community, communityEdit, ["owner"])) return messages.ERR_COMMUNITY_EDIT_ATTEMPTED_TO_MODIFY_OWNER_EXCLUSIVE_PROPS;
1105
1156
  }
1106
1157
  if (!await isPublicationAuthorPartOfRoles(community, communityEdit, ["owner", "admin"])) return messages.ERR_COMMUNITY_EDIT_ATTEMPTED_TO_MODIFY_COMMUNITY_WITHOUT_BEING_OWNER_OR_ADMIN;
1107
- const allowedCommunityEditKeys = [...import_commonjs.keys.strict(CommunityIpfsSchema.shape), "address"];
1108
- if (import_commonjs.difference(import_commonjs.keys.strict(communityEdit.communityEdit), allowedCommunityEditKeys).length > 0) return messages.ERR_COMMUNITY_EDIT_ATTEMPTED_TO_NON_PUBLIC_PROPS;
1158
+ const allowedCommunityEditKeys = [...t$6(CommunityIpfsSchema.shape), "address"];
1159
+ if (r$1(t$6(communityEdit.communityEdit), allowedCommunityEditKeys).length > 0) return messages.ERR_COMMUNITY_EDIT_ATTEMPTED_TO_NON_PUBLIC_PROPS;
1109
1160
  }
1110
1161
  async function checkCommentEditPublication(community, request) {
1111
1162
  if (!request.commentEdit) return void 0;
1112
1163
  const commentEditPublication = request.commentEdit;
1113
- if (import_commonjs.intersection(CommentEditReservedFields, import_commonjs.keys.strict(commentEditPublication)).length > 0) return messages.ERR_COMMENT_EDIT_HAS_RESERVED_FIELD;
1164
+ if (r$2(CommentEditReservedFields, t$6(commentEditPublication)).length > 0) return messages.ERR_COMMENT_EDIT_HAS_RESERVED_FIELD;
1114
1165
  const commentToBeEdited = community._dbHandler.queryComment(commentEditPublication.commentCid);
1115
1166
  if (!commentToBeEdited) return messages.ERR_COMMENT_EDIT_NO_COMMENT_TO_EDIT;
1116
1167
  if (community._dbHandler.hasCommentEditWithSignatureEncoded(commentEditPublication.signature.signature)) return messages.ERR_DUPLICATE_COMMENT_EDIT;
@@ -1219,7 +1270,7 @@ async function prepareCommentWithAnonymity(community, originalComment) {
1219
1270
  });
1220
1271
  const displayName = originalComment.author?.displayName;
1221
1272
  const sanitizedAuthor = cleanWireAuthor(displayName !== void 0 ? { displayName } : void 0);
1222
- const anonymizedComment = import_commonjs.clone(originalComment);
1273
+ const anonymizedComment = t$10(originalComment);
1223
1274
  if (sanitizedAuthor !== void 0) anonymizedComment.author = sanitizedAuthor;
1224
1275
  else delete anonymizedComment.author;
1225
1276
  anonymizedComment.signature = await signComment({
@@ -1247,7 +1298,7 @@ async function prepareCommentEditWithAlias(community, originalEdit) {
1247
1298
  privateKey: aliasSignerOfComment.aliasPrivateKey,
1248
1299
  type: "ed25519"
1249
1300
  });
1250
- const commentEditSignedByAlias = import_commonjs.clone(originalEdit);
1301
+ const commentEditSignedByAlias = t$10(originalEdit);
1251
1302
  delete commentEditSignedByAlias.author;
1252
1303
  commentEditSignedByAlias.signature = await signCommentEdit({
1253
1304
  edit: {
@@ -1275,10 +1326,10 @@ async function storeCommentEdit(community, commentEditRaw, challengeRequestId) {
1275
1326
  authorSignerAddress,
1276
1327
  insertedAt: timestamp()
1277
1328
  };
1278
- const extraPropsInEdit = import_commonjs.difference(import_commonjs.keys.strict(commentEditRaw), import_commonjs.keys.strict(CommentEditPubsubMessagePublicationSchema.shape)).filter((key) => key !== "communityAddress");
1329
+ const extraPropsInEdit = r$1(t$6(commentEditRaw), t$6(CommentEditPubsubMessagePublicationSchema.shape)).filter((key) => key !== "communityAddress");
1279
1330
  if (extraPropsInEdit.length > 0) {
1280
1331
  log("Found extra props on CommentEdit", extraPropsInEdit, "Will be adding them to extraProps column");
1281
- editTableRow.extraProps = import_commonjs.pick(commentEditRaw, extraPropsInEdit);
1332
+ editTableRow.extraProps = t$9(commentEditRaw, extraPropsInEdit);
1282
1333
  }
1283
1334
  if (community._dbHandler.hasCommentEditWithSignatureEncoded(editTableRow.signature.signature)) throw new PKCError("ERR_DUPLICATE_COMMENT_EDIT", { editTableRow });
1284
1335
  community._dbHandler.insertCommentEdits([editTableRow]);
@@ -1322,10 +1373,10 @@ async function storeCommentModeration(community, commentModRaw, challengeRequest
1322
1373
  targetAuthorDomain
1323
1374
  };
1324
1375
  if (community._dbHandler.hasCommentModerationWithSignatureEncoded(modTableRow.signature.signature)) throw new PKCError("ERR_DUPLICATE_COMMENT_MODERATION", { modTableRow });
1325
- const extraPropsInMod = import_commonjs.difference(import_commonjs.keys.strict(commentModRaw), import_commonjs.keys.strict(CommentModerationPubsubMessagePublicationSchema.shape)).filter((key) => key !== "communityAddress");
1376
+ const extraPropsInMod = r$1(t$6(commentModRaw), t$6(CommentModerationPubsubMessagePublicationSchema.shape)).filter((key) => key !== "communityAddress");
1326
1377
  if (extraPropsInMod.length > 0) {
1327
1378
  log("Found extra props on CommentModeration", extraPropsInMod, "Will be adding them to extraProps column");
1328
- modTableRow.extraProps = import_commonjs.pick(commentModRaw, extraPropsInMod);
1379
+ modTableRow.extraProps = t$9(commentModRaw, extraPropsInMod);
1329
1380
  }
1330
1381
  if (modTableRow.commentModeration.purged) {
1331
1382
  log("commentModeration.purged=true, and therefore will delete the post/comment and all its reply tree from the db as well as unpin the cids from ipfs", "comment cid is", modTableRow.commentCid);
@@ -1357,7 +1408,7 @@ async function storeVote(community, newVoteProps, challengeRequestId) {
1357
1408
  const authorSignerAddress = await getPKCAddressFromPublicKey(newVoteProps.signature.publicKey);
1358
1409
  community._dbHandler.deleteVote(authorSignerAddress, newVoteProps.commentCid);
1359
1410
  const voteTableRow = {
1360
- ...import_commonjs.pick(newVoteProps, [
1411
+ ...t$9(newVoteProps, [
1361
1412
  "vote",
1362
1413
  "commentCid",
1363
1414
  "protocolVersion",
@@ -1366,10 +1417,10 @@ async function storeVote(community, newVoteProps, challengeRequestId) {
1366
1417
  authorSignerAddress,
1367
1418
  insertedAt: timestamp()
1368
1419
  };
1369
- const extraPropsInVote = import_commonjs.difference(import_commonjs.keys.strict(newVoteProps), import_commonjs.keys.strict(VotePubsubMessagePublicationSchema.shape));
1420
+ const extraPropsInVote = r$1(t$6(newVoteProps), t$6(VotePubsubMessagePublicationSchema.shape));
1370
1421
  if (extraPropsInVote.length > 0) {
1371
1422
  log("Found extra props on Vote", extraPropsInVote, "Will be adding them to extraProps column");
1372
- voteTableRow.extraProps = import_commonjs.pick(newVoteProps, extraPropsInVote);
1423
+ voteTableRow.extraProps = t$9(newVoteProps, extraPropsInVote);
1373
1424
  }
1374
1425
  community._dbHandler.insertVotes([voteTableRow]);
1375
1426
  log("Inserted vote", "of comment", voteTableRow.commentCid, "into db", "with props", voteTableRow);
@@ -1379,7 +1430,7 @@ async function storeCommunityEditPublication(community, editProps, challengeRequ
1379
1430
  const authorSignerAddress = await getPKCAddressFromPublicKey(editProps.signature.publicKey);
1380
1431
  const authorIdentity = getAuthorNameFromWire(editProps.author) || authorSignerAddress;
1381
1432
  log("Received community edit", editProps.communityEdit, "from author", authorIdentity, "with signer address", authorSignerAddress, "Will be using these props to edit the community props");
1382
- const propsAfterEdit = import_commonjs.pick(community, import_commonjs.keys.strict(editProps.communityEdit));
1433
+ const propsAfterEdit = t$9(community, t$6(editProps.communityEdit));
1383
1434
  log("Current props from community edit (not edited yet)", propsAfterEdit);
1384
1435
  (0, import_lodash_merge.default)(propsAfterEdit, editProps.communityEdit);
1385
1436
  await community.edit(propsAfterEdit);
@@ -1429,10 +1480,10 @@ async function storeComment(community, opts) {
1429
1480
  insertedAt: timestamp(),
1430
1481
  pendingApproval
1431
1482
  };
1432
- const unknownProps = import_commonjs.difference(import_commonjs.keys.strict(commentIpfs), import_commonjs.keys.strict(CommentIpfsSchema.shape)).filter((key) => key !== "communityAddress");
1483
+ const unknownProps = r$1(t$6(commentIpfs), t$6(CommentIpfsSchema.shape)).filter((key) => key !== "communityAddress");
1433
1484
  if (unknownProps.length > 0) {
1434
1485
  log("Found extra props on Comment", unknownProps, "Will be adding them to extraProps column");
1435
- commentRow.extraProps = import_commonjs.pick(commentIpfs, unknownProps);
1486
+ commentRow.extraProps = t$9(commentIpfs, unknownProps);
1436
1487
  }
1437
1488
  if (challengeAggregate?.aggregatedCommentUpdate && Object.keys(challengeAggregate.aggregatedCommentUpdate).length > 0) commentRow.challengeCommentUpdate = challengeAggregate.aggregatedCommentUpdate;
1438
1489
  if (originalCommentSignatureEncoded) commentRow.originalCommentSignatureEncoded = originalCommentSignatureEncoded;
@@ -3203,7 +3254,7 @@ var DbHandler = class {
3203
3254
  "reply",
3204
3255
  "vote"
3205
3256
  ];
3206
- const newSettings = import_commonjs.clone(oldSettings);
3257
+ const newSettings = t$10(oldSettings);
3207
3258
  if (Array.isArray(newSettings.challenges)) {
3208
3259
  newSettings.challenges = newSettings.challenges.filter((cs) => !cs.name || cs.path || cs.name in pkcJsChallenges);
3209
3260
  for (const oldChallengeSetting of newSettings.challenges) if (oldChallengeSetting.exclude) for (const oldExcludeSetting of oldChallengeSetting.exclude) for (const fieldToMove of fieldsToRemove) delete oldExcludeSetting[fieldToMove];
@@ -3222,9 +3273,9 @@ var DbHandler = class {
3222
3273
  if (needToMigrate) {
3223
3274
  if (dbExistsAlready && currentDbVersion > 0) {
3224
3275
  this.destoryConnection();
3225
- backupDbPath = path$1.join(path$1.dirname(dbPath), ".backup_before_migration", `${path$1.basename(dbPath)}.${currentDbVersion}.${timestamp()}`);
3226
- log(`Copying db ${path$1.basename(dbPath)} to ${backupDbPath} before migration`);
3227
- if (!fs.existsSync(path$1.dirname(backupDbPath))) await fs.promises.mkdir(path$1.dirname(backupDbPath), { recursive: true });
3276
+ backupDbPath = path.join(path.dirname(dbPath), ".backup_before_migration", `${path.basename(dbPath)}.${currentDbVersion}.${timestamp()}`);
3277
+ log(`Copying db ${path.basename(dbPath)} to ${backupDbPath} before migration`);
3278
+ if (!fs.existsSync(path.dirname(backupDbPath))) await fs.promises.mkdir(path.dirname(backupDbPath), { recursive: true });
3228
3279
  const sourceDb = new Database(dbPath, { fileMustExist: true });
3229
3280
  await sourceDb.backup(backupDbPath);
3230
3281
  sourceDb.close();
@@ -3396,7 +3447,7 @@ var DbHandler = class {
3396
3447
  const commentToBeEdited = this.queryComment(srcRecord.commentCid);
3397
3448
  if (!commentToBeEdited) throw Error(`Failed to compute isAuthorEdit for ${srcRecord.commentCid}`);
3398
3449
  srcRecord["isAuthorEdit"] = parsedSig.publicKey === commentToBeEdited.signature.publicKey;
3399
- const extraProps = removeNullUndefinedValues(import_commonjs.pick(srcRecord, ["removed"]));
3450
+ const extraProps = removeNullUndefinedValues(t$9(srcRecord, ["removed"]));
3400
3451
  if (Object.keys(extraProps).length > 0) srcRecord.extraProps = {
3401
3452
  ...srcRecord.extraProps,
3402
3453
  ...extraProps
@@ -3407,7 +3458,7 @@ var DbHandler = class {
3407
3458
  srcRecord["authorSignerAddress"] = await getPKCAddressFromPublicKey(sig["publicKey"]);
3408
3459
  }
3409
3460
  if (srcTable === TABLES.COMMENTS) {
3410
- const extraProps = removeNullUndefinedValues(import_commonjs.pick(srcRecord, ["ipnsName"]));
3461
+ const extraProps = removeNullUndefinedValues(t$9(srcRecord, ["ipnsName"]));
3411
3462
  if (Object.keys(extraProps).length > 0) srcRecord.extraProps = {
3412
3463
  ...srcRecord.extraProps,
3413
3464
  ...extraProps
@@ -3528,7 +3579,7 @@ var DbHandler = class {
3528
3579
  }
3529
3580
  const commentEditWithExtraProps = this._spreadExtraProps({ ...commentEditRecord });
3530
3581
  const validRes = await verifyCommentEdit({
3531
- edit: import_commonjs.pick(commentEditWithExtraProps, [...commentEditWithExtraProps.signature.signedPropertyNames, "signature"]),
3582
+ edit: t$9(commentEditWithExtraProps, [...commentEditWithExtraProps.signature.signedPropertyNames, "signature"]),
3532
3583
  resolveAuthorNames: false,
3533
3584
  clientsManager: this._community._clientsManager
3534
3585
  });
@@ -3614,7 +3665,7 @@ var DbHandler = class {
3614
3665
  (cid, authorSignerAddress, author, link, linkWidth, linkHeight, thumbnailUrl, thumbnailUrlWidth, thumbnailUrlHeight, parentCid, postCid, previousCid, communityPublicKey, communityName, content, timestamp, signature, originalCommentSignatureEncoded, title, depth, linkHtmlTagName, flairs, spoiler, pendingApproval, number, postNumber, nsfw, pseudonymityMode, quotedCids, extraProps, challengeCommentUpdate, protocolVersion, insertedAt)
3615
3666
  VALUES (@cid, @authorSignerAddress, @author, @link, @linkWidth, @linkHeight, @thumbnailUrl, @thumbnailUrlWidth, @thumbnailUrlHeight, @parentCid, @postCid, @previousCid, @communityPublicKey, @communityName, @content, @timestamp, @signature, @originalCommentSignatureEncoded, @title, @depth, @linkHtmlTagName, @flairs, @spoiler, @pendingApproval, @number, @postNumber, @nsfw, @pseudonymityMode, @quotedCids, @extraProps, @challengeCommentUpdate, @protocolVersion, @insertedAt)
3616
3667
  `);
3617
- const defaults = import_commonjs.mapToObj(columnNames, (column) => [column, null]);
3668
+ const defaults = t$7(columnNames, (column) => [column, null]);
3618
3669
  this._db.transaction((items) => {
3619
3670
  for (const comment of items) {
3620
3671
  const completeComment = {
@@ -3655,7 +3706,7 @@ var DbHandler = class {
3655
3706
  publishedToPostUpdatesMFS = excluded.publishedToPostUpdatesMFS,
3656
3707
  insertedAt = excluded.insertedAt
3657
3708
  `);
3658
- const defaults = import_commonjs.mapToObj(columnNames, (column) => [column, null]);
3709
+ const defaults = t$7(columnNames, (column) => [column, null]);
3659
3710
  this._db.transaction((items) => {
3660
3711
  for (const update of items) {
3661
3712
  const completeUpdate = {
@@ -3675,7 +3726,7 @@ var DbHandler = class {
3675
3726
  (commentCid, author, signature, modSignerAddress, protocolVersion, communityPublicKey, communityName, timestamp, commentModeration, insertedAt, extraProps, targetAuthorSignerAddress, targetAuthorDomain)
3676
3727
  VALUES (@commentCid, @author, @signature, @modSignerAddress, @protocolVersion, @communityPublicKey, @communityName, @timestamp, @commentModeration, @insertedAt, @extraProps, @targetAuthorSignerAddress, @targetAuthorDomain)
3677
3728
  `);
3678
- const defaults = import_commonjs.mapToObj(columnNames, (column) => [column, null]);
3729
+ const defaults = t$7(columnNames, (column) => [column, null]);
3679
3730
  this._db.transaction((items) => {
3680
3731
  for (const mod of items) {
3681
3732
  const completeMod = {
@@ -3695,7 +3746,7 @@ var DbHandler = class {
3695
3746
  (commentCid, authorSignerAddress, author, signature, protocolVersion, communityPublicKey, communityName, timestamp, content, reason, deleted, flairs, spoiler, nsfw, isAuthorEdit, insertedAt, extraProps)
3696
3747
  VALUES (@commentCid, @authorSignerAddress, @author, @signature, @protocolVersion, @communityPublicKey, @communityName, @timestamp, @content, @reason, @deleted, @flairs, @spoiler, @nsfw, @isAuthorEdit, @insertedAt, @extraProps)
3697
3748
  `);
3698
- const defaults = import_commonjs.mapToObj(columnNames, (column) => [column, null]);
3749
+ const defaults = t$7(columnNames, (column) => [column, null]);
3699
3750
  this._db.transaction((items) => {
3700
3751
  for (const edit of items) {
3701
3752
  const completeEdit = {
@@ -3811,8 +3862,8 @@ var DbHandler = class {
3811
3862
  return result.max_timestamp;
3812
3863
  }
3813
3864
  queryPageComments(options) {
3814
- const commentUpdateSelects = import_commonjs.keys.strict(options.commentUpdateFieldsToExclude ? import_commonjs.omit(CommentUpdateSchema.shape, options.commentUpdateFieldsToExclude) : CommentUpdateSchema.shape).map((col) => `${TABLES.COMMENT_UPDATES}.${col} AS commentUpdate_${col}`);
3815
- const commentIpfsSelects = [...import_commonjs.keys.strict(CommentIpfsSchema.shape), "extraProps"].map((col) => `${TABLES.COMMENTS}.${col} AS commentIpfs_${col}`);
3865
+ const commentUpdateSelects = t$6(options.commentUpdateFieldsToExclude ? n$3(CommentUpdateSchema.shape, options.commentUpdateFieldsToExclude) : CommentUpdateSchema.shape).map((col) => `${TABLES.COMMENT_UPDATES}.${col} AS commentUpdate_${col}`);
3866
+ const commentIpfsSelects = [...t$6(CommentIpfsSchema.shape), "extraProps"].map((col) => `${TABLES.COMMENTS}.${col} AS commentIpfs_${col}`);
3816
3867
  const { whereClauses, params } = this._buildPageQueryParts(options);
3817
3868
  const queryStr = `
3818
3869
  SELECT ${commentIpfsSelects.join(", ")}, ${commentUpdateSelects.join(", ")}
@@ -3828,8 +3879,8 @@ var DbHandler = class {
3828
3879
  });
3829
3880
  }
3830
3881
  queryPageCommentsWithResolvedReplies(options) {
3831
- const commentUpdateCols = import_commonjs.keys.strict(CommentUpdateSchema.shape);
3832
- const commentIpfsCols = [...import_commonjs.keys.strict(CommentIpfsSchema.shape), "extraProps"];
3882
+ const commentUpdateCols = t$6(CommentUpdateSchema.shape);
3883
+ const commentIpfsCols = [...t$6(CommentIpfsSchema.shape), "extraProps"];
3833
3884
  const baseCommentUpdateSelects = commentUpdateCols.map((col) => `${TABLES.COMMENT_UPDATES}.${col} AS commentUpdate_${col}`);
3834
3885
  const baseCommentIpfsSelects = commentIpfsCols.map((col) => `${TABLES.COMMENTS}.${col} AS commentIpfs_${col}`);
3835
3886
  const recCommentUpdateSelects = commentUpdateCols.map((col) => `cu2.${col} AS commentUpdate_${col}`);
@@ -3925,8 +3976,8 @@ var DbHandler = class {
3925
3976
  }));
3926
3977
  }
3927
3978
  resolveRepliesCidRefsForEntries(entries) {
3928
- const commentUpdateCols = import_commonjs.keys.strict(CommentUpdateSchema.shape);
3929
- const commentIpfsCols = [...import_commonjs.keys.strict(CommentIpfsSchema.shape), "extraProps"];
3979
+ const commentUpdateCols = t$6(CommentUpdateSchema.shape);
3980
+ const commentIpfsCols = [...t$6(CommentIpfsSchema.shape), "extraProps"];
3930
3981
  const allCids = [];
3931
3982
  for (const entry of entries) {
3932
3983
  const replies = entry.commentUpdate.replies;
@@ -4060,9 +4111,9 @@ var DbHandler = class {
4060
4111
  });
4061
4112
  }
4062
4113
  queryFlattenedPageReplies(options) {
4063
- const commentUpdateCols = import_commonjs.keys.strict(options.commentUpdateFieldsToExclude ? import_commonjs.omit(CommentUpdateSchema.shape, options.commentUpdateFieldsToExclude) : CommentUpdateSchema.shape);
4114
+ const commentUpdateCols = t$6(options.commentUpdateFieldsToExclude ? n$3(CommentUpdateSchema.shape, options.commentUpdateFieldsToExclude) : CommentUpdateSchema.shape);
4064
4115
  commentUpdateCols.map((col) => `c_updates.${col} AS commentUpdate_${col}`);
4065
- const commentIpfsSelects = [...import_commonjs.keys.strict(CommentIpfsSchema.shape), "extraProps"].map((col) => `comments_alias.${col} AS commentIpfs_${col}`);
4116
+ const commentIpfsSelects = [...t$6(CommentIpfsSchema.shape), "extraProps"].map((col) => `comments_alias.${col} AS commentIpfs_${col}`);
4066
4117
  let baseWhereClausesStr = "";
4067
4118
  let recursiveWhereClausesStr = "";
4068
4119
  const params = [options.parentCid];
@@ -4561,8 +4612,8 @@ var DbHandler = class {
4561
4612
  if (!row) return void 0;
4562
4613
  const parsed = this._spreadExtraProps(this._parseCommentEditsRow(row));
4563
4614
  const signedKeys = parsed.signature.signedPropertyNames;
4564
- const commentEditFields = import_commonjs.keys.strict(CommentEditPubsubMessagePublicationSchema.shape);
4565
- return import_commonjs.pick(parsed, [
4615
+ const commentEditFields = t$6(CommentEditPubsubMessagePublicationSchema.shape);
4616
+ return t$9(parsed, [
4566
4617
  "signature",
4567
4618
  ...signedKeys,
4568
4619
  ...commentEditFields
@@ -4701,7 +4752,7 @@ var DbHandler = class {
4701
4752
  `;
4702
4753
  const flags = this._db.prepare(query).get(cid);
4703
4754
  if (!flags) return {};
4704
- return import_commonjs.mapValues(removeNullUndefinedValues(flags), Boolean);
4755
+ return t$12(removeNullUndefinedValues(flags), Boolean);
4705
4756
  }
4706
4757
  queryAuthorEditDeleted(cid) {
4707
4758
  const result = this._db.prepare(`
@@ -4924,11 +4975,11 @@ var DbHandler = class {
4924
4975
  }
4925
4976
  const authorPosts = authorCommentsData.filter((c) => c.depth === 0);
4926
4977
  const authorReplies = authorCommentsData.filter((c) => c.depth > 0);
4927
- const postScore = import_commonjs.sumBy(authorPosts, (p) => p.upvoteCount) - import_commonjs.sumBy(authorPosts, (p) => p.downvoteCount);
4928
- const replyScore = import_commonjs.sumBy(authorReplies, (r) => r.upvoteCount) - import_commonjs.sumBy(authorReplies, (r) => r.downvoteCount);
4929
- const lastCommentCid = import_commonjs.maxBy(authorCommentsData, (c) => c.rowid)?.cid;
4978
+ const postScore = t(authorPosts, (p) => p.upvoteCount) - t(authorPosts, (p) => p.downvoteCount);
4979
+ const replyScore = t(authorReplies, (r) => r.upvoteCount) - t(authorReplies, (r) => r.downvoteCount);
4980
+ const lastCommentCid = n$5(authorCommentsData, [(c) => c.rowid, "desc"])?.cid;
4930
4981
  if (!lastCommentCid) throw Error("Failed to query communityAuthor.lastCommentCid");
4931
- const firstCommentTimestamp = import_commonjs.minBy(authorCommentsData, (c) => c.rowid)?.timestamp;
4982
+ const firstCommentTimestamp = n$5(authorCommentsData, (c) => c.rowid)?.timestamp;
4932
4983
  if (typeof firstCommentTimestamp !== "number") throw Error("Failed to query communityAuthor.firstCommentTimestamp");
4933
4984
  return {
4934
4985
  postScore,
@@ -5015,7 +5066,7 @@ var DbHandler = class {
5015
5066
  if (allCommentsToUpdate.length > 0) this.forceUpdateOnAllCommentsWithCid(allCommentsToUpdate);
5016
5067
  }
5017
5068
  if (!isNestedCall) this.commitTransaction();
5018
- return import_commonjs.uniqueBy(purgedRecords, (record) => record.commentTableRow.cid);
5069
+ return n(purgedRecords, (record) => record.commentTableRow.cid);
5019
5070
  } catch (error) {
5020
5071
  log.error(`Error during comment purge for ${cid}: ${error}`);
5021
5072
  if (!isNestedCall) this.rollbackTransaction();
@@ -5027,10 +5078,10 @@ var DbHandler = class {
5027
5078
  if (this._db || this._keyv) await this.destoryConnection();
5028
5079
  this._transactionDepth = 0;
5029
5080
  const dataPath = this._community._pkc.dataPath;
5030
- const oldPathString = path$1.join(dataPath, "communities", oldDbName);
5031
- const newPathString = path$1.join(dataPath, "communities", newDbName);
5032
- await fs.promises.mkdir(path$1.dirname(oldPathString), { recursive: true });
5033
- await fs.promises.mkdir(path$1.dirname(newPathString), { recursive: true });
5081
+ const oldPathString = path.join(dataPath, "communities", oldDbName);
5082
+ const newPathString = path.join(dataPath, "communities", newDbName);
5083
+ await fs.promises.mkdir(path.dirname(oldPathString), { recursive: true });
5084
+ await fs.promises.mkdir(path.dirname(newPathString), { recursive: true });
5034
5085
  try {
5035
5086
  if (!fs.existsSync(oldPathString)) log(`Old DB file ${oldPathString} does not exist. Cannot backup/rename.`);
5036
5087
  else {
@@ -5052,8 +5103,8 @@ var DbHandler = class {
5052
5103
  }
5053
5104
  async lockCommunityStart(communityAddress = this._community.address) {
5054
5105
  const log = logger_default("pkc-js:local-community:db-handler:lock:start");
5055
- const lockfilePath = path$1.join(this._community._pkc.dataPath, "communities", `${communityAddress}.start.lock`);
5056
- const communityDbPath = path$1.join(this._community._pkc.dataPath, "communities", communityAddress);
5106
+ const lockfilePath = path.join(this._community._pkc.dataPath, "communities", `${communityAddress}.start.lock`);
5107
+ const communityDbPath = path.join(this._community._pkc.dataPath, "communities", communityAddress);
5057
5108
  try {
5058
5109
  await import_src.default.lock(communityDbPath, {
5059
5110
  lockfilePath,
@@ -5074,8 +5125,8 @@ var DbHandler = class {
5074
5125
  async unlockCommunityStart(communityAddress = this._community.address) {
5075
5126
  const log = logger_default("pkc-js:local-community:db-handler:unlock:start");
5076
5127
  log.trace(`Attempting to unlock the start of community (${communityAddress})`);
5077
- const lockfilePath = path$1.join(this._community._pkc.dataPath, "communities", `${communityAddress}.start.lock`);
5078
- const communityDbPath = path$1.join(this._community._pkc.dataPath, "communities", communityAddress);
5128
+ const lockfilePath = path.join(this._community._pkc.dataPath, "communities", `${communityAddress}.start.lock`);
5129
+ const communityDbPath = path.join(this._community._pkc.dataPath, "communities", communityAddress);
5079
5130
  if (!fs.existsSync(lockfilePath) || !fs.existsSync(communityDbPath)) return;
5080
5131
  try {
5081
5132
  await import_src.default.unlock(communityDbPath, { lockfilePath });
@@ -5086,8 +5137,8 @@ var DbHandler = class {
5086
5137
  }
5087
5138
  }
5088
5139
  async isCommunityStartLocked(communityAddress = this._community.address) {
5089
- const lockfilePath = path$1.join(this._community._pkc.dataPath, "communities", `${communityAddress}.start.lock`);
5090
- const communityDbPath = path$1.join(this._community._pkc.dataPath, "communities", communityAddress);
5140
+ const lockfilePath = path.join(this._community._pkc.dataPath, "communities", `${communityAddress}.start.lock`);
5141
+ const communityDbPath = path.join(this._community._pkc.dataPath, "communities", communityAddress);
5091
5142
  return await import_src.default.check(communityDbPath, {
5092
5143
  lockfilePath,
5093
5144
  realpath: false,
@@ -5096,8 +5147,8 @@ var DbHandler = class {
5096
5147
  }
5097
5148
  async lockCommunityState() {
5098
5149
  const log = logger_default("pkc-js:local-community:db-handler:lock:lockCommunityState");
5099
- const lockfilePath = path$1.join(this._community._pkc.dataPath, "communities", `${this._community.address}.state.lock`);
5100
- const communityDbPath = path$1.join(this._community._pkc.dataPath, "communities", this._community.address);
5150
+ const lockfilePath = path.join(this._community._pkc.dataPath, "communities", `${this._community.address}.state.lock`);
5151
+ const communityDbPath = path.join(this._community._pkc.dataPath, "communities", this._community.address);
5101
5152
  try {
5102
5153
  await import_src.default.lock(communityDbPath, {
5103
5154
  lockfilePath,
@@ -5114,8 +5165,8 @@ var DbHandler = class {
5114
5165
  }
5115
5166
  async unlockCommunityState() {
5116
5167
  const log = logger_default("pkc-js:local-community:db-handler:lock:unlockCommunityState");
5117
- const lockfilePath = path$1.join(this._community._pkc.dataPath, "communities", `${this._community.address}.state.lock`);
5118
- const communityDbPath = path$1.join(this._community._pkc.dataPath, "communities", this._community.address);
5168
+ const lockfilePath = path.join(this._community._pkc.dataPath, "communities", `${this._community.address}.state.lock`);
5169
+ const communityDbPath = path.join(this._community._pkc.dataPath, "communities", this._community.address);
5119
5170
  if (!fs.existsSync(lockfilePath)) return;
5120
5171
  try {
5121
5172
  await import_src.default.unlock(communityDbPath, { lockfilePath });
@@ -5125,7 +5176,7 @@ var DbHandler = class {
5125
5176
  }
5126
5177
  }
5127
5178
  communityDbExists() {
5128
- const communityDbPath = path$1.join(this._community._pkc.dataPath, "communities", this._community.address);
5179
+ const communityDbPath = path.join(this._community._pkc.dataPath, "communities", this._community.address);
5129
5180
  return fs.existsSync(communityDbPath);
5130
5181
  }
5131
5182
  markCommentsAsPublishedToPostUpdates(commentCids) {
@@ -5189,9 +5240,9 @@ var DbHandler = class {
5189
5240
  ${activeScoreDescendantWhere}
5190
5241
  ) SELECT post_cid, MAX(timestamp) as active_score FROM descendants GROUP BY post_cid
5191
5242
  `;
5192
- const commentUpdateSelects = import_commonjs.keys.strict(pageOptions.commentUpdateFieldsToExclude ? import_commonjs.omit(CommentUpdateSchema.shape, pageOptions.commentUpdateFieldsToExclude) : CommentUpdateSchema.shape).map((col) => `cu.${col} AS commentUpdate_${col}`);
5243
+ const commentUpdateSelects = t$6(pageOptions.commentUpdateFieldsToExclude ? n$3(CommentUpdateSchema.shape, pageOptions.commentUpdateFieldsToExclude) : CommentUpdateSchema.shape).map((col) => `cu.${col} AS commentUpdate_${col}`);
5193
5244
  let postsQueryStr = `
5194
- SELECT ${[...import_commonjs.keys.strict(CommentIpfsSchema.shape), "extraProps"].map((col) => `c.${col} AS commentIpfs_${col}`).join(", ")}, ${commentUpdateSelects.join(", ")}, asc_scores.active_score
5245
+ SELECT ${[...t$6(CommentIpfsSchema.shape), "extraProps"].map((col) => `c.${col} AS commentIpfs_${col}`).join(", ")}, ${commentUpdateSelects.join(", ")}, asc_scores.active_score
5195
5246
  FROM ${TABLES.COMMENTS} c INNER JOIN ${TABLES.COMMENT_UPDATES} cu ON c.cid = cu.cid
5196
5247
  INNER JOIN (${activeScoresCte}) AS asc_scores ON c.cid = asc_scores.post_cid
5197
5248
  `;
@@ -5221,7 +5272,7 @@ var DbHandler = class {
5221
5272
  _processRecordsForDbBeforeInsert(records) {
5222
5273
  return records.map((record) => {
5223
5274
  const processed = { ...record };
5224
- for (const [key, value] of import_commonjs.entries(processed)) if (import_commonjs.isPlainObject(value) || Array.isArray(value)) processed[key] = JSON.stringify(value);
5275
+ for (const [key, value] of t$2(processed)) if (e(value) || Array.isArray(value)) processed[key] = JSON.stringify(value);
5225
5276
  else if (typeof value === "boolean") processed[key] = value ? 1 : 0;
5226
5277
  return processed;
5227
5278
  });
@@ -5455,7 +5506,7 @@ var PageGenerator = class {
5455
5506
  const timestampLower = options.baseTimestamp - TIMEFRAMES_TO_SECONDS[sortProps.timeframe];
5456
5507
  unpinnedComments = unpinnedComments.filter((obj) => obj.comment.timestamp >= timestampLower);
5457
5508
  }
5458
- const commentsSorted = pinnedComments.concat(unpinnedComments).map((comment) => import_commonjs.omit(comment, ["activeScore"]));
5509
+ const commentsSorted = pinnedComments.concat(unpinnedComments).map((comment) => n$3(comment, ["activeScore"]));
5459
5510
  if (commentsSorted.length === 0) return [];
5460
5511
  return await this._chunkComments({
5461
5512
  comments: commentsSorted,
@@ -5502,7 +5553,7 @@ var PageGenerator = class {
5502
5553
  if (preloadedChunk.length === 1) return { singlePreloadedPage: { [preloadedPageSortName]: { comments: preloadedChunk[0] } } };
5503
5554
  const sortResults = [];
5504
5555
  sortResults.push(await this.addPreloadedCommentChunksToIpfs(preloadedChunk, preloadedPageSortName));
5505
- const nonPreloadedSorts = import_commonjs.keys.strict(POSTS_SORT_TYPES).filter((sortName) => sortName !== preloadedPageSortName);
5556
+ const nonPreloadedSorts = t$6(POSTS_SORT_TYPES).filter((sortName) => sortName !== preloadedPageSortName);
5506
5557
  await Promise.all(nonPreloadedSorts.map(async (sortName) => {
5507
5558
  sortResults.push(await this.sortChunkAddIpfsNonPreloaded(rawPosts, sortName, {
5508
5559
  ...pageOptions,
@@ -5574,7 +5625,7 @@ var PageGenerator = class {
5574
5625
  firstPageSizeBytes: 1024 * 1024
5575
5626
  }));
5576
5627
  else sortResults.push(await this.addPreloadedCommentChunksToIpfs(preloadedChunk, preloadedReplyPageSortName));
5577
- const nonPreloadedSorts = import_commonjs.keys.strict(POST_REPLIES_SORT_TYPES).filter((sortName) => sortName !== preloadedReplyPageSortName);
5628
+ const nonPreloadedSorts = t$6(POST_REPLIES_SORT_TYPES).filter((sortName) => sortName !== preloadedReplyPageSortName);
5578
5629
  const flattenedReplies = this._community._dbHandler.queryFlattenedPageReplies({
5579
5630
  ...pageOptions,
5580
5631
  commentUpdateFieldsToExclude: ["replies"]
@@ -5614,7 +5665,7 @@ var PageGenerator = class {
5614
5665
  });
5615
5666
  const disablePreload = await getSerializedCommentsSize(preloadedChunk[0], preloadedChunk.length > 1) > preloadedPageSizeBytes;
5616
5667
  if (!disablePreload && preloadedChunk.length === 1) return { singlePreloadedPage: { [preloadedReplyPageSortName]: { comments: preloadedChunk[0] } } };
5617
- const nonPreloadedSorts = import_commonjs.keys.strict(REPLY_REPLIES_SORT_TYPES).filter((sortName) => sortName !== preloadedReplyPageSortName);
5668
+ const nonPreloadedSorts = t$6(REPLY_REPLIES_SORT_TYPES).filter((sortName) => sortName !== preloadedReplyPageSortName);
5618
5669
  const sortResults = [];
5619
5670
  if (disablePreload) sortResults.push(await this.sortChunkAddIpfsNonPreloaded(hierarchalReplies, preloadedReplyPageSortName, {
5620
5671
  ...pageOptions,
@@ -5685,7 +5736,7 @@ async function getDbInternalState(community, lock) {
5685
5736
  }
5686
5737
  async function updateDbInternalState(community, props) {
5687
5738
  const log = logger_default("pkc-js:local-community:_updateDbInternalState");
5688
- if (import_commonjs.isEmpty(props)) throw Error("props to update DB internal state should not be empty");
5739
+ if (e$1(props)) throw Error("props to update DB internal state should not be empty");
5689
5740
  await community._dbHandler.initDbIfNeeded();
5690
5741
  props._internalStateUpdateId = v4();
5691
5742
  let lockedIt = false;
@@ -5780,7 +5831,7 @@ async function setChallengesToDefaultIfNotDefined(community, log) {
5780
5831
  if (community._usingDefaultChallenge) {
5781
5832
  const currentAnswer = community.settings?.challenges?.[0]?.options?.answer;
5782
5833
  if (currentAnswer && isDefaultChallengeStructure(community._defaultCommunityChallenges)) community._defaultCommunityChallenges = generateDefaultChallenges(currentAnswer);
5783
- if (!import_commonjs.isDeepEqual(community.settings?.challenges, community._defaultCommunityChallenges)) {
5834
+ if (!t$11(community.settings?.challenges, community._defaultCommunityChallenges)) {
5784
5835
  await community.edit({ settings: {
5785
5836
  ...community.settings,
5786
5837
  challenges: community._defaultCommunityChallenges
@@ -5796,7 +5847,7 @@ async function createNewLocalCommunityDb(community) {
5796
5847
  await community._dbHandler.initDbIfNeeded({ fileMustExist: false });
5797
5848
  await community._dbHandler.createOrMigrateTablesIfNeeded();
5798
5849
  await initSignerProps(community, community.signer);
5799
- if (!community.pubsubTopic) community.pubsubTopic = import_commonjs.clone(community.signer.address);
5850
+ if (!community.pubsubTopic) community.pubsubTopic = t$10(community.signer.address);
5800
5851
  if (typeof community.createdAt !== "number") community.createdAt = timestamp();
5801
5852
  if (!community.protocolVersion) community.protocolVersion = version_default.PROTOCOL_VERSION;
5802
5853
  if (!community.settings?.maxPendingApprovalCount) community.settings = {
@@ -5859,9 +5910,9 @@ async function initInternalCommunityAfterFirstUpdateNoMerge(community, newProps)
5859
5910
  }
5860
5911
  const keysOfCommunityIpfs = [...CommunitySignedPropertyNames, "signature"];
5861
5912
  community.initRpcInternalCommunityAfterFirstUpdateNoMerge({
5862
- community: import_commonjs.pick(newProps, keysOfCommunityIpfs),
5913
+ community: t$9(newProps, keysOfCommunityIpfs),
5863
5914
  localCommunity: {
5864
- signer: import_commonjs.pick(newProps.signer, [
5915
+ signer: t$9(newProps.signer, [
5865
5916
  "publicKey",
5866
5917
  "address",
5867
5918
  "shortAddress",
@@ -5885,12 +5936,12 @@ async function initInternalCommunityAfterFirstUpdateNoMerge(community, newProps)
5885
5936
  }
5886
5937
  async function initInternalCommunityBeforeFirstUpdateNoMerge(community, newProps) {
5887
5938
  community.initRpcInternalCommunityBeforeFirstUpdateNoMerge({ localCommunity: {
5888
- ...import_commonjs.omit(newProps, [
5939
+ ...n$3(newProps, [
5889
5940
  "signer",
5890
5941
  "_internalStateUpdateId",
5891
5942
  "_pendingEditProps"
5892
5943
  ]),
5893
- signer: import_commonjs.pick(newProps.signer, [
5944
+ signer: t$9(newProps.signer, [
5894
5945
  "publicKey",
5895
5946
  "address",
5896
5947
  "shortAddress",
@@ -5963,7 +6014,7 @@ async function calculateNewPostUpdates(community) {
5963
6014
  });
5964
6015
  if (statRes.blocks !== 0) postUpdates[String(timeBucket)] = String(statRes.cid);
5965
6016
  } catch {}
5966
- if (import_commonjs.isEmpty(postUpdates)) return void 0;
6017
+ if (e$1(postUpdates)) return void 0;
5967
6018
  return postUpdates;
5968
6019
  }
5969
6020
  function calculateLatestUpdateTrigger(community) {
@@ -6006,7 +6057,7 @@ async function addOldPageCidsToCidsToUnpin(community, curPages, newPages, addToB
6006
6057
  pages: newPages,
6007
6058
  clientManager: community._clientsManager
6008
6059
  });
6009
- import_commonjs.difference(allPageCidsUnderCurPages, allPageCidsUnderNewPages).forEach((cid) => {
6060
+ r$1(n$4(allPageCidsUnderCurPages), allPageCidsUnderNewPages).forEach((cid) => {
6010
6061
  community._cidsToUnPin.add(cid);
6011
6062
  if (addToBlockRm) community._blocksToRm.push(cid);
6012
6063
  });
@@ -6054,10 +6105,10 @@ async function calculateNextCommunityRecord(community, commentUpdateRowsToPublis
6054
6105
  const currentTimestamp = timestamp();
6055
6106
  const updatedAt = typeof community?.updatedAt === "number" && community.updatedAt >= currentTimestamp ? community.updatedAt + 1 : currentTimestamp;
6056
6107
  const editIdsToIncludeInNextUpdate = community._pendingEditProps.map((editProps) => editProps.editId);
6057
- const pendingCommunityIpfsEditProps = Object.assign({}, ...community._pendingEditProps.map((editProps) => import_commonjs.pick(editProps, import_commonjs.keys.strict(CommunityIpfsSchema.shape))));
6108
+ const pendingCommunityIpfsEditProps = Object.assign({}, ...community._pendingEditProps.map((editProps) => t$9(editProps, t$6(CommunityIpfsSchema.shape))));
6058
6109
  if (community._pendingEditProps.length > 0) log("Including edit props in next IPNS update", community._pendingEditProps);
6059
6110
  const newIpns = { ...cleanUpBeforePublishing({
6060
- ...import_commonjs.omit(community._toJSONIpfsBaseNoPosts(), ["signature"]),
6111
+ ...n$3(community._toJSONIpfsBaseNoPosts(), ["signature"]),
6061
6112
  ...pendingCommunityIpfsEditProps,
6062
6113
  lastPostCid: latestPost?.cid,
6063
6114
  lastCommentCid: latestComment?.cid,
@@ -6076,7 +6127,7 @@ async function calculateNextCommunityRecord(community, commentUpdateRowsToPublis
6076
6127
  if ("singlePreloadedPage" in generatedPosts) newIpns.posts = { pages: generatedPosts.singlePreloadedPage };
6077
6128
  else if (generatedPosts.pageCids) newIpns.posts = {
6078
6129
  pageCids: generatedPosts.pageCids,
6079
- pages: import_commonjs.pick(generatedPosts.pages, [preloadedPostsPages])
6130
+ pages: t$9(generatedPosts.pages, [preloadedPostsPages])
6080
6131
  };
6081
6132
  } else await community._updateDbInternalState({ posts: void 0 });
6082
6133
  {
@@ -6161,7 +6212,7 @@ async function publishCommunityRecordToIpns(community, build, newCommunityRecord
6161
6212
  community.updateCid = file.path;
6162
6213
  community._pendingEditProps = community._pendingEditProps.filter((editProps) => !editIdsToIncludeInNextUpdate.includes(editProps.editId));
6163
6214
  if (community._pendingEditProps.length > 0) {
6164
- const remainingEditProps = Object.assign({}, ...community._pendingEditProps.map((editProps) => import_commonjs.pick(editProps, import_commonjs.keys.strict(CommunityIpfsSchema.shape))));
6215
+ const remainingEditProps = Object.assign({}, ...community._pendingEditProps.map((editProps) => t$9(editProps, t$6(CommunityIpfsSchema.shape))));
6165
6216
  Object.assign(community, remainingEditProps);
6166
6217
  }
6167
6218
  community._communityUpdateTrigger = false;
@@ -6223,11 +6274,10 @@ async function getBrowserDialableSelfAddrs(client) {
6223
6274
  const idRes = await client.id();
6224
6275
  const peerId = idRes.id.toString();
6225
6276
  const swarmListeningAddresses = (await client.swarm.addrs()).filter((swarmAddr) => swarmAddr.id.toString() === peerId);
6226
- const normalized = normalizeSelfAddrsForProvider([...idRes.addresses.map((addr) => addr.toString()), ...import_commonjs.flatten(swarmListeningAddresses.map((swarmAddr) => swarmAddr.addrs.map((addr) => addr.toString())))], peerId);
6227
- return import_commonjs.unique(normalized.filter(isBrowserDialableAddr)).sort();
6277
+ return n$4(normalizeSelfAddrsForProvider([...idRes.addresses.map((addr) => addr.toString()), ...n$6(swarmListeningAddresses.map((swarmAddr) => swarmAddr.addrs.map((addr) => addr.toString())))], peerId).filter(isBrowserDialableAddr)).sort();
6228
6278
  }
6229
6279
  function connectionCriticalCids(community) {
6230
- return import_commonjs.unique([community.pubsubTopicRoutingCid, community.ipnsPubsubTopicRoutingCid].filter((cid) => typeof cid === "string"));
6280
+ return n$4([community.pubsubTopicRoutingCid, community.ipnsPubsubTopicRoutingCid].filter((cid) => typeof cid === "string"));
6231
6281
  }
6232
6282
  /**
6233
6283
  * Re-provide the connection-critical CIDs when the node's browser-dialable (WSS/WebRTC) self-addresses
@@ -6250,7 +6300,7 @@ async function reprovideConnectionCidsIfBrowserAddrsChanged(community) {
6250
6300
  browserAddrs: current
6251
6301
  };
6252
6302
  }
6253
- if (import_commonjs.isDeepEqual(previous, current)) return {
6303
+ if (t$11(previous, current)) return {
6254
6304
  reprovided: false,
6255
6305
  providedCids: [],
6256
6306
  browserAddrs: current
@@ -6436,7 +6486,7 @@ async function initMirroringStartedOrUpdatingCommunity(community, startedCommuni
6436
6486
  community._mirroredStartedOrUpdatingCommunity.community.on("challengeverification", community._mirroredStartedOrUpdatingCommunity.challengeverification);
6437
6487
  community._mirroredStartedOrUpdatingCommunity.community.on("challengeanswer", community._mirroredStartedOrUpdatingCommunity.challengeanswer);
6438
6488
  community._mirroredStartedOrUpdatingCommunity.community.on("challenge", community._mirroredStartedOrUpdatingCommunity.challenge);
6439
- const clientKeys = import_commonjs.keys.strict(community.clients);
6489
+ const clientKeys = t$6(community.clients);
6440
6490
  for (const clientType of clientKeys) if (community.clients[clientType]) {
6441
6491
  for (const clientUrl of Object.keys(community.clients[clientType])) if (clientUrl in community._mirroredStartedOrUpdatingCommunity.community.clients[clientType]) community.clients[clientType][clientUrl].mirror(community._mirroredStartedOrUpdatingCommunity.community.clients[clientType][clientUrl]);
6442
6492
  }
@@ -6455,7 +6505,7 @@ async function cleanUpMirroredStartedOrUpdatingCommunity(community) {
6455
6505
  community._mirroredStartedOrUpdatingCommunity.community.removeListener("challengeverification", community._mirroredStartedOrUpdatingCommunity.challengeverification);
6456
6506
  community._mirroredStartedOrUpdatingCommunity.community.removeListener("challengeanswer", community._mirroredStartedOrUpdatingCommunity.challengeanswer);
6457
6507
  community._mirroredStartedOrUpdatingCommunity.community.removeListener("challenge", community._mirroredStartedOrUpdatingCommunity.challenge);
6458
- const clientKeys = import_commonjs.keys.strict(community.clients);
6508
+ const clientKeys = t$6(community.clients);
6459
6509
  for (const clientType of clientKeys) if (community.clients[clientType]) for (const clientUrl of Object.keys(community.clients[clientType])) community.clients[clientType][clientUrl].unmirror();
6460
6510
  community._mirroredStartedOrUpdatingCommunity = void 0;
6461
6511
  }
@@ -6485,7 +6535,7 @@ async function updateOnce(community) {
6485
6535
  return;
6486
6536
  }
6487
6537
  trackUpdatingCommunity(community._pkc, community);
6488
- const oldUpdateId = import_commonjs.clone(community._internalStateUpdateId);
6538
+ const oldUpdateId = t$10(community._internalStateUpdateId);
6489
6539
  await updateInstancePropsWithStartedCommunityOrDb(community);
6490
6540
  if (community._internalStateUpdateId !== oldUpdateId) {
6491
6541
  log(`Local Community (${community.address}) received a new update from db with updatedAt (${community.updatedAt}). Will emit an update event`);
@@ -6687,7 +6737,7 @@ async function parseRolesToEdit(community, newRawRoles) {
6687
6737
  if (!resolved) throw new PKCError("ERR_ROLE_ADDRESS_NAME_COULD_NOT_BE_RESOLVED", { roleAddress });
6688
6738
  }
6689
6739
  }
6690
- return import_commonjs.omitBy(newRawRoles, (val, key) => val === void 0 || val === null);
6740
+ return t$8(newRawRoles, (val, key) => val === void 0 || val === null);
6691
6741
  }
6692
6742
  async function parseChallengesToEdit(community, newChallengeSettings) {
6693
6743
  return {
@@ -6712,7 +6762,7 @@ async function validateNewAddressBeforeEditing(community, newAddress, log) {
6712
6762
  }
6713
6763
  async function editPropsOnStartedCommunity(community, parsedEditOptions) {
6714
6764
  const log = logger_default("pkc-js:local-community:start:editPropsOnStartedCommunity");
6715
- const oldAddress = import_commonjs.clone(community.address);
6765
+ const oldAddress = t$10(community.address);
6716
6766
  if (typeof parsedEditOptions.address === "string" && community.address !== parsedEditOptions.address) {
6717
6767
  await validateNewAddressBeforeEditing(community, parsedEditOptions.address, log);
6718
6768
  log(`Attempting to edit community.address from ${oldAddress} to ${parsedEditOptions.address}. We will stop community first`);
@@ -6739,7 +6789,7 @@ async function editPropsOnStartedCommunity(community, parsedEditOptions) {
6739
6789
  _internalStateUpdateId: uniqueEditId
6740
6790
  });
6741
6791
  community._communityUpdateTrigger = true;
6742
- log(`Community (${community.address}) props (${import_commonjs.keys.strict(parsedEditOptions)}) has been edited. Will be including edited props in next update: `, import_commonjs.pick(community, import_commonjs.keys.strict(parsedEditOptions)));
6792
+ log(`Community (${community.address}) props (${t$6(parsedEditOptions)}) has been edited. Will be including edited props in next update: `, t$9(community, t$6(parsedEditOptions)));
6743
6793
  community.emit("update", community);
6744
6794
  if (community.address !== oldAddress) {
6745
6795
  trackStartedCommunity(community._pkc, community);
@@ -6749,7 +6799,7 @@ async function editPropsOnStartedCommunity(community, parsedEditOptions) {
6749
6799
  }
6750
6800
  async function editPropsOnNotStartedCommunity(community, parsedEditOptions) {
6751
6801
  const log = logger_default("pkc-js:local-community:edit:editPropsOnNotStartedCommunity");
6752
- const oldAddress = import_commonjs.clone(community.address);
6802
+ const oldAddress = t$10(community.address);
6753
6803
  await community.initDbHandlerIfNeeded();
6754
6804
  await community._dbHandler.initDbIfNeeded();
6755
6805
  if (typeof parsedEditOptions.address === "string" && community.address !== parsedEditOptions.address) {
@@ -6802,7 +6852,7 @@ async function edit(community, newCommunityOptions) {
6802
6852
  ...editWithDerivedName?.settings?.challenges ? await parseChallengesToEdit(community, editWithDerivedName.settings.challenges) : void 0
6803
6853
  };
6804
6854
  const newProps = {
6805
- ...import_commonjs.omit(editWithDerivedName, ["roles"]),
6855
+ ...n$3(editWithDerivedName, ["roles"]),
6806
6856
  ...newInternalProps
6807
6857
  };
6808
6858
  if (!community.started && !startedCommunity) return editPropsOnNotStartedCommunity(community, newProps);
@@ -6817,11 +6867,11 @@ async function edit(community, newCommunityOptions) {
6817
6867
  const EXPORTS_KEY = STORAGE_KEYS[STORAGE_KEYS.EXPORTS];
6818
6868
  function defaultExportPathFor(community, exportId) {
6819
6869
  if (typeof community._pkc.dataPath !== "string") throw new PKCError("ERR_DATA_PATH_IS_NOT_DEFINED", { communityAddress: community.address });
6820
- return path.join(community._pkc.dataPath, "exports", `${exportId}.sqlite`);
6870
+ return Path.join(community._pkc.dataPath, "exports", `${exportId}.sqlite`);
6821
6871
  }
6822
6872
  function sourceDbPathFor(community) {
6823
6873
  if (typeof community._pkc.dataPath !== "string") throw new PKCError("ERR_DATA_PATH_IS_NOT_DEFINED", { communityAddress: community.address });
6824
- return path.join(community._pkc.dataPath, "communities", community.address);
6874
+ return Path.join(community._pkc.dataPath, "communities", community.address);
6825
6875
  }
6826
6876
  async function persistExports(community) {
6827
6877
  if (!community._dbHandler) return;
@@ -6897,9 +6947,9 @@ async function runExportTask(community, exportId, opts) {
6897
6947
  async function exportCommunityEmbedded(community, options = {}) {
6898
6948
  if (options.signal?.aborted) throw options.signal.reason ?? new DOMException("The operation was aborted.", "AbortError");
6899
6949
  const exportId = v4();
6900
- const destPath = options.exportPath ? path.resolve(options.exportPath) : defaultExportPathFor(community, exportId);
6950
+ const destPath = options.exportPath ? Path.resolve(options.exportPath) : defaultExportPathFor(community, exportId);
6901
6951
  const includePrivateKey = options.includePrivateKey === true;
6902
- if (path.resolve(destPath) === path.resolve(sourceDbPathFor(community))) throw new PKCError("ERR_EXPORT_PATH_TARGETS_LIVE_DB", {
6952
+ if (Path.resolve(destPath) === Path.resolve(sourceDbPathFor(community))) throw new PKCError("ERR_EXPORT_PATH_TARGETS_LIVE_DB", {
6903
6953
  communityAddress: community.address,
6904
6954
  exportPath: destPath
6905
6955
  });
@@ -7051,9 +7101,9 @@ var LocalCommunity = class extends RpcLocalCommunity {
7051
7101
  const rpcJson = this.toJSONInternalRpcAfterFirstUpdate();
7052
7102
  return {
7053
7103
  ...rpcJson.community,
7054
- ...import_commonjs.omit(rpcJson.localCommunity, ["started", "startedState"]),
7104
+ ...n$3(rpcJson.localCommunity, ["started", "startedState"]),
7055
7105
  updateCid: rpcJson.runtimeFields.updateCid,
7056
- signer: import_commonjs.pick(this.signer, [
7106
+ signer: t$9(this.signer, [
7057
7107
  "privateKey",
7058
7108
  "type",
7059
7109
  "address",
@@ -7067,10 +7117,9 @@ var LocalCommunity = class extends RpcLocalCommunity {
7067
7117
  };
7068
7118
  }
7069
7119
  toJSONInternalBeforeFirstUpdate() {
7070
- const rpcJson = this.toJSONInternalRpcBeforeFirstUpdate();
7071
7120
  return {
7072
- ...import_commonjs.omit(rpcJson.localCommunity, ["started", "startedState"]),
7073
- signer: import_commonjs.pick(this.signer, [
7121
+ ...n$3(this.toJSONInternalRpcBeforeFirstUpdate().localCommunity, ["started", "startedState"]),
7122
+ signer: t$9(this.signer, [
7074
7123
  "privateKey",
7075
7124
  "type",
7076
7125
  "address",
@@ -7087,7 +7136,7 @@ var LocalCommunity = class extends RpcLocalCommunity {
7087
7136
  ...base,
7088
7137
  localCommunity: {
7089
7138
  ...base.localCommunity,
7090
- signer: import_commonjs.pick(this.signer, [
7139
+ signer: t$9(this.signer, [
7091
7140
  "publicKey",
7092
7141
  "address",
7093
7142
  "shortAddress",
@@ -7099,7 +7148,7 @@ var LocalCommunity = class extends RpcLocalCommunity {
7099
7148
  toJSONInternalRpcBeforeFirstUpdate() {
7100
7149
  return { localCommunity: {
7101
7150
  ...super.toJSONInternalRpcBeforeFirstUpdate().localCommunity,
7102
- signer: import_commonjs.pick(this.signer, [
7151
+ signer: t$9(this.signer, [
7103
7152
  "publicKey",
7104
7153
  "address",
7105
7154
  "shortAddress",