@mittwald/flow-remote-core 0.2.0-alpha.104 → 0.2.0-alpha.1041

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 (126) hide show
  1. package/README.md +2 -2
  2. package/dist/js/_virtual/_rolldown/runtime.mjs +13 -0
  3. package/dist/js/index-node.mjs +21 -0
  4. package/dist/js/index-node.mjs.map +1 -0
  5. package/dist/js/index.mjs +24 -0
  6. package/dist/js/index.mjs.map +1 -0
  7. package/dist/js/node_modules/.pnpm/@quilted_events@2.1.5/node_modules/@quilted/events/build/esm/abort/NestedAbortController.mjs +35 -0
  8. package/dist/js/node_modules/.pnpm/@quilted_events@2.1.5/node_modules/@quilted/events/build/esm/abort/NestedAbortController.mjs.map +1 -0
  9. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/Thread.mjs +173 -0
  10. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/Thread.mjs.map +1 -0
  11. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/constants.mjs +7 -0
  12. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/constants.mjs.map +1 -0
  13. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/errors.mjs +10 -0
  14. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/errors.mjs.map +1 -0
  15. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/functions/ThreadFunctionsAutomatic.mjs +70 -0
  16. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/functions/ThreadFunctionsAutomatic.mjs.map +1 -0
  17. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/nanoid.mjs +11 -0
  18. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/nanoid.mjs.map +1 -0
  19. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/serialization/ThreadSerializationStructuredClone.mjs +132 -0
  20. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/serialization/ThreadSerializationStructuredClone.mjs.map +1 -0
  21. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/serialization/shared.mjs +13 -0
  22. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/serialization/shared.mjs.map +1 -0
  23. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/threads/ThreadIframe.mjs +154 -0
  24. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/threads/ThreadIframe.mjs.map +1 -0
  25. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/threads/ThreadNestedIframe.mjs +78 -0
  26. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/threads/ThreadNestedIframe.mjs.map +1 -0
  27. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/threads/window/ThreadNestedWindow.mjs +120 -0
  28. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/threads/window/ThreadNestedWindow.mjs.map +1 -0
  29. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/threads/window/ThreadWindow.mjs +192 -0
  30. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/threads/window/ThreadWindow.mjs.map +1 -0
  31. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/threads/window/shared.mjs +7 -0
  32. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/threads/window/shared.mjs.map +1 -0
  33. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/transfer.mjs +16 -0
  34. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/transfer.mjs.map +1 -0
  35. package/dist/js/packages/remote-core/src/connection/connectHostRenderRoot.mjs +54 -0
  36. package/dist/js/packages/remote-core/src/connection/connectHostRenderRoot.mjs.map +1 -0
  37. package/dist/js/packages/remote-core/src/connection/connectRemoteIframe.mjs +77 -0
  38. package/dist/js/packages/remote-core/src/connection/connectRemoteIframe.mjs.map +1 -0
  39. package/dist/js/packages/remote-core/src/connection/index.mjs +4 -0
  40. package/dist/js/packages/remote-core/src/connection/types.mjs +14 -0
  41. package/dist/js/packages/remote-core/src/connection/types.mjs.map +1 -0
  42. package/dist/js/packages/remote-core/src/error.mjs +12 -0
  43. package/dist/js/packages/remote-core/src/error.mjs.map +1 -0
  44. package/dist/js/packages/remote-core/src/events/remoteEvents.mjs +17 -0
  45. package/dist/js/packages/remote-core/src/events/remoteEvents.mjs.map +1 -0
  46. package/dist/js/packages/remote-core/src/ext-bridge/getWithMergedHostConfig.mjs +12 -0
  47. package/dist/js/packages/remote-core/src/ext-bridge/getWithMergedHostConfig.mjs.map +1 -0
  48. package/dist/js/packages/remote-core/src/ext-bridge/implementation.mjs +9 -0
  49. package/dist/js/packages/remote-core/src/ext-bridge/implementation.mjs.map +1 -0
  50. package/dist/js/packages/remote-core/src/serialization/FlowThreadSerialization.mjs +50 -0
  51. package/dist/js/packages/remote-core/src/serialization/FlowThreadSerialization.mjs.map +1 -0
  52. package/dist/js/packages/remote-core/src/serialization/Serializer.mjs +32 -0
  53. package/dist/js/packages/remote-core/src/serialization/Serializer.mjs.map +1 -0
  54. package/dist/js/packages/remote-core/src/serialization/index.mjs +10 -0
  55. package/dist/js/packages/remote-core/src/serialization/serializers/dataTransferText.mjs +22 -0
  56. package/dist/js/packages/remote-core/src/serialization/serializers/dataTransferText.mjs.map +1 -0
  57. package/dist/js/packages/remote-core/src/serialization/serializers/date.mjs +15 -0
  58. package/dist/js/packages/remote-core/src/serialization/serializers/date.mjs.map +1 -0
  59. package/dist/js/packages/remote-core/src/serialization/serializers/file.mjs +32 -0
  60. package/dist/js/packages/remote-core/src/serialization/serializers/file.mjs.map +1 -0
  61. package/dist/js/packages/remote-core/src/serialization/serializers/fileList.mjs +20 -0
  62. package/dist/js/packages/remote-core/src/serialization/serializers/fileList.mjs.map +1 -0
  63. package/dist/js/packages/remote-core/src/serialization/serializers/formData.mjs +29 -0
  64. package/dist/js/packages/remote-core/src/serialization/serializers/formData.mjs.map +1 -0
  65. package/dist/js/packages/remote-core/src/serialization/serializers/index.mjs +23 -0
  66. package/dist/js/packages/remote-core/src/serialization/serializers/index.mjs.map +1 -0
  67. package/dist/js/packages/remote-core/src/serialization/serializers/passwordPolicy.mjs +15 -0
  68. package/dist/js/packages/remote-core/src/serialization/serializers/passwordPolicy.mjs.map +1 -0
  69. package/dist/js/packages/remote-core/src/shim.mjs +33 -0
  70. package/dist/js/packages/remote-core/src/shim.mjs.map +1 -0
  71. package/dist/types/connection/connectHostRenderRoot.d.ts +11 -2
  72. package/dist/types/connection/connectHostRenderRoot.d.ts.map +1 -1
  73. package/dist/types/connection/connectRemoteIframe.d.ts +14 -8
  74. package/dist/types/connection/connectRemoteIframe.d.ts.map +1 -1
  75. package/dist/types/connection/types.d.ts +50 -5
  76. package/dist/types/connection/types.d.ts.map +1 -1
  77. package/dist/types/events/remoteEvents.d.ts +17 -0
  78. package/dist/types/events/remoteEvents.d.ts.map +1 -0
  79. package/dist/types/events/remoteEvents.test.d.ts +2 -0
  80. package/dist/types/events/remoteEvents.test.d.ts.map +1 -0
  81. package/dist/types/ext-bridge/getWithMergedHostConfig.d.ts +4 -0
  82. package/dist/types/ext-bridge/getWithMergedHostConfig.d.ts.map +1 -0
  83. package/dist/types/ext-bridge/implementation.d.ts +2 -2
  84. package/dist/types/ext-bridge/implementation.d.ts.map +1 -1
  85. package/dist/types/index-node.d.ts +2 -0
  86. package/dist/types/index-node.d.ts.map +1 -0
  87. package/dist/types/index.d.ts +4 -4
  88. package/dist/types/index.d.ts.map +1 -1
  89. package/dist/types/serialization/FlowThreadSerialization.d.ts +7 -0
  90. package/dist/types/serialization/FlowThreadSerialization.d.ts.map +1 -0
  91. package/dist/types/serialization/FlowThreadSerialization.test.d.ts +2 -0
  92. package/dist/types/serialization/FlowThreadSerialization.test.d.ts.map +1 -0
  93. package/dist/types/serialization/Serialization.test.d.ts +2 -0
  94. package/dist/types/serialization/Serialization.test.d.ts.map +1 -0
  95. package/dist/types/serialization/Serializer.d.ts +28 -0
  96. package/dist/types/serialization/Serializer.d.ts.map +1 -0
  97. package/dist/types/serialization/index.d.ts +4 -0
  98. package/dist/types/serialization/index.d.ts.map +1 -0
  99. package/dist/types/serialization/serializers/dataTransferText.d.ts +3 -0
  100. package/dist/types/serialization/serializers/dataTransferText.d.ts.map +1 -0
  101. package/dist/types/serialization/serializers/date.d.ts +4 -0
  102. package/dist/types/serialization/serializers/date.d.ts.map +1 -0
  103. package/dist/types/serialization/serializers/file.d.ts +12 -0
  104. package/dist/types/serialization/serializers/file.d.ts.map +1 -0
  105. package/dist/types/serialization/serializers/fileList.d.ts +4 -0
  106. package/dist/types/serialization/serializers/fileList.d.ts.map +1 -0
  107. package/dist/types/serialization/serializers/formData.d.ts +7 -0
  108. package/dist/types/serialization/serializers/formData.d.ts.map +1 -0
  109. package/dist/types/serialization/serializers/index.d.ts +7 -0
  110. package/dist/types/serialization/serializers/index.d.ts.map +1 -0
  111. package/dist/types/serialization/serializers/passwordPolicy.d.ts +4 -0
  112. package/dist/types/serialization/serializers/passwordPolicy.d.ts.map +1 -0
  113. package/dist/types/shim.d.ts +14 -0
  114. package/dist/types/shim.d.ts.map +1 -0
  115. package/dist/types/tests/utils.d.ts +2 -0
  116. package/dist/types/tests/utils.d.ts.map +1 -0
  117. package/package.json +29 -22
  118. package/dist/index.js +0 -100
  119. package/dist/types/events/FlowRemoteEvent.d.ts +0 -4
  120. package/dist/types/events/FlowRemoteEvent.d.ts.map +0 -1
  121. package/dist/types/events/index.d.ts +0 -5
  122. package/dist/types/events/index.d.ts.map +0 -1
  123. package/dist/types/events/serializers.d.ts +0 -5
  124. package/dist/types/events/serializers.d.ts.map +0 -1
  125. package/dist/types/ext-bridge/delegateExtBridgeRemoteFunctions.d.ts +0 -4
  126. package/dist/types/ext-bridge/delegateExtBridgeRemoteFunctions.d.ts.map +0 -1
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # @mittwald/flow-remote-core
2
2
 
3
3
  This package is part of
4
- [Flow – mittwald design system](https://mittwald.github.io/flow/). See the
5
- homepage for more details.
4
+ [Flow – mittwald design system](https://flow.mittwald.de/). See the homepage for
5
+ more details.
@@ -0,0 +1,13 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __defProp = Object.defineProperty;
3
+ var __exportAll = (all, no_symbols) => {
4
+ let target = {};
5
+ for (var name in all) __defProp(target, name, {
6
+ get: all[name],
7
+ enumerable: true
8
+ });
9
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
10
+ return target;
11
+ };
12
+ //#endregion
13
+ export { __exportAll };
@@ -0,0 +1,21 @@
1
+ import { domShimApplied } from "./packages/remote-core/src/shim.mjs";
2
+ import { Serializer } from "./packages/remote-core/src/serialization/Serializer.mjs";
3
+ import { calendarDateSerializer } from "./packages/remote-core/src/serialization/serializers/date.mjs";
4
+ import { fileDeSerialize, fileSerialize, fileSerializer, isSerializedFile } from "./packages/remote-core/src/serialization/serializers/file.mjs";
5
+ import { fileListSerializer } from "./packages/remote-core/src/serialization/serializers/fileList.mjs";
6
+ import { dataTransferTextSerializer } from "./packages/remote-core/src/serialization/serializers/dataTransferText.mjs";
7
+ import { formDataSerializer } from "./packages/remote-core/src/serialization/serializers/formData.mjs";
8
+ import { passwordPolicySerializer } from "./packages/remote-core/src/serialization/serializers/passwordPolicy.mjs";
9
+ import { FlowThreadSerialization } from "./packages/remote-core/src/serialization/FlowThreadSerialization.mjs";
10
+ import { Version } from "./packages/remote-core/src/connection/types.mjs";
11
+ import { RemoteError } from "./packages/remote-core/src/error.mjs";
12
+ import { connectHostRenderRoot, connectHostRenderRootRef, connectRemoteReceiver } from "./packages/remote-core/src/connection/connectHostRenderRoot.mjs";
13
+ import { componentRenderedEventSchema, parseReportedEvent, reportedEventSchema } from "./packages/remote-core/src/events/remoteEvents.mjs";
14
+ import { connectRemoteIframe, connectRemoteIframeRef } from "./packages/remote-core/src/connection/connectRemoteIframe.mjs";
15
+ import { RemoteElement, RemoteEvent, RemoteReceiver } from "./index.mjs";
16
+ //#region src/index-node.ts
17
+ if (!domShimApplied) throw new Error("remote-core DOM shim failed to initialize");
18
+ //#endregion
19
+ export { FlowThreadSerialization, RemoteElement, RemoteError, RemoteEvent, RemoteReceiver, Serializer, Version, calendarDateSerializer, componentRenderedEventSchema, connectHostRenderRoot, connectHostRenderRootRef, connectRemoteIframe, connectRemoteIframeRef, connectRemoteReceiver, dataTransferTextSerializer, fileDeSerialize, fileListSerializer, fileSerialize, fileSerializer, formDataSerializer, isSerializedFile, parseReportedEvent, passwordPolicySerializer, reportedEventSchema };
20
+
21
+ //# sourceMappingURL=index-node.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-node.mjs","names":[],"sources":["../../src/index-node.ts"],"sourcesContent":["// The `node` export condition resolves here. The shim must be the very first\n// import so the DOM globals exist before any sibling module transitively pulls\n// in RemoteElement (which subclasses HTMLElement). Do NOT simplify this to a\n// bare `import \"./shim\"` or a plain `export * from \"./index\"`: Rollup then hoists\n// the remote-dom import ahead of the shim and SSR breaks with \"HTMLElement is\n// not defined\". Importing the shim as a used binding keeps it first.\nimport { domShimApplied } from \"./shim\";\nif (!domShimApplied) {\n throw new Error(\"remote-core DOM shim failed to initialize\");\n}\nexport * from \"./index\";\n"],"mappings":";;;;;;;;;;;;;;;;AAOA,IAAI,CAAC,gBACH,MAAM,IAAI,MAAM,2CAA2C"}
@@ -0,0 +1,24 @@
1
+ import { domShimApplied } from "./packages/remote-core/src/shim.mjs";
2
+ import { Serializer } from "./packages/remote-core/src/serialization/Serializer.mjs";
3
+ import { calendarDateSerializer } from "./packages/remote-core/src/serialization/serializers/date.mjs";
4
+ import { fileDeSerialize, fileSerialize, fileSerializer, isSerializedFile } from "./packages/remote-core/src/serialization/serializers/file.mjs";
5
+ import { fileListSerializer } from "./packages/remote-core/src/serialization/serializers/fileList.mjs";
6
+ import { dataTransferTextSerializer } from "./packages/remote-core/src/serialization/serializers/dataTransferText.mjs";
7
+ import { formDataSerializer } from "./packages/remote-core/src/serialization/serializers/formData.mjs";
8
+ import { passwordPolicySerializer } from "./packages/remote-core/src/serialization/serializers/passwordPolicy.mjs";
9
+ import { FlowThreadSerialization } from "./packages/remote-core/src/serialization/FlowThreadSerialization.mjs";
10
+ import "./packages/remote-core/src/serialization/index.mjs";
11
+ import { Version } from "./packages/remote-core/src/connection/types.mjs";
12
+ import { RemoteError } from "./packages/remote-core/src/error.mjs";
13
+ import { connectHostRenderRoot, connectHostRenderRootRef, connectRemoteReceiver } from "./packages/remote-core/src/connection/connectHostRenderRoot.mjs";
14
+ import { componentRenderedEventSchema, parseReportedEvent, reportedEventSchema } from "./packages/remote-core/src/events/remoteEvents.mjs";
15
+ import { connectRemoteIframe, connectRemoteIframeRef } from "./packages/remote-core/src/connection/connectRemoteIframe.mjs";
16
+ import "./packages/remote-core/src/connection/index.mjs";
17
+ import { RemoteReceiver } from "@mittwald/remote-dom-core/receivers";
18
+ import { RemoteElement, RemoteEvent } from "@mittwald/remote-dom-core/elements";
19
+ //#region src/index.ts
20
+ if (!domShimApplied) throw new Error("remote-core DOM shim failed to initialize");
21
+ //#endregion
22
+ export { FlowThreadSerialization, RemoteElement, RemoteError, RemoteEvent, RemoteReceiver, Serializer, Version, calendarDateSerializer, componentRenderedEventSchema, connectHostRenderRoot, connectHostRenderRootRef, connectRemoteIframe, connectRemoteIframeRef, connectRemoteReceiver, dataTransferTextSerializer, fileDeSerialize, fileListSerializer, fileSerialize, fileSerializer, formDataSerializer, isSerializedFile, parseReportedEvent, passwordPolicySerializer, reportedEventSchema };
23
+
24
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../src/index.ts"],"sourcesContent":["import { domShimApplied } from \"./shim\";\n\nexport { RemoteReceiver } from \"@mittwald/remote-dom-core/receivers\";\nexport {\n RemoteElement,\n RemoteEvent,\n type RemoteElementConstructor,\n} from \"@mittwald/remote-dom-core/elements\";\nexport * from \"./serialization\";\nexport * from \"./connection\";\nexport * from \"./error\";\nexport * from \"./events/remoteEvents\";\n\n// The DOM shim above must be evaluated before RemoteElement (which subclasses\n// HTMLElement) is imported. Referencing the binding keeps the import from being\n// tree-shaken or reordered after the remote-dom re-export.\nif (!domShimApplied) {\n throw new Error(\"remote-core DOM shim failed to initialize\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAgBA,IAAI,CAAC,gBACH,MAAM,IAAI,MAAM,2CAA2C"}
@@ -0,0 +1,35 @@
1
+ //#region ../../node_modules/.pnpm/@quilted+events@2.1.5/node_modules/@quilted/events/build/esm/abort/NestedAbortController.mjs
2
+ /**
3
+ * An `AbortController` that will automatically abort when any of
4
+ * its "parent" `AbortController`s abort. This is useful for when
5
+ * you have nested asynchronous operations that may abort independently.
6
+ * The `AbortController` can also be independently aborted.
7
+ *
8
+ * To associate the parent `AbortController`s, pass their signals
9
+ * as arguments to the constructor.
10
+ *
11
+ * @example
12
+ * import {NestedAbortController} from '@shopify/events';
13
+ *
14
+ * const parent = new AbortController();
15
+ * const nested = new NestedAbortController(parent.signal);
16
+ *
17
+ * parent.abort();
18
+ * nested.signal.aborted; // true
19
+ */
20
+ var NestedAbortController = class extends AbortController {
21
+ constructor(...parents) {
22
+ super();
23
+ const abortedSignal = parents.find((signal) => signal.aborted);
24
+ if (abortedSignal) this.abort(abortedSignal.reason);
25
+ else {
26
+ const abort = (event) => this.abort(event.target.reason);
27
+ const options = { signal: this.signal };
28
+ for (const signal of parents) signal.addEventListener("abort", abort, options);
29
+ }
30
+ }
31
+ };
32
+ //#endregion
33
+ export { NestedAbortController };
34
+
35
+ //# sourceMappingURL=NestedAbortController.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NestedAbortController.mjs","names":[],"sources":["../../../../../../../../../../../../../node_modules/.pnpm/@quilted+events@2.1.5/node_modules/@quilted/events/build/esm/abort/NestedAbortController.mjs"],"sourcesContent":["/**\n * An `AbortController` that will automatically abort when any of\n * its \"parent\" `AbortController`s abort. This is useful for when\n * you have nested asynchronous operations that may abort independently.\n * The `AbortController` can also be independently aborted.\n *\n * To associate the parent `AbortController`s, pass their signals\n * as arguments to the constructor.\n *\n * @example\n * import {NestedAbortController} from '@shopify/events';\n *\n * const parent = new AbortController();\n * const nested = new NestedAbortController(parent.signal);\n *\n * parent.abort();\n * nested.signal.aborted; // true\n */\nclass NestedAbortController extends AbortController {\n constructor(...parents) {\n super();\n const abortedSignal = parents.find(signal => signal.aborted);\n if (abortedSignal) {\n this.abort(abortedSignal.reason);\n } else {\n const abort = event => this.abort(event.target.reason);\n const options = {\n signal: this.signal\n };\n for (const signal of parents) {\n signal.addEventListener('abort', abort, options);\n }\n }\n }\n}\n\nexport { NestedAbortController };\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;;AAkBA,IAAM,wBAAN,cAAoC,gBAAgB;CAClD,YAAY,GAAG,SAAS;EACtB,MAAM;EACN,MAAM,gBAAgB,QAAQ,MAAK,WAAU,OAAO,OAAO;EAC3D,IAAI,eACF,KAAK,MAAM,cAAc,MAAM;OAC1B;GACL,MAAM,SAAQ,UAAS,KAAK,MAAM,MAAM,OAAO,MAAM;GACrD,MAAM,UAAU,EACd,QAAQ,KAAK,OACf;GACA,KAAK,MAAM,UAAU,SACnB,OAAO,iBAAiB,SAAS,OAAO,OAAO;EAEnD;CACF;AACF"}
@@ -0,0 +1,173 @@
1
+ import { NestedAbortController } from "../../../../../../@quilted_events@2.1.5/node_modules/@quilted/events/build/esm/abort/NestedAbortController.mjs";
2
+ import { ThreadClosedError } from "./errors.mjs";
3
+ import { nanoid } from "./nanoid.mjs";
4
+ import { ThreadFunctionsAutomatic } from "./functions/ThreadFunctionsAutomatic.mjs";
5
+ import { ThreadSerializationStructuredClone } from "./serialization/ThreadSerializationStructuredClone.mjs";
6
+ //#region ../../node_modules/.pnpm/@quilted+threads@3.3.1_patch_hash=df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/Thread.mjs
7
+ /**
8
+ * A thread represents a target JavaScript environment that exposes a set
9
+ * of callable, asynchronous methods. The thread takes care of automatically
10
+ * encoding and decoding its arguments and return values, so you can interact
11
+ * with it as if its methods were implemented in the same environment as your
12
+ * own code.
13
+ */
14
+ var Thread = class {
15
+ get signal() {
16
+ return this.#abort.signal;
17
+ }
18
+ get closed() {
19
+ return this.#abort.signal.aborted;
20
+ }
21
+ #abort;
22
+ #idsToResolver = (() => /* @__PURE__ */ new Map())();
23
+ constructor(messages, { imports, exports, functions = new ThreadFunctionsAutomatic(), serialization = new ThreadSerializationStructuredClone(), signal } = {}) {
24
+ this.messages = messages;
25
+ this.#abort = signal ? new NestedAbortController(signal) : new AbortController();
26
+ this.exports = exports ?? {};
27
+ this.imports = createThreadImports(this.#handlerForCall.bind(this), imports);
28
+ this.functions = functions;
29
+ this.serialization = serialization;
30
+ this.functions.start?.(this);
31
+ this.serialization.start?.(this);
32
+ this.signal.addEventListener("abort", () => {
33
+ for (const id of this.#idsToResolver.keys()) this.#resolveCall(id, void 0, new ThreadClosedError());
34
+ this.#idsToResolver.clear();
35
+ }, { once: true });
36
+ messages.listen(async (rawData) => {
37
+ if (!(Array.isArray(rawData) && typeof rawData[0] === "number")) return;
38
+ const data = rawData;
39
+ switch (data[0]) {
40
+ case 1: {
41
+ const [, id, property, args] = data;
42
+ const func = this.exports[property] ?? (() => {
43
+ throw new Error(`No '${property}' method is exported from this thread`);
44
+ });
45
+ await this.#callLocal(func, args, (value, error, transferable) => {
46
+ this.messages.send([
47
+ 2,
48
+ id,
49
+ value,
50
+ error
51
+ ], transferable);
52
+ });
53
+ break;
54
+ }
55
+ case 3: {
56
+ const [, callID, funcID, args] = data;
57
+ const func = this.functions.get(funcID, this) ?? missingThreadFunction;
58
+ await this.#callLocal(func, args, (value, error, transferable) => {
59
+ this.messages.send([
60
+ 4,
61
+ callID,
62
+ value,
63
+ error
64
+ ], transferable);
65
+ });
66
+ break;
67
+ }
68
+ case 2:
69
+ case 4:
70
+ this.#resolveCall(...data.slice(1));
71
+ break;
72
+ case 5: {
73
+ const id = data[1];
74
+ this.functions.release(id, this);
75
+ break;
76
+ }
77
+ }
78
+ }, { signal: this.signal });
79
+ }
80
+ close() {
81
+ this.#abort.abort();
82
+ }
83
+ async call(func, args) {
84
+ if (this.closed) return Promise.reject(new ThreadClosedError());
85
+ const transferable = [];
86
+ const serialized = await this.serialization.serialize(args, this, transferable);
87
+ const id = nanoid();
88
+ const done = this.#waitForResult(id);
89
+ func(id, serialized, transferable);
90
+ return done;
91
+ }
92
+ async #callLocal(func, args, withResult) {
93
+ try {
94
+ const result = this.functions.call ? await this.functions.call(func, args, this) : await func(...await this.serialization.deserialize(args, this));
95
+ const transferable = [];
96
+ withResult(await this.serialization.serialize(result, this, transferable), void 0, transferable);
97
+ } catch (error) {
98
+ withResult(void 0, await this.serialization.serialize(error, this));
99
+ }
100
+ }
101
+ #handlerForCall(property) {
102
+ return (...args) => {
103
+ try {
104
+ if (typeof property !== "string" && typeof property !== "number") throw new Error(`Can’t call a symbol method on a thread: ${property.toString()}`);
105
+ return this.call((id, serializedArgs, transferable) => {
106
+ this.messages.send([
107
+ 1,
108
+ id,
109
+ property,
110
+ serializedArgs
111
+ ], transferable);
112
+ }, args);
113
+ } catch (error) {
114
+ return Promise.reject(error);
115
+ }
116
+ };
117
+ }
118
+ #resolveCall(...args) {
119
+ const callID = args[0];
120
+ const resolver = this.#idsToResolver.get(callID);
121
+ if (resolver) {
122
+ resolver(...args);
123
+ this.#idsToResolver.delete(callID);
124
+ }
125
+ }
126
+ #waitForResult(id) {
127
+ const promise = new Promise((resolve, reject) => {
128
+ this.#idsToResolver.set(id, async (_, value, error) => {
129
+ try {
130
+ if (error == null) resolve(await this.serialization.deserialize(value, this));
131
+ else reject(await this.serialization.deserialize(error, this));
132
+ } catch (deserializeError) {
133
+ reject(deserializeError);
134
+ }
135
+ });
136
+ });
137
+ Object.defineProperty(promise, Symbol.asyncIterator, { async *value() {
138
+ const result = await promise;
139
+ Object.defineProperty(result, Symbol.asyncIterator, { value: () => result });
140
+ yield* result;
141
+ } });
142
+ return promise;
143
+ }
144
+ };
145
+ function createThreadImports(handlerForImport, imported) {
146
+ let call;
147
+ if (imported == null) {
148
+ if (typeof Proxy !== "function") throw new Error(`You must pass an array of callable methods in environments without Proxies.`);
149
+ const cache = /* @__PURE__ */ new Map();
150
+ call = new Proxy({}, { get(_target, property) {
151
+ if (cache.has(property)) return cache.get(property);
152
+ const handler = handlerForImport(property);
153
+ cache.set(property, handler);
154
+ return handler;
155
+ } });
156
+ } else {
157
+ call = {};
158
+ for (const method of imported) Object.defineProperty(call, method, {
159
+ value: handlerForImport(method),
160
+ writable: false,
161
+ configurable: true,
162
+ enumerable: true
163
+ });
164
+ }
165
+ return call;
166
+ }
167
+ function missingThreadFunction() {
168
+ throw new Error(`You attempted to call a function that is not stored. It may have already been released.`);
169
+ }
170
+ //#endregion
171
+ export { Thread };
172
+
173
+ //# sourceMappingURL=Thread.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Thread.mjs","names":["#abort","#handlerForCall","#idsToResolver","#resolveCall","#callLocal","#waitForResult"],"sources":["../../../../../../../../../../../../node_modules/.pnpm/@quilted+threads@3.3.1_patch_hash=df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/Thread.mjs"],"sourcesContent":["import { NestedAbortController } from '@quilted/events';\nimport { ThreadClosedError } from './errors.mjs';\nimport { nanoid } from './nanoid.mjs';\nimport { MESSAGE_FUNCTION_RELEASE, MESSAGE_FUNCTION_RESULT, MESSAGE_CALL_RESULT, MESSAGE_FUNCTION_CALL, MESSAGE_CALL } from './constants.mjs';\nimport { ThreadFunctionsAutomatic } from './functions/ThreadFunctionsAutomatic.mjs';\nimport { ThreadSerializationStructuredClone } from './serialization/ThreadSerializationStructuredClone.mjs';\n\n/**\n * A thread represents a target JavaScript environment that exposes a set\n * of callable, asynchronous methods. The thread takes care of automatically\n * encoding and decoding its arguments and return values, so you can interact\n * with it as if its methods were implemented in the same environment as your\n * own code.\n */\nclass Thread {\n get signal() {\n return this.#abort.signal;\n }\n\n get closed() {\n return this.#abort.signal.aborted;\n }\n\n #abort;\n #idsToResolver = (() => new Map())();\n\n constructor(messages, {\n imports,\n exports,\n functions = new ThreadFunctionsAutomatic(),\n serialization = new ThreadSerializationStructuredClone(),\n signal\n } = {}) {\n this.messages = messages;\n this.#abort = signal ? new NestedAbortController(signal) : new AbortController();\n this.exports = exports ?? {};\n this.imports = createThreadImports(this.#handlerForCall.bind(this), imports);\n this.functions = functions;\n this.serialization = serialization;\n\n this.functions.start?.(this);\n this.serialization.start?.(this);\n\n this.signal.addEventListener('abort', () => {\n for (const id of this.#idsToResolver.keys()) {\n this.#resolveCall(id, undefined, new ThreadClosedError());\n }\n this.#idsToResolver.clear();\n }, { once: true });\n\n messages.listen(async (rawData) => {\n const isThreadMessageData = Array.isArray(rawData) && typeof rawData[0] === 'number';\n if (!isThreadMessageData) return;\n\n const data = rawData;\n\n switch (data[0]) {\n case MESSAGE_CALL: {\n const [, id, property, args] = data;\n const func = this.exports[property] ?? (() => {\n throw new Error(`No '${property}' method is exported from this thread`);\n });\n\n await this.#callLocal(func, args, (value, error, transferable) => {\n this.messages.send([MESSAGE_CALL_RESULT, id, value, error], transferable);\n });\n\n break;\n }\n\n case MESSAGE_FUNCTION_CALL: {\n const [, callID, funcID, args] = data;\n const func = this.functions.get(funcID, this) ?? missingThreadFunction;\n\n await this.#callLocal(func, args, (value, error, transferable) => {\n this.messages.send([MESSAGE_FUNCTION_RESULT, callID, value, error], transferable);\n });\n\n break;\n }\n\n case MESSAGE_CALL_RESULT:\n case MESSAGE_FUNCTION_RESULT: {\n this.#resolveCall(...data.slice(1));\n break;\n }\n\n case MESSAGE_FUNCTION_RELEASE: {\n const id = data[1];\n this.functions.release(id, this);\n break;\n }\n }\n }, { signal: this.signal });\n }\n\n close() {\n this.#abort.abort();\n }\n\n async call(func, args) {\n if (this.closed) {\n return Promise.reject(new ThreadClosedError());\n }\n\n const transferable = [];\n const serialized = await this.serialization.serialize(args, this, transferable);\n\n const id = nanoid();\n const done = this.#waitForResult(id);\n\n func(id, serialized, transferable);\n\n return done;\n }\n\n async #callLocal(func, args, withResult) {\n try {\n const result = this.functions.call\n ? await this.functions.call(func, args, this) // keep original contract\n : await func(...(await this.serialization.deserialize(args, this)));\n\n const transferable = [];\n const serialized = await this.serialization.serialize(result, this, transferable);\n\n withResult(serialized, undefined, transferable);\n } catch (error) {\n withResult(undefined, await this.serialization.serialize(error, this));\n }\n }\n\n #handlerForCall(property) {\n return (...args) => {\n try {\n if (typeof property !== 'string' && typeof property !== 'number') {\n throw new Error(`Can’t call a symbol method on a thread: ${property.toString()}`);\n }\n\n return this.call((id, serializedArgs, transferable) => {\n this.messages.send([MESSAGE_CALL, id, property, serializedArgs], transferable);\n }, args);\n } catch (error) {\n return Promise.reject(error);\n }\n };\n }\n\n #resolveCall(...args) {\n const callID = args[0];\n const resolver = this.#idsToResolver.get(callID);\n\n if (resolver) {\n resolver(...args);\n this.#idsToResolver.delete(callID);\n }\n }\n\n #waitForResult(id) {\n const promise = new Promise((resolve, reject) => {\n this.#idsToResolver.set(id, async (_, value, error) => {\n try {\n if (error == null) {\n resolve(await this.serialization.deserialize(value, this));\n } else {\n reject(await this.serialization.deserialize(error, this));\n }\n } catch (deserializeError) {\n reject(deserializeError);\n }\n });\n });\n\n Object.defineProperty(promise, Symbol.asyncIterator, {\n async *value() {\n const result = await promise;\n\n Object.defineProperty(result, Symbol.asyncIterator, {\n value: () => result\n });\n\n yield* result;\n }\n });\n\n return promise;\n }\n}\n\nfunction createThreadImports(handlerForImport, imported) {\n let call;\n\n if (imported == null) {\n if (typeof Proxy !== 'function') {\n throw new Error(`You must pass an array of callable methods in environments without Proxies.`);\n }\n\n const cache = new Map();\n\n call = new Proxy({}, {\n get(_target, property) {\n if (cache.has(property)) {\n return cache.get(property);\n }\n\n const handler = handlerForImport(property);\n cache.set(property, handler);\n return handler;\n }\n });\n } else {\n call = {};\n\n for (const method of imported) {\n Object.defineProperty(call, method, {\n value: handlerForImport(method),\n writable: false,\n configurable: true,\n enumerable: true\n });\n }\n }\n\n return call;\n}\n\nfunction missingThreadFunction() {\n throw new Error(`You attempted to call a function that is not stored. It may have already been released.`);\n}\n\nexport { Thread };\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;AAcA,IAAM,SAAN,MAAa;CACX,IAAI,SAAS;EACX,OAAO,KAAKA,OAAO;CACrB;CAEA,IAAI,SAAS;EACX,OAAO,KAAKA,OAAO,OAAO;CAC5B;CAEA;CACA,wCAAwB,IAAI,IAAI,EAAA,CAAG;CAEnC,YAAY,UAAU,EACpB,SACA,SACA,YAAY,IAAI,yBAAyB,GACzC,gBAAgB,IAAI,mCAAmC,GACvD,WACE,CAAC,GAAG;EACN,KAAK,WAAW;EAChB,KAAKA,SAAS,SAAS,IAAI,sBAAsB,MAAM,IAAI,IAAI,gBAAgB;EAC/E,KAAK,UAAU,WAAW,CAAC;EAC3B,KAAK,UAAU,oBAAoB,KAAKC,gBAAgB,KAAK,IAAI,GAAG,OAAO;EAC3E,KAAK,YAAY;EACjB,KAAK,gBAAgB;EAErB,KAAK,UAAU,QAAQ,IAAI;EAC3B,KAAK,cAAc,QAAQ,IAAI;EAE/B,KAAK,OAAO,iBAAiB,eAAe;GAC1C,KAAK,MAAM,MAAM,KAAKC,eAAe,KAAK,GACxC,KAAKC,aAAa,IAAI,KAAA,GAAW,IAAI,kBAAkB,CAAC;GAE1D,KAAKD,eAAe,MAAM;EAC5B,GAAG,EAAE,MAAM,KAAK,CAAC;EAEjB,SAAS,OAAO,OAAO,YAAY;GAEjC,IAAI,EADwB,MAAM,QAAQ,OAAO,KAAK,OAAO,QAAQ,OAAO,WAClD;GAE1B,MAAM,OAAO;GAEb,Q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AQ,OAAO,eAAe,EAClD,aAAa,OACf,CAAC;GAED,OAAO;EACT,EACF,CAAC;EAED,OAAO;CACT;AACF;AAEA,SAAS,oBAAoB,kBAAkB,UAAU;CACvD,IAAI;CAEJ,IAAI,YAAY,MAAM;EACpB,IAAI,OAAO,UAAU,YACnB,MAAM,IAAI,MAAM,6EAA6E;EAG/F,MAAM,wBAAQ,IAAI,IAAI;EAEtB,OAAO,IAAI,MAAM,CAAC,GAAG,EACnB,IAAI,SAAS,UAAU;GACrB,IAAI,MAAM,IAAI,QAAQ,GACpB,OAAO,MAAM,IAAI,QAAQ;GAG3B,MAAM,UAAU,iBAAiB,QAAQ;GACzC,MAAM,IAAI,UAAU,OAAO;GAC3B,OAAO;EACT,EACF,CAAC;CACH,OAAO;EACL,OAAO,CAAC;EAER,KAAK,MAAM,UAAU,UACnB,OAAO,eAAe,MAAM,QAAQ;GAClC,OAAO,iBAAiB,MAAM;GAC9B,UAAU;GACV,cAAc;GACd,YAAY;EACd,CAAC;CAEL;CAEA,OAAO;AACT;AAEA,SAAS,wBAAwB;CAC/B,MAAM,IAAI,MAAM,yFAAyF;AAC3G"}
@@ -0,0 +1,7 @@
1
+ //#region ../../node_modules/.pnpm/@quilted+threads@3.3.1_patch_hash=df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/constants.mjs
2
+ var SERIALIZE_METHOD = Symbol.for("quilt.threads.serialize");
3
+ var TRANSFERABLE = Symbol.for("quilt.threads.transferable");
4
+ //#endregion
5
+ export { SERIALIZE_METHOD, TRANSFERABLE };
6
+
7
+ //# sourceMappingURL=constants.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.mjs","names":[],"sources":["../../../../../../../../../../../../node_modules/.pnpm/@quilted+threads@3.3.1_patch_hash=df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/constants.mjs"],"sourcesContent":["const MESSAGE_CALL = 1;\nconst MESSAGE_CALL_RESULT = 2;\nconst MESSAGE_FUNCTION_CALL = 3;\nconst MESSAGE_FUNCTION_RESULT = 4;\nconst MESSAGE_FUNCTION_RELEASE = 5;\nconst SERIALIZE_METHOD = Symbol.for('quilt.threads.serialize');\nconst TRANSFERABLE = Symbol.for('quilt.threads.transferable');\n\nexport { MESSAGE_CALL, MESSAGE_CALL_RESULT, MESSAGE_FUNCTION_CALL, MESSAGE_FUNCTION_RELEASE, MESSAGE_FUNCTION_RESULT, SERIALIZE_METHOD, TRANSFERABLE };\n"],"x_google_ignoreList":[0],"mappings":";AAKA,IAAM,mBAAmB,OAAO,IAAI,yBAAyB;AAC7D,IAAM,eAAe,OAAO,IAAI,4BAA4B"}
@@ -0,0 +1,10 @@
1
+ //#region ../../node_modules/.pnpm/@quilted+threads@3.3.1_patch_hash=df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/errors.mjs
2
+ var ThreadClosedError = class extends Error {
3
+ constructor() {
4
+ super("You attempted to call a function on a closed thread.");
5
+ }
6
+ };
7
+ //#endregion
8
+ export { ThreadClosedError };
9
+
10
+ //# sourceMappingURL=errors.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.mjs","names":[],"sources":["../../../../../../../../../../../../node_modules/.pnpm/@quilted+threads@3.3.1_patch_hash=df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/errors.mjs"],"sourcesContent":["class ThreadClosedError extends Error {\n constructor() {\n super('You attempted to call a function on a closed thread.');\n }\n}\n\nexport { ThreadClosedError };\n"],"x_google_ignoreList":[0],"mappings":";AAAA,IAAM,oBAAN,cAAgC,MAAM;CACpC,cAAc;EACZ,MAAM,sDAAsD;CAC9D;AACF"}
@@ -0,0 +1,70 @@
1
+ import { nanoid } from "../nanoid.mjs";
2
+ //#region ../../node_modules/.pnpm/@quilted+threads@3.3.1_patch_hash=df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/functions/ThreadFunctionsAutomatic.mjs
3
+ /**
4
+ * A strategy for managing functions across threads that automatically releases
5
+ * functions when they are no longer needed. This is done by deserializing functions
6
+ * into a proxy that can be called, and wrapping that proxy in a `FinalizationRegistry`,
7
+ * which allows us to send a message to the parent thread when the function is no
8
+ * longer used.
9
+ *
10
+ * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry
11
+ */
12
+ var ThreadFunctionsAutomatic = class {
13
+ #functionsToId = (() => /* @__PURE__ */ new Map())();
14
+ #idsToFunction = (() => /* @__PURE__ */ new Map())();
15
+ #idsToProxy = (() => /* @__PURE__ */ new Map())();
16
+ #finalization = (() => /* @__PURE__ */ new WeakMap())();
17
+ get(id) {
18
+ return this.#idsToFunction.get(id);
19
+ }
20
+ release(id) {
21
+ const func = this.#idsToFunction.get(id);
22
+ if (func) {
23
+ this.#idsToFunction.delete(id);
24
+ this.#functionsToId.delete(func);
25
+ }
26
+ return Boolean(func);
27
+ }
28
+ serialize(func) {
29
+ let id = this.#functionsToId.get(func);
30
+ if (id == null) {
31
+ id = nanoid();
32
+ this.#functionsToId.set(func, id);
33
+ this.#idsToFunction.set(id, func);
34
+ }
35
+ return id;
36
+ }
37
+ deserialize(id, thread) {
38
+ let proxy = this.#idsToProxy.get(id)?.deref();
39
+ if (proxy) return proxy;
40
+ proxy = (...args) => {
41
+ if (!this.#idsToProxy.has(id)) throw new Error("You attempted to call a function that was already revoked.");
42
+ return thread.call((callID, args, transferable) => {
43
+ thread.messages.send([
44
+ 3,
45
+ callID,
46
+ id,
47
+ args
48
+ ], transferable);
49
+ }, args);
50
+ };
51
+ this.#finalizationRegistry(thread)?.register(proxy, id);
52
+ this.#idsToProxy.set(id, new WeakRef(proxy));
53
+ return proxy;
54
+ }
55
+ #finalizationRegistry(thread) {
56
+ let finalization = this.#finalization.get(thread);
57
+ if (typeof FinalizationRegistry === "undefined") return;
58
+ if (!finalization) {
59
+ finalization = new FinalizationRegistry((id) => {
60
+ thread.messages.send([5, id]);
61
+ });
62
+ this.#finalization.set(thread, finalization);
63
+ }
64
+ return finalization;
65
+ }
66
+ };
67
+ //#endregion
68
+ export { ThreadFunctionsAutomatic };
69
+
70
+ //# sourceMappingURL=ThreadFunctionsAutomatic.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThreadFunctionsAutomatic.mjs","names":["#idsToFunction","#functionsToId","#idsToProxy","#finalizationRegistry","#finalization"],"sources":["../../../../../../../../../../../../../node_modules/.pnpm/@quilted+threads@3.3.1_patch_hash=df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/functions/ThreadFunctionsAutomatic.mjs"],"sourcesContent":["import { MESSAGE_FUNCTION_CALL, MESSAGE_FUNCTION_RELEASE } from '../constants.mjs';\nimport { nanoid } from '../nanoid.mjs';\n\n/**\n * A strategy for managing functions across threads that automatically releases\n * functions when they are no longer needed. This is done by deserializing functions\n * into a proxy that can be called, and wrapping that proxy in a `FinalizationRegistry`,\n * which allows us to send a message to the parent thread when the function is no\n * longer used.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry\n */\nclass ThreadFunctionsAutomatic {\n #functionsToId = (() => new Map())();\n #idsToFunction = (() => new Map())();\n #idsToProxy = (() => new Map())();\n #finalization = (() => new WeakMap())();\n get(id) {\n return this.#idsToFunction.get(id);\n }\n release(id) {\n const func = this.#idsToFunction.get(id);\n if (func) {\n this.#idsToFunction.delete(id);\n this.#functionsToId.delete(func);\n }\n return Boolean(func);\n }\n serialize(func) {\n let id = this.#functionsToId.get(func);\n if (id == null) {\n id = nanoid();\n this.#functionsToId.set(func, id);\n this.#idsToFunction.set(id, func);\n }\n return id;\n }\n deserialize(id, thread) {\n let proxy = this.#idsToProxy.get(id)?.deref();\n if (proxy) return proxy;\n proxy = (...args) => {\n if (!this.#idsToProxy.has(id)) {\n throw new Error('You attempted to call a function that was already revoked.');\n }\n return thread.call((callID, args, transferable) => {\n thread.messages.send([MESSAGE_FUNCTION_CALL, callID, id, args], transferable);\n }, args);\n };\n this.#finalizationRegistry(thread)?.register(proxy, id);\n this.#idsToProxy.set(id, new WeakRef(proxy));\n return proxy;\n }\n #finalizationRegistry(thread) {\n let finalization = this.#finalization.get(thread);\n if (typeof FinalizationRegistry === 'undefined') {\n return undefined;\n }\n if (!finalization) {\n finalization = new FinalizationRegistry(id => {\n thread.messages.send([MESSAGE_FUNCTION_RELEASE, id]);\n });\n this.#finalization.set(thread, finalization);\n }\n return finalization;\n }\n}\n\nexport { ThreadFunctionsAutomatic };\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;AAYA,IAAM,2BAAN,MAA+B;CAC7B,wCAAwB,IAAI,IAAI,EAAA,CAAG;CACnC,wCAAwB,IAAI,IAAI,EAAA,CAAG;CACnC,qCAAqB,IAAI,IAAI,EAAA,CAAG;CAChC,uCAAuB,IAAI,QAAQ,EAAA,CAAG;CACtC,IAAI,IAAI;EACN,OAAO,KAAKA,eAAe,IAAI,EAAE;CACnC;CACA,QAAQ,IAAI;EACV,MAAM,OAAO,KAAKA,eAAe,IAAI,EAAE;EACvC,IAAI,MAAM;GACR,KAAKA,eAAe,OAAO,EAAE;GAC7B,KAAKC,eAAe,OAAO,IAAI;EACjC;EACA,OAAO,QAAQ,IAAI;CACrB;CACA,UAAU,MAAM;EACd,IAAI,KAAK,KAAKA,eAAe,IAAI,IAAI;EACrC,IAAI,MAAM,MAAM;GACd,KAAK,OAAO;GACZ,KAAKA,eAAe,IAAI,MAAM,EAAE;GAChC,KAAKD,eAAe,IAAI,IAAI,IAAI;EAClC;EACA,OAAO;CACT;CACA,YAAY,IAAI,QAAQ;EACtB,IAAI,QAAQ,KAAKE,YAAY,IAAI,EAAE,CAAC,EAAE,MAAM;EAC5C,IAAI,OAAO,OAAO;EAClB,SAAS,GAAG,SAAS;GACnB,IAAI,CAAC,KAAKA,YAAY,IAAI,EAAE,GAC1B,MAAM,IAAI,MAAM,4DAA4D;GAE9E,OAAO,OAAO,MAAM,QAAQ,MAAM,iBAAiB;IACjD,OAAO,SAAS,KAAK;;KAAwB;KAAQ;KAAI;IAAI,GAAG,YAAY;GAC9E,GAAG,IAAI;EACT;EACA,KAAKC,sBAAsB,MAAM,CAAC,EAAE,SAAS,OAAO,EAAE;EACtD,KAAKD,YAAY,IAAI,IAAI,IAAI,QAAQ,KAAK,CAAC;EAC3C,OAAO;CACT;CACA,sBAAsB,QAAQ;EAC5B,IAAI,eAAe,KAAKE,cAAc,IAAI,MAAM;EAChD,IAAI,OAAO,yBAAyB,aAClC;EAEF,IAAI,CAAC,cAAc;GACjB,eAAe,IAAI,sBAAqB,OAAM;IAC5C,OAAO,SAAS,KAAK,CAAA,GAA2B,EAAE,CAAC;GACrD,CAAC;GACD,KAAKA,cAAc,IAAI,QAAQ,YAAY;EAC7C;EACA,OAAO;CACT;AACF"}
@@ -0,0 +1,11 @@
1
+ //#region ../../node_modules/.pnpm/@quilted+threads@3.3.1_patch_hash=df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/nanoid.mjs
2
+ var a = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
3
+ function nanoid(e = 21) {
4
+ let t = "", r = crypto.getRandomValues(new Uint8Array(e));
5
+ for (let n = 0; n < e; n++) t += a[63 & r[n]];
6
+ return t;
7
+ }
8
+ //#endregion
9
+ export { nanoid };
10
+
11
+ //# sourceMappingURL=nanoid.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nanoid.mjs","names":[],"sources":["../../../../../../../../../../../../node_modules/.pnpm/@quilted+threads@3.3.1_patch_hash=df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/nanoid.mjs"],"sourcesContent":["// Copied from https://github.com/ai/nanoid/blob/main/nanoid.js\nlet a = 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict';\nfunction nanoid(e = 21) {\n let t = '',\n r = crypto.getRandomValues(new Uint8Array(e));\n for (let n = 0; n < e; n++) t += a[63 & r[n]];\n return t;\n}\n\nexport { nanoid };\n"],"x_google_ignoreList":[0],"mappings":";AACA,IAAI,IAAI;AACR,SAAS,OAAO,IAAI,IAAI;CACtB,IAAI,IAAI,IACN,IAAI,OAAO,gBAAgB,IAAI,WAAW,CAAC,CAAC;CAC9C,KAAK,IAAI,IAAI,GAAG,IAAI,GAAG,KAAK,KAAK,EAAE,KAAK,EAAE;CAC1C,OAAO;AACT"}
@@ -0,0 +1,132 @@
1
+ import { SERIALIZE_METHOD, TRANSFERABLE } from "../constants.mjs";
2
+ import { isBasicObject, isIterator } from "./shared.mjs";
3
+ //#region ../../node_modules/.pnpm/@quilted+threads@3.3.1_patch_hash=df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/serialization/ThreadSerializationStructuredClone.mjs
4
+ var FUNCTION = "_@f";
5
+ var ASYNC_ITERATOR = "_@i";
6
+ /**
7
+ * A thread encoder that can transfer supports a wide variety of JavaScript types by
8
+ * converting them to a format that the [`structuredClone`](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm)
9
+ * algorithm can process. This
10
+ *
11
+ * Additionally, this encoder will convert functions into a JSON-friendly representation.
12
+ * These functions will use a manual memory management technique to ensure they can be
13
+ * garbage collected by default, but can be configured to use a `WeakRef`-based automatic
14
+ * memory management system by setting the `garbageCollection: 'weak-ref'` option.
15
+ */
16
+ var ThreadSerializationStructuredClone = class {
17
+ #customSerializer;
18
+ #customDeserializer;
19
+ constructor(options) {
20
+ this.#customSerializer = options?.serialize;
21
+ this.#customDeserializer = options?.deserialize;
22
+ }
23
+ /**
24
+ * Serializes a value into a structured cloning-compatible format that can be transferred between threads.
25
+ */
26
+ async serialize(value, thread, transferable) {
27
+ return this.#serializeInternal(value, thread, transferable);
28
+ }
29
+ async #serializeInternal(value, thread, transferable, seen = /* @__PURE__ */ new Map(), isApplyingDefault = false) {
30
+ if (value == null) return value;
31
+ if (seen.has(value)) return seen.get(value);
32
+ seen.set(value, void 0);
33
+ if (typeof value === "object") {
34
+ if (this.#customSerializer && !isApplyingDefault) {
35
+ const customValue = await this.#customSerializer(value, (value) => this.#serializeInternal(value, thread, transferable, seen, true), thread, transferable);
36
+ if (customValue !== void 0) {
37
+ seen.set(value, customValue);
38
+ return customValue;
39
+ }
40
+ }
41
+ if (value[TRANSFERABLE]) {
42
+ transferable?.push(value);
43
+ seen.set(value, value);
44
+ return value;
45
+ }
46
+ const serializeValue = (value) => {
47
+ return this.#serializeInternal(value, thread, transferable, seen);
48
+ };
49
+ if (typeof value[SERIALIZE_METHOD] === "function") {
50
+ const result = await value[SERIALIZE_METHOD]({ serialize: serializeValue });
51
+ seen.set(value, result);
52
+ return result;
53
+ }
54
+ if (Array.isArray(value)) {
55
+ const result = await Promise.all(value.map((item) => serializeValue(item)));
56
+ seen.set(value, result);
57
+ return result;
58
+ }
59
+ if (value instanceof Map) {
60
+ const entries = await Promise.all([...value.entries()].map(async ([key, value]) => {
61
+ return [await serializeValue(key), await serializeValue(value)];
62
+ }));
63
+ const result = new Map(entries);
64
+ seen.set(value, result);
65
+ return result;
66
+ }
67
+ if (value instanceof Set) {
68
+ const entries = await Promise.all([...value].map((entry) => serializeValue(entry)));
69
+ const result = new Set(entries);
70
+ seen.set(value, result);
71
+ return result;
72
+ }
73
+ const valueIsIterator = isIterator(value);
74
+ if (isBasicObject(value) || valueIsIterator) {
75
+ const result = {};
76
+ for (const key of Object.keys(value)) result[key] = await serializeValue(value[key]);
77
+ if (valueIsIterator) {
78
+ result.next ??= await serializeValue(value.next.bind(value));
79
+ result.return ??= await serializeValue(value.return.bind(value));
80
+ result.throw ??= await serializeValue(value.throw.bind(value));
81
+ result[ASYNC_ITERATOR] = true;
82
+ }
83
+ seen.set(value, result);
84
+ return result;
85
+ }
86
+ }
87
+ if (typeof value === "function") {
88
+ const serialized = thread.functions.serialize(value, thread, transferable);
89
+ const result = { [FUNCTION]: serialized };
90
+ seen.set(value, result);
91
+ return result;
92
+ }
93
+ seen.set(value, value);
94
+ return value;
95
+ }
96
+ /**
97
+ * Deserializes a structured cloning-compatible value from another thread.
98
+ */
99
+ async deserialize(value, thread) {
100
+ return this.#deserializeInternal(value, thread);
101
+ }
102
+ async #deserializeInternal(value, thread, isApplyingDefault = false) {
103
+ if (value == null) return value;
104
+ if (typeof value === "object") {
105
+ if (this.#customDeserializer && !isApplyingDefault) {
106
+ const customValue = await this.#customDeserializer(value, (value) => this.#deserializeInternal(value, thread, true), thread);
107
+ if (customValue !== void 0) return customValue;
108
+ }
109
+ if (value == null) return value;
110
+ if (Array.isArray(value)) return Promise.all(value.map((value) => this.#deserializeInternal(value, thread)));
111
+ if (value instanceof Map) {
112
+ const entries = await Promise.all([...value].map(async ([key, value]) => [await this.#deserializeInternal(key, thread), await this.#deserializeInternal(value, thread)]));
113
+ return new Map(entries);
114
+ }
115
+ if (value instanceof Set) {
116
+ const entries = await Promise.all([...value].map((entry) => this.#deserializeInternal(entry, thread)));
117
+ return new Set(entries);
118
+ }
119
+ if (FUNCTION in value) return thread.functions.deserialize(value[FUNCTION], thread);
120
+ if (!isBasicObject(value)) return value;
121
+ const result = {};
122
+ for (const key of Object.keys(value)) if (key === ASYNC_ITERATOR) result[Symbol.asyncIterator] = () => result;
123
+ else result[key] = await this.#deserializeInternal(value[key], thread);
124
+ return result;
125
+ }
126
+ return value;
127
+ }
128
+ };
129
+ //#endregion
130
+ export { ThreadSerializationStructuredClone };
131
+
132
+ //# sourceMappingURL=ThreadSerializationStructuredClone.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThreadSerializationStructuredClone.mjs","names":["#customSerializer","#customDeserializer","#serializeInternal","#deserializeInternal"],"sources":["../../../../../../../../../../../../../node_modules/.pnpm/@quilted+threads@3.3.1_patch_hash=df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/serialization/ThreadSerializationStructuredClone.mjs"],"sourcesContent":["import { TRANSFERABLE, SERIALIZE_METHOD } from '../constants.mjs';\nimport { isIterator, isBasicObject } from './shared.mjs';\n\nconst FUNCTION = '_@f';\nconst ASYNC_ITERATOR = '_@i';\n\n/**\n * A thread encoder that can transfer supports a wide variety of JavaScript types by\n * converting them to a format that the [`structuredClone`](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm)\n * algorithm can process. This\n *\n * Additionally, this encoder will convert functions into a JSON-friendly representation.\n * These functions will use a manual memory management technique to ensure they can be\n * garbage collected by default, but can be configured to use a `WeakRef`-based automatic\n * memory management system by setting the `garbageCollection: 'weak-ref'` option.\n */\nclass ThreadSerializationStructuredClone {\n #customSerializer;\n #customDeserializer;\n\n constructor(options) {\n this.#customSerializer = options?.serialize;\n this.#customDeserializer = options?.deserialize;\n }\n\n /**\n * Serializes a value into a structured cloning-compatible format that can be transferred between threads.\n */\n async serialize(value, thread, transferable) {\n return this.#serializeInternal(value, thread, transferable);\n }\n\n async #serializeInternal(value, thread, transferable, seen = new Map(), isApplyingDefault = false) {\n if (value == null) return value;\n if (seen.has(value)) return seen.get(value);\n\n // Prevent circular references\n seen.set(value, undefined);\n\n if (typeof value === 'object') {\n if (this.#customSerializer && !isApplyingDefault) {\n const customValue = await this.#customSerializer(\n value,\n (value) => this.#serializeInternal(value, thread, transferable, seen, true),\n thread,\n transferable,\n );\n\n if (customValue !== undefined) {\n seen.set(value, customValue);\n return customValue;\n }\n }\n\n if (value[TRANSFERABLE]) {\n transferable?.push(value);\n seen.set(value, value);\n return value;\n }\n\n const serializeValue = (value) => {\n return this.#serializeInternal(value, thread, transferable, seen);\n };\n\n if (typeof value[SERIALIZE_METHOD] === 'function') {\n const result = await value[SERIALIZE_METHOD]({\n serialize: serializeValue,\n });\n\n seen.set(value, result);\n return result;\n }\n\n if (Array.isArray(value)) {\n const result = await Promise.all(value.map((item) => serializeValue(item)));\n seen.set(value, result);\n return result;\n }\n\n if (value instanceof Map) {\n const entries = await Promise.all(\n [...value.entries()].map(async ([key, value]) => {\n return [await serializeValue(key), await serializeValue(value)];\n }),\n );\n\n const result = new Map(entries);\n seen.set(value, result);\n return result;\n }\n\n if (value instanceof Set) {\n const entries = await Promise.all(\n [...value].map((entry) => serializeValue(entry)),\n );\n\n const result = new Set(entries);\n seen.set(value, result);\n return result;\n }\n\n const valueIsIterator = isIterator(value);\n\n if (isBasicObject(value) || valueIsIterator) {\n const result = {};\n\n for (const key of Object.keys(value)) {\n result[key] = await serializeValue(value[key]);\n }\n\n if (valueIsIterator) {\n result.next ??= await serializeValue(value.next.bind(value));\n result.return ??= await serializeValue(value.return.bind(value));\n result.throw ??= await serializeValue(value.throw.bind(value));\n result[ASYNC_ITERATOR] = true;\n }\n\n seen.set(value, result);\n return result;\n }\n }\n\n if (typeof value === 'function') {\n const serialized = thread.functions.serialize(value, thread, transferable);\n const result = { [FUNCTION]: serialized };\n\n seen.set(value, result);\n return result;\n }\n\n seen.set(value, value);\n return value;\n }\n\n /**\n * Deserializes a structured cloning-compatible value from another thread.\n */\n async deserialize(value, thread) {\n return this.#deserializeInternal(value, thread);\n }\n\n async #deserializeInternal(value, thread, isApplyingDefault = false) {\n if (value == null) return value;\n\n if (typeof value === 'object') {\n if (this.#customDeserializer && !isApplyingDefault) {\n const customValue = await this.#customDeserializer(\n value,\n (value) => this.#deserializeInternal(value, thread, true),\n thread,\n );\n\n if (customValue !== undefined) {\n return customValue;\n }\n }\n\n if (value == null) {\n return value;\n }\n\n if (Array.isArray(value)) {\n return Promise.all(value.map((value) => this.#deserializeInternal(value, thread)));\n }\n\n if (value instanceof Map) {\n const entries = await Promise.all(\n [...value].map(async ([key, value]) => [\n await this.#deserializeInternal(key, thread),\n await this.#deserializeInternal(value, thread),\n ]),\n );\n\n return new Map(entries);\n }\n\n if (value instanceof Set) {\n const entries = await Promise.all(\n [...value].map((entry) => this.#deserializeInternal(entry, thread)),\n );\n\n return new Set(entries);\n }\n\n if (FUNCTION in value) {\n const func = thread.functions.deserialize(value[FUNCTION], thread);\n return func;\n }\n\n if (!isBasicObject(value)) {\n return value;\n }\n\n const result = {};\n\n for (const key of Object.keys(value)) {\n if (key === ASYNC_ITERATOR) {\n result[Symbol.asyncIterator] = () => result;\n } else {\n result[key] = await this.#deserializeInternal(value[key], thread);\n }\n }\n\n return result;\n }\n\n return value;\n }\n}\n\nexport { ThreadSerializationStructuredClone };\n"],"x_google_ignoreList":[0],"mappings":";;;AAGA,IAAM,WAAW;AACjB,IAAM,iBAAiB;;;;;;;;;;;AAYvB,IAAM,qCAAN,MAAyC;CACvC;CACA;CAEA,YAAY,SAAS;EACnB,KAAKA,oBAAoB,SAAS;EAClC,KAAKC,sBAAsB,SAAS;CACtC;;;;CAKA,MAAM,UAAU,OAAO,QAAQ,cAAc;EAC3C,OAAO,KAAKC,mBAAmB,OAAO,QAAQ,YAAY;CAC5D;CAEA,MAAMA,mBAAmB,OAAO,QAAQ,cAAc,uBAAO,IAAI,IAAI,GAAG,oBAAoB,OAAO;EACjG,IAAI,SAAS,MAAM,OAAO;EAC1B,IAAI,KAAK,IAAI,KAAK,GAAG,OAAO,KAAK,IAAI,KAAK;EAG1C,KAAK,IAAI,OAAO,KAAA,CAAS;EAEzB,IAAI,OAAO,UAAU,UAAU;GAC7B,IAAI,KAAKF,qBAAqB,CAAC,mBAAmB;IAChD,MAAM,cAAc,MAAM,KAAKA,kBAC7B,QACC,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CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,WAAW,CACrC,MAAM,KAAKA,qBAAqB,KAAK,MAAM,GAC3C,MAAM,KAAKA,qBAAqB,OAAO,MAAM,CAC/C,CAAC,CACH;IAEA,OAAO,IAAI,IAAI,OAAO;GACxB;GAEA,IAAI,iBAAiB,KAAK;IACxB,MAAM,UAAU,MAAM,QAAQ,IAC5B,CAAC,GAAG,KAAK,CAAC,CAAC,KAAK,UAAU,KAAKA,qBAAqB,OAAO,MAAM,CAAC,CACpE;IAEA,OAAO,IAAI,IAAI,OAAO;GACxB;GAEA,IAAI,YAAY,OAEd,OADa,OAAO,UAAU,YAAY,MAAM,WAAW,MACjD;GAGZ,IAAI,CAAC,cAAc,KAAK,GACtB,OAAO;GAGT,MAAM,SAAS,CAAC;GAEhB,KAAK,MAAM,OAAO,OAAO,KAAK,KAAK,GACjC,IAAI,QAAQ,gBACV,OAAO,OAAO,uBAAuB;QAErC,OAAO,OAAO,MAAM,KAAKA,qBAAqB,MAAM,MAAM,MAAM;GAIpE,OAAO;EACT;EAEA,OAAO;CACT;AACF"}
@@ -0,0 +1,13 @@
1
+ //#region ../../node_modules/.pnpm/@quilted+threads@3.3.1_patch_hash=df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/serialization/shared.mjs
2
+ function isIterator(value) {
3
+ return value != null && (Symbol.asyncIterator in value || Symbol.iterator in value) && typeof value.next === "function";
4
+ }
5
+ function isBasicObject(value) {
6
+ if (value == null || typeof value !== "object") return false;
7
+ const prototype = Object.getPrototypeOf(value);
8
+ return prototype == null || prototype === Object.prototype;
9
+ }
10
+ //#endregion
11
+ export { isBasicObject, isIterator };
12
+
13
+ //# sourceMappingURL=shared.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.mjs","names":[],"sources":["../../../../../../../../../../../../../node_modules/.pnpm/@quilted+threads@3.3.1_patch_hash=df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/serialization/shared.mjs"],"sourcesContent":["function isIterator(value) {\n return value != null && (Symbol.asyncIterator in value || Symbol.iterator in value) && typeof value.next === 'function';\n}\nfunction isBasicObject(value) {\n if (value == null || typeof value !== 'object') return false;\n const prototype = Object.getPrototypeOf(value);\n return prototype == null || prototype === Object.prototype;\n}\n\nexport { isBasicObject, isIterator };\n"],"x_google_ignoreList":[0],"mappings":";AAAA,SAAS,WAAW,OAAO;CACzB,OAAO,SAAS,SAAS,OAAO,iBAAiB,SAAS,OAAO,YAAY,UAAU,OAAO,MAAM,SAAS;AAC/G;AACA,SAAS,cAAc,OAAO;CAC5B,IAAI,SAAS,QAAQ,OAAO,UAAU,UAAU,OAAO;CACvD,MAAM,YAAY,OAAO,eAAe,KAAK;CAC7C,OAAO,aAAa,QAAQ,cAAc,OAAO;AACnD"}