storybook 10.1.0-alpha.8 → 10.1.0-beta.0

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 (198) hide show
  1. package/dist/_browser-chunks/Color-FTG7SQDA.js +1097 -0
  2. package/dist/_browser-chunks/WithTooltip-LMROHDUP.js +1651 -0
  3. package/dist/_browser-chunks/chunk-2FRVAXCZ.js +7 -0
  4. package/dist/_browser-chunks/{chunk-FDWKXLBI.js → chunk-2XZMBGTA.js} +44 -109
  5. package/dist/_browser-chunks/chunk-3IAH5M2U.js +171 -0
  6. package/dist/_browser-chunks/chunk-3OXGAGBE.js +779 -0
  7. package/dist/_browser-chunks/{chunk-TMDZCWME.js → chunk-3PJE6VLG.js} +1 -3
  8. package/dist/_browser-chunks/{chunk-VAMFPZY3.js → chunk-45UGUKRX.js} +2 -7
  9. package/dist/_browser-chunks/chunk-6XWLIJQL.js +11 -0
  10. package/dist/_browser-chunks/{chunk-MM7DTO55.js → chunk-A242L54C.js} +10 -16
  11. package/dist/_browser-chunks/chunk-AIOS4NGK.js +252 -0
  12. package/dist/_browser-chunks/chunk-AS2HQEYC.js +14 -0
  13. package/dist/_browser-chunks/chunk-AXG2BOBL.js +836 -0
  14. package/dist/_browser-chunks/{chunk-MH6AXFXB.js → chunk-CHUV5WSW.js} +0 -5
  15. package/dist/_browser-chunks/chunk-EUVGDK4H.js +93 -0
  16. package/dist/_browser-chunks/chunk-EZSQOHRI.js +18 -0
  17. package/dist/_browser-chunks/{chunk-CADGRH3P.js → chunk-FNXWN6IK.js} +3 -8
  18. package/dist/_browser-chunks/chunk-FQ7SLVLR.js +66 -0
  19. package/dist/_browser-chunks/chunk-GFLS4VP3.js +64 -0
  20. package/dist/_browser-chunks/chunk-GFY5R5EY.js +47 -0
  21. package/dist/_browser-chunks/{chunk-L2D73C6Z.js → chunk-H6XK3RSC.js} +13 -21
  22. package/dist/_browser-chunks/chunk-IPA5A322.js +71 -0
  23. package/dist/_browser-chunks/chunk-JP7NCOJX.js +37 -0
  24. package/dist/_browser-chunks/chunk-KJHJLCBK.js +11 -0
  25. package/dist/_browser-chunks/{chunk-OWPZQM2D.js → chunk-L4RMQ7D7.js} +60 -110
  26. package/dist/_browser-chunks/chunk-P4F4UVXX.js +951 -0
  27. package/dist/_browser-chunks/{chunk-AB7OOPUX.js → chunk-QKODTO7K.js} +0 -5
  28. package/dist/_browser-chunks/chunk-RP5RXKFU.js +2491 -0
  29. package/dist/_browser-chunks/chunk-SL75JR6Y.js +9 -0
  30. package/dist/_browser-chunks/chunk-SS2NHR7W.js +2969 -0
  31. package/dist/_browser-chunks/chunk-UD6FQLAF.js +1481 -0
  32. package/dist/_browser-chunks/chunk-VYJQ7RU5.js +2853 -0
  33. package/dist/_browser-chunks/chunk-WJYERY3R.js +136 -0
  34. package/dist/_browser-chunks/chunk-XJNX76GA.js +85 -0
  35. package/dist/_browser-chunks/{chunk-F4Q6SGTB.js → chunk-YKE5S47A.js} +177 -399
  36. package/dist/_browser-chunks/{chunk-SN4J4IQ3.js → chunk-ZUWEVLDX.js} +1 -7
  37. package/dist/_browser-chunks/{formatter-OMEEQ6HG.js → formatter-QJ4M4OGQ.js} +4 -9
  38. package/dist/_browser-chunks/{syntaxhighlighter-CAVLW7PM.js → syntaxhighlighter-IQDEPFLK.js} +704 -1848
  39. package/dist/_node-chunks/{builder-manager-57OYTFQ5.js → builder-manager-BDAQHXFI.js} +510 -1019
  40. package/dist/_node-chunks/camelcase-3C7DZZPX.js +37 -0
  41. package/dist/_node-chunks/chunk-2IIQTGNE.js +6024 -0
  42. package/dist/_node-chunks/chunk-56U5LEMP.js +3043 -0
  43. package/dist/_node-chunks/chunk-7LIRCAQE.js +20 -0
  44. package/dist/_node-chunks/chunk-7RN6TXKP.js +603 -0
  45. package/dist/_node-chunks/chunk-7SJ7PZNL.js +4523 -0
  46. package/dist/_node-chunks/{chunk-2GK7NW46.js → chunk-BG4RDXG7.js} +8 -10
  47. package/dist/_node-chunks/chunk-CBQKMXLQ.js +18 -0
  48. package/dist/_node-chunks/chunk-CN2IW2KQ.js +1564 -0
  49. package/dist/_node-chunks/chunk-CQMAU6UQ.js +943 -0
  50. package/dist/_node-chunks/{chunk-RG4Z25PY.js → chunk-D6ND3TVY.js} +116 -276
  51. package/dist/_node-chunks/chunk-DC355CYB.js +61 -0
  52. package/dist/_node-chunks/{chunk-EBYCXVVR.js → chunk-EVK2SBW5.js} +292 -688
  53. package/dist/_node-chunks/chunk-IXWEUXJ2.js +119 -0
  54. package/dist/_node-chunks/{chunk-6F6CCOXH.js → chunk-KVRF22SH.js} +469 -983
  55. package/dist/_node-chunks/chunk-LEDP4QQW.js +919 -0
  56. package/dist/_node-chunks/{chunk-C4KEDJ6O.js → chunk-MMVV6DGG.js} +8133 -8887
  57. package/dist/_node-chunks/chunk-O5CGEVRI.js +29 -0
  58. package/dist/_node-chunks/chunk-OZZO56XN.js +299 -0
  59. package/dist/_node-chunks/chunk-POT2EVGD.js +78 -0
  60. package/dist/_node-chunks/chunk-R5YGFSTV.js +3781 -0
  61. package/dist/_node-chunks/chunk-SQCTM2OS.js +23 -0
  62. package/dist/_node-chunks/chunk-UFOFO5H7.js +54 -0
  63. package/dist/_node-chunks/chunk-VBF7ALJF.js +72 -0
  64. package/dist/_node-chunks/chunk-W6MAMTUF.js +70 -0
  65. package/dist/_node-chunks/chunk-WURL4XOT.js +46662 -0
  66. package/dist/_node-chunks/chunk-XGK6MVKR.js +61 -0
  67. package/dist/_node-chunks/chunk-YV3GDSDT.js +765 -0
  68. package/dist/_node-chunks/{chunk-RSHLCHYY.js → chunk-YWV55YW3.js} +15 -24
  69. package/dist/_node-chunks/dist-KEP4IFRN.js +121 -0
  70. package/dist/_node-chunks/globby-4WUBTDCN.js +3452 -0
  71. package/dist/_node-chunks/lib-JVOEKTYM.js +366 -0
  72. package/dist/_node-chunks/mdx-N42X6CFJ-C5WFYYXR.js +14329 -0
  73. package/dist/_node-chunks/p-limit-LDY632RS.js +116 -0
  74. package/dist/actions/decorator.js +21 -42
  75. package/dist/actions/index.js +3 -3
  76. package/dist/babel/index.d.ts +671 -335
  77. package/dist/babel/index.js +10 -11
  78. package/dist/bin/core.js +601 -1548
  79. package/dist/bin/dispatcher.js +36 -36
  80. package/dist/bin/loader.js +24 -38
  81. package/dist/channels/index.js +98 -234
  82. package/dist/cli/index.d.ts +1479 -133
  83. package/dist/cli/index.js +30 -8540
  84. package/dist/client-logger/index.js +31 -61
  85. package/dist/common/index.d.ts +139 -62
  86. package/dist/common/index.js +66 -51
  87. package/dist/components/index.d.ts +575 -273
  88. package/dist/components/index.js +14863 -4313
  89. package/dist/core-events/index.js +2 -66
  90. package/dist/core-server/index.d.ts +3 -2
  91. package/dist/core-server/index.js +2910 -8519
  92. package/dist/core-server/presets/common-manager.css +2 -2
  93. package/dist/core-server/presets/common-manager.js +2521 -5233
  94. package/dist/core-server/presets/common-override-preset.js +31 -60
  95. package/dist/core-server/presets/common-preset.js +663 -962
  96. package/dist/csf/index.js +534 -1179
  97. package/dist/csf-tools/index.js +9 -9
  98. package/dist/docs-tools/index.js +6 -6
  99. package/dist/highlight/index.js +2 -2
  100. package/dist/instrumenter/index.js +199 -415
  101. package/dist/manager/globals-runtime.js +59044 -67141
  102. package/dist/manager/globals.js +2 -3
  103. package/dist/manager/manager-stores.d.ts +1 -0
  104. package/dist/manager/manager-stores.js +23 -0
  105. package/dist/manager/runtime.js +11511 -10953
  106. package/dist/manager-api/index.d.ts +1811 -2
  107. package/dist/manager-api/index.js +1348 -2401
  108. package/dist/manager-errors.d.ts +9 -0
  109. package/dist/manager-errors.js +3 -3
  110. package/dist/mocking-utils/index.d.ts +1126 -0
  111. package/dist/mocking-utils/index.js +1181 -0
  112. package/dist/node-logger/index.d.ts +192 -24
  113. package/dist/node-logger/index.js +23 -4471
  114. package/dist/preview/globals.js +2 -3
  115. package/dist/preview/runtime.js +10799 -22393
  116. package/dist/preview-api/index.d.ts +1 -1
  117. package/dist/preview-api/index.js +13 -13
  118. package/dist/preview-errors.d.ts +9 -0
  119. package/dist/preview-errors.js +4 -4
  120. package/dist/router/index.js +347 -899
  121. package/dist/server-errors.d.ts +34 -1
  122. package/dist/server-errors.js +17 -10
  123. package/dist/telemetry/index.d.ts +24 -3
  124. package/dist/telemetry/index.js +25 -24
  125. package/dist/test/index.js +6131 -11916
  126. package/dist/theming/create.d.ts +1 -0
  127. package/dist/theming/create.js +4 -4
  128. package/dist/theming/index.d.ts +3366 -2599
  129. package/dist/theming/index.js +501 -1091
  130. package/dist/types/index.d.ts +72 -8
  131. package/dist/types/index.js +27 -12
  132. package/dist/viewport/index.js +3 -3
  133. package/package.json +26 -17
  134. package/dist/_browser-chunks/Color-7ZNS6F6B.js +0 -1676
  135. package/dist/_browser-chunks/WithTooltip-SK46ZJ2J.js +0 -13
  136. package/dist/_browser-chunks/chunk-6A7OIVEL.js +0 -66
  137. package/dist/_browser-chunks/chunk-B4A3ADP3.js +0 -3816
  138. package/dist/_browser-chunks/chunk-BOOOPFZF.js +0 -2335
  139. package/dist/_browser-chunks/chunk-FSBVR7H5.js +0 -106
  140. package/dist/_browser-chunks/chunk-FUOHXXZT.js +0 -23
  141. package/dist/_browser-chunks/chunk-GTKOCWCT.js +0 -17
  142. package/dist/_browser-chunks/chunk-HHW4FUMO.js +0 -12
  143. package/dist/_browser-chunks/chunk-JVSKG4YS.js +0 -4052
  144. package/dist/_browser-chunks/chunk-LASUB7TL.js +0 -76
  145. package/dist/_browser-chunks/chunk-LYCSRYYR.js +0 -101
  146. package/dist/_browser-chunks/chunk-NVV6MIOE.js +0 -243
  147. package/dist/_browser-chunks/chunk-OBXWFEPB.js +0 -852
  148. package/dist/_browser-chunks/chunk-OPCDBBL3.js +0 -48
  149. package/dist/_browser-chunks/chunk-PB6FZ3WE.js +0 -130
  150. package/dist/_browser-chunks/chunk-RNE2IUTB.js +0 -1300
  151. package/dist/_browser-chunks/chunk-RW5PKMWM.js +0 -4182
  152. package/dist/_browser-chunks/chunk-SYS437NN.js +0 -122
  153. package/dist/_browser-chunks/chunk-U46RQHA4.js +0 -12
  154. package/dist/_browser-chunks/chunk-UTNZYD2N.js +0 -311
  155. package/dist/_browser-chunks/chunk-VUAFL5XK.js +0 -20
  156. package/dist/_browser-chunks/chunk-XDGMHOV7.js +0 -2197
  157. package/dist/_browser-chunks/chunk-XW6KSYKF.js +0 -16
  158. package/dist/_browser-chunks/chunk-Y3M7TW6K.js +0 -1041
  159. package/dist/_browser-chunks/chunk-ZNRFDIVA.js +0 -233
  160. package/dist/_node-chunks/camelcase-2KEDZHZ2.js +0 -18
  161. package/dist/_node-chunks/chunk-34NNXTBR.js +0 -28
  162. package/dist/_node-chunks/chunk-3N2A3KZX.js +0 -420
  163. package/dist/_node-chunks/chunk-5P7P5KDN.js +0 -90
  164. package/dist/_node-chunks/chunk-5WBRBDXI.js +0 -79
  165. package/dist/_node-chunks/chunk-7PWTU7T2.js +0 -697
  166. package/dist/_node-chunks/chunk-CHRHQ7AZ.js +0 -4272
  167. package/dist/_node-chunks/chunk-D4EGQLJI.js +0 -64656
  168. package/dist/_node-chunks/chunk-EKCURTKU.js +0 -1544
  169. package/dist/_node-chunks/chunk-GBVPPW4H.js +0 -1657
  170. package/dist/_node-chunks/chunk-J6VOKT2F.js +0 -220
  171. package/dist/_node-chunks/chunk-JLBYSGXS.js +0 -69
  172. package/dist/_node-chunks/chunk-LLCELSUL.js +0 -1198
  173. package/dist/_node-chunks/chunk-NS4OCQ4F.js +0 -61
  174. package/dist/_node-chunks/chunk-NXVLFYDR.js +0 -1518
  175. package/dist/_node-chunks/chunk-NZPWAJOZ.js +0 -304
  176. package/dist/_node-chunks/chunk-OYFSIV3I.js +0 -6712
  177. package/dist/_node-chunks/chunk-OZ43LMDF.js +0 -5029
  178. package/dist/_node-chunks/chunk-Q5HJHFF2.js +0 -61
  179. package/dist/_node-chunks/chunk-QHER4CEN.js +0 -34
  180. package/dist/_node-chunks/chunk-RF2PJM54.js +0 -1531
  181. package/dist/_node-chunks/chunk-S3OHGEE3.js +0 -101
  182. package/dist/_node-chunks/chunk-S5XOMVSV.js +0 -2256
  183. package/dist/_node-chunks/chunk-SGXQZ47H.js +0 -1586
  184. package/dist/_node-chunks/chunk-TDU6OVUH.js +0 -111
  185. package/dist/_node-chunks/chunk-TYQQFNQX.js +0 -1250
  186. package/dist/_node-chunks/chunk-WNGLARN2.js +0 -4741
  187. package/dist/_node-chunks/chunk-YUOVDCXL.js +0 -18
  188. package/dist/_node-chunks/dist-O5FB7YUW.js +0 -175
  189. package/dist/_node-chunks/globby-3NMV7WHX.js +0 -5222
  190. package/dist/_node-chunks/lib-VZD7BRSA.js +0 -518
  191. package/dist/_node-chunks/mdx-N42X6CFJ-3RP7RKKU.js +0 -22017
  192. package/dist/_node-chunks/p-limit-LIKBTXEJ.js +0 -168
  193. package/dist/_node-chunks/plugin-2NYZBK4A.js +0 -129
  194. package/dist/_node-chunks/plugin-6QGMO7J7.js +0 -159
  195. package/dist/_node-chunks/webpack-inject-mocker-runtime-plugin-Z2JI6J2H.js +0 -69102
  196. package/dist/_node-chunks/webpack-mock-plugin-D4BE2SSI.js +0 -124
  197. package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.js +0 -36
  198. package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.js +0 -33
@@ -0,0 +1,1481 @@
1
+ import {
2
+ dedent
3
+ } from "./chunk-JP7NCOJX.js";
4
+
5
+ // src/shared/universal-store/instances.ts
6
+ var instances = /* @__PURE__ */ new Map();
7
+
8
+ // src/shared/universal-store/index.ts
9
+ var CHANNEL_EVENT_PREFIX = "UNIVERSAL_STORE:", ProgressState = {
10
+ PENDING: "PENDING",
11
+ RESOLVED: "RESOLVED",
12
+ REJECTED: "REJECTED"
13
+ }, _UniversalStore = class _UniversalStore {
14
+ constructor(options, environmentOverrides) {
15
+ /** Enable debug logs for this store */
16
+ this.debugging = !1;
17
+ // TODO: narrow type of listeners based on event type
18
+ this.listeners = /* @__PURE__ */ new Map([["*", /* @__PURE__ */ new Set()]]);
19
+ /** Gets the current state */
20
+ this.getState = () => (this.debug("getState", { state: this.state }), this.state);
21
+ /**
22
+ * Subscribes to store events
23
+ *
24
+ * @returns A function to unsubscribe
25
+ */
26
+ this.subscribe = (eventTypeOrListener, maybeListener) => {
27
+ let subscribesToAllEvents = typeof eventTypeOrListener == "function", eventType = subscribesToAllEvents ? "*" : eventTypeOrListener, listener = subscribesToAllEvents ? eventTypeOrListener : maybeListener;
28
+ if (this.debug("subscribe", { eventType, listener }), !listener)
29
+ throw new TypeError(
30
+ `Missing first subscribe argument, or second if first is the event type, when subscribing to a UniversalStore with id '${this.id}'`
31
+ );
32
+ return this.listeners.has(eventType) || this.listeners.set(eventType, /* @__PURE__ */ new Set()), this.listeners.get(eventType).add(listener), () => {
33
+ this.debug("unsubscribe", { eventType, listener }), this.listeners.has(eventType) && (this.listeners.get(eventType).delete(listener), this.listeners.get(eventType)?.size === 0 && this.listeners.delete(eventType));
34
+ };
35
+ };
36
+ /** Sends a custom event to the other stores */
37
+ this.send = (event) => {
38
+ if (this.debug("send", { event }), this.status !== _UniversalStore.Status.READY)
39
+ throw new TypeError(
40
+ dedent`Cannot send event before store is ready. You can get the current status with store.status,
41
+ or await store.readyPromise to wait for the store to be ready before sending events.
42
+ ${JSON.stringify(
43
+ {
44
+ event,
45
+ id: this.id,
46
+ actor: this.actor,
47
+ environment: this.environment
48
+ },
49
+ null,
50
+ 2
51
+ )}`
52
+ );
53
+ this.emitToListeners(event, { actor: this.actor }), this.emitToChannel(event, { actor: this.actor });
54
+ };
55
+ if (this.debugging = options.debug ?? !1, !_UniversalStore.isInternalConstructing)
56
+ throw new TypeError(
57
+ "UniversalStore is not constructable - use UniversalStore.create() instead"
58
+ );
59
+ if (_UniversalStore.isInternalConstructing = !1, this.id = options.id, this.actorId = Date.now().toString(36) + Math.random().toString(36).substring(2), this.actorType = options.leader ? _UniversalStore.ActorType.LEADER : _UniversalStore.ActorType.FOLLOWER, this.state = options.initialState, this.channelEventName = `${CHANNEL_EVENT_PREFIX}${this.id}`, this.debug("constructor", {
60
+ options,
61
+ environmentOverrides,
62
+ channelEventName: this.channelEventName
63
+ }), this.actor.type === _UniversalStore.ActorType.LEADER)
64
+ this.syncing = {
65
+ state: ProgressState.RESOLVED,
66
+ promise: Promise.resolve()
67
+ };
68
+ else {
69
+ let syncingResolve, syncingReject, syncingPromise = new Promise((resolve, reject) => {
70
+ syncingResolve = () => {
71
+ this.syncing.state === ProgressState.PENDING && (this.syncing.state = ProgressState.RESOLVED, resolve());
72
+ }, syncingReject = (reason) => {
73
+ this.syncing.state === ProgressState.PENDING && (this.syncing.state = ProgressState.REJECTED, reject(reason));
74
+ };
75
+ });
76
+ this.syncing = {
77
+ state: ProgressState.PENDING,
78
+ promise: syncingPromise,
79
+ resolve: syncingResolve,
80
+ reject: syncingReject
81
+ };
82
+ }
83
+ this.getState = this.getState.bind(this), this.setState = this.setState.bind(this), this.subscribe = this.subscribe.bind(this), this.onStateChange = this.onStateChange.bind(this), this.send = this.send.bind(this), this.emitToChannel = this.emitToChannel.bind(this), this.prepareThis = this.prepareThis.bind(this), this.emitToListeners = this.emitToListeners.bind(this), this.handleChannelEvents = this.handleChannelEvents.bind(this), this.debug = this.debug.bind(this), this.channel = environmentOverrides?.channel ?? _UniversalStore.preparation.channel, this.environment = environmentOverrides?.environment ?? _UniversalStore.preparation.environment, this.channel && this.environment ? (_UniversalStore.preparation.resolve({ channel: this.channel, environment: this.environment }), this.prepareThis({ channel: this.channel, environment: this.environment })) : _UniversalStore.preparation.promise.then(this.prepareThis);
84
+ }
85
+ static setupPreparationPromise() {
86
+ let resolveRef, rejectRef, promise = new Promise(
87
+ (resolve, reject) => {
88
+ resolveRef = (args) => {
89
+ resolve(args);
90
+ }, rejectRef = (...args) => {
91
+ reject(args);
92
+ };
93
+ }
94
+ );
95
+ _UniversalStore.preparation = {
96
+ resolve: resolveRef,
97
+ reject: rejectRef,
98
+ promise
99
+ };
100
+ }
101
+ /** The actor object representing the store instance with a unique ID and a type */
102
+ get actor() {
103
+ return Object.freeze({
104
+ id: this.actorId,
105
+ type: this.actorType,
106
+ environment: this.environment ?? _UniversalStore.Environment.UNKNOWN
107
+ });
108
+ }
109
+ /**
110
+ * The current state of the store, that signals both if the store is prepared by Storybook and
111
+ * also - in the case of a follower - if the state has been synced with the leader's state.
112
+ */
113
+ get status() {
114
+ if (!this.channel || !this.environment)
115
+ return _UniversalStore.Status.UNPREPARED;
116
+ switch (this.syncing?.state) {
117
+ case ProgressState.PENDING:
118
+ case void 0:
119
+ return _UniversalStore.Status.SYNCING;
120
+ case ProgressState.REJECTED:
121
+ return _UniversalStore.Status.ERROR;
122
+ case ProgressState.RESOLVED:
123
+ default:
124
+ return _UniversalStore.Status.READY;
125
+ }
126
+ }
127
+ /**
128
+ * A promise that resolves when the store is fully ready. A leader will be ready when the store
129
+ * has been prepared by Storybook, which is almost instantly.
130
+ *
131
+ * A follower will be ready when the state has been synced with the leader's state, within a few
132
+ * hundred milliseconds.
133
+ */
134
+ untilReady() {
135
+ return Promise.all([_UniversalStore.preparation.promise, this.syncing?.promise]);
136
+ }
137
+ /** Creates a new instance of UniversalStore */
138
+ static create(options) {
139
+ if (!options || typeof options?.id != "string")
140
+ throw new TypeError("id is required and must be a string, when creating a UniversalStore");
141
+ options.debug && console.debug(
142
+ dedent`[UniversalStore]
143
+ create`,
144
+ { options }
145
+ );
146
+ let existing = instances.get(options.id);
147
+ if (existing)
148
+ return console.warn(dedent`UniversalStore with id "${options.id}" already exists in this environment, re-using existing.
149
+ You should reuse the existing instance instead of trying to create a new one.`), existing;
150
+ _UniversalStore.isInternalConstructing = !0;
151
+ let store = new _UniversalStore(options);
152
+ return instances.set(options.id, store), store;
153
+ }
154
+ /**
155
+ * Used by Storybook to set the channel for all instances of UniversalStore in the given
156
+ * environment.
157
+ *
158
+ * @internal
159
+ */
160
+ static __prepare(channel, environment) {
161
+ _UniversalStore.preparation.channel = channel, _UniversalStore.preparation.environment = environment, _UniversalStore.preparation.resolve({ channel, environment });
162
+ }
163
+ /**
164
+ * Updates the store's state
165
+ *
166
+ * Either a new state or a state updater function can be passed to the method.
167
+ */
168
+ setState(updater) {
169
+ let previousState = this.state, newState = typeof updater == "function" ? updater(previousState) : updater;
170
+ if (this.debug("setState", { newState, previousState, updater }), this.status !== _UniversalStore.Status.READY)
171
+ throw new TypeError(
172
+ dedent`Cannot set state before store is ready. You can get the current status with store.status,
173
+ or await store.readyPromise to wait for the store to be ready before sending events.
174
+ ${JSON.stringify(
175
+ {
176
+ newState,
177
+ id: this.id,
178
+ actor: this.actor,
179
+ environment: this.environment
180
+ },
181
+ null,
182
+ 2
183
+ )}`
184
+ );
185
+ this.state = newState;
186
+ let event = {
187
+ type: _UniversalStore.InternalEventType.SET_STATE,
188
+ payload: {
189
+ state: newState,
190
+ previousState
191
+ }
192
+ };
193
+ this.emitToChannel(event, { actor: this.actor }), this.emitToListeners(event, { actor: this.actor });
194
+ }
195
+ /**
196
+ * Subscribes to state changes
197
+ *
198
+ * @returns Unsubscribe function
199
+ */
200
+ onStateChange(listener) {
201
+ return this.debug("onStateChange", { listener }), this.subscribe(
202
+ _UniversalStore.InternalEventType.SET_STATE,
203
+ ({ payload }, eventInfo) => {
204
+ listener(payload.state, payload.previousState, eventInfo);
205
+ }
206
+ );
207
+ }
208
+ emitToChannel(event, eventInfo) {
209
+ this.debug("emitToChannel", { event, eventInfo, channel: !!this.channel }), this.channel?.emit(this.channelEventName, {
210
+ event,
211
+ eventInfo
212
+ });
213
+ }
214
+ prepareThis({
215
+ channel,
216
+ environment
217
+ }) {
218
+ this.channel = channel, this.environment = environment, this.debug("prepared", { channel: !!channel, environment }), this.channel.on(this.channelEventName, this.handleChannelEvents), this.actor.type === _UniversalStore.ActorType.LEADER ? this.emitToChannel(
219
+ { type: _UniversalStore.InternalEventType.LEADER_CREATED },
220
+ { actor: this.actor }
221
+ ) : (this.emitToChannel(
222
+ { type: _UniversalStore.InternalEventType.FOLLOWER_CREATED },
223
+ { actor: this.actor }
224
+ ), this.emitToChannel(
225
+ { type: _UniversalStore.InternalEventType.EXISTING_STATE_REQUEST },
226
+ { actor: this.actor }
227
+ ), setTimeout(() => {
228
+ this.syncing.reject(
229
+ new TypeError(
230
+ `No existing state found for follower with id: '${this.id}'. Make sure a leader with the same id exists before creating a follower.`
231
+ )
232
+ );
233
+ }, 1e3));
234
+ }
235
+ emitToListeners(event, eventInfo) {
236
+ let eventTypeListeners = this.listeners.get(event.type), everythingListeners = this.listeners.get("*");
237
+ this.debug("emitToListeners", {
238
+ event,
239
+ eventInfo,
240
+ eventTypeListeners,
241
+ everythingListeners
242
+ }), [...eventTypeListeners ?? [], ...everythingListeners ?? []].forEach(
243
+ (listener) => listener(event, eventInfo)
244
+ );
245
+ }
246
+ handleChannelEvents(channelEvent) {
247
+ let { event, eventInfo } = channelEvent;
248
+ if ([eventInfo.actor.id, eventInfo.forwardingActor?.id].includes(this.actor.id)) {
249
+ this.debug("handleChannelEvents: Ignoring event from self", { channelEvent });
250
+ return;
251
+ } else if (this.syncing?.state === ProgressState.PENDING && event.type !== _UniversalStore.InternalEventType.EXISTING_STATE_RESPONSE) {
252
+ this.debug("handleChannelEvents: Ignoring event while syncing", { channelEvent });
253
+ return;
254
+ }
255
+ if (this.debug("handleChannelEvents", { channelEvent }), this.actor.type === _UniversalStore.ActorType.LEADER) {
256
+ let shouldForwardEvent = !0;
257
+ switch (event.type) {
258
+ case _UniversalStore.InternalEventType.EXISTING_STATE_REQUEST:
259
+ shouldForwardEvent = !1;
260
+ let responseEvent = {
261
+ type: _UniversalStore.InternalEventType.EXISTING_STATE_RESPONSE,
262
+ payload: this.state
263
+ };
264
+ this.debug("handleChannelEvents: responding to existing state request", {
265
+ responseEvent
266
+ }), this.emitToChannel(responseEvent, { actor: this.actor }), this.emitToListeners(responseEvent, { actor: this.actor });
267
+ break;
268
+ case _UniversalStore.InternalEventType.LEADER_CREATED:
269
+ shouldForwardEvent = !1, this.syncing.state = ProgressState.REJECTED, this.debug("handleChannelEvents: erroring due to second leader being created", {
270
+ event
271
+ }), console.error(
272
+ dedent`Detected multiple UniversalStore leaders created with the same id "${this.id}".
273
+ Only one leader can exists at a time, your stores are now in an invalid state.
274
+ Leaders detected:
275
+ this: ${JSON.stringify(this.actor, null, 2)}
276
+ other: ${JSON.stringify(eventInfo.actor, null, 2)}`
277
+ );
278
+ break;
279
+ }
280
+ shouldForwardEvent && (this.debug("handleChannelEvents: forwarding event", { channelEvent }), this.emitToChannel(event, { actor: eventInfo.actor, forwardingActor: this.actor }));
281
+ }
282
+ if (this.actor.type === _UniversalStore.ActorType.FOLLOWER)
283
+ switch (event.type) {
284
+ case _UniversalStore.InternalEventType.EXISTING_STATE_RESPONSE:
285
+ if (this.debug("handleChannelEvents: Setting state from leader's existing state response", {
286
+ event
287
+ }), this.syncing?.state !== ProgressState.PENDING)
288
+ break;
289
+ this.syncing.resolve?.();
290
+ let setStateEvent = {
291
+ type: _UniversalStore.InternalEventType.SET_STATE,
292
+ payload: {
293
+ state: event.payload,
294
+ previousState: this.state
295
+ }
296
+ };
297
+ this.state = event.payload, this.emitToListeners(setStateEvent, eventInfo);
298
+ break;
299
+ }
300
+ switch (event.type) {
301
+ case _UniversalStore.InternalEventType.SET_STATE:
302
+ this.debug("handleChannelEvents: Setting state", { event }), this.state = event.payload.state;
303
+ break;
304
+ }
305
+ this.emitToListeners(event, { actor: eventInfo.actor });
306
+ }
307
+ debug(message, data) {
308
+ this.debugging && console.debug(
309
+ dedent`[UniversalStore::${this.id}::${this.environment ?? _UniversalStore.Environment.UNKNOWN}]
310
+ ${message}`,
311
+ JSON.stringify(
312
+ {
313
+ data,
314
+ actor: this.actor,
315
+ state: this.state,
316
+ status: this.status
317
+ },
318
+ null,
319
+ 2
320
+ )
321
+ );
322
+ }
323
+ /**
324
+ * Used to reset the static fields of the UniversalStore class when cleaning up tests
325
+ *
326
+ * @internal
327
+ */
328
+ static __reset() {
329
+ _UniversalStore.preparation.reject(new Error("reset")), _UniversalStore.setupPreparationPromise(), _UniversalStore.isInternalConstructing = !1;
330
+ }
331
+ };
332
+ /**
333
+ * Defines the possible actor types in the store system
334
+ *
335
+ * @readonly
336
+ */
337
+ _UniversalStore.ActorType = {
338
+ LEADER: "LEADER",
339
+ FOLLOWER: "FOLLOWER"
340
+ }, /**
341
+ * Defines the possible environments the store can run in
342
+ *
343
+ * @readonly
344
+ */
345
+ _UniversalStore.Environment = {
346
+ SERVER: "SERVER",
347
+ MANAGER: "MANAGER",
348
+ PREVIEW: "PREVIEW",
349
+ UNKNOWN: "UNKNOWN",
350
+ MOCK: "MOCK"
351
+ }, /**
352
+ * Internal event types used for store synchronization
353
+ *
354
+ * @readonly
355
+ */
356
+ _UniversalStore.InternalEventType = {
357
+ EXISTING_STATE_REQUEST: "__EXISTING_STATE_REQUEST",
358
+ EXISTING_STATE_RESPONSE: "__EXISTING_STATE_RESPONSE",
359
+ SET_STATE: "__SET_STATE",
360
+ LEADER_CREATED: "__LEADER_CREATED",
361
+ FOLLOWER_CREATED: "__FOLLOWER_CREATED"
362
+ }, _UniversalStore.Status = {
363
+ UNPREPARED: "UNPREPARED",
364
+ SYNCING: "SYNCING",
365
+ READY: "READY",
366
+ ERROR: "ERROR"
367
+ }, // This is used to check if constructor was called from the static factory create()
368
+ _UniversalStore.isInternalConstructing = !1, _UniversalStore.setupPreparationPromise();
369
+ var UniversalStore = _UniversalStore;
370
+
371
+ // ../node_modules/telejson/dist/chunk-EAFQLD22.mjs
372
+ var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __getOwnPropNames = Object.getOwnPropertyNames, __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty, __commonJS = (cb, mod) => function() {
373
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
374
+ }, __copyProps = (to, from, except, desc) => {
375
+ if (from && typeof from == "object" || typeof from == "function")
376
+ for (let key of __getOwnPropNames(from))
377
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
378
+ return to;
379
+ }, __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
380
+ // If the importer is in node compatibility mode or this is not an ESM
381
+ // file that has been converted to a CommonJS file using a Babel-
382
+ // compatible transform (i.e. "__esModule" has not been set), then set
383
+ // "default" to the CommonJS "module.exports" for node compatibility.
384
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
385
+ mod
386
+ )), eventProperties = [
387
+ "bubbles",
388
+ "cancelBubble",
389
+ "cancelable",
390
+ "composed",
391
+ "currentTarget",
392
+ "defaultPrevented",
393
+ "eventPhase",
394
+ "isTrusted",
395
+ "returnValue",
396
+ "srcElement",
397
+ "target",
398
+ "timeStamp",
399
+ "type"
400
+ ], customEventSpecificProperties = ["detail"];
401
+ function extractEventHiddenProperties(event) {
402
+ let rebuildEvent = eventProperties.filter((value) => event[value] !== void 0).reduce((acc, value) => (acc[value] = event[value], acc), {});
403
+ if (event instanceof CustomEvent)
404
+ for (let value of customEventSpecificProperties.filter(
405
+ (value2) => event[value2] !== void 0
406
+ ))
407
+ rebuildEvent[value] = event[value];
408
+ return rebuildEvent;
409
+ }
410
+
411
+ // ../node_modules/telejson/dist/index.mjs
412
+ var require_es_object_atoms = __commonJS({
413
+ "node_modules/.pnpm/es-object-atoms@1.1.1/node_modules/es-object-atoms/index.js"(exports, module) {
414
+ "use strict";
415
+ module.exports = Object;
416
+ }
417
+ }), require_es_errors = __commonJS({
418
+ "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/index.js"(exports, module) {
419
+ "use strict";
420
+ module.exports = Error;
421
+ }
422
+ }), require_eval = __commonJS({
423
+ "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/eval.js"(exports, module) {
424
+ "use strict";
425
+ module.exports = EvalError;
426
+ }
427
+ }), require_range = __commonJS({
428
+ "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/range.js"(exports, module) {
429
+ "use strict";
430
+ module.exports = RangeError;
431
+ }
432
+ }), require_ref = __commonJS({
433
+ "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/ref.js"(exports, module) {
434
+ "use strict";
435
+ module.exports = ReferenceError;
436
+ }
437
+ }), require_syntax = __commonJS({
438
+ "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/syntax.js"(exports, module) {
439
+ "use strict";
440
+ module.exports = SyntaxError;
441
+ }
442
+ }), require_type = __commonJS({
443
+ "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.js"(exports, module) {
444
+ "use strict";
445
+ module.exports = TypeError;
446
+ }
447
+ }), require_uri = __commonJS({
448
+ "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/uri.js"(exports, module) {
449
+ "use strict";
450
+ module.exports = URIError;
451
+ }
452
+ }), require_abs = __commonJS({
453
+ "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/abs.js"(exports, module) {
454
+ "use strict";
455
+ module.exports = Math.abs;
456
+ }
457
+ }), require_floor = __commonJS({
458
+ "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/floor.js"(exports, module) {
459
+ "use strict";
460
+ module.exports = Math.floor;
461
+ }
462
+ }), require_max = __commonJS({
463
+ "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/max.js"(exports, module) {
464
+ "use strict";
465
+ module.exports = Math.max;
466
+ }
467
+ }), require_min = __commonJS({
468
+ "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/min.js"(exports, module) {
469
+ "use strict";
470
+ module.exports = Math.min;
471
+ }
472
+ }), require_pow = __commonJS({
473
+ "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/pow.js"(exports, module) {
474
+ "use strict";
475
+ module.exports = Math.pow;
476
+ }
477
+ }), require_round = __commonJS({
478
+ "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/round.js"(exports, module) {
479
+ "use strict";
480
+ module.exports = Math.round;
481
+ }
482
+ }), require_isNaN = __commonJS({
483
+ "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isNaN.js"(exports, module) {
484
+ "use strict";
485
+ module.exports = Number.isNaN || function(a) {
486
+ return a !== a;
487
+ };
488
+ }
489
+ }), require_sign = __commonJS({
490
+ "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/sign.js"(exports, module) {
491
+ "use strict";
492
+ var $isNaN = require_isNaN();
493
+ module.exports = function(number) {
494
+ return $isNaN(number) || number === 0 ? number : number < 0 ? -1 : 1;
495
+ };
496
+ }
497
+ }), require_gOPD = __commonJS({
498
+ "node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/gOPD.js"(exports, module) {
499
+ "use strict";
500
+ module.exports = Object.getOwnPropertyDescriptor;
501
+ }
502
+ }), require_gopd = __commonJS({
503
+ "node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/index.js"(exports, module) {
504
+ "use strict";
505
+ var $gOPD = require_gOPD();
506
+ if ($gOPD)
507
+ try {
508
+ $gOPD([], "length");
509
+ } catch {
510
+ $gOPD = null;
511
+ }
512
+ module.exports = $gOPD;
513
+ }
514
+ }), require_es_define_property = __commonJS({
515
+ "node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/index.js"(exports, module) {
516
+ "use strict";
517
+ var $defineProperty = Object.defineProperty || !1;
518
+ if ($defineProperty)
519
+ try {
520
+ $defineProperty({}, "a", { value: 1 });
521
+ } catch {
522
+ $defineProperty = !1;
523
+ }
524
+ module.exports = $defineProperty;
525
+ }
526
+ }), require_shams = __commonJS({
527
+ "node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/shams.js"(exports, module) {
528
+ "use strict";
529
+ module.exports = function() {
530
+ if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function")
531
+ return !1;
532
+ if (typeof Symbol.iterator == "symbol")
533
+ return !0;
534
+ var obj = {}, sym = Symbol("test"), symObj = Object(sym);
535
+ if (typeof sym == "string" || Object.prototype.toString.call(sym) !== "[object Symbol]" || Object.prototype.toString.call(symObj) !== "[object Symbol]")
536
+ return !1;
537
+ var symVal = 42;
538
+ obj[sym] = symVal;
539
+ for (var _ in obj)
540
+ return !1;
541
+ if (typeof Object.keys == "function" && Object.keys(obj).length !== 0 || typeof Object.getOwnPropertyNames == "function" && Object.getOwnPropertyNames(obj).length !== 0)
542
+ return !1;
543
+ var syms = Object.getOwnPropertySymbols(obj);
544
+ if (syms.length !== 1 || syms[0] !== sym || !Object.prototype.propertyIsEnumerable.call(obj, sym))
545
+ return !1;
546
+ if (typeof Object.getOwnPropertyDescriptor == "function") {
547
+ var descriptor = (
548
+ /** @type {PropertyDescriptor} */
549
+ Object.getOwnPropertyDescriptor(obj, sym)
550
+ );
551
+ if (descriptor.value !== symVal || descriptor.enumerable !== !0)
552
+ return !1;
553
+ }
554
+ return !0;
555
+ };
556
+ }
557
+ }), require_has_symbols = __commonJS({
558
+ "node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/index.js"(exports, module) {
559
+ "use strict";
560
+ var origSymbol = typeof Symbol < "u" && Symbol, hasSymbolSham = require_shams();
561
+ module.exports = function() {
562
+ return typeof origSymbol != "function" || typeof Symbol != "function" || typeof origSymbol("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : hasSymbolSham();
563
+ };
564
+ }
565
+ }), require_Reflect_getPrototypeOf = __commonJS({
566
+ "node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Reflect.getPrototypeOf.js"(exports, module) {
567
+ "use strict";
568
+ module.exports = typeof Reflect < "u" && Reflect.getPrototypeOf || null;
569
+ }
570
+ }), require_Object_getPrototypeOf = __commonJS({
571
+ "node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Object.getPrototypeOf.js"(exports, module) {
572
+ "use strict";
573
+ var $Object = require_es_object_atoms();
574
+ module.exports = $Object.getPrototypeOf || null;
575
+ }
576
+ }), require_implementation = __commonJS({
577
+ "node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.js"(exports, module) {
578
+ "use strict";
579
+ var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ", toStr = Object.prototype.toString, max = Math.max, funcType = "[object Function]", concatty = function(a, b) {
580
+ for (var arr = [], i = 0; i < a.length; i += 1)
581
+ arr[i] = a[i];
582
+ for (var j = 0; j < b.length; j += 1)
583
+ arr[j + a.length] = b[j];
584
+ return arr;
585
+ }, slicy = function(arrLike, offset) {
586
+ for (var arr = [], i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1)
587
+ arr[j] = arrLike[i];
588
+ return arr;
589
+ }, joiny = function(arr, joiner) {
590
+ for (var str = "", i = 0; i < arr.length; i += 1)
591
+ str += arr[i], i + 1 < arr.length && (str += joiner);
592
+ return str;
593
+ };
594
+ module.exports = function(that) {
595
+ var target = this;
596
+ if (typeof target != "function" || toStr.apply(target) !== funcType)
597
+ throw new TypeError(ERROR_MESSAGE + target);
598
+ for (var args = slicy(arguments, 1), bound, binder = function() {
599
+ if (this instanceof bound) {
600
+ var result = target.apply(
601
+ this,
602
+ concatty(args, arguments)
603
+ );
604
+ return Object(result) === result ? result : this;
605
+ }
606
+ return target.apply(
607
+ that,
608
+ concatty(args, arguments)
609
+ );
610
+ }, boundLength = max(0, target.length - args.length), boundArgs = [], i = 0; i < boundLength; i++)
611
+ boundArgs[i] = "$" + i;
612
+ if (bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder), target.prototype) {
613
+ var Empty = function() {
614
+ };
615
+ Empty.prototype = target.prototype, bound.prototype = new Empty(), Empty.prototype = null;
616
+ }
617
+ return bound;
618
+ };
619
+ }
620
+ }), require_function_bind = __commonJS({
621
+ "node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.js"(exports, module) {
622
+ "use strict";
623
+ var implementation = require_implementation();
624
+ module.exports = Function.prototype.bind || implementation;
625
+ }
626
+ }), require_functionCall = __commonJS({
627
+ "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionCall.js"(exports, module) {
628
+ "use strict";
629
+ module.exports = Function.prototype.call;
630
+ }
631
+ }), require_functionApply = __commonJS({
632
+ "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionApply.js"(exports, module) {
633
+ "use strict";
634
+ module.exports = Function.prototype.apply;
635
+ }
636
+ }), require_reflectApply = __commonJS({
637
+ "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/reflectApply.js"(exports, module) {
638
+ "use strict";
639
+ module.exports = typeof Reflect < "u" && Reflect && Reflect.apply;
640
+ }
641
+ }), require_actualApply = __commonJS({
642
+ "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/actualApply.js"(exports, module) {
643
+ "use strict";
644
+ var bind = require_function_bind(), $apply = require_functionApply(), $call = require_functionCall(), $reflectApply = require_reflectApply();
645
+ module.exports = $reflectApply || bind.call($call, $apply);
646
+ }
647
+ }), require_call_bind_apply_helpers = __commonJS({
648
+ "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/index.js"(exports, module) {
649
+ "use strict";
650
+ var bind = require_function_bind(), $TypeError = require_type(), $call = require_functionCall(), $actualApply = require_actualApply();
651
+ module.exports = function(args) {
652
+ if (args.length < 1 || typeof args[0] != "function")
653
+ throw new $TypeError("a function is required");
654
+ return $actualApply(bind, $call, args);
655
+ };
656
+ }
657
+ }), require_get = __commonJS({
658
+ "node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/get.js"(exports, module) {
659
+ "use strict";
660
+ var callBind = require_call_bind_apply_helpers(), gOPD = require_gopd(), hasProtoAccessor;
661
+ try {
662
+ hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */
663
+ [].__proto__ === Array.prototype;
664
+ } catch (e) {
665
+ if (!e || typeof e != "object" || !("code" in e) || e.code !== "ERR_PROTO_ACCESS")
666
+ throw e;
667
+ }
668
+ var desc = !!hasProtoAccessor && gOPD && gOPD(
669
+ Object.prototype,
670
+ /** @type {keyof typeof Object.prototype} */
671
+ "__proto__"
672
+ ), $Object = Object, $getPrototypeOf = $Object.getPrototypeOf;
673
+ module.exports = desc && typeof desc.get == "function" ? callBind([desc.get]) : typeof $getPrototypeOf == "function" ? (
674
+ /** @type {import('./get')} */
675
+ (function(value) {
676
+ return $getPrototypeOf(value == null ? value : $Object(value));
677
+ })
678
+ ) : !1;
679
+ }
680
+ }), require_get_proto = __commonJS({
681
+ "node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/index.js"(exports, module) {
682
+ "use strict";
683
+ var reflectGetProto = require_Reflect_getPrototypeOf(), originalGetProto = require_Object_getPrototypeOf(), getDunderProto = require_get();
684
+ module.exports = reflectGetProto ? function(O) {
685
+ return reflectGetProto(O);
686
+ } : originalGetProto ? function(O) {
687
+ if (!O || typeof O != "object" && typeof O != "function")
688
+ throw new TypeError("getProto: not an object");
689
+ return originalGetProto(O);
690
+ } : getDunderProto ? function(O) {
691
+ return getDunderProto(O);
692
+ } : null;
693
+ }
694
+ }), require_hasown = __commonJS({
695
+ "node_modules/.pnpm/hasown@2.0.2/node_modules/hasown/index.js"(exports, module) {
696
+ "use strict";
697
+ var call = Function.prototype.call, $hasOwn = Object.prototype.hasOwnProperty, bind = require_function_bind();
698
+ module.exports = bind.call(call, $hasOwn);
699
+ }
700
+ }), require_get_intrinsic = __commonJS({
701
+ "node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/index.js"(exports, module) {
702
+ "use strict";
703
+ var undefined2, $Object = require_es_object_atoms(), $Error = require_es_errors(), $EvalError = require_eval(), $RangeError = require_range(), $ReferenceError = require_ref(), $SyntaxError = require_syntax(), $TypeError = require_type(), $URIError = require_uri(), abs = require_abs(), floor = require_floor(), max = require_max(), min = require_min(), pow = require_pow(), round = require_round(), sign = require_sign(), $Function = Function, getEvalledConstructor = function(expressionSyntax) {
704
+ try {
705
+ return $Function('"use strict"; return (' + expressionSyntax + ").constructor;")();
706
+ } catch {
707
+ }
708
+ }, $gOPD = require_gopd(), $defineProperty = require_es_define_property(), throwTypeError = function() {
709
+ throw new $TypeError();
710
+ }, ThrowTypeError = $gOPD ? (function() {
711
+ try {
712
+ return arguments.callee, throwTypeError;
713
+ } catch {
714
+ try {
715
+ return $gOPD(arguments, "callee").get;
716
+ } catch {
717
+ return throwTypeError;
718
+ }
719
+ }
720
+ })() : throwTypeError, hasSymbols = require_has_symbols()(), getProto = require_get_proto(), $ObjectGPO = require_Object_getPrototypeOf(), $ReflectGPO = require_Reflect_getPrototypeOf(), $apply = require_functionApply(), $call = require_functionCall(), needsEval = {}, TypedArray = typeof Uint8Array > "u" || !getProto ? undefined2 : getProto(Uint8Array), INTRINSICS = {
721
+ __proto__: null,
722
+ "%AggregateError%": typeof AggregateError > "u" ? undefined2 : AggregateError,
723
+ "%Array%": Array,
724
+ "%ArrayBuffer%": typeof ArrayBuffer > "u" ? undefined2 : ArrayBuffer,
725
+ "%ArrayIteratorPrototype%": hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined2,
726
+ "%AsyncFromSyncIteratorPrototype%": undefined2,
727
+ "%AsyncFunction%": needsEval,
728
+ "%AsyncGenerator%": needsEval,
729
+ "%AsyncGeneratorFunction%": needsEval,
730
+ "%AsyncIteratorPrototype%": needsEval,
731
+ "%Atomics%": typeof Atomics > "u" ? undefined2 : Atomics,
732
+ "%BigInt%": typeof BigInt > "u" ? undefined2 : BigInt,
733
+ "%BigInt64Array%": typeof BigInt64Array > "u" ? undefined2 : BigInt64Array,
734
+ "%BigUint64Array%": typeof BigUint64Array > "u" ? undefined2 : BigUint64Array,
735
+ "%Boolean%": Boolean,
736
+ "%DataView%": typeof DataView > "u" ? undefined2 : DataView,
737
+ "%Date%": Date,
738
+ "%decodeURI%": decodeURI,
739
+ "%decodeURIComponent%": decodeURIComponent,
740
+ "%encodeURI%": encodeURI,
741
+ "%encodeURIComponent%": encodeURIComponent,
742
+ "%Error%": $Error,
743
+ "%eval%": eval,
744
+ // eslint-disable-line no-eval
745
+ "%EvalError%": $EvalError,
746
+ "%Float16Array%": typeof Float16Array > "u" ? undefined2 : Float16Array,
747
+ "%Float32Array%": typeof Float32Array > "u" ? undefined2 : Float32Array,
748
+ "%Float64Array%": typeof Float64Array > "u" ? undefined2 : Float64Array,
749
+ "%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? undefined2 : FinalizationRegistry,
750
+ "%Function%": $Function,
751
+ "%GeneratorFunction%": needsEval,
752
+ "%Int8Array%": typeof Int8Array > "u" ? undefined2 : Int8Array,
753
+ "%Int16Array%": typeof Int16Array > "u" ? undefined2 : Int16Array,
754
+ "%Int32Array%": typeof Int32Array > "u" ? undefined2 : Int32Array,
755
+ "%isFinite%": isFinite,
756
+ "%isNaN%": isNaN,
757
+ "%IteratorPrototype%": hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined2,
758
+ "%JSON%": typeof JSON == "object" ? JSON : undefined2,
759
+ "%Map%": typeof Map > "u" ? undefined2 : Map,
760
+ "%MapIteratorPrototype%": typeof Map > "u" || !hasSymbols || !getProto ? undefined2 : getProto((/* @__PURE__ */ new Map())[Symbol.iterator]()),
761
+ "%Math%": Math,
762
+ "%Number%": Number,
763
+ "%Object%": $Object,
764
+ "%Object.getOwnPropertyDescriptor%": $gOPD,
765
+ "%parseFloat%": parseFloat,
766
+ "%parseInt%": parseInt,
767
+ "%Promise%": typeof Promise > "u" ? undefined2 : Promise,
768
+ "%Proxy%": typeof Proxy > "u" ? undefined2 : Proxy,
769
+ "%RangeError%": $RangeError,
770
+ "%ReferenceError%": $ReferenceError,
771
+ "%Reflect%": typeof Reflect > "u" ? undefined2 : Reflect,
772
+ "%RegExp%": RegExp,
773
+ "%Set%": typeof Set > "u" ? undefined2 : Set,
774
+ "%SetIteratorPrototype%": typeof Set > "u" || !hasSymbols || !getProto ? undefined2 : getProto((/* @__PURE__ */ new Set())[Symbol.iterator]()),
775
+ "%SharedArrayBuffer%": typeof SharedArrayBuffer > "u" ? undefined2 : SharedArrayBuffer,
776
+ "%String%": String,
777
+ "%StringIteratorPrototype%": hasSymbols && getProto ? getProto(""[Symbol.iterator]()) : undefined2,
778
+ "%Symbol%": hasSymbols ? Symbol : undefined2,
779
+ "%SyntaxError%": $SyntaxError,
780
+ "%ThrowTypeError%": ThrowTypeError,
781
+ "%TypedArray%": TypedArray,
782
+ "%TypeError%": $TypeError,
783
+ "%Uint8Array%": typeof Uint8Array > "u" ? undefined2 : Uint8Array,
784
+ "%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? undefined2 : Uint8ClampedArray,
785
+ "%Uint16Array%": typeof Uint16Array > "u" ? undefined2 : Uint16Array,
786
+ "%Uint32Array%": typeof Uint32Array > "u" ? undefined2 : Uint32Array,
787
+ "%URIError%": $URIError,
788
+ "%WeakMap%": typeof WeakMap > "u" ? undefined2 : WeakMap,
789
+ "%WeakRef%": typeof WeakRef > "u" ? undefined2 : WeakRef,
790
+ "%WeakSet%": typeof WeakSet > "u" ? undefined2 : WeakSet,
791
+ "%Function.prototype.call%": $call,
792
+ "%Function.prototype.apply%": $apply,
793
+ "%Object.defineProperty%": $defineProperty,
794
+ "%Object.getPrototypeOf%": $ObjectGPO,
795
+ "%Math.abs%": abs,
796
+ "%Math.floor%": floor,
797
+ "%Math.max%": max,
798
+ "%Math.min%": min,
799
+ "%Math.pow%": pow,
800
+ "%Math.round%": round,
801
+ "%Math.sign%": sign,
802
+ "%Reflect.getPrototypeOf%": $ReflectGPO
803
+ };
804
+ if (getProto)
805
+ try {
806
+ null.error;
807
+ } catch (e) {
808
+ errorProto = getProto(getProto(e)), INTRINSICS["%Error.prototype%"] = errorProto;
809
+ }
810
+ var errorProto, doEval = function doEval2(name) {
811
+ var value;
812
+ if (name === "%AsyncFunction%")
813
+ value = getEvalledConstructor("async function () {}");
814
+ else if (name === "%GeneratorFunction%")
815
+ value = getEvalledConstructor("function* () {}");
816
+ else if (name === "%AsyncGeneratorFunction%")
817
+ value = getEvalledConstructor("async function* () {}");
818
+ else if (name === "%AsyncGenerator%") {
819
+ var fn = doEval2("%AsyncGeneratorFunction%");
820
+ fn && (value = fn.prototype);
821
+ } else if (name === "%AsyncIteratorPrototype%") {
822
+ var gen = doEval2("%AsyncGenerator%");
823
+ gen && getProto && (value = getProto(gen.prototype));
824
+ }
825
+ return INTRINSICS[name] = value, value;
826
+ }, LEGACY_ALIASES = {
827
+ __proto__: null,
828
+ "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
829
+ "%ArrayPrototype%": ["Array", "prototype"],
830
+ "%ArrayProto_entries%": ["Array", "prototype", "entries"],
831
+ "%ArrayProto_forEach%": ["Array", "prototype", "forEach"],
832
+ "%ArrayProto_keys%": ["Array", "prototype", "keys"],
833
+ "%ArrayProto_values%": ["Array", "prototype", "values"],
834
+ "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"],
835
+ "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"],
836
+ "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"],
837
+ "%BooleanPrototype%": ["Boolean", "prototype"],
838
+ "%DataViewPrototype%": ["DataView", "prototype"],
839
+ "%DatePrototype%": ["Date", "prototype"],
840
+ "%ErrorPrototype%": ["Error", "prototype"],
841
+ "%EvalErrorPrototype%": ["EvalError", "prototype"],
842
+ "%Float32ArrayPrototype%": ["Float32Array", "prototype"],
843
+ "%Float64ArrayPrototype%": ["Float64Array", "prototype"],
844
+ "%FunctionPrototype%": ["Function", "prototype"],
845
+ "%Generator%": ["GeneratorFunction", "prototype"],
846
+ "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"],
847
+ "%Int8ArrayPrototype%": ["Int8Array", "prototype"],
848
+ "%Int16ArrayPrototype%": ["Int16Array", "prototype"],
849
+ "%Int32ArrayPrototype%": ["Int32Array", "prototype"],
850
+ "%JSONParse%": ["JSON", "parse"],
851
+ "%JSONStringify%": ["JSON", "stringify"],
852
+ "%MapPrototype%": ["Map", "prototype"],
853
+ "%NumberPrototype%": ["Number", "prototype"],
854
+ "%ObjectPrototype%": ["Object", "prototype"],
855
+ "%ObjProto_toString%": ["Object", "prototype", "toString"],
856
+ "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"],
857
+ "%PromisePrototype%": ["Promise", "prototype"],
858
+ "%PromiseProto_then%": ["Promise", "prototype", "then"],
859
+ "%Promise_all%": ["Promise", "all"],
860
+ "%Promise_reject%": ["Promise", "reject"],
861
+ "%Promise_resolve%": ["Promise", "resolve"],
862
+ "%RangeErrorPrototype%": ["RangeError", "prototype"],
863
+ "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"],
864
+ "%RegExpPrototype%": ["RegExp", "prototype"],
865
+ "%SetPrototype%": ["Set", "prototype"],
866
+ "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"],
867
+ "%StringPrototype%": ["String", "prototype"],
868
+ "%SymbolPrototype%": ["Symbol", "prototype"],
869
+ "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"],
870
+ "%TypedArrayPrototype%": ["TypedArray", "prototype"],
871
+ "%TypeErrorPrototype%": ["TypeError", "prototype"],
872
+ "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"],
873
+ "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"],
874
+ "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"],
875
+ "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"],
876
+ "%URIErrorPrototype%": ["URIError", "prototype"],
877
+ "%WeakMapPrototype%": ["WeakMap", "prototype"],
878
+ "%WeakSetPrototype%": ["WeakSet", "prototype"]
879
+ }, bind = require_function_bind(), hasOwn = require_hasown(), $concat = bind.call($call, Array.prototype.concat), $spliceApply = bind.call($apply, Array.prototype.splice), $replace = bind.call($call, String.prototype.replace), $strSlice = bind.call($call, String.prototype.slice), $exec = bind.call($call, RegExp.prototype.exec), rePropName2 = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, reEscapeChar2 = /\\(\\)?/g, stringToPath2 = function(string) {
880
+ var first = $strSlice(string, 0, 1), last = $strSlice(string, -1);
881
+ if (first === "%" && last !== "%")
882
+ throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`");
883
+ if (last === "%" && first !== "%")
884
+ throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`");
885
+ var result = [];
886
+ return $replace(string, rePropName2, function(match, number, quote, subString) {
887
+ result[result.length] = quote ? $replace(subString, reEscapeChar2, "$1") : number || match;
888
+ }), result;
889
+ }, getBaseIntrinsic = function(name, allowMissing) {
890
+ var intrinsicName = name, alias;
891
+ if (hasOwn(LEGACY_ALIASES, intrinsicName) && (alias = LEGACY_ALIASES[intrinsicName], intrinsicName = "%" + alias[0] + "%"), hasOwn(INTRINSICS, intrinsicName)) {
892
+ var value = INTRINSICS[intrinsicName];
893
+ if (value === needsEval && (value = doEval(intrinsicName)), typeof value > "u" && !allowMissing)
894
+ throw new $TypeError("intrinsic " + name + " exists, but is not available. Please file an issue!");
895
+ return {
896
+ alias,
897
+ name: intrinsicName,
898
+ value
899
+ };
900
+ }
901
+ throw new $SyntaxError("intrinsic " + name + " does not exist!");
902
+ };
903
+ module.exports = function(name, allowMissing) {
904
+ if (typeof name != "string" || name.length === 0)
905
+ throw new $TypeError("intrinsic name must be a non-empty string");
906
+ if (arguments.length > 1 && typeof allowMissing != "boolean")
907
+ throw new $TypeError('"allowMissing" argument must be a boolean');
908
+ if ($exec(/^%?[^%]*%?$/, name) === null)
909
+ throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
910
+ var parts = stringToPath2(name), intrinsicBaseName = parts.length > 0 ? parts[0] : "", intrinsic = getBaseIntrinsic("%" + intrinsicBaseName + "%", allowMissing), intrinsicRealName = intrinsic.name, value = intrinsic.value, skipFurtherCaching = !1, alias = intrinsic.alias;
911
+ alias && (intrinsicBaseName = alias[0], $spliceApply(parts, $concat([0, 1], alias)));
912
+ for (var i = 1, isOwn = !0; i < parts.length; i += 1) {
913
+ var part = parts[i], first = $strSlice(part, 0, 1), last = $strSlice(part, -1);
914
+ if ((first === '"' || first === "'" || first === "`" || last === '"' || last === "'" || last === "`") && first !== last)
915
+ throw new $SyntaxError("property names with quotes must have matching quotes");
916
+ if ((part === "constructor" || !isOwn) && (skipFurtherCaching = !0), intrinsicBaseName += "." + part, intrinsicRealName = "%" + intrinsicBaseName + "%", hasOwn(INTRINSICS, intrinsicRealName))
917
+ value = INTRINSICS[intrinsicRealName];
918
+ else if (value != null) {
919
+ if (!(part in value)) {
920
+ if (!allowMissing)
921
+ throw new $TypeError("base intrinsic for " + name + " exists, but the property is not available.");
922
+ return;
923
+ }
924
+ if ($gOPD && i + 1 >= parts.length) {
925
+ var desc = $gOPD(value, part);
926
+ isOwn = !!desc, isOwn && "get" in desc && !("originalValue" in desc.get) ? value = desc.get : value = value[part];
927
+ } else
928
+ isOwn = hasOwn(value, part), value = value[part];
929
+ isOwn && !skipFurtherCaching && (INTRINSICS[intrinsicRealName] = value);
930
+ }
931
+ }
932
+ return value;
933
+ };
934
+ }
935
+ }), require_call_bound = __commonJS({
936
+ "node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/index.js"(exports, module) {
937
+ "use strict";
938
+ var GetIntrinsic = require_get_intrinsic(), callBindBasic = require_call_bind_apply_helpers(), $indexOf = callBindBasic([GetIntrinsic("%String.prototype.indexOf%")]);
939
+ module.exports = function(name, allowMissing) {
940
+ var intrinsic = (
941
+ /** @type {(this: unknown, ...args: unknown[]) => unknown} */
942
+ GetIntrinsic(name, !!allowMissing)
943
+ );
944
+ return typeof intrinsic == "function" && $indexOf(name, ".prototype.") > -1 ? callBindBasic(
945
+ /** @type {const} */
946
+ [intrinsic]
947
+ ) : intrinsic;
948
+ };
949
+ }
950
+ }), require_shams2 = __commonJS({
951
+ "node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/shams.js"(exports, module) {
952
+ "use strict";
953
+ var hasSymbols = require_shams();
954
+ module.exports = function() {
955
+ return hasSymbols() && !!Symbol.toStringTag;
956
+ };
957
+ }
958
+ }), require_is_regex = __commonJS({
959
+ "node_modules/.pnpm/is-regex@1.2.1/node_modules/is-regex/index.js"(exports, module) {
960
+ "use strict";
961
+ var callBound = require_call_bound(), hasToStringTag = require_shams2()(), hasOwn = require_hasown(), gOPD = require_gopd(), fn;
962
+ hasToStringTag ? ($exec = callBound("RegExp.prototype.exec"), isRegexMarker = {}, throwRegexMarker = function() {
963
+ throw isRegexMarker;
964
+ }, badStringifier = {
965
+ toString: throwRegexMarker,
966
+ valueOf: throwRegexMarker
967
+ }, typeof Symbol.toPrimitive == "symbol" && (badStringifier[Symbol.toPrimitive] = throwRegexMarker), fn = function(value) {
968
+ if (!value || typeof value != "object")
969
+ return !1;
970
+ var descriptor = (
971
+ /** @type {NonNullable<typeof gOPD>} */
972
+ gOPD(
973
+ /** @type {{ lastIndex?: unknown }} */
974
+ value,
975
+ "lastIndex"
976
+ )
977
+ ), hasLastIndexDataProperty = descriptor && hasOwn(descriptor, "value");
978
+ if (!hasLastIndexDataProperty)
979
+ return !1;
980
+ try {
981
+ $exec(
982
+ value,
983
+ /** @type {string} */
984
+ /** @type {unknown} */
985
+ badStringifier
986
+ );
987
+ } catch (e) {
988
+ return e === isRegexMarker;
989
+ }
990
+ }) : ($toString = callBound("Object.prototype.toString"), regexClass = "[object RegExp]", fn = function(value) {
991
+ return !value || typeof value != "object" && typeof value != "function" ? !1 : $toString(value) === regexClass;
992
+ });
993
+ var $exec, isRegexMarker, throwRegexMarker, badStringifier, $toString, regexClass;
994
+ module.exports = fn;
995
+ }
996
+ }), require_is_function = __commonJS({
997
+ "node_modules/.pnpm/is-function@1.0.2/node_modules/is-function/index.js"(exports, module) {
998
+ module.exports = isFunction3;
999
+ var toString2 = Object.prototype.toString;
1000
+ function isFunction3(fn) {
1001
+ if (!fn)
1002
+ return !1;
1003
+ var string = toString2.call(fn);
1004
+ return string === "[object Function]" || typeof fn == "function" && string !== "[object RegExp]" || typeof window < "u" && // IE8 and below
1005
+ (fn === window.setTimeout || fn === window.alert || fn === window.confirm || fn === window.prompt);
1006
+ }
1007
+ }
1008
+ }), require_safe_regex_test = __commonJS({
1009
+ "node_modules/.pnpm/safe-regex-test@1.1.0/node_modules/safe-regex-test/index.js"(exports, module) {
1010
+ "use strict";
1011
+ var callBound = require_call_bound(), isRegex = require_is_regex(), $exec = callBound("RegExp.prototype.exec"), $TypeError = require_type();
1012
+ module.exports = function(regex) {
1013
+ if (!isRegex(regex))
1014
+ throw new $TypeError("`regex` must be a RegExp");
1015
+ return function(s) {
1016
+ return $exec(regex, s) !== null;
1017
+ };
1018
+ };
1019
+ }
1020
+ }), require_is_symbol = __commonJS({
1021
+ "node_modules/.pnpm/is-symbol@1.1.1/node_modules/is-symbol/index.js"(exports, module) {
1022
+ "use strict";
1023
+ var callBound = require_call_bound(), $toString = callBound("Object.prototype.toString"), hasSymbols = require_has_symbols()(), safeRegexTest = require_safe_regex_test();
1024
+ hasSymbols ? ($symToStr = callBound("Symbol.prototype.toString"), isSymString = safeRegexTest(/^Symbol\(.*\)$/), isSymbolObject = function(value) {
1025
+ return typeof value.valueOf() != "symbol" ? !1 : isSymString($symToStr(value));
1026
+ }, module.exports = function(value) {
1027
+ if (typeof value == "symbol")
1028
+ return !0;
1029
+ if (!value || typeof value != "object" || $toString(value) !== "[object Symbol]")
1030
+ return !1;
1031
+ try {
1032
+ return isSymbolObject(value);
1033
+ } catch {
1034
+ return !1;
1035
+ }
1036
+ }) : module.exports = function(value) {
1037
+ return !1;
1038
+ };
1039
+ var $symToStr, isSymString, isSymbolObject;
1040
+ }
1041
+ }), import_is_regex = __toESM(require_is_regex()), import_is_function = __toESM(require_is_function()), import_is_symbol = __toESM(require_is_symbol());
1042
+ function isObject(val) {
1043
+ return val != null && typeof val == "object" && Array.isArray(val) === !1;
1044
+ }
1045
+ var freeGlobal = typeof global == "object" && global && global.Object === Object && global, freeGlobal_default = freeGlobal, freeSelf = typeof self == "object" && self && self.Object === Object && self, root = freeGlobal_default || freeSelf || Function("return this")(), root_default = root, Symbol2 = root_default.Symbol, Symbol_default = Symbol2, objectProto = Object.prototype, hasOwnProperty = objectProto.hasOwnProperty, nativeObjectToString = objectProto.toString, symToStringTag = Symbol_default ? Symbol_default.toStringTag : void 0;
1046
+ function getRawTag(value) {
1047
+ var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
1048
+ try {
1049
+ value[symToStringTag] = void 0;
1050
+ var unmasked = !0;
1051
+ } catch {
1052
+ }
1053
+ var result = nativeObjectToString.call(value);
1054
+ return unmasked && (isOwn ? value[symToStringTag] = tag : delete value[symToStringTag]), result;
1055
+ }
1056
+ var getRawTag_default = getRawTag, objectProto2 = Object.prototype, nativeObjectToString2 = objectProto2.toString;
1057
+ function objectToString(value) {
1058
+ return nativeObjectToString2.call(value);
1059
+ }
1060
+ var objectToString_default = objectToString, nullTag = "[object Null]", undefinedTag = "[object Undefined]", symToStringTag2 = Symbol_default ? Symbol_default.toStringTag : void 0;
1061
+ function baseGetTag(value) {
1062
+ return value == null ? value === void 0 ? undefinedTag : nullTag : symToStringTag2 && symToStringTag2 in Object(value) ? getRawTag_default(value) : objectToString_default(value);
1063
+ }
1064
+ var baseGetTag_default = baseGetTag;
1065
+ function isObjectLike(value) {
1066
+ return value != null && typeof value == "object";
1067
+ }
1068
+ var isObjectLike_default = isObjectLike, symbolTag = "[object Symbol]";
1069
+ function isSymbol(value) {
1070
+ return typeof value == "symbol" || isObjectLike_default(value) && baseGetTag_default(value) == symbolTag;
1071
+ }
1072
+ var isSymbol_default = isSymbol;
1073
+ function arrayMap(array, iteratee) {
1074
+ for (var index = -1, length = array == null ? 0 : array.length, result = Array(length); ++index < length; )
1075
+ result[index] = iteratee(array[index], index, array);
1076
+ return result;
1077
+ }
1078
+ var arrayMap_default = arrayMap, isArray = Array.isArray, isArray_default = isArray, INFINITY = 1 / 0, symbolProto = Symbol_default ? Symbol_default.prototype : void 0, symbolToString = symbolProto ? symbolProto.toString : void 0;
1079
+ function baseToString(value) {
1080
+ if (typeof value == "string")
1081
+ return value;
1082
+ if (isArray_default(value))
1083
+ return arrayMap_default(value, baseToString) + "";
1084
+ if (isSymbol_default(value))
1085
+ return symbolToString ? symbolToString.call(value) : "";
1086
+ var result = value + "";
1087
+ return result == "0" && 1 / value == -INFINITY ? "-0" : result;
1088
+ }
1089
+ var baseToString_default = baseToString;
1090
+ function isObject2(value) {
1091
+ var type = typeof value;
1092
+ return value != null && (type == "object" || type == "function");
1093
+ }
1094
+ var isObject_default = isObject2, asyncTag = "[object AsyncFunction]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
1095
+ function isFunction(value) {
1096
+ if (!isObject_default(value))
1097
+ return !1;
1098
+ var tag = baseGetTag_default(value);
1099
+ return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
1100
+ }
1101
+ var isFunction_default = isFunction, coreJsData = root_default["__core-js_shared__"], coreJsData_default = coreJsData, maskSrcKey = (function() {
1102
+ var uid = /[^.]+$/.exec(coreJsData_default && coreJsData_default.keys && coreJsData_default.keys.IE_PROTO || "");
1103
+ return uid ? "Symbol(src)_1." + uid : "";
1104
+ })();
1105
+ function isMasked(func) {
1106
+ return !!maskSrcKey && maskSrcKey in func;
1107
+ }
1108
+ var isMasked_default = isMasked, funcProto = Function.prototype, funcToString = funcProto.toString;
1109
+ function toSource(func) {
1110
+ if (func != null) {
1111
+ try {
1112
+ return funcToString.call(func);
1113
+ } catch {
1114
+ }
1115
+ try {
1116
+ return func + "";
1117
+ } catch {
1118
+ }
1119
+ }
1120
+ return "";
1121
+ }
1122
+ var toSource_default = toSource, reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reIsHostCtor = /^\[object .+?Constructor\]$/, funcProto2 = Function.prototype, objectProto3 = Object.prototype, funcToString2 = funcProto2.toString, hasOwnProperty2 = objectProto3.hasOwnProperty, reIsNative = RegExp(
1123
+ "^" + funcToString2.call(hasOwnProperty2).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
1124
+ );
1125
+ function baseIsNative(value) {
1126
+ if (!isObject_default(value) || isMasked_default(value))
1127
+ return !1;
1128
+ var pattern = isFunction_default(value) ? reIsNative : reIsHostCtor;
1129
+ return pattern.test(toSource_default(value));
1130
+ }
1131
+ var baseIsNative_default = baseIsNative;
1132
+ function getValue(object, key) {
1133
+ return object?.[key];
1134
+ }
1135
+ var getValue_default = getValue;
1136
+ function getNative(object, key) {
1137
+ var value = getValue_default(object, key);
1138
+ return baseIsNative_default(value) ? value : void 0;
1139
+ }
1140
+ var getNative_default = getNative;
1141
+ function eq(value, other) {
1142
+ return value === other || value !== value && other !== other;
1143
+ }
1144
+ var eq_default = eq, reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/;
1145
+ function isKey(value, object) {
1146
+ if (isArray_default(value))
1147
+ return !1;
1148
+ var type = typeof value;
1149
+ return type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol_default(value) ? !0 : reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
1150
+ }
1151
+ var isKey_default = isKey, nativeCreate = getNative_default(Object, "create"), nativeCreate_default = nativeCreate;
1152
+ function hashClear() {
1153
+ this.__data__ = nativeCreate_default ? nativeCreate_default(null) : {}, this.size = 0;
1154
+ }
1155
+ var hashClear_default = hashClear;
1156
+ function hashDelete(key) {
1157
+ var result = this.has(key) && delete this.__data__[key];
1158
+ return this.size -= result ? 1 : 0, result;
1159
+ }
1160
+ var hashDelete_default = hashDelete, HASH_UNDEFINED = "__lodash_hash_undefined__", objectProto4 = Object.prototype, hasOwnProperty3 = objectProto4.hasOwnProperty;
1161
+ function hashGet(key) {
1162
+ var data = this.__data__;
1163
+ if (nativeCreate_default) {
1164
+ var result = data[key];
1165
+ return result === HASH_UNDEFINED ? void 0 : result;
1166
+ }
1167
+ return hasOwnProperty3.call(data, key) ? data[key] : void 0;
1168
+ }
1169
+ var hashGet_default = hashGet, objectProto5 = Object.prototype, hasOwnProperty4 = objectProto5.hasOwnProperty;
1170
+ function hashHas(key) {
1171
+ var data = this.__data__;
1172
+ return nativeCreate_default ? data[key] !== void 0 : hasOwnProperty4.call(data, key);
1173
+ }
1174
+ var hashHas_default = hashHas, HASH_UNDEFINED2 = "__lodash_hash_undefined__";
1175
+ function hashSet(key, value) {
1176
+ var data = this.__data__;
1177
+ return this.size += this.has(key) ? 0 : 1, data[key] = nativeCreate_default && value === void 0 ? HASH_UNDEFINED2 : value, this;
1178
+ }
1179
+ var hashSet_default = hashSet;
1180
+ function Hash(entries) {
1181
+ var index = -1, length = entries == null ? 0 : entries.length;
1182
+ for (this.clear(); ++index < length; ) {
1183
+ var entry = entries[index];
1184
+ this.set(entry[0], entry[1]);
1185
+ }
1186
+ }
1187
+ Hash.prototype.clear = hashClear_default;
1188
+ Hash.prototype.delete = hashDelete_default;
1189
+ Hash.prototype.get = hashGet_default;
1190
+ Hash.prototype.has = hashHas_default;
1191
+ Hash.prototype.set = hashSet_default;
1192
+ var Hash_default = Hash;
1193
+ function listCacheClear() {
1194
+ this.__data__ = [], this.size = 0;
1195
+ }
1196
+ var listCacheClear_default = listCacheClear;
1197
+ function assocIndexOf(array, key) {
1198
+ for (var length = array.length; length--; )
1199
+ if (eq_default(array[length][0], key))
1200
+ return length;
1201
+ return -1;
1202
+ }
1203
+ var assocIndexOf_default = assocIndexOf, arrayProto = Array.prototype, splice = arrayProto.splice;
1204
+ function listCacheDelete(key) {
1205
+ var data = this.__data__, index = assocIndexOf_default(data, key);
1206
+ if (index < 0)
1207
+ return !1;
1208
+ var lastIndex = data.length - 1;
1209
+ return index == lastIndex ? data.pop() : splice.call(data, index, 1), --this.size, !0;
1210
+ }
1211
+ var listCacheDelete_default = listCacheDelete;
1212
+ function listCacheGet(key) {
1213
+ var data = this.__data__, index = assocIndexOf_default(data, key);
1214
+ return index < 0 ? void 0 : data[index][1];
1215
+ }
1216
+ var listCacheGet_default = listCacheGet;
1217
+ function listCacheHas(key) {
1218
+ return assocIndexOf_default(this.__data__, key) > -1;
1219
+ }
1220
+ var listCacheHas_default = listCacheHas;
1221
+ function listCacheSet(key, value) {
1222
+ var data = this.__data__, index = assocIndexOf_default(data, key);
1223
+ return index < 0 ? (++this.size, data.push([key, value])) : data[index][1] = value, this;
1224
+ }
1225
+ var listCacheSet_default = listCacheSet;
1226
+ function ListCache(entries) {
1227
+ var index = -1, length = entries == null ? 0 : entries.length;
1228
+ for (this.clear(); ++index < length; ) {
1229
+ var entry = entries[index];
1230
+ this.set(entry[0], entry[1]);
1231
+ }
1232
+ }
1233
+ ListCache.prototype.clear = listCacheClear_default;
1234
+ ListCache.prototype.delete = listCacheDelete_default;
1235
+ ListCache.prototype.get = listCacheGet_default;
1236
+ ListCache.prototype.has = listCacheHas_default;
1237
+ ListCache.prototype.set = listCacheSet_default;
1238
+ var ListCache_default = ListCache, Map2 = getNative_default(root_default, "Map"), Map_default = Map2;
1239
+ function mapCacheClear() {
1240
+ this.size = 0, this.__data__ = {
1241
+ hash: new Hash_default(),
1242
+ map: new (Map_default || ListCache_default)(),
1243
+ string: new Hash_default()
1244
+ };
1245
+ }
1246
+ var mapCacheClear_default = mapCacheClear;
1247
+ function isKeyable(value) {
1248
+ var type = typeof value;
1249
+ return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
1250
+ }
1251
+ var isKeyable_default = isKeyable;
1252
+ function getMapData(map, key) {
1253
+ var data = map.__data__;
1254
+ return isKeyable_default(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
1255
+ }
1256
+ var getMapData_default = getMapData;
1257
+ function mapCacheDelete(key) {
1258
+ var result = getMapData_default(this, key).delete(key);
1259
+ return this.size -= result ? 1 : 0, result;
1260
+ }
1261
+ var mapCacheDelete_default = mapCacheDelete;
1262
+ function mapCacheGet(key) {
1263
+ return getMapData_default(this, key).get(key);
1264
+ }
1265
+ var mapCacheGet_default = mapCacheGet;
1266
+ function mapCacheHas(key) {
1267
+ return getMapData_default(this, key).has(key);
1268
+ }
1269
+ var mapCacheHas_default = mapCacheHas;
1270
+ function mapCacheSet(key, value) {
1271
+ var data = getMapData_default(this, key), size = data.size;
1272
+ return data.set(key, value), this.size += data.size == size ? 0 : 1, this;
1273
+ }
1274
+ var mapCacheSet_default = mapCacheSet;
1275
+ function MapCache(entries) {
1276
+ var index = -1, length = entries == null ? 0 : entries.length;
1277
+ for (this.clear(); ++index < length; ) {
1278
+ var entry = entries[index];
1279
+ this.set(entry[0], entry[1]);
1280
+ }
1281
+ }
1282
+ MapCache.prototype.clear = mapCacheClear_default;
1283
+ MapCache.prototype.delete = mapCacheDelete_default;
1284
+ MapCache.prototype.get = mapCacheGet_default;
1285
+ MapCache.prototype.has = mapCacheHas_default;
1286
+ MapCache.prototype.set = mapCacheSet_default;
1287
+ var MapCache_default = MapCache, FUNC_ERROR_TEXT = "Expected a function";
1288
+ function memoize(func, resolver) {
1289
+ if (typeof func != "function" || resolver != null && typeof resolver != "function")
1290
+ throw new TypeError(FUNC_ERROR_TEXT);
1291
+ var memoized = function() {
1292
+ var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
1293
+ if (cache.has(key))
1294
+ return cache.get(key);
1295
+ var result = func.apply(this, args);
1296
+ return memoized.cache = cache.set(key, result) || cache, result;
1297
+ };
1298
+ return memoized.cache = new (memoize.Cache || MapCache_default)(), memoized;
1299
+ }
1300
+ memoize.Cache = MapCache_default;
1301
+ var memoize_default = memoize, MAX_MEMOIZE_SIZE = 500;
1302
+ function memoizeCapped(func) {
1303
+ var result = memoize_default(func, function(key) {
1304
+ return cache.size === MAX_MEMOIZE_SIZE && cache.clear(), key;
1305
+ }), cache = result.cache;
1306
+ return result;
1307
+ }
1308
+ var memoizeCapped_default = memoizeCapped, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, reEscapeChar = /\\(\\)?/g, stringToPath = memoizeCapped_default(function(string) {
1309
+ var result = [];
1310
+ return string.charCodeAt(0) === 46 && result.push(""), string.replace(rePropName, function(match, number, quote, subString) {
1311
+ result.push(quote ? subString.replace(reEscapeChar, "$1") : number || match);
1312
+ }), result;
1313
+ }), stringToPath_default = stringToPath;
1314
+ function toString(value) {
1315
+ return value == null ? "" : baseToString_default(value);
1316
+ }
1317
+ var toString_default = toString;
1318
+ function castPath(value, object) {
1319
+ return isArray_default(value) ? value : isKey_default(value, object) ? [value] : stringToPath_default(toString_default(value));
1320
+ }
1321
+ var castPath_default = castPath, INFINITY2 = 1 / 0;
1322
+ function toKey(value) {
1323
+ if (typeof value == "string" || isSymbol_default(value))
1324
+ return value;
1325
+ var result = value + "";
1326
+ return result == "0" && 1 / value == -INFINITY2 ? "-0" : result;
1327
+ }
1328
+ var toKey_default = toKey;
1329
+ function baseGet(object, path) {
1330
+ path = castPath_default(path, object);
1331
+ for (var index = 0, length = path.length; object != null && index < length; )
1332
+ object = object[toKey_default(path[index++])];
1333
+ return index && index == length ? object : void 0;
1334
+ }
1335
+ var baseGet_default = baseGet;
1336
+ function get(object, path, defaultValue) {
1337
+ var result = object == null ? void 0 : baseGet_default(object, path);
1338
+ return result === void 0 ? defaultValue : result;
1339
+ }
1340
+ var get_default = get, isObject3 = isObject, dateFormat = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?Z$/, isJSON = (input) => input.match(/^[\[\{\"\}].*[\]\}\"]$/);
1341
+ function convertUnconventionalData(data) {
1342
+ if (!isObject3(data))
1343
+ return data;
1344
+ let result = data, wasMutated = !1;
1345
+ return typeof Event < "u" && data instanceof Event && (result = extractEventHiddenProperties(result), wasMutated = !0), result = Object.keys(result).reduce((acc, key) => {
1346
+ try {
1347
+ result[key] && result[key].toJSON, acc[key] = result[key];
1348
+ } catch {
1349
+ wasMutated = !0;
1350
+ }
1351
+ return acc;
1352
+ }, {}), wasMutated ? result : data;
1353
+ }
1354
+ var replacer = function(options) {
1355
+ let objects, map, stack, keys;
1356
+ return function(key, value) {
1357
+ try {
1358
+ if (key === "")
1359
+ return keys = [], objects = /* @__PURE__ */ new Map([[value, "[]"]]), map = /* @__PURE__ */ new Map(), stack = [], value;
1360
+ let origin = map.get(this) || this;
1361
+ for (; stack.length && origin !== stack[0]; )
1362
+ stack.shift(), keys.pop();
1363
+ if (typeof value == "boolean")
1364
+ return value;
1365
+ if (value === void 0)
1366
+ return options.allowUndefined ? "_undefined_" : void 0;
1367
+ if (value === null)
1368
+ return null;
1369
+ if (typeof value == "number")
1370
+ return value === Number.NEGATIVE_INFINITY ? "_-Infinity_" : value === Number.POSITIVE_INFINITY ? "_Infinity_" : Number.isNaN(value) ? "_NaN_" : value;
1371
+ if (typeof value == "bigint")
1372
+ return `_bigint_${value.toString()}`;
1373
+ if (typeof value == "string")
1374
+ return dateFormat.test(value) ? options.allowDate ? `_date_${value}` : void 0 : value;
1375
+ if ((0, import_is_regex.default)(value))
1376
+ return options.allowRegExp ? `_regexp_${value.flags}|${value.source}` : void 0;
1377
+ if ((0, import_is_function.default)(value))
1378
+ return;
1379
+ if ((0, import_is_symbol.default)(value)) {
1380
+ if (!options.allowSymbol)
1381
+ return;
1382
+ let globalRegistryKey = Symbol.keyFor(value);
1383
+ return globalRegistryKey !== void 0 ? `_gsymbol_${globalRegistryKey}` : `_symbol_${value.toString().slice(7, -1)}`;
1384
+ }
1385
+ if (stack.length >= options.maxDepth)
1386
+ return Array.isArray(value) ? `[Array(${value.length})]` : "[Object]";
1387
+ if (value === this)
1388
+ return `_duplicate_${JSON.stringify(keys)}`;
1389
+ if (value instanceof Error && options.allowError)
1390
+ return {
1391
+ __isConvertedError__: !0,
1392
+ errorProperties: {
1393
+ // @ts-expect-error cause is not defined in the current tsconfig target(es2020)
1394
+ ...value.cause ? { cause: value.cause } : {},
1395
+ ...value,
1396
+ name: value.name,
1397
+ message: value.message,
1398
+ stack: value.stack,
1399
+ "_constructor-name_": value.constructor.name
1400
+ }
1401
+ };
1402
+ if (value?.constructor?.name && value.constructor.name !== "Object" && !Array.isArray(value)) {
1403
+ let found2 = objects.get(value);
1404
+ if (!found2) {
1405
+ let plainObject = {
1406
+ __isClassInstance__: !0,
1407
+ __className__: value.constructor.name,
1408
+ ...Object.getOwnPropertyNames(value).reduce(
1409
+ (acc, prop) => {
1410
+ try {
1411
+ acc[prop] = value[prop];
1412
+ } catch {
1413
+ }
1414
+ return acc;
1415
+ },
1416
+ {}
1417
+ )
1418
+ };
1419
+ return keys.push(key), stack.unshift(plainObject), objects.set(value, JSON.stringify(keys)), value !== plainObject && map.set(value, plainObject), plainObject;
1420
+ }
1421
+ return `_duplicate_${found2}`;
1422
+ }
1423
+ let found = objects.get(value);
1424
+ if (!found) {
1425
+ let converted = Array.isArray(value) ? value : convertUnconventionalData(value);
1426
+ return keys.push(key), stack.unshift(converted), objects.set(value, JSON.stringify(keys)), value !== converted && map.set(value, converted), converted;
1427
+ }
1428
+ return `_duplicate_${found}`;
1429
+ } catch {
1430
+ return;
1431
+ }
1432
+ };
1433
+ }, reviver = function(options) {
1434
+ let refs = [], root2;
1435
+ return function(key, value) {
1436
+ if (key === "" && (root2 = value, refs.forEach(({ target, container, replacement }) => {
1437
+ let replacementArr = isJSON(replacement) ? JSON.parse(replacement) : replacement.split(".");
1438
+ replacementArr.length === 0 ? container[target] = root2 : container[target] = get_default(root2, replacementArr);
1439
+ })), key === "_constructor-name_")
1440
+ return value;
1441
+ if (isObject3(value) && value.__isConvertedError__) {
1442
+ let { message, ...properties } = value.errorProperties, error = new Error(message);
1443
+ return Object.assign(error, properties), error;
1444
+ }
1445
+ if (typeof value == "string" && value.startsWith("_regexp_") && options.allowRegExp) {
1446
+ let [, flags, source] = value.match(/_regexp_([^|]*)\|(.*)/) || [];
1447
+ return new RegExp(source, flags);
1448
+ }
1449
+ return typeof value == "string" && value.startsWith("_date_") && options.allowDate ? new Date(value.replace("_date_", "")) : typeof value == "string" && value.startsWith("_duplicate_") ? (refs.push({ target: key, container: this, replacement: value.replace(/^_duplicate_/, "") }), null) : typeof value == "string" && value.startsWith("_symbol_") && options.allowSymbol ? Symbol(value.replace("_symbol_", "")) : typeof value == "string" && value.startsWith("_gsymbol_") && options.allowSymbol ? Symbol.for(value.replace("_gsymbol_", "")) : typeof value == "string" && value === "_-Infinity_" ? Number.NEGATIVE_INFINITY : typeof value == "string" && value === "_Infinity_" ? Number.POSITIVE_INFINITY : typeof value == "string" && value === "_NaN_" ? Number.NaN : typeof value == "string" && value.startsWith("_bigint_") && typeof BigInt == "function" ? BigInt(value.replace("_bigint_", "")) : value;
1450
+ };
1451
+ }, defaultOptions = {
1452
+ maxDepth: 10,
1453
+ space: void 0,
1454
+ allowRegExp: !0,
1455
+ allowDate: !0,
1456
+ allowError: !0,
1457
+ allowUndefined: !0,
1458
+ allowSymbol: !0
1459
+ }, stringify = (data, options = {}) => {
1460
+ let mergedOptions = { ...defaultOptions, ...options };
1461
+ return JSON.stringify(convertUnconventionalData(data), replacer(mergedOptions), options.space);
1462
+ }, mutator = () => {
1463
+ let mutated = /* @__PURE__ */ new Map();
1464
+ return function mutateUndefined(value) {
1465
+ isObject3(value) && Object.entries(value).forEach(([k, v]) => {
1466
+ v === "_undefined_" ? value[k] = void 0 : mutated.get(v) || (mutated.set(v, !0), mutateUndefined(v));
1467
+ }), Array.isArray(value) && value.forEach((v, index) => {
1468
+ v === "_undefined_" ? (mutated.set(v, !0), value[index] = void 0) : mutated.get(v) || (mutated.set(v, !0), mutateUndefined(v));
1469
+ });
1470
+ };
1471
+ }, parse = (data, options = {}) => {
1472
+ let mergedOptions = { ...defaultOptions, ...options }, result = JSON.parse(data, reviver(mergedOptions));
1473
+ return mutator()(result), result;
1474
+ };
1475
+
1476
+ export {
1477
+ UniversalStore,
1478
+ isJSON,
1479
+ stringify,
1480
+ parse
1481
+ };