@teurons/vds-diagrams 0.0.0-stage → 0.3.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 (51) hide show
  1. package/README.md +170 -2
  2. package/dist/cli.js +2244 -0
  3. package/dist/diagrams.css +991 -0
  4. package/dist/grid.d.ts +1 -0
  5. package/dist/grid.js +283 -0
  6. package/dist/index.d.ts +1 -0
  7. package/dist/index.js +2044 -0
  8. package/dist/skills/vds-aggregates/SKILL.md +115 -0
  9. package/dist/skills/vds-ask-or-park/SKILL.md +101 -0
  10. package/dist/skills/vds-book-to-spec/SKILL.md +136 -0
  11. package/dist/skills/vds-build-from-published/SKILL.md +89 -0
  12. package/dist/skills/vds-change/SKILL.md +113 -0
  13. package/dist/skills/vds-context-map/SKILL.md +125 -0
  14. package/dist/skills/vds-contexts/SKILL.md +134 -0
  15. package/dist/skills/vds-diagrams/SKILL.md +88 -0
  16. package/dist/skills/vds-entities-and-values/SKILL.md +108 -0
  17. package/dist/skills/vds-language/SKILL.md +106 -0
  18. package/dist/skills/vds-model-review/SKILL.md +123 -0
  19. package/dist/skills/vds-ports-and-adapters/SKILL.md +119 -0
  20. package/dist/skills/vds-publish/SKILL.md +123 -0
  21. package/dist/skills/vds-reframe/SKILL.md +122 -0
  22. package/dist/skills/vds-requirements/SKILL.md +128 -0
  23. package/dist/skills/vds-requirements-review/SKILL.md +121 -0
  24. package/dist/skills/vds-scenarios/SKILL.md +142 -0
  25. package/dist/skills/vds-slice-blocks/SKILL.md +127 -0
  26. package/dist/skills/vds-story-walk/SKILL.md +128 -0
  27. package/dist/skills/vds-strip-invented/SKILL.md +130 -0
  28. package/dist/skills/vds-subdomains/SKILL.md +127 -0
  29. package/dist/skills/vds-which-skill/FILE-SHAPES.md +312 -0
  30. package/dist/skills/vds-which-skill/SKILL.md +125 -0
  31. package/dist/types/diagrams/src/grid/camera.d.ts +32 -0
  32. package/dist/types/diagrams/src/grid/capability.d.ts +11 -0
  33. package/dist/types/diagrams/src/grid/fold-uj.d.ts +2 -0
  34. package/dist/types/diagrams/src/grid/grid-canvas.d.ts +95 -0
  35. package/dist/types/diagrams/src/grid/index.d.ts +5 -0
  36. package/dist/types/diagrams/src/grid/input.d.ts +93 -0
  37. package/dist/types/diagrams/src/grid/route.d.ts +21 -0
  38. package/dist/types/engine/js/bridge.d.ts +12 -0
  39. package/dist/types/engine/js/index.d.ts +73 -0
  40. package/dist/types/vds-diagrams/src/canvas.d.ts +43 -0
  41. package/dist/types/vds-diagrams/src/from-scenarios.d.ts +4 -0
  42. package/dist/types/vds-diagrams/src/grid-folds.d.ts +1 -0
  43. package/dist/types/vds-diagrams/src/grid.d.ts +2 -0
  44. package/dist/types/vds-diagrams/src/index.d.ts +6 -0
  45. package/dist/types/vds-diagrams/src/types.d.ts +39 -0
  46. package/dist/types/vds-diagrams/src/user-journey.d.ts +54 -0
  47. package/dist/types/vds-diagrams/src/workspace.d.ts +25 -0
  48. package/dist/vds_engine.wasm +0 -0
  49. package/dist/workspace.d.ts +1 -0
  50. package/dist/workspace.js +113 -0
  51. package/package.json +68 -3
package/dist/cli.js ADDED
@@ -0,0 +1,2244 @@
1
+ #!/usr/bin/env node
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __commonJS = (cb, mod) => function __require() {
9
+ try {
10
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
11
+ } catch (e) {
12
+ throw mod = 0, e;
13
+ }
14
+ };
15
+ var __copyProps = (to, from, except, desc) => {
16
+ if (from && typeof from === "object" || typeof from === "function") {
17
+ for (let key of __getOwnPropNames(from))
18
+ if (!__hasOwnProp.call(to, key) && key !== except)
19
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
20
+ }
21
+ return to;
22
+ };
23
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
24
+ // If the importer is in node compatibility mode or this is not an ESM
25
+ // file that has been converted to a CommonJS file using a Babel-
26
+ // compatible transform (i.e. "__esModule" has not been set), then set
27
+ // "default" to the CommonJS "module.exports" for node compatibility.
28
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
29
+ mod
30
+ ));
31
+
32
+ // ../../node_modules/.pnpm/react@19.3.1/node_modules/react/cjs/react-jsx-runtime.production.js
33
+ var require_react_jsx_runtime_production = __commonJS({
34
+ "../../node_modules/.pnpm/react@19.3.1/node_modules/react/cjs/react-jsx-runtime.production.js"(exports) {
35
+ "use strict";
36
+ var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element");
37
+ var REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment");
38
+ function jsxProd(type, config, maybeKey) {
39
+ var key = null;
40
+ void 0 !== maybeKey && (key = "" + maybeKey);
41
+ void 0 !== config.key && (key = "" + config.key);
42
+ if ("key" in config) {
43
+ maybeKey = {};
44
+ for (var propName in config)
45
+ "key" !== propName && (maybeKey[propName] = config[propName]);
46
+ } else maybeKey = config;
47
+ config = maybeKey.ref;
48
+ return {
49
+ $$typeof: REACT_ELEMENT_TYPE,
50
+ type,
51
+ key,
52
+ ref: void 0 !== config ? config : null,
53
+ props: maybeKey
54
+ };
55
+ }
56
+ exports.Fragment = REACT_FRAGMENT_TYPE;
57
+ exports.jsx = jsxProd;
58
+ exports.jsxs = jsxProd;
59
+ }
60
+ });
61
+
62
+ // ../../node_modules/.pnpm/react@19.3.1/node_modules/react/cjs/react.production.js
63
+ var require_react_production = __commonJS({
64
+ "../../node_modules/.pnpm/react@19.3.1/node_modules/react/cjs/react.production.js"(exports) {
65
+ "use strict";
66
+ var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element");
67
+ var REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal");
68
+ var REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment");
69
+ var REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode");
70
+ var REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler");
71
+ var REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer");
72
+ var REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context");
73
+ var REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref");
74
+ var REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense");
75
+ var REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo");
76
+ var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
77
+ var REACT_ACTIVITY_TYPE = /* @__PURE__ */ Symbol.for("react.activity");
78
+ var REACT_VIEW_TRANSITION_TYPE = /* @__PURE__ */ Symbol.for("react.view_transition");
79
+ var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
80
+ function getIteratorFn(maybeIterable) {
81
+ if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
82
+ maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
83
+ return "function" === typeof maybeIterable ? maybeIterable : null;
84
+ }
85
+ var ReactNoopUpdateQueue = {
86
+ isMounted: function() {
87
+ return false;
88
+ },
89
+ enqueueForceUpdate: function() {
90
+ },
91
+ enqueueReplaceState: function() {
92
+ },
93
+ enqueueSetState: function() {
94
+ }
95
+ };
96
+ var assign = Object.assign;
97
+ var emptyObject = {};
98
+ function Component(props, context, updater) {
99
+ this.props = props;
100
+ this.context = context;
101
+ this.refs = emptyObject;
102
+ this.updater = updater || ReactNoopUpdateQueue;
103
+ }
104
+ Component.prototype.isReactComponent = {};
105
+ Component.prototype.setState = function(partialState, callback) {
106
+ if ("object" !== typeof partialState && "function" !== typeof partialState && null != partialState)
107
+ throw Error(
108
+ "takes an object of state variables to update or a function which returns an object of state variables."
109
+ );
110
+ this.updater.enqueueSetState(this, partialState, callback, "setState");
111
+ };
112
+ Component.prototype.forceUpdate = function(callback) {
113
+ this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
114
+ };
115
+ function ComponentDummy() {
116
+ }
117
+ ComponentDummy.prototype = Component.prototype;
118
+ function PureComponent(props, context, updater) {
119
+ this.props = props;
120
+ this.context = context;
121
+ this.refs = emptyObject;
122
+ this.updater = updater || ReactNoopUpdateQueue;
123
+ }
124
+ var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
125
+ pureComponentPrototype.constructor = PureComponent;
126
+ assign(pureComponentPrototype, Component.prototype);
127
+ pureComponentPrototype.isPureReactComponent = true;
128
+ var isArrayImpl = Array.isArray;
129
+ function noop() {
130
+ }
131
+ var ReactSharedInternals = { H: null, A: null, T: null, S: null };
132
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
133
+ function ReactElement(type, key, props) {
134
+ var refProp = props.ref;
135
+ return {
136
+ $$typeof: REACT_ELEMENT_TYPE,
137
+ type,
138
+ key,
139
+ ref: void 0 !== refProp ? refProp : null,
140
+ props
141
+ };
142
+ }
143
+ function cloneAndReplaceKey(oldElement, newKey) {
144
+ return ReactElement(oldElement.type, newKey, oldElement.props);
145
+ }
146
+ function isValidElement(object) {
147
+ return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
148
+ }
149
+ function escape(key) {
150
+ var escaperLookup = { "=": "=0", ":": "=2" };
151
+ return "$" + key.replace(/[=:]/g, function(match) {
152
+ return escaperLookup[match];
153
+ });
154
+ }
155
+ var userProvidedKeyEscapeRegex = /\/+/g;
156
+ function getElementKey(element, index) {
157
+ return "object" === typeof element && null !== element && null != element.key ? escape("" + element.key) : index.toString(36);
158
+ }
159
+ function resolveThenable(thenable) {
160
+ switch (thenable.status) {
161
+ case "fulfilled":
162
+ return thenable.value;
163
+ case "rejected":
164
+ throw thenable.reason;
165
+ default:
166
+ switch ("string" === typeof thenable.status ? thenable.then(noop, noop) : (thenable.status = "pending", thenable.then(
167
+ function(fulfilledValue) {
168
+ "pending" === thenable.status && (thenable.status = "fulfilled", thenable.value = fulfilledValue);
169
+ },
170
+ function(error) {
171
+ "pending" === thenable.status && (thenable.status = "rejected", thenable.reason = error);
172
+ }
173
+ )), thenable.status) {
174
+ case "fulfilled":
175
+ return thenable.value;
176
+ case "rejected":
177
+ throw thenable.reason;
178
+ }
179
+ }
180
+ throw thenable;
181
+ }
182
+ function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
183
+ var type = typeof children;
184
+ if ("undefined" === type || "boolean" === type) children = null;
185
+ var invokeCallback = false;
186
+ if (null === children) invokeCallback = true;
187
+ else
188
+ switch (type) {
189
+ case "bigint":
190
+ case "string":
191
+ case "number":
192
+ invokeCallback = true;
193
+ break;
194
+ case "object":
195
+ switch (children.$$typeof) {
196
+ case REACT_ELEMENT_TYPE:
197
+ case REACT_PORTAL_TYPE:
198
+ invokeCallback = true;
199
+ break;
200
+ case REACT_LAZY_TYPE:
201
+ return invokeCallback = children._init, mapIntoArray(
202
+ invokeCallback(children._payload),
203
+ array,
204
+ escapedPrefix,
205
+ nameSoFar,
206
+ callback
207
+ );
208
+ }
209
+ }
210
+ if (invokeCallback)
211
+ return callback = callback(children), invokeCallback = "" === nameSoFar ? "." + getElementKey(children, 0) : nameSoFar, isArrayImpl(callback) ? (escapedPrefix = "", null != invokeCallback && (escapedPrefix = invokeCallback.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), mapIntoArray(callback, array, escapedPrefix, "", function(c) {
212
+ return c;
213
+ })) : null != callback && (isValidElement(callback) && (callback = cloneAndReplaceKey(
214
+ callback,
215
+ escapedPrefix + (null == callback.key || children && children.key === callback.key ? "" : ("" + callback.key).replace(
216
+ userProvidedKeyEscapeRegex,
217
+ "$&/"
218
+ ) + "/") + invokeCallback
219
+ )), array.push(callback)), 1;
220
+ invokeCallback = 0;
221
+ var nextNamePrefix = "" === nameSoFar ? "." : nameSoFar + ":";
222
+ if (isArrayImpl(children))
223
+ for (var i = 0; i < children.length; i++)
224
+ nameSoFar = children[i], type = nextNamePrefix + getElementKey(nameSoFar, i), invokeCallback += mapIntoArray(
225
+ nameSoFar,
226
+ array,
227
+ escapedPrefix,
228
+ type,
229
+ callback
230
+ );
231
+ else if (i = getIteratorFn(children), "function" === typeof i)
232
+ for (children = i.call(children), i = 0; !(nameSoFar = children.next()).done; )
233
+ nameSoFar = nameSoFar.value, type = nextNamePrefix + getElementKey(nameSoFar, i++), invokeCallback += mapIntoArray(
234
+ nameSoFar,
235
+ array,
236
+ escapedPrefix,
237
+ type,
238
+ callback
239
+ );
240
+ else if ("object" === type) {
241
+ if ("function" === typeof children.then)
242
+ return mapIntoArray(
243
+ resolveThenable(children),
244
+ array,
245
+ escapedPrefix,
246
+ nameSoFar,
247
+ callback
248
+ );
249
+ array = String(children);
250
+ throw Error(
251
+ "Objects are not valid as a React child (found: " + ("[object Object]" === array ? "object with keys {" + Object.keys(children).join(", ") + "}" : array) + "). If you meant to render a collection of children, use an array instead."
252
+ );
253
+ }
254
+ return invokeCallback;
255
+ }
256
+ function mapChildren(children, func, context) {
257
+ if (null == children) return children;
258
+ var result = [], count = 0;
259
+ mapIntoArray(children, result, "", "", function(child) {
260
+ return func.call(context, child, count++);
261
+ });
262
+ return result;
263
+ }
264
+ function lazyInitializer(payload) {
265
+ if (-1 === payload._status) {
266
+ var ctor = payload._result, thenable = ctor();
267
+ thenable.then(
268
+ function(moduleObject) {
269
+ if (0 === payload._status || -1 === payload._status)
270
+ payload._status = 1, payload._result = moduleObject, void 0 === thenable.status && (thenable.status = "fulfilled", thenable.value = moduleObject);
271
+ },
272
+ function(error) {
273
+ if (0 === payload._status || -1 === payload._status)
274
+ payload._status = 2, payload._result = error, void 0 === thenable.status && (thenable.status = "rejected", thenable.reason = error);
275
+ }
276
+ );
277
+ -1 === payload._status && (payload._status = 0, payload._result = thenable);
278
+ }
279
+ if (1 === payload._status) return payload._result.default;
280
+ throw payload._result;
281
+ }
282
+ var reportGlobalError = "function" === typeof reportError ? reportError : function(error) {
283
+ if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
284
+ var event = new window.ErrorEvent("error", {
285
+ bubbles: true,
286
+ cancelable: true,
287
+ message: "object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error),
288
+ error
289
+ });
290
+ if (!window.dispatchEvent(event)) return;
291
+ } else if ("object" === typeof process && "function" === typeof process.emit) {
292
+ process.emit("uncaughtException", error);
293
+ return;
294
+ }
295
+ console.error(error);
296
+ };
297
+ function startTransition(scope) {
298
+ var prevTransition = ReactSharedInternals.T, currentTransition = {};
299
+ currentTransition.types = null !== prevTransition ? prevTransition.types : null;
300
+ ReactSharedInternals.T = currentTransition;
301
+ try {
302
+ var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S;
303
+ null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
304
+ "object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && returnValue.then(noop, reportGlobalError);
305
+ } catch (error) {
306
+ reportGlobalError(error);
307
+ } finally {
308
+ null !== prevTransition && null !== currentTransition.types && (prevTransition.types = currentTransition.types), ReactSharedInternals.T = prevTransition;
309
+ }
310
+ }
311
+ function addTransitionType(type) {
312
+ var transition = ReactSharedInternals.T;
313
+ if (null !== transition) {
314
+ var transitionTypes = transition.types;
315
+ null === transitionTypes ? transition.types = [type] : -1 === transitionTypes.indexOf(type) && transitionTypes.push(type);
316
+ } else startTransition(addTransitionType.bind(null, type));
317
+ }
318
+ var Children = {
319
+ map: mapChildren,
320
+ forEach: function(children, forEachFunc, forEachContext) {
321
+ mapChildren(
322
+ children,
323
+ function() {
324
+ forEachFunc.apply(this, arguments);
325
+ },
326
+ forEachContext
327
+ );
328
+ },
329
+ count: function(children) {
330
+ var n = 0;
331
+ mapChildren(children, function() {
332
+ n++;
333
+ });
334
+ return n;
335
+ },
336
+ toArray: function(children) {
337
+ return mapChildren(children, function(child) {
338
+ return child;
339
+ }) || [];
340
+ },
341
+ only: function(children) {
342
+ if (!isValidElement(children))
343
+ throw Error(
344
+ "React.Children.only expected to receive a single React element child."
345
+ );
346
+ return children;
347
+ }
348
+ };
349
+ exports.Activity = REACT_ACTIVITY_TYPE;
350
+ exports.Children = Children;
351
+ exports.Component = Component;
352
+ exports.Fragment = REACT_FRAGMENT_TYPE;
353
+ exports.Profiler = REACT_PROFILER_TYPE;
354
+ exports.PureComponent = PureComponent;
355
+ exports.StrictMode = REACT_STRICT_MODE_TYPE;
356
+ exports.Suspense = REACT_SUSPENSE_TYPE;
357
+ exports.ViewTransition = REACT_VIEW_TRANSITION_TYPE;
358
+ exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
359
+ exports.__COMPILER_RUNTIME = {
360
+ __proto__: null,
361
+ c: function(size) {
362
+ return ReactSharedInternals.H.useMemoCache(size);
363
+ }
364
+ };
365
+ exports.addTransitionType = addTransitionType;
366
+ exports.cache = function(fn) {
367
+ return function() {
368
+ return fn.apply(null, arguments);
369
+ };
370
+ };
371
+ exports.cacheSignal = function() {
372
+ return null;
373
+ };
374
+ exports.cloneElement = function(element, config, children) {
375
+ if (null === element || void 0 === element)
376
+ throw Error(
377
+ "The argument must be a React element, but you passed " + element + "."
378
+ );
379
+ var props = assign({}, element.props), key = element.key;
380
+ if (null != config)
381
+ for (propName in void 0 !== config.key && (key = "" + config.key), config)
382
+ !hasOwnProperty.call(config, propName) || "key" === propName || "__self" === propName || "__source" === propName || "ref" === propName && void 0 === config.ref || (props[propName] = config[propName]);
383
+ var propName = arguments.length - 2;
384
+ if (1 === propName) props.children = children;
385
+ else if (1 < propName) {
386
+ for (var childArray = Array(propName), i = 0; i < propName; i++)
387
+ childArray[i] = arguments[i + 2];
388
+ props.children = childArray;
389
+ }
390
+ return ReactElement(element.type, key, props);
391
+ };
392
+ exports.createContext = function(defaultValue) {
393
+ defaultValue = {
394
+ $$typeof: REACT_CONTEXT_TYPE,
395
+ _currentValue: defaultValue,
396
+ _currentValue2: defaultValue,
397
+ _threadCount: 0,
398
+ Provider: null,
399
+ Consumer: null
400
+ };
401
+ defaultValue.Provider = defaultValue;
402
+ defaultValue.Consumer = {
403
+ $$typeof: REACT_CONSUMER_TYPE,
404
+ _context: defaultValue
405
+ };
406
+ return defaultValue;
407
+ };
408
+ exports.createElement = function(type, config, children) {
409
+ var propName, props = {}, key = null;
410
+ if (null != config)
411
+ for (propName in void 0 !== config.key && (key = "" + config.key), config)
412
+ hasOwnProperty.call(config, propName) && "key" !== propName && "__self" !== propName && "__source" !== propName && (props[propName] = config[propName]);
413
+ var childrenLength = arguments.length - 2;
414
+ if (1 === childrenLength) props.children = children;
415
+ else if (1 < childrenLength) {
416
+ for (var childArray = Array(childrenLength), i = 0; i < childrenLength; i++)
417
+ childArray[i] = arguments[i + 2];
418
+ props.children = childArray;
419
+ }
420
+ if (type && type.defaultProps)
421
+ for (propName in childrenLength = type.defaultProps, childrenLength)
422
+ void 0 === props[propName] && (props[propName] = childrenLength[propName]);
423
+ return ReactElement(type, key, props);
424
+ };
425
+ exports.createRef = function() {
426
+ return { current: null };
427
+ };
428
+ exports.forwardRef = function(render) {
429
+ return { $$typeof: REACT_FORWARD_REF_TYPE, render };
430
+ };
431
+ exports.isValidElement = isValidElement;
432
+ exports.lazy = function(ctor) {
433
+ return {
434
+ $$typeof: REACT_LAZY_TYPE,
435
+ _payload: { _status: -1, _result: ctor },
436
+ _init: lazyInitializer
437
+ };
438
+ };
439
+ exports.memo = function(type, compare) {
440
+ return {
441
+ $$typeof: REACT_MEMO_TYPE,
442
+ type,
443
+ compare: void 0 === compare ? null : compare
444
+ };
445
+ };
446
+ exports.startTransition = startTransition;
447
+ exports.unstable_useCacheRefresh = function() {
448
+ return ReactSharedInternals.H.useCacheRefresh();
449
+ };
450
+ exports.use = function(usable) {
451
+ return ReactSharedInternals.H.use(usable);
452
+ };
453
+ exports.useActionState = function(action, initialState, permalink) {
454
+ return ReactSharedInternals.H.useActionState(action, initialState, permalink);
455
+ };
456
+ exports.useCallback = function(callback, deps) {
457
+ return ReactSharedInternals.H.useCallback(callback, deps);
458
+ };
459
+ exports.useContext = function(Context) {
460
+ return ReactSharedInternals.H.useContext(Context);
461
+ };
462
+ exports.useDebugValue = function() {
463
+ };
464
+ exports.useDeferredValue = function(value, initialValue) {
465
+ return ReactSharedInternals.H.useDeferredValue(value, initialValue);
466
+ };
467
+ exports.useEffect = function(create, deps) {
468
+ return ReactSharedInternals.H.useEffect(create, deps);
469
+ };
470
+ exports.useEffectEvent = function(callback) {
471
+ return ReactSharedInternals.H.useEffectEvent(callback);
472
+ };
473
+ exports.useId = function() {
474
+ return ReactSharedInternals.H.useId();
475
+ };
476
+ exports.useImperativeHandle = function(ref, create, deps) {
477
+ return ReactSharedInternals.H.useImperativeHandle(ref, create, deps);
478
+ };
479
+ exports.useInsertionEffect = function(create, deps) {
480
+ return ReactSharedInternals.H.useInsertionEffect(create, deps);
481
+ };
482
+ exports.useLayoutEffect = function(create, deps) {
483
+ return ReactSharedInternals.H.useLayoutEffect(create, deps);
484
+ };
485
+ exports.useMemo = function(create, deps) {
486
+ return ReactSharedInternals.H.useMemo(create, deps);
487
+ };
488
+ exports.useOptimistic = function(passthrough, reducer) {
489
+ return ReactSharedInternals.H.useOptimistic(passthrough, reducer);
490
+ };
491
+ exports.useReducer = function(reducer, initialArg, init) {
492
+ return ReactSharedInternals.H.useReducer(reducer, initialArg, init);
493
+ };
494
+ exports.useRef = function(initialValue) {
495
+ return ReactSharedInternals.H.useRef(initialValue);
496
+ };
497
+ exports.useState = function(initialState) {
498
+ return ReactSharedInternals.H.useState(initialState);
499
+ };
500
+ exports.useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) {
501
+ return ReactSharedInternals.H.useSyncExternalStore(
502
+ subscribe,
503
+ getSnapshot,
504
+ getServerSnapshot
505
+ );
506
+ };
507
+ exports.useTransition = function() {
508
+ return ReactSharedInternals.H.useTransition();
509
+ };
510
+ exports.version = "19.3.1";
511
+ }
512
+ });
513
+
514
+ // ../../node_modules/.pnpm/react@19.3.1/node_modules/react/cjs/react.development.js
515
+ var require_react_development = __commonJS({
516
+ "../../node_modules/.pnpm/react@19.3.1/node_modules/react/cjs/react.development.js"(exports, module) {
517
+ "use strict";
518
+ "production" !== process.env.NODE_ENV && (function() {
519
+ function defineDeprecationWarning(methodName, info) {
520
+ Object.defineProperty(Component.prototype, methodName, {
521
+ get: function() {
522
+ console.warn(
523
+ "%s(...) is deprecated in plain JavaScript React classes. %s",
524
+ info[0],
525
+ info[1]
526
+ );
527
+ }
528
+ });
529
+ }
530
+ function getIteratorFn(maybeIterable) {
531
+ if (null === maybeIterable || "object" !== typeof maybeIterable)
532
+ return null;
533
+ maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
534
+ return "function" === typeof maybeIterable ? maybeIterable : null;
535
+ }
536
+ function warnNoop(publicInstance, callerName) {
537
+ publicInstance = (publicInstance = publicInstance.constructor) && (publicInstance.displayName || publicInstance.name) || "ReactClass";
538
+ var warningKey = publicInstance + "." + callerName;
539
+ didWarnStateUpdateForUnmountedComponent[warningKey] || (console.error(
540
+ "Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",
541
+ callerName,
542
+ publicInstance
543
+ ), didWarnStateUpdateForUnmountedComponent[warningKey] = true);
544
+ }
545
+ function Component(props, context, updater) {
546
+ this.props = props;
547
+ this.context = context;
548
+ this.refs = emptyObject;
549
+ this.updater = updater || ReactNoopUpdateQueue;
550
+ }
551
+ function ComponentDummy() {
552
+ }
553
+ function PureComponent(props, context, updater) {
554
+ this.props = props;
555
+ this.context = context;
556
+ this.refs = emptyObject;
557
+ this.updater = updater || ReactNoopUpdateQueue;
558
+ }
559
+ function noop() {
560
+ }
561
+ function testStringCoercion(value) {
562
+ return "" + value;
563
+ }
564
+ function checkKeyStringCoercion(value) {
565
+ try {
566
+ testStringCoercion(value);
567
+ var JSCompiler_inline_result = false;
568
+ } catch (e) {
569
+ JSCompiler_inline_result = true;
570
+ }
571
+ if (JSCompiler_inline_result) {
572
+ JSCompiler_inline_result = console;
573
+ var JSCompiler_temp_const = JSCompiler_inline_result.error;
574
+ var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
575
+ JSCompiler_temp_const.call(
576
+ JSCompiler_inline_result,
577
+ "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
578
+ JSCompiler_inline_result$jscomp$0
579
+ );
580
+ return testStringCoercion(value);
581
+ }
582
+ }
583
+ function getComponentNameFromType(type) {
584
+ if (null == type) return null;
585
+ if ("function" === typeof type)
586
+ return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
587
+ if ("string" === typeof type) return type;
588
+ switch (type) {
589
+ case REACT_FRAGMENT_TYPE:
590
+ return "Fragment";
591
+ case REACT_PROFILER_TYPE:
592
+ return "Profiler";
593
+ case REACT_STRICT_MODE_TYPE:
594
+ return "StrictMode";
595
+ case REACT_SUSPENSE_TYPE:
596
+ return "Suspense";
597
+ case REACT_SUSPENSE_LIST_TYPE:
598
+ return "SuspenseList";
599
+ case REACT_ACTIVITY_TYPE:
600
+ return "Activity";
601
+ case REACT_VIEW_TRANSITION_TYPE:
602
+ return "ViewTransition";
603
+ }
604
+ if ("object" === typeof type)
605
+ switch ("number" === typeof type.tag && console.error(
606
+ "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
607
+ ), type.$$typeof) {
608
+ case REACT_PORTAL_TYPE:
609
+ return "Portal";
610
+ case REACT_CONTEXT_TYPE:
611
+ return type.displayName || "Context";
612
+ case REACT_CONSUMER_TYPE:
613
+ return (type._context.displayName || "Context") + ".Consumer";
614
+ case REACT_FORWARD_REF_TYPE:
615
+ var innerType = type.render;
616
+ type = type.displayName;
617
+ type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
618
+ return type;
619
+ case REACT_MEMO_TYPE:
620
+ return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
621
+ case REACT_LAZY_TYPE:
622
+ innerType = type._payload;
623
+ type = type._init;
624
+ try {
625
+ return getComponentNameFromType(type(innerType));
626
+ } catch (x) {
627
+ }
628
+ }
629
+ return null;
630
+ }
631
+ function getTaskName(type) {
632
+ if (type === REACT_FRAGMENT_TYPE) return "<>";
633
+ if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE)
634
+ return "<...>";
635
+ try {
636
+ var name = getComponentNameFromType(type);
637
+ return name ? "<" + name + ">" : "<...>";
638
+ } catch (x) {
639
+ return "<...>";
640
+ }
641
+ }
642
+ function getOwner() {
643
+ var dispatcher = ReactSharedInternals.A;
644
+ return null === dispatcher ? null : dispatcher.getOwner();
645
+ }
646
+ function UnknownOwner() {
647
+ return Error("react-stack-top-frame");
648
+ }
649
+ function hasValidKey(config) {
650
+ if (hasOwnProperty.call(config, "key")) {
651
+ var getter = Object.getOwnPropertyDescriptor(config, "key").get;
652
+ if (getter && getter.isReactWarning) return false;
653
+ }
654
+ return void 0 !== config.key;
655
+ }
656
+ function defineKeyPropWarningGetter(props, displayName) {
657
+ function warnAboutAccessingKey() {
658
+ specialPropKeyWarningShown || (specialPropKeyWarningShown = true, console.error(
659
+ "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
660
+ displayName
661
+ ));
662
+ }
663
+ warnAboutAccessingKey.isReactWarning = true;
664
+ Object.defineProperty(props, "key", {
665
+ get: warnAboutAccessingKey,
666
+ configurable: true
667
+ });
668
+ }
669
+ function elementRefGetterWithDeprecationWarning() {
670
+ var componentName = getComponentNameFromType(this.type);
671
+ didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = true, console.error(
672
+ "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
673
+ ));
674
+ componentName = this.props.ref;
675
+ return void 0 !== componentName ? componentName : null;
676
+ }
677
+ function ReactElement(type, key, props, owner, debugStack, debugTask) {
678
+ var refProp = props.ref;
679
+ type = {
680
+ $$typeof: REACT_ELEMENT_TYPE,
681
+ type,
682
+ key,
683
+ props,
684
+ _owner: owner
685
+ };
686
+ null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type, "ref", {
687
+ enumerable: false,
688
+ get: elementRefGetterWithDeprecationWarning
689
+ }) : Object.defineProperty(type, "ref", { enumerable: false, value: null });
690
+ type._store = {};
691
+ Object.defineProperty(type._store, "validated", {
692
+ configurable: false,
693
+ enumerable: false,
694
+ writable: true,
695
+ value: 0
696
+ });
697
+ Object.defineProperty(type, "_debugInfo", {
698
+ configurable: false,
699
+ enumerable: false,
700
+ writable: true,
701
+ value: null
702
+ });
703
+ Object.defineProperty(type, "_debugStack", {
704
+ configurable: false,
705
+ enumerable: false,
706
+ writable: true,
707
+ value: debugStack
708
+ });
709
+ Object.defineProperty(type, "_debugTask", {
710
+ configurable: false,
711
+ enumerable: false,
712
+ writable: true,
713
+ value: debugTask
714
+ });
715
+ Object.freeze && (Object.freeze(type.props), Object.freeze(type));
716
+ return type;
717
+ }
718
+ function cloneAndReplaceKey(oldElement, newKey) {
719
+ newKey = ReactElement(
720
+ oldElement.type,
721
+ newKey,
722
+ oldElement.props,
723
+ oldElement._owner,
724
+ oldElement._debugStack,
725
+ oldElement._debugTask
726
+ );
727
+ oldElement._store && (newKey._store.validated = oldElement._store.validated);
728
+ return newKey;
729
+ }
730
+ function validateChildKeys(node) {
731
+ isValidElement(node) ? node._store && (node._store.validated = 1) : "object" === typeof node && null !== node && node.$$typeof === REACT_LAZY_TYPE && ("fulfilled" === node._payload.status ? isValidElement(node._payload.value) && node._payload.value._store && (node._payload.value._store.validated = 1) : node._store && (node._store.validated = 1));
732
+ }
733
+ function isValidElement(object) {
734
+ return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
735
+ }
736
+ function escape(key) {
737
+ var escaperLookup = { "=": "=0", ":": "=2" };
738
+ return "$" + key.replace(/[=:]/g, function(match) {
739
+ return escaperLookup[match];
740
+ });
741
+ }
742
+ function getElementKey(element, index) {
743
+ return "object" === typeof element && null !== element && null != element.key ? (checkKeyStringCoercion(element.key), escape("" + element.key)) : index.toString(36);
744
+ }
745
+ function resolveThenable(thenable) {
746
+ switch (thenable.status) {
747
+ case "fulfilled":
748
+ return thenable.value;
749
+ case "rejected":
750
+ throw thenable.reason;
751
+ default:
752
+ switch ("string" === typeof thenable.status ? thenable.then(noop, noop) : (thenable.status = "pending", thenable.then(
753
+ function(fulfilledValue) {
754
+ "pending" === thenable.status && (thenable.status = "fulfilled", thenable.value = fulfilledValue);
755
+ },
756
+ function(error) {
757
+ "pending" === thenable.status && (thenable.status = "rejected", thenable.reason = error);
758
+ }
759
+ )), thenable.status) {
760
+ case "fulfilled":
761
+ return thenable.value;
762
+ case "rejected":
763
+ throw thenable.reason;
764
+ }
765
+ }
766
+ throw thenable;
767
+ }
768
+ function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
769
+ var type = typeof children;
770
+ if ("undefined" === type || "boolean" === type) children = null;
771
+ var invokeCallback = false;
772
+ if (null === children) invokeCallback = true;
773
+ else
774
+ switch (type) {
775
+ case "bigint":
776
+ case "string":
777
+ case "number":
778
+ invokeCallback = true;
779
+ break;
780
+ case "object":
781
+ switch (children.$$typeof) {
782
+ case REACT_ELEMENT_TYPE:
783
+ case REACT_PORTAL_TYPE:
784
+ invokeCallback = true;
785
+ break;
786
+ case REACT_LAZY_TYPE:
787
+ return invokeCallback = children._init, mapIntoArray(
788
+ invokeCallback(children._payload),
789
+ array,
790
+ escapedPrefix,
791
+ nameSoFar,
792
+ callback
793
+ );
794
+ }
795
+ }
796
+ if (invokeCallback) {
797
+ invokeCallback = children;
798
+ callback = callback(invokeCallback);
799
+ var childKey = "" === nameSoFar ? "." + getElementKey(invokeCallback, 0) : nameSoFar;
800
+ isArrayImpl(callback) ? (escapedPrefix = "", null != childKey && (escapedPrefix = childKey.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), mapIntoArray(callback, array, escapedPrefix, "", function(c) {
801
+ return c;
802
+ })) : null != callback && (isValidElement(callback) && (null != callback.key && (invokeCallback && invokeCallback.key === callback.key || checkKeyStringCoercion(callback.key)), escapedPrefix = cloneAndReplaceKey(
803
+ callback,
804
+ escapedPrefix + (null == callback.key || invokeCallback && invokeCallback.key === callback.key ? "" : ("" + callback.key).replace(
805
+ userProvidedKeyEscapeRegex,
806
+ "$&/"
807
+ ) + "/") + childKey
808
+ ), "" !== nameSoFar && null != invokeCallback && isValidElement(invokeCallback) && null == invokeCallback.key && invokeCallback._store && !invokeCallback._store.validated && (escapedPrefix._store.validated = 2), callback = escapedPrefix), array.push(callback));
809
+ return 1;
810
+ }
811
+ invokeCallback = 0;
812
+ childKey = "" === nameSoFar ? "." : nameSoFar + ":";
813
+ if (isArrayImpl(children))
814
+ for (var i = 0; i < children.length; i++)
815
+ nameSoFar = children[i], type = childKey + getElementKey(nameSoFar, i), invokeCallback += mapIntoArray(
816
+ nameSoFar,
817
+ array,
818
+ escapedPrefix,
819
+ type,
820
+ callback
821
+ );
822
+ else if (i = getIteratorFn(children), "function" === typeof i)
823
+ for (i === children.entries && (didWarnAboutMaps || console.warn(
824
+ "Using Maps as children is not supported. Use an array of keyed ReactElements instead."
825
+ ), didWarnAboutMaps = true), children = i.call(children), i = 0; !(nameSoFar = children.next()).done; )
826
+ nameSoFar = nameSoFar.value, type = childKey + getElementKey(nameSoFar, i++), invokeCallback += mapIntoArray(
827
+ nameSoFar,
828
+ array,
829
+ escapedPrefix,
830
+ type,
831
+ callback
832
+ );
833
+ else if ("object" === type) {
834
+ if ("function" === typeof children.then)
835
+ return mapIntoArray(
836
+ resolveThenable(children),
837
+ array,
838
+ escapedPrefix,
839
+ nameSoFar,
840
+ callback
841
+ );
842
+ array = String(children);
843
+ throw Error(
844
+ "Objects are not valid as a React child (found: " + ("[object Object]" === array ? "object with keys {" + Object.keys(children).join(", ") + "}" : array) + "). If you meant to render a collection of children, use an array instead."
845
+ );
846
+ }
847
+ return invokeCallback;
848
+ }
849
+ function mapChildren(children, func, context) {
850
+ if (null == children) return children;
851
+ var result = [], count = 0;
852
+ mapIntoArray(children, result, "", "", function(child) {
853
+ return func.call(context, child, count++);
854
+ });
855
+ return result;
856
+ }
857
+ function lazyInitializer(payload) {
858
+ if (-1 === payload._status) {
859
+ var resolveDebugValue = null, rejectDebugValue = null, ioInfo = payload._ioInfo;
860
+ null != ioInfo && (ioInfo.start = ioInfo.end = performance.now(), ioInfo.value = new Promise(function(resolve, reject) {
861
+ resolveDebugValue = resolve;
862
+ rejectDebugValue = reject;
863
+ }));
864
+ ioInfo = payload._result;
865
+ var thenable = ioInfo();
866
+ thenable.then(
867
+ function(moduleObject) {
868
+ if (0 === payload._status || -1 === payload._status) {
869
+ payload._status = 1;
870
+ payload._result = moduleObject;
871
+ var _ioInfo = payload._ioInfo;
872
+ if (null != _ioInfo) {
873
+ _ioInfo.end = performance.now();
874
+ var debugValue = null == moduleObject ? void 0 : moduleObject.default;
875
+ resolveDebugValue(debugValue);
876
+ _ioInfo.value.status = "fulfilled";
877
+ _ioInfo.value.value = debugValue;
878
+ }
879
+ void 0 === thenable.status && (thenable.status = "fulfilled", thenable.value = moduleObject);
880
+ }
881
+ },
882
+ function(error) {
883
+ if (0 === payload._status || -1 === payload._status) {
884
+ payload._status = 2;
885
+ payload._result = error;
886
+ var _ioInfo2 = payload._ioInfo;
887
+ null != _ioInfo2 && (_ioInfo2.end = performance.now(), _ioInfo2.value.then(noop, noop), rejectDebugValue(error), _ioInfo2.value.status = "rejected", _ioInfo2.value.reason = error);
888
+ void 0 === thenable.status && (thenable.status = "rejected", thenable.reason = error);
889
+ }
890
+ }
891
+ );
892
+ ioInfo = payload._ioInfo;
893
+ if (null != ioInfo) {
894
+ var displayName = thenable.displayName;
895
+ "string" === typeof displayName && (ioInfo.name = displayName);
896
+ }
897
+ -1 === payload._status && (payload._status = 0, payload._result = thenable);
898
+ }
899
+ if (1 === payload._status)
900
+ return ioInfo = payload._result, void 0 === ioInfo && console.error(
901
+ "lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?",
902
+ ioInfo
903
+ ), "default" in ioInfo || console.error(
904
+ "lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",
905
+ ioInfo
906
+ ), ioInfo.default;
907
+ throw payload._result;
908
+ }
909
+ function resolveDispatcher() {
910
+ var dispatcher = ReactSharedInternals.H;
911
+ null === dispatcher && console.error(
912
+ "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."
913
+ );
914
+ return dispatcher;
915
+ }
916
+ function releaseAsyncTransition() {
917
+ ReactSharedInternals.asyncTransitions--;
918
+ }
919
+ function startTransition(scope) {
920
+ var prevTransition = ReactSharedInternals.T, currentTransition = {};
921
+ currentTransition.types = null !== prevTransition ? prevTransition.types : null;
922
+ currentTransition._updatedFibers = /* @__PURE__ */ new Set();
923
+ ReactSharedInternals.T = currentTransition;
924
+ try {
925
+ var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S;
926
+ null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
927
+ "object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && (ReactSharedInternals.asyncTransitions++, returnValue.then(releaseAsyncTransition, releaseAsyncTransition), returnValue.then(noop, reportGlobalError));
928
+ } catch (error) {
929
+ reportGlobalError(error);
930
+ } finally {
931
+ null === prevTransition && currentTransition._updatedFibers && (scope = currentTransition._updatedFibers.size, currentTransition._updatedFibers.clear(), 10 < scope && console.warn(
932
+ "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."
933
+ )), null !== prevTransition && null !== currentTransition.types && (null !== prevTransition.types && prevTransition.types !== currentTransition.types && console.error(
934
+ "We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."
935
+ ), prevTransition.types = currentTransition.types), ReactSharedInternals.T = prevTransition;
936
+ }
937
+ }
938
+ function addTransitionType(type) {
939
+ var transition = ReactSharedInternals.T;
940
+ if (null !== transition) {
941
+ var transitionTypes = transition.types;
942
+ null === transitionTypes ? transition.types = [type] : -1 === transitionTypes.indexOf(type) && transitionTypes.push(type);
943
+ } else
944
+ 0 === ReactSharedInternals.asyncTransitions && console.error(
945
+ "addTransitionType can only be called inside a `startTransition()` callback. It must be associated with a specific Transition."
946
+ ), startTransition(addTransitionType.bind(null, type));
947
+ }
948
+ function enqueueTask(task) {
949
+ if (null === enqueueTaskImpl)
950
+ try {
951
+ var requireString = ("require" + Math.random()).slice(0, 7);
952
+ enqueueTaskImpl = (module && module[requireString]).call(
953
+ module,
954
+ "timers"
955
+ ).setImmediate;
956
+ } catch (_err) {
957
+ enqueueTaskImpl = function(callback) {
958
+ false === didWarnAboutMessageChannel && (didWarnAboutMessageChannel = true, "undefined" === typeof MessageChannel && console.error(
959
+ "This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."
960
+ ));
961
+ var channel = new MessageChannel();
962
+ channel.port1.onmessage = callback;
963
+ channel.port2.postMessage(void 0);
964
+ };
965
+ }
966
+ return enqueueTaskImpl(task);
967
+ }
968
+ function aggregateErrors(errors) {
969
+ return 1 < errors.length && "function" === typeof AggregateError ? new AggregateError(errors) : errors[0];
970
+ }
971
+ function popActScope(prevActQueue, prevActScopeDepth) {
972
+ prevActScopeDepth !== actScopeDepth - 1 && console.error(
973
+ "You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "
974
+ );
975
+ actScopeDepth = prevActScopeDepth;
976
+ }
977
+ function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
978
+ var queue = ReactSharedInternals.actQueue;
979
+ if (null !== queue)
980
+ if (0 !== queue.length)
981
+ try {
982
+ flushActQueue(queue);
983
+ enqueueTask(function() {
984
+ return recursivelyFlushAsyncActWork(returnValue, resolve, reject);
985
+ });
986
+ return;
987
+ } catch (error) {
988
+ ReactSharedInternals.thrownErrors.push(error);
989
+ }
990
+ else ReactSharedInternals.actQueue = null;
991
+ 0 < ReactSharedInternals.thrownErrors.length ? (queue = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, reject(queue)) : resolve(returnValue);
992
+ }
993
+ function flushActQueue(queue) {
994
+ if (!isFlushing) {
995
+ isFlushing = true;
996
+ var i = 0;
997
+ try {
998
+ for (; i < queue.length; i++) {
999
+ var callback = queue[i];
1000
+ do {
1001
+ ReactSharedInternals.didUsePromise = false;
1002
+ var continuation = callback(false);
1003
+ if (null !== continuation) {
1004
+ if (ReactSharedInternals.didUsePromise) {
1005
+ queue[i] = callback;
1006
+ queue.splice(0, i);
1007
+ return;
1008
+ }
1009
+ callback = continuation;
1010
+ } else break;
1011
+ } while (1);
1012
+ }
1013
+ queue.length = 0;
1014
+ } catch (error) {
1015
+ queue.splice(0, i + 1), ReactSharedInternals.thrownErrors.push(error);
1016
+ } finally {
1017
+ isFlushing = false;
1018
+ }
1019
+ }
1020
+ }
1021
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
1022
+ var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo"), REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = /* @__PURE__ */ Symbol.for("react.activity"), REACT_VIEW_TRANSITION_TYPE = /* @__PURE__ */ Symbol.for("react.view_transition"), MAYBE_ITERATOR_SYMBOL = Symbol.iterator, didWarnStateUpdateForUnmountedComponent = {}, ReactNoopUpdateQueue = {
1023
+ isMounted: function() {
1024
+ return false;
1025
+ },
1026
+ enqueueForceUpdate: function(publicInstance) {
1027
+ warnNoop(publicInstance, "forceUpdate");
1028
+ },
1029
+ enqueueReplaceState: function(publicInstance) {
1030
+ warnNoop(publicInstance, "replaceState");
1031
+ },
1032
+ enqueueSetState: function(publicInstance) {
1033
+ warnNoop(publicInstance, "setState");
1034
+ }
1035
+ }, assign = Object.assign, emptyObject = {};
1036
+ Object.freeze(emptyObject);
1037
+ Component.prototype.isReactComponent = {};
1038
+ Component.prototype.setState = function(partialState, callback) {
1039
+ if ("object" !== typeof partialState && "function" !== typeof partialState && null != partialState)
1040
+ throw Error(
1041
+ "takes an object of state variables to update or a function which returns an object of state variables."
1042
+ );
1043
+ this.updater.enqueueSetState(this, partialState, callback, "setState");
1044
+ };
1045
+ Component.prototype.forceUpdate = function(callback) {
1046
+ this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
1047
+ };
1048
+ var deprecatedAPIs = {
1049
+ isMounted: [
1050
+ "isMounted",
1051
+ "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."
1052
+ ],
1053
+ replaceState: [
1054
+ "replaceState",
1055
+ "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."
1056
+ ]
1057
+ };
1058
+ for (fnName in deprecatedAPIs)
1059
+ deprecatedAPIs.hasOwnProperty(fnName) && defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
1060
+ ComponentDummy.prototype = Component.prototype;
1061
+ deprecatedAPIs = PureComponent.prototype = new ComponentDummy();
1062
+ deprecatedAPIs.constructor = PureComponent;
1063
+ assign(deprecatedAPIs, Component.prototype);
1064
+ deprecatedAPIs.isPureReactComponent = true;
1065
+ var isArrayImpl = Array.isArray, REACT_CLIENT_REFERENCE = /* @__PURE__ */ Symbol.for("react.client.reference"), ReactSharedInternals = {
1066
+ H: null,
1067
+ A: null,
1068
+ T: null,
1069
+ S: null,
1070
+ actQueue: null,
1071
+ asyncTransitions: 0,
1072
+ isBatchingLegacy: false,
1073
+ didScheduleLegacyUpdate: false,
1074
+ didUsePromise: false,
1075
+ thrownErrors: [],
1076
+ getCurrentStack: null,
1077
+ recentlyCreatedOwnerStacks: 0
1078
+ }, hasOwnProperty = Object.prototype.hasOwnProperty, createTask = console.createTask ? console.createTask : function() {
1079
+ return null;
1080
+ };
1081
+ deprecatedAPIs = {
1082
+ react_stack_bottom_frame: function(callStackForError) {
1083
+ return callStackForError();
1084
+ }
1085
+ };
1086
+ var specialPropKeyWarningShown, didWarnAboutOldJSXRuntime;
1087
+ var didWarnAboutElementRef = {};
1088
+ var unknownOwnerDebugStack = deprecatedAPIs.react_stack_bottom_frame.bind(
1089
+ deprecatedAPIs,
1090
+ UnknownOwner
1091
+ )();
1092
+ var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
1093
+ var didWarnAboutMaps = false, userProvidedKeyEscapeRegex = /\/+/g, reportGlobalError = "function" === typeof reportError ? reportError : function(error) {
1094
+ if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
1095
+ var event = new window.ErrorEvent("error", {
1096
+ bubbles: true,
1097
+ cancelable: true,
1098
+ message: "object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error),
1099
+ error
1100
+ });
1101
+ if (!window.dispatchEvent(event)) return;
1102
+ } else if ("object" === typeof process && "function" === typeof process.emit) {
1103
+ process.emit("uncaughtException", error);
1104
+ return;
1105
+ }
1106
+ console.error(error);
1107
+ }, didWarnAboutMessageChannel = false, enqueueTaskImpl = null, actScopeDepth = 0, didWarnNoAwaitAct = false, isFlushing = false, queueSeveralMicrotasks = "function" === typeof queueMicrotask ? function(callback) {
1108
+ queueMicrotask(function() {
1109
+ return queueMicrotask(callback);
1110
+ });
1111
+ } : enqueueTask;
1112
+ deprecatedAPIs = Object.freeze({
1113
+ __proto__: null,
1114
+ c: function(size) {
1115
+ return resolveDispatcher().useMemoCache(size);
1116
+ }
1117
+ });
1118
+ var fnName = {
1119
+ map: mapChildren,
1120
+ forEach: function(children, forEachFunc, forEachContext) {
1121
+ mapChildren(
1122
+ children,
1123
+ function() {
1124
+ forEachFunc.apply(this, arguments);
1125
+ },
1126
+ forEachContext
1127
+ );
1128
+ },
1129
+ count: function(children) {
1130
+ var n = 0;
1131
+ mapChildren(children, function() {
1132
+ n++;
1133
+ });
1134
+ return n;
1135
+ },
1136
+ toArray: function(children) {
1137
+ return mapChildren(children, function(child) {
1138
+ return child;
1139
+ }) || [];
1140
+ },
1141
+ only: function(children) {
1142
+ if (!isValidElement(children))
1143
+ throw Error(
1144
+ "React.Children.only expected to receive a single React element child."
1145
+ );
1146
+ return children;
1147
+ }
1148
+ };
1149
+ exports.Activity = REACT_ACTIVITY_TYPE;
1150
+ exports.Children = fnName;
1151
+ exports.Component = Component;
1152
+ exports.Fragment = REACT_FRAGMENT_TYPE;
1153
+ exports.Profiler = REACT_PROFILER_TYPE;
1154
+ exports.PureComponent = PureComponent;
1155
+ exports.StrictMode = REACT_STRICT_MODE_TYPE;
1156
+ exports.Suspense = REACT_SUSPENSE_TYPE;
1157
+ exports.ViewTransition = REACT_VIEW_TRANSITION_TYPE;
1158
+ exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
1159
+ exports.__COMPILER_RUNTIME = deprecatedAPIs;
1160
+ exports.act = function(callback) {
1161
+ var prevActQueue = ReactSharedInternals.actQueue, prevActScopeDepth = actScopeDepth;
1162
+ actScopeDepth++;
1163
+ var queue = ReactSharedInternals.actQueue = null !== prevActQueue ? prevActQueue : [], didAwaitActCall = false;
1164
+ try {
1165
+ var result = callback();
1166
+ } catch (error) {
1167
+ ReactSharedInternals.thrownErrors.push(error);
1168
+ }
1169
+ if (0 < ReactSharedInternals.thrownErrors.length)
1170
+ throw popActScope(prevActQueue, prevActScopeDepth), callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
1171
+ if (null !== result && "object" === typeof result && "function" === typeof result.then) {
1172
+ var thenable = result;
1173
+ queueSeveralMicrotasks(function() {
1174
+ didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = true, console.error(
1175
+ "You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"
1176
+ ));
1177
+ });
1178
+ return {
1179
+ then: function(resolve, reject) {
1180
+ didAwaitActCall = true;
1181
+ thenable.then(
1182
+ function(returnValue) {
1183
+ popActScope(prevActQueue, prevActScopeDepth);
1184
+ if (0 === prevActScopeDepth) {
1185
+ try {
1186
+ flushActQueue(queue), enqueueTask(function() {
1187
+ return recursivelyFlushAsyncActWork(
1188
+ returnValue,
1189
+ resolve,
1190
+ reject
1191
+ );
1192
+ });
1193
+ } catch (error$0) {
1194
+ ReactSharedInternals.thrownErrors.push(error$0);
1195
+ }
1196
+ if (0 < ReactSharedInternals.thrownErrors.length) {
1197
+ var _thrownError = aggregateErrors(
1198
+ ReactSharedInternals.thrownErrors
1199
+ );
1200
+ ReactSharedInternals.thrownErrors.length = 0;
1201
+ reject(_thrownError);
1202
+ }
1203
+ } else resolve(returnValue);
1204
+ },
1205
+ function(error) {
1206
+ popActScope(prevActQueue, prevActScopeDepth);
1207
+ 0 < ReactSharedInternals.thrownErrors.length ? (error = aggregateErrors(
1208
+ ReactSharedInternals.thrownErrors
1209
+ ), ReactSharedInternals.thrownErrors.length = 0, reject(error)) : reject(error);
1210
+ }
1211
+ );
1212
+ }
1213
+ };
1214
+ }
1215
+ var returnValue$jscomp$0 = result;
1216
+ popActScope(prevActQueue, prevActScopeDepth);
1217
+ 0 === prevActScopeDepth && (flushActQueue(queue), 0 !== queue.length && queueSeveralMicrotasks(function() {
1218
+ didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = true, console.error(
1219
+ "A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"
1220
+ ));
1221
+ }), ReactSharedInternals.actQueue = null);
1222
+ if (0 < ReactSharedInternals.thrownErrors.length)
1223
+ throw callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
1224
+ return {
1225
+ then: function(resolve, reject) {
1226
+ didAwaitActCall = true;
1227
+ 0 === prevActScopeDepth ? (ReactSharedInternals.actQueue = queue, enqueueTask(function() {
1228
+ return recursivelyFlushAsyncActWork(
1229
+ returnValue$jscomp$0,
1230
+ resolve,
1231
+ reject
1232
+ );
1233
+ })) : resolve(returnValue$jscomp$0);
1234
+ }
1235
+ };
1236
+ };
1237
+ exports.addTransitionType = addTransitionType;
1238
+ exports.cache = function(fn) {
1239
+ return function() {
1240
+ return fn.apply(null, arguments);
1241
+ };
1242
+ };
1243
+ exports.cacheSignal = function() {
1244
+ return null;
1245
+ };
1246
+ exports.captureOwnerStack = function() {
1247
+ var getCurrentStack = ReactSharedInternals.getCurrentStack;
1248
+ return null === getCurrentStack ? null : getCurrentStack();
1249
+ };
1250
+ exports.cloneElement = function(element, config, children) {
1251
+ if (null === element || void 0 === element)
1252
+ throw Error(
1253
+ "The argument must be a React element, but you passed " + element + "."
1254
+ );
1255
+ var props = assign({}, element.props), key = element.key, owner = element._owner;
1256
+ if (null != config) {
1257
+ var JSCompiler_inline_result;
1258
+ a: {
1259
+ if (hasOwnProperty.call(config, "ref") && (JSCompiler_inline_result = Object.getOwnPropertyDescriptor(
1260
+ config,
1261
+ "ref"
1262
+ ).get) && JSCompiler_inline_result.isReactWarning) {
1263
+ JSCompiler_inline_result = false;
1264
+ break a;
1265
+ }
1266
+ JSCompiler_inline_result = void 0 !== config.ref;
1267
+ }
1268
+ JSCompiler_inline_result && (owner = getOwner());
1269
+ hasValidKey(config) && (checkKeyStringCoercion(config.key), key = "" + config.key);
1270
+ for (propName in config)
1271
+ !hasOwnProperty.call(config, propName) || "key" === propName || "__self" === propName || "__source" === propName || "ref" === propName && void 0 === config.ref || (props[propName] = config[propName]);
1272
+ }
1273
+ var propName = arguments.length - 2;
1274
+ if (1 === propName) props.children = children;
1275
+ else if (1 < propName) {
1276
+ JSCompiler_inline_result = Array(propName);
1277
+ for (var i = 0; i < propName; i++)
1278
+ JSCompiler_inline_result[i] = arguments[i + 2];
1279
+ props.children = JSCompiler_inline_result;
1280
+ }
1281
+ props = ReactElement(
1282
+ element.type,
1283
+ key,
1284
+ props,
1285
+ owner,
1286
+ element._debugStack,
1287
+ element._debugTask
1288
+ );
1289
+ for (key = 2; key < arguments.length; key++)
1290
+ validateChildKeys(arguments[key]);
1291
+ return props;
1292
+ };
1293
+ exports.createContext = function(defaultValue) {
1294
+ defaultValue = {
1295
+ $$typeof: REACT_CONTEXT_TYPE,
1296
+ _currentValue: defaultValue,
1297
+ _currentValue2: defaultValue,
1298
+ _threadCount: 0,
1299
+ Provider: null,
1300
+ Consumer: null
1301
+ };
1302
+ defaultValue.Provider = defaultValue;
1303
+ defaultValue.Consumer = {
1304
+ $$typeof: REACT_CONSUMER_TYPE,
1305
+ _context: defaultValue
1306
+ };
1307
+ defaultValue._currentRenderer = null;
1308
+ defaultValue._currentRenderer2 = null;
1309
+ return defaultValue;
1310
+ };
1311
+ exports.createElement = function(type, config, children) {
1312
+ for (var i = 2; i < arguments.length; i++)
1313
+ validateChildKeys(arguments[i]);
1314
+ var propName;
1315
+ i = {};
1316
+ var key = null;
1317
+ if (null != config)
1318
+ for (propName in didWarnAboutOldJSXRuntime || !("__self" in config) || "key" in config || (didWarnAboutOldJSXRuntime = true, console.warn(
1319
+ "Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform"
1320
+ )), hasValidKey(config) && (checkKeyStringCoercion(config.key), key = "" + config.key), config)
1321
+ hasOwnProperty.call(config, propName) && "key" !== propName && "__self" !== propName && "__source" !== propName && (i[propName] = config[propName]);
1322
+ var childrenLength = arguments.length - 2;
1323
+ if (1 === childrenLength) i.children = children;
1324
+ else if (1 < childrenLength) {
1325
+ for (var childArray = Array(childrenLength), _i = 0; _i < childrenLength; _i++)
1326
+ childArray[_i] = arguments[_i + 2];
1327
+ Object.freeze && Object.freeze(childArray);
1328
+ i.children = childArray;
1329
+ }
1330
+ if (type && type.defaultProps)
1331
+ for (propName in childrenLength = type.defaultProps, childrenLength)
1332
+ void 0 === i[propName] && (i[propName] = childrenLength[propName]);
1333
+ key && defineKeyPropWarningGetter(
1334
+ i,
1335
+ "function" === typeof type ? type.displayName || type.name || "Unknown" : type
1336
+ );
1337
+ (propName = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++) ? (childArray = Error.stackTraceLimit, Error.stackTraceLimit = 10, childrenLength = Error("react-stack-top-frame"), Error.stackTraceLimit = childArray) : childrenLength = unknownOwnerDebugStack;
1338
+ return ReactElement(
1339
+ type,
1340
+ key,
1341
+ i,
1342
+ getOwner(),
1343
+ childrenLength,
1344
+ propName ? createTask(getTaskName(type)) : unknownOwnerDebugTask
1345
+ );
1346
+ };
1347
+ exports.createRef = function() {
1348
+ var refObject = { current: null };
1349
+ Object.seal(refObject);
1350
+ return refObject;
1351
+ };
1352
+ exports.forwardRef = function(render) {
1353
+ null != render && render.$$typeof === REACT_MEMO_TYPE ? console.error(
1354
+ "forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."
1355
+ ) : "function" !== typeof render ? console.error(
1356
+ "forwardRef requires a render function but was given %s.",
1357
+ null === render ? "null" : typeof render
1358
+ ) : 0 !== render.length && 2 !== render.length && console.error(
1359
+ "forwardRef render functions accept exactly two parameters: props and ref. %s",
1360
+ 1 === render.length ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined."
1361
+ );
1362
+ null != render && null != render.defaultProps && console.error(
1363
+ "forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?"
1364
+ );
1365
+ var elementType = { $$typeof: REACT_FORWARD_REF_TYPE, render }, ownName;
1366
+ Object.defineProperty(elementType, "displayName", {
1367
+ enumerable: false,
1368
+ configurable: true,
1369
+ get: function() {
1370
+ return ownName;
1371
+ },
1372
+ set: function(name) {
1373
+ ownName = name;
1374
+ render.name || render.displayName || (Object.defineProperty(render, "name", { value: name }), render.displayName = name);
1375
+ }
1376
+ });
1377
+ return elementType;
1378
+ };
1379
+ exports.isValidElement = isValidElement;
1380
+ exports.lazy = function(ctor) {
1381
+ ctor = { _status: -1, _result: ctor };
1382
+ var lazyType = {
1383
+ $$typeof: REACT_LAZY_TYPE,
1384
+ _payload: ctor,
1385
+ _init: lazyInitializer
1386
+ }, ioInfo = {
1387
+ name: "lazy",
1388
+ start: -1,
1389
+ end: -1,
1390
+ value: null,
1391
+ owner: null,
1392
+ debugStack: Error("react-stack-top-frame"),
1393
+ debugTask: console.createTask ? console.createTask("lazy()") : null
1394
+ };
1395
+ ctor._ioInfo = ioInfo;
1396
+ lazyType._debugInfo = [{ awaited: ioInfo }];
1397
+ return lazyType;
1398
+ };
1399
+ exports.memo = function(type, compare) {
1400
+ null == type && console.error(
1401
+ "memo: The first argument must be a component. Instead received: %s",
1402
+ null === type ? "null" : typeof type
1403
+ );
1404
+ compare = {
1405
+ $$typeof: REACT_MEMO_TYPE,
1406
+ type,
1407
+ compare: void 0 === compare ? null : compare
1408
+ };
1409
+ var ownName;
1410
+ Object.defineProperty(compare, "displayName", {
1411
+ enumerable: false,
1412
+ configurable: true,
1413
+ get: function() {
1414
+ return ownName;
1415
+ },
1416
+ set: function(name) {
1417
+ ownName = name;
1418
+ type.name || type.displayName || (Object.defineProperty(type, "name", { value: name }), type.displayName = name);
1419
+ }
1420
+ });
1421
+ return compare;
1422
+ };
1423
+ exports.startTransition = startTransition;
1424
+ exports.unstable_useCacheRefresh = function() {
1425
+ return resolveDispatcher().useCacheRefresh();
1426
+ };
1427
+ exports.use = function(usable) {
1428
+ return resolveDispatcher().use(usable);
1429
+ };
1430
+ exports.useActionState = function(action, initialState, permalink) {
1431
+ return resolveDispatcher().useActionState(
1432
+ action,
1433
+ initialState,
1434
+ permalink
1435
+ );
1436
+ };
1437
+ exports.useCallback = function(callback, deps) {
1438
+ return resolveDispatcher().useCallback(callback, deps);
1439
+ };
1440
+ exports.useContext = function(Context) {
1441
+ var dispatcher = resolveDispatcher();
1442
+ Context.$$typeof === REACT_CONSUMER_TYPE && console.error(
1443
+ "Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"
1444
+ );
1445
+ return dispatcher.useContext(Context);
1446
+ };
1447
+ exports.useDebugValue = function(value, formatterFn) {
1448
+ return resolveDispatcher().useDebugValue(value, formatterFn);
1449
+ };
1450
+ exports.useDeferredValue = function(value, initialValue) {
1451
+ return resolveDispatcher().useDeferredValue(value, initialValue);
1452
+ };
1453
+ exports.useEffect = function(create, deps) {
1454
+ null == create && console.warn(
1455
+ "React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"
1456
+ );
1457
+ return resolveDispatcher().useEffect(create, deps);
1458
+ };
1459
+ exports.useEffectEvent = function(callback) {
1460
+ return resolveDispatcher().useEffectEvent(callback);
1461
+ };
1462
+ exports.useId = function() {
1463
+ return resolveDispatcher().useId();
1464
+ };
1465
+ exports.useImperativeHandle = function(ref, create, deps) {
1466
+ return resolveDispatcher().useImperativeHandle(ref, create, deps);
1467
+ };
1468
+ exports.useInsertionEffect = function(create, deps) {
1469
+ null == create && console.warn(
1470
+ "React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"
1471
+ );
1472
+ return resolveDispatcher().useInsertionEffect(create, deps);
1473
+ };
1474
+ exports.useLayoutEffect = function(create, deps) {
1475
+ null == create && console.warn(
1476
+ "React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"
1477
+ );
1478
+ return resolveDispatcher().useLayoutEffect(create, deps);
1479
+ };
1480
+ exports.useMemo = function(create, deps) {
1481
+ return resolveDispatcher().useMemo(create, deps);
1482
+ };
1483
+ exports.useOptimistic = function(passthrough, reducer) {
1484
+ return resolveDispatcher().useOptimistic(passthrough, reducer);
1485
+ };
1486
+ exports.useReducer = function(reducer, initialArg, init) {
1487
+ return resolveDispatcher().useReducer(reducer, initialArg, init);
1488
+ };
1489
+ exports.useRef = function(initialValue) {
1490
+ return resolveDispatcher().useRef(initialValue);
1491
+ };
1492
+ exports.useState = function(initialState) {
1493
+ return resolveDispatcher().useState(initialState);
1494
+ };
1495
+ exports.useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) {
1496
+ return resolveDispatcher().useSyncExternalStore(
1497
+ subscribe,
1498
+ getSnapshot,
1499
+ getServerSnapshot
1500
+ );
1501
+ };
1502
+ exports.useTransition = function() {
1503
+ return resolveDispatcher().useTransition();
1504
+ };
1505
+ exports.version = "19.3.1";
1506
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
1507
+ })();
1508
+ }
1509
+ });
1510
+
1511
+ // ../../node_modules/.pnpm/react@19.3.1/node_modules/react/index.js
1512
+ var require_react = __commonJS({
1513
+ "../../node_modules/.pnpm/react@19.3.1/node_modules/react/index.js"(exports, module) {
1514
+ "use strict";
1515
+ if (process.env.NODE_ENV === "production") {
1516
+ module.exports = require_react_production();
1517
+ } else {
1518
+ module.exports = require_react_development();
1519
+ }
1520
+ }
1521
+ });
1522
+
1523
+ // ../../node_modules/.pnpm/react@19.3.1/node_modules/react/cjs/react-jsx-runtime.development.js
1524
+ var require_react_jsx_runtime_development = __commonJS({
1525
+ "../../node_modules/.pnpm/react@19.3.1/node_modules/react/cjs/react-jsx-runtime.development.js"(exports) {
1526
+ "use strict";
1527
+ "production" !== process.env.NODE_ENV && (function() {
1528
+ function getComponentNameFromType(type) {
1529
+ if (null == type) return null;
1530
+ if ("function" === typeof type)
1531
+ return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
1532
+ if ("string" === typeof type) return type;
1533
+ switch (type) {
1534
+ case REACT_FRAGMENT_TYPE:
1535
+ return "Fragment";
1536
+ case REACT_PROFILER_TYPE:
1537
+ return "Profiler";
1538
+ case REACT_STRICT_MODE_TYPE:
1539
+ return "StrictMode";
1540
+ case REACT_SUSPENSE_TYPE:
1541
+ return "Suspense";
1542
+ case REACT_SUSPENSE_LIST_TYPE:
1543
+ return "SuspenseList";
1544
+ case REACT_ACTIVITY_TYPE:
1545
+ return "Activity";
1546
+ case REACT_VIEW_TRANSITION_TYPE:
1547
+ return "ViewTransition";
1548
+ }
1549
+ if ("object" === typeof type)
1550
+ switch ("number" === typeof type.tag && console.error(
1551
+ "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
1552
+ ), type.$$typeof) {
1553
+ case REACT_PORTAL_TYPE:
1554
+ return "Portal";
1555
+ case REACT_CONTEXT_TYPE:
1556
+ return type.displayName || "Context";
1557
+ case REACT_CONSUMER_TYPE:
1558
+ return (type._context.displayName || "Context") + ".Consumer";
1559
+ case REACT_FORWARD_REF_TYPE:
1560
+ var innerType = type.render;
1561
+ type = type.displayName;
1562
+ type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
1563
+ return type;
1564
+ case REACT_MEMO_TYPE:
1565
+ return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
1566
+ case REACT_LAZY_TYPE:
1567
+ innerType = type._payload;
1568
+ type = type._init;
1569
+ try {
1570
+ return getComponentNameFromType(type(innerType));
1571
+ } catch (x) {
1572
+ }
1573
+ }
1574
+ return null;
1575
+ }
1576
+ function testStringCoercion(value) {
1577
+ return "" + value;
1578
+ }
1579
+ function checkKeyStringCoercion(value) {
1580
+ try {
1581
+ testStringCoercion(value);
1582
+ var JSCompiler_inline_result = false;
1583
+ } catch (e) {
1584
+ JSCompiler_inline_result = true;
1585
+ }
1586
+ if (JSCompiler_inline_result) {
1587
+ JSCompiler_inline_result = console;
1588
+ var JSCompiler_temp_const = JSCompiler_inline_result.error;
1589
+ var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
1590
+ JSCompiler_temp_const.call(
1591
+ JSCompiler_inline_result,
1592
+ "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
1593
+ JSCompiler_inline_result$jscomp$0
1594
+ );
1595
+ return testStringCoercion(value);
1596
+ }
1597
+ }
1598
+ function getTaskName(type) {
1599
+ if (type === REACT_FRAGMENT_TYPE) return "<>";
1600
+ if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE)
1601
+ return "<...>";
1602
+ try {
1603
+ var name = getComponentNameFromType(type);
1604
+ return name ? "<" + name + ">" : "<...>";
1605
+ } catch (x) {
1606
+ return "<...>";
1607
+ }
1608
+ }
1609
+ function getOwner() {
1610
+ var dispatcher = ReactSharedInternals.A;
1611
+ return null === dispatcher ? null : dispatcher.getOwner();
1612
+ }
1613
+ function UnknownOwner() {
1614
+ return Error("react-stack-top-frame");
1615
+ }
1616
+ function hasValidKey(config) {
1617
+ if (hasOwnProperty.call(config, "key")) {
1618
+ var getter = Object.getOwnPropertyDescriptor(config, "key").get;
1619
+ if (getter && getter.isReactWarning) return false;
1620
+ }
1621
+ return void 0 !== config.key;
1622
+ }
1623
+ function defineKeyPropWarningGetter(props, displayName) {
1624
+ function warnAboutAccessingKey() {
1625
+ specialPropKeyWarningShown || (specialPropKeyWarningShown = true, console.error(
1626
+ "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
1627
+ displayName
1628
+ ));
1629
+ }
1630
+ warnAboutAccessingKey.isReactWarning = true;
1631
+ Object.defineProperty(props, "key", {
1632
+ get: warnAboutAccessingKey,
1633
+ configurable: true
1634
+ });
1635
+ }
1636
+ function elementRefGetterWithDeprecationWarning() {
1637
+ var componentName = getComponentNameFromType(this.type);
1638
+ didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = true, console.error(
1639
+ "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
1640
+ ));
1641
+ componentName = this.props.ref;
1642
+ return void 0 !== componentName ? componentName : null;
1643
+ }
1644
+ function ReactElement(type, key, props, owner, debugStack, debugTask) {
1645
+ var refProp = props.ref;
1646
+ type = {
1647
+ $$typeof: REACT_ELEMENT_TYPE,
1648
+ type,
1649
+ key,
1650
+ props,
1651
+ _owner: owner
1652
+ };
1653
+ null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type, "ref", {
1654
+ enumerable: false,
1655
+ get: elementRefGetterWithDeprecationWarning
1656
+ }) : Object.defineProperty(type, "ref", { enumerable: false, value: null });
1657
+ type._store = {};
1658
+ Object.defineProperty(type._store, "validated", {
1659
+ configurable: false,
1660
+ enumerable: false,
1661
+ writable: true,
1662
+ value: 0
1663
+ });
1664
+ Object.defineProperty(type, "_debugInfo", {
1665
+ configurable: false,
1666
+ enumerable: false,
1667
+ writable: true,
1668
+ value: null
1669
+ });
1670
+ Object.defineProperty(type, "_debugStack", {
1671
+ configurable: false,
1672
+ enumerable: false,
1673
+ writable: true,
1674
+ value: debugStack
1675
+ });
1676
+ Object.defineProperty(type, "_debugTask", {
1677
+ configurable: false,
1678
+ enumerable: false,
1679
+ writable: true,
1680
+ value: debugTask
1681
+ });
1682
+ Object.freeze && (Object.freeze(type.props), Object.freeze(type));
1683
+ return type;
1684
+ }
1685
+ function jsxDEVImpl(type, config, maybeKey, isStaticChildren, debugStack, debugTask) {
1686
+ var children = config.children;
1687
+ if (void 0 !== children)
1688
+ if (isStaticChildren)
1689
+ if (isArrayImpl(children)) {
1690
+ for (isStaticChildren = 0; isStaticChildren < children.length; isStaticChildren++)
1691
+ validateChildKeys(children[isStaticChildren]);
1692
+ Object.freeze && Object.freeze(children);
1693
+ } else
1694
+ console.error(
1695
+ "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
1696
+ );
1697
+ else validateChildKeys(children);
1698
+ if (hasOwnProperty.call(config, "key")) {
1699
+ children = getComponentNameFromType(type);
1700
+ var keys = Object.keys(config).filter(function(k) {
1701
+ return "key" !== k;
1702
+ });
1703
+ isStaticChildren = 0 < keys.length ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
1704
+ didWarnAboutKeySpread[children + isStaticChildren] || (keys = 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}", console.error(
1705
+ 'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',
1706
+ isStaticChildren,
1707
+ children,
1708
+ keys,
1709
+ children
1710
+ ), didWarnAboutKeySpread[children + isStaticChildren] = true);
1711
+ }
1712
+ children = null;
1713
+ void 0 !== maybeKey && (checkKeyStringCoercion(maybeKey), children = "" + maybeKey);
1714
+ hasValidKey(config) && (checkKeyStringCoercion(config.key), children = "" + config.key);
1715
+ if ("key" in config) {
1716
+ maybeKey = {};
1717
+ for (var propName in config)
1718
+ "key" !== propName && (maybeKey[propName] = config[propName]);
1719
+ } else maybeKey = config;
1720
+ children && defineKeyPropWarningGetter(
1721
+ maybeKey,
1722
+ "function" === typeof type ? type.displayName || type.name || "Unknown" : type
1723
+ );
1724
+ return ReactElement(
1725
+ type,
1726
+ children,
1727
+ maybeKey,
1728
+ getOwner(),
1729
+ debugStack,
1730
+ debugTask
1731
+ );
1732
+ }
1733
+ function validateChildKeys(node) {
1734
+ isValidElement(node) ? node._store && (node._store.validated = 1) : "object" === typeof node && null !== node && node.$$typeof === REACT_LAZY_TYPE && ("fulfilled" === node._payload.status ? isValidElement(node._payload.value) && node._payload.value._store && (node._payload.value._store.validated = 1) : node._store && (node._store.validated = 1));
1735
+ }
1736
+ function isValidElement(object) {
1737
+ return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
1738
+ }
1739
+ var React = require_react(), REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo"), REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = /* @__PURE__ */ Symbol.for("react.activity"), REACT_VIEW_TRANSITION_TYPE = /* @__PURE__ */ Symbol.for("react.view_transition"), REACT_CLIENT_REFERENCE = /* @__PURE__ */ Symbol.for("react.client.reference"), ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, hasOwnProperty = Object.prototype.hasOwnProperty, isArrayImpl = Array.isArray, createTask = console.createTask ? console.createTask : function() {
1740
+ return null;
1741
+ };
1742
+ React = {
1743
+ react_stack_bottom_frame: function(callStackForError) {
1744
+ return callStackForError();
1745
+ }
1746
+ };
1747
+ var specialPropKeyWarningShown;
1748
+ var didWarnAboutElementRef = {};
1749
+ var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(
1750
+ React,
1751
+ UnknownOwner
1752
+ )();
1753
+ var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
1754
+ var didWarnAboutKeySpread = {};
1755
+ exports.Fragment = REACT_FRAGMENT_TYPE;
1756
+ exports.jsx = function(type, config, maybeKey) {
1757
+ var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
1758
+ if (trackActualOwner) {
1759
+ var previousStackTraceLimit = Error.stackTraceLimit;
1760
+ Error.stackTraceLimit = 10;
1761
+ var debugStackDEV = Error("react-stack-top-frame");
1762
+ Error.stackTraceLimit = previousStackTraceLimit;
1763
+ } else debugStackDEV = unknownOwnerDebugStack;
1764
+ return jsxDEVImpl(
1765
+ type,
1766
+ config,
1767
+ maybeKey,
1768
+ false,
1769
+ debugStackDEV,
1770
+ trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
1771
+ );
1772
+ };
1773
+ exports.jsxs = function(type, config, maybeKey) {
1774
+ var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
1775
+ if (trackActualOwner) {
1776
+ var previousStackTraceLimit = Error.stackTraceLimit;
1777
+ Error.stackTraceLimit = 10;
1778
+ var debugStackDEV = Error("react-stack-top-frame");
1779
+ Error.stackTraceLimit = previousStackTraceLimit;
1780
+ } else debugStackDEV = unknownOwnerDebugStack;
1781
+ return jsxDEVImpl(
1782
+ type,
1783
+ config,
1784
+ maybeKey,
1785
+ true,
1786
+ debugStackDEV,
1787
+ trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
1788
+ );
1789
+ };
1790
+ })();
1791
+ }
1792
+ });
1793
+
1794
+ // ../../node_modules/.pnpm/react@19.3.1/node_modules/react/jsx-runtime.js
1795
+ var require_jsx_runtime = __commonJS({
1796
+ "../../node_modules/.pnpm/react@19.3.1/node_modules/react/jsx-runtime.js"(exports, module) {
1797
+ "use strict";
1798
+ if (process.env.NODE_ENV === "production") {
1799
+ module.exports = require_react_jsx_runtime_production();
1800
+ } else {
1801
+ module.exports = require_react_jsx_runtime_development();
1802
+ }
1803
+ }
1804
+ });
1805
+
1806
+ // src/cli.ts
1807
+ import { readFile, stat } from "node:fs/promises";
1808
+
1809
+ // ../diagrams/src/grid/camera.ts
1810
+ var pen = typeof document !== "undefined" ? document.createElement("canvas").getContext("2d") : null;
1811
+
1812
+ // ../diagrams/src/grid/input.ts
1813
+ var GRID_INPUTS = [1];
1814
+ var ids = (list) => (list ?? []).map((x) => x.id);
1815
+ function twice(list) {
1816
+ const seen = /* @__PURE__ */ new Set();
1817
+ const out = [];
1818
+ for (const id of list) {
1819
+ if (seen.has(id)) out.push(id);
1820
+ seen.add(id);
1821
+ }
1822
+ return [...new Set(out)];
1823
+ }
1824
+ var wrongKind = (input) => input?.kind !== "grid" || input?.input === void 0 || !GRID_INPUTS.includes(input.input) ? `not a grid input this canvas reads: kind ${input?.kind ?? "(none)"}, input ${input?.input ?? "(none)"}; it reads grid ${GRID_INPUTS.join(", ")}` : null;
1825
+ function shapeProblems(input) {
1826
+ const out = [];
1827
+ if (!input.columns?.length) out.push("no columns");
1828
+ if (!input.rows?.length) out.push("no rows");
1829
+ for (const [what, list] of [
1830
+ ["column", ids(input.columns)],
1831
+ ["row", ids(input.rows)],
1832
+ ["box", ids(input.boxes)]
1833
+ ])
1834
+ for (const id of twice(list)) out.push(`${what} ${id} appears twice`);
1835
+ return out;
1836
+ }
1837
+ var spanOf = (b) => {
1838
+ const span = b.span ?? 1;
1839
+ return Number.isInteger(span) && span >= 1 ? span : null;
1840
+ };
1841
+ function spanProblem(b, at, cols) {
1842
+ const span = spanOf(b);
1843
+ if (span === null) return `box ${b.id}: span must be a whole number from 1`;
1844
+ return at + span > cols ? `box ${b.id}: spans past the last column` : null;
1845
+ }
1846
+ function placeProblems(b, row, at, cols) {
1847
+ if (!row || at < 0)
1848
+ return [
1849
+ !row && `box ${b.id}: unknown row ${b.row}`,
1850
+ at < 0 && `box ${b.id}: unknown column ${b.column}`
1851
+ ].filter((m) => Boolean(m));
1852
+ return [
1853
+ row.kind === "divider" && `box ${b.id}: a divider row holds no box`,
1854
+ spanProblem(b, at, cols)
1855
+ ].filter((m) => Boolean(m));
1856
+ }
1857
+ function cellsOf(b, rows, cols) {
1858
+ const at = cols.indexOf(b.column);
1859
+ const span = spanOf(b);
1860
+ if (!rows.has(b.row) || at < 0 || span === null) return [];
1861
+ const end = Math.min(at + span, cols.length);
1862
+ return Array.from({ length: end - at }, (_, k) => `${b.row}|${at + k}`);
1863
+ }
1864
+ function overlapProblems(boxes, rows, cols) {
1865
+ const out = [];
1866
+ const covered = /* @__PURE__ */ new Map();
1867
+ for (const b of boxes) {
1868
+ const span = spanOf(b) ?? 0;
1869
+ for (const key of cellsOf(b, rows, cols)) {
1870
+ const other = covered.get(key);
1871
+ if (other && (other.span > 1 || span > 1))
1872
+ out.push(`box ${b.id}: overlaps box ${other.id} in row ${b.row}`);
1873
+ covered.set(key, { id: b.id, span });
1874
+ }
1875
+ }
1876
+ return out;
1877
+ }
1878
+ function arrowProblems(arrows, boxes) {
1879
+ const known = new Set(ids(boxes));
1880
+ return (arrows ?? []).flatMap(
1881
+ (a) => [a.from, a.to].filter((end) => !known.has(String(end).split("#")[0] ?? "")).map((end) => `arrow ${a.from} \u2192 ${a.to}: unknown box ${end}`)
1882
+ );
1883
+ }
1884
+ function problemsOf(input) {
1885
+ const kind = wrongKind(input);
1886
+ if (kind) return [kind];
1887
+ if (!input)
1888
+ return [
1889
+ `not a grid input this canvas reads: kind (none), input (none); it reads grid ${GRID_INPUTS.join(", ")}`
1890
+ ];
1891
+ const cols = ids(input.columns);
1892
+ const rows = new Map((input.rows ?? []).map((r) => [r.id, r]));
1893
+ const boxes = input.boxes ?? [];
1894
+ return [
1895
+ ...shapeProblems(input),
1896
+ ...boxes.flatMap((b) => placeProblems(b, rows.get(b.row), cols.indexOf(b.column), cols.length)),
1897
+ ...overlapProblems(boxes, rows, cols),
1898
+ ...arrowProblems(input.arrows, boxes)
1899
+ ];
1900
+ }
1901
+
1902
+ // ../diagrams/src/grid/grid-canvas.tsx
1903
+ var import_react = __toESM(require_react(), 1);
1904
+ var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
1905
+ var Ctx = (0, import_react.createContext)(null);
1906
+
1907
+ // ../diagrams/src/grid/capability.ts
1908
+ var SCREEN = "scr";
1909
+ function screenKey(flow, box) {
1910
+ const d = flow.details?.[box.id];
1911
+ return d?.rows?.find((r) => r.label === "Screen")?.value ?? box.title;
1912
+ }
1913
+ function screenColumns(flow) {
1914
+ const cols = flow.columns ?? [];
1915
+ const at = /* @__PURE__ */ new Map();
1916
+ for (const b of (flow.boxes ?? []).filter((x) => x.kind === SCREEN)) {
1917
+ const i = cols.findIndex((c) => c.id === b.column);
1918
+ for (const c of cols.slice(i, i + (b.span ?? 1))) at.set(c.id, screenKey(flow, b));
1919
+ }
1920
+ return at;
1921
+ }
1922
+ function screenAtStep(flow) {
1923
+ const cols = flow.columns ?? [];
1924
+ const at = screenColumns(flow);
1925
+ let last = cols.map((c) => at.get(c.id)).find(Boolean);
1926
+ for (const c of cols) {
1927
+ last = at.get(c.id) ?? last;
1928
+ if (last) at.set(c.id, last);
1929
+ }
1930
+ return at;
1931
+ }
1932
+ function screensInOrder(flows) {
1933
+ const rank = /* @__PURE__ */ new Map();
1934
+ for (const f of flows) {
1935
+ (f.boxes ?? []).filter((b) => b.kind === SCREEN).forEach((b, i) => {
1936
+ const k = screenKey(f, b);
1937
+ const was = rank.get(k);
1938
+ if (!was || i < was.at) rank.set(k, { at: i, title: was?.title ?? b.title });
1939
+ });
1940
+ }
1941
+ return [...rank.entries()].sort((a, b) => a[1].at - b[1].at).map(([key, v]) => ({ key, title: v.title }));
1942
+ }
1943
+ function mergedPlace(f, b, step, colOf) {
1944
+ const screen = b.kind === SCREEN ? screenKey(f, b) : step.get(b.column);
1945
+ const column = colOf.get(screen ?? "") ?? "c0";
1946
+ return {
1947
+ id: b.kind === SCREEN ? `scr:${screen}` : `${b.kind}:${column}:${b.row}:${b.title}`,
1948
+ column
1949
+ };
1950
+ }
1951
+ function addBox(into, b, place, d) {
1952
+ if (into.boxes.has(place.id)) return;
1953
+ const { span: _, ...rest } = b;
1954
+ into.boxes.set(place.id, { ...rest, ...place });
1955
+ if (d !== void 0) into.details[place.id] = d;
1956
+ }
1957
+ function mergeBoxes(f, colOf, into) {
1958
+ const step = screenAtStep(f);
1959
+ const idOf = /* @__PURE__ */ new Map();
1960
+ for (const b of f.boxes ?? []) {
1961
+ const place = mergedPlace(f, b, step, colOf);
1962
+ idOf.set(b.id, place.id);
1963
+ addBox(into, b, place, f.details?.[b.id]);
1964
+ }
1965
+ return idOf;
1966
+ }
1967
+ function addArrow(into, a, from = "", to = "") {
1968
+ const key = `${from}>${to}>${a.label}`;
1969
+ if (from && to && from !== to && !into.arrows.has(key)) into.arrows.set(key, { ...a, from, to });
1970
+ }
1971
+ function mergeOne(f, colOf, into) {
1972
+ const idOf = mergeBoxes(f, colOf, into);
1973
+ for (const a of f.arrows ?? []) addArrow(into, a, idOf.get(a.from), idOf.get(a.to));
1974
+ }
1975
+ function mergeScenarioGrids(flows) {
1976
+ const screens = screensInOrder(flows);
1977
+ const colOf = new Map(screens.map((s, i) => [s.key, `c${i}`]));
1978
+ const columns = screens.map((s, i) => ({
1979
+ id: `c${i}`,
1980
+ number: String(i + 1),
1981
+ label: s.title
1982
+ }));
1983
+ const rows = [];
1984
+ for (const r of flows.flatMap((f) => f.rows ?? []))
1985
+ if (!rows.some((x) => x.id === r.id)) rows.push(r);
1986
+ const merged = { boxes: /* @__PURE__ */ new Map(), arrows: /* @__PURE__ */ new Map(), details: {} };
1987
+ for (const f of flows) mergeOne(f, colOf, merged);
1988
+ return {
1989
+ ...flows[0] ?? { kind: "grid", input: 1 },
1990
+ corner: ["Screen \u2192", "Lane \u2193"],
1991
+ columns,
1992
+ rows,
1993
+ boxes: [...merged.boxes.values()],
1994
+ arrows: [...merged.arrows.values()],
1995
+ details: merged.details
1996
+ };
1997
+ }
1998
+
1999
+ // src/from-scenarios.ts
2000
+ var SUMMED = /* @__PURE__ */ new Set(["auto", "call", "ext", "tr"]);
2001
+ var screenId = (boxId) => boxId.replace(/^scr:/, "");
2002
+ function decisionsOf(g) {
2003
+ const byScreen = /* @__PURE__ */ new Map();
2004
+ for (const a of g.arrows ?? []) {
2005
+ if (!a.from.startsWith("scr:") || !a.to.startsWith("scr:") || a.from === a.to) continue;
2006
+ const d = byScreen.get(a.from) ?? { after: screenId(a.from), ways: [] };
2007
+ const way = { when: a.label ?? "Next", to: screenId(a.to) };
2008
+ if (!d.ways.some((w) => w.when === way.when && w.to === way.to)) d.ways.push(way);
2009
+ byScreen.set(a.from, d);
2010
+ }
2011
+ return [...byScreen.values()];
2012
+ }
2013
+ function capabilityUserJourney(scenarioGrids, title) {
2014
+ const g = mergeScenarioGrids(scenarioGrids);
2015
+ const boxes = g.boxes ?? [];
2016
+ const screenAt = new Map(
2017
+ boxes.filter((b) => b.kind === "scr").map((b) => [b.column, screenId(b.id)])
2018
+ );
2019
+ const persona = (g.rows ?? []).find((r) => r.kind === "actor")?.label;
2020
+ const under = (column) => screenAt.get(column) ?? "";
2021
+ return {
2022
+ kind: "journey",
2023
+ input: 1,
2024
+ title,
2025
+ ...persona ? { persona } : {},
2026
+ screens: boxes.filter((b) => b.kind === "scr").map((b) => ({ id: screenId(b.id), title: b.title })),
2027
+ decisions: decisionsOf(g),
2028
+ messages: boxes.filter((b) => b.kind === "msg").map((b, i) => ({
2029
+ id: `msg-${i + 1}`,
2030
+ channel: b.row === "email" ? "email" : "sms",
2031
+ title: b.title,
2032
+ after: under(b.column)
2033
+ })),
2034
+ backend: boxes.filter((b) => SUMMED.has(b.kind ?? "")).map((b) => ({ under: under(b.column), title: b.title }))
2035
+ };
2036
+ }
2037
+
2038
+ // src/grid.ts
2039
+ function validateScenarioGrid(json) {
2040
+ if (!json || typeof json !== "object") return ["not a grid: expected a JSON object"];
2041
+ return problemsOf(json);
2042
+ }
2043
+
2044
+ // ../engine/js/bridge.ts
2045
+ var enc = new TextEncoder();
2046
+ var dec = new TextDecoder();
2047
+ function instanceOf(module) {
2048
+ return new WebAssembly.Instance(module, {});
2049
+ }
2050
+ function bridge(instance) {
2051
+ const x = instance.exports;
2052
+ const read = (packed) => {
2053
+ const ptr = Number(packed >> 32n);
2054
+ const len = Number(packed & 0xffffffffn);
2055
+ const text = dec.decode(new Uint8Array(x.memory.buffer, ptr, len));
2056
+ x.dealloc(ptr, len);
2057
+ return text;
2058
+ };
2059
+ const call = (fn, input) => {
2060
+ const bytes = enc.encode(input);
2061
+ const ptr = x.alloc(bytes.length);
2062
+ new Uint8Array(x.memory.buffer, ptr, bytes.length).set(bytes);
2063
+ return read(x[fn](ptr, bytes.length));
2064
+ };
2065
+ return {
2066
+ call,
2067
+ json: (fn, input) => JSON.parse(call(fn, JSON.stringify(input))),
2068
+ none: (fn) => JSON.parse(read(x[fn]()))
2069
+ };
2070
+ }
2071
+
2072
+ // ../engine/js/index.ts
2073
+ function ok(answer) {
2074
+ if (answer && typeof answer === "object" && "error" in answer)
2075
+ throw new Error(String(answer.error));
2076
+ return answer;
2077
+ }
2078
+ function bind(instance) {
2079
+ const { call, json, none } = bridge(instance);
2080
+ return {
2081
+ check: (files) => json("check", files),
2082
+ flows: (files) => json("flows", files),
2083
+ grids: (files) => json("grids", files),
2084
+ hexagons: (files) => json("hexagons", files),
2085
+ contextMap: (files) => json("context_map", files),
2086
+ open: (files) => json("open", files),
2087
+ generated: (files) => call("generated", JSON.stringify(files)),
2088
+ index: (files) => call("index", JSON.stringify(files)),
2089
+ snapshot: (files) => ok(json("snapshot", { spec: "0.1", files })),
2090
+ toYaml: (value) => call("to_yaml", JSON.stringify(value)),
2091
+ parseInput: (text) => ok(JSON.parse(call("parse_input", text))),
2092
+ owned: () => ok(none("owned")),
2093
+ closure: (files, caps) => ok(json("closure", { caps, files }))
2094
+ };
2095
+ }
2096
+ function instantiate(module) {
2097
+ return bind(instanceOf(module));
2098
+ }
2099
+
2100
+ // src/workspace.ts
2101
+ var engine;
2102
+ var where;
2103
+ async function wasmBytes() {
2104
+ const url = where ?? new URL("./vds_engine.wasm", import.meta.url);
2105
+ if (typeof window === "undefined") {
2106
+ const { readFile: readFile2 } = await import("node:fs/promises");
2107
+ const { fileURLToPath } = await import("node:url");
2108
+ const b = await readFile2(fileURLToPath(String(url)));
2109
+ return b.buffer.slice(b.byteOffset, b.byteOffset + b.byteLength);
2110
+ }
2111
+ return (await fetch(url)).arrayBuffer();
2112
+ }
2113
+ function load() {
2114
+ engine ??= wasmBytes().then(async (b) => instantiate(await WebAssembly.compile(b)));
2115
+ return engine;
2116
+ }
2117
+ async function checkWorkspace(files) {
2118
+ const s = (await load()).snapshot(files);
2119
+ return { problems: s.problems, incomplete: s.incomplete, open: s.open };
2120
+ }
2121
+ async function compileScenarioGrids(files) {
2122
+ const m = await load();
2123
+ const grids = m.grids(files);
2124
+ if ("error" in grids) throw new Error(String(grids.error));
2125
+ const out = {};
2126
+ for (const [path, text] of Object.entries(grids)) {
2127
+ const id = /([^/]+)\.grid$/.exec(path)?.[1];
2128
+ if (id) out[id] = m.parseInput(text);
2129
+ }
2130
+ return out;
2131
+ }
2132
+ async function readWorkspaceFolder(dir) {
2133
+ const { readdir, readFile: readFile2, stat: stat2 } = await import("node:fs/promises");
2134
+ const { join, relative } = await import("node:path");
2135
+ const root = await stat2(join(dir, "domain")).catch(() => null) ? join(dir, "domain") : dir;
2136
+ const out = {};
2137
+ const walk = async (d) => {
2138
+ for (const e of await readdir(d, { withFileTypes: true })) {
2139
+ const p = join(d, e.name);
2140
+ if (e.isDirectory()) await walk(p);
2141
+ else out[relative(root, p)] = await readFile2(p, "utf8");
2142
+ }
2143
+ };
2144
+ await walk(root);
2145
+ return out;
2146
+ }
2147
+
2148
+ // src/cli.ts
2149
+ async function validateWorkspace(dir) {
2150
+ const files = await readWorkspaceFolder(dir);
2151
+ const r = await checkWorkspace(files);
2152
+ for (const p of r.problems)
2153
+ console.log(`problem: ${p.message}${p.path ? ` (${p.path}:${p.line ?? 1})` : ""}`);
2154
+ for (const p of r.incomplete) console.log(`not modelled yet: ${p.message}`);
2155
+ if (r.problems.length) return 1;
2156
+ const grids = await compileScenarioGrids(files);
2157
+ console.log(
2158
+ `valid; ${Object.keys(grids).length} scenario grids compile; ${r.open.length} open questions`
2159
+ );
2160
+ return 0;
2161
+ }
2162
+ async function userJourney(dir, cap) {
2163
+ const code = cap.replace(/^CAP-/, "");
2164
+ const files = await readWorkspaceFolder(dir);
2165
+ const r = await checkWorkspace(files);
2166
+ for (const p of r.problems) console.error(`problem: ${p.message}`);
2167
+ if (r.problems.length) return 1;
2168
+ const grids = Object.entries(await compileScenarioGrids(files)).filter(([id]) => id.startsWith(`DGSF-${code}-`)).map(([, g]) => g);
2169
+ if (!grids.length) {
2170
+ console.error(`no scenario grids for CAP-${code}`);
2171
+ return 1;
2172
+ }
2173
+ const title = /^title:\s*(.+)$/m.exec(
2174
+ files[Object.keys(files).find((p) => p.endsWith(`CAP-${code}/problem/capability.yaml`)) ?? ""] ?? ""
2175
+ )?.[1];
2176
+ console.log(
2177
+ JSON.stringify(capabilityUserJourney(grids, title?.trim() ?? `CAP-${code}`), null, 2)
2178
+ );
2179
+ return 0;
2180
+ }
2181
+ var USAGE = [
2182
+ "usage: vds-diagrams validate <workspace or domain folder | grid.json>",
2183
+ " vds-diagrams user-journey <workspace> <CAP-CODE> prints the capability's user journey JSON"
2184
+ ].join("\n");
2185
+ async function main(argv) {
2186
+ const [cmd, target, cap] = argv;
2187
+ if (cmd === "user-journey" && target && cap) return userJourney(target, cap);
2188
+ if (cmd !== "validate" || !target) {
2189
+ console.log(USAGE);
2190
+ return 2;
2191
+ }
2192
+ if ((await stat(target)).isDirectory()) return validateWorkspace(target);
2193
+ const problems = validateScenarioGrid(JSON.parse(await readFile(target, "utf8")));
2194
+ for (const p of problems) console.log(`problem: ${p}`);
2195
+ if (!problems.length) console.log("valid; this grid can be drawn");
2196
+ return problems.length ? 1 : 0;
2197
+ }
2198
+ process.exitCode = await main(process.argv.slice(2));
2199
+ /*! Bundled license information:
2200
+
2201
+ react/cjs/react-jsx-runtime.production.js:
2202
+ (**
2203
+ * @license React
2204
+ * react-jsx-runtime.production.js
2205
+ *
2206
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
2207
+ *
2208
+ * This source code is licensed under the MIT license found in the
2209
+ * LICENSE file in the root directory of this source tree.
2210
+ *)
2211
+
2212
+ react/cjs/react.production.js:
2213
+ (**
2214
+ * @license React
2215
+ * react.production.js
2216
+ *
2217
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
2218
+ *
2219
+ * This source code is licensed under the MIT license found in the
2220
+ * LICENSE file in the root directory of this source tree.
2221
+ *)
2222
+
2223
+ react/cjs/react.development.js:
2224
+ (**
2225
+ * @license React
2226
+ * react.development.js
2227
+ *
2228
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
2229
+ *
2230
+ * This source code is licensed under the MIT license found in the
2231
+ * LICENSE file in the root directory of this source tree.
2232
+ *)
2233
+
2234
+ react/cjs/react-jsx-runtime.development.js:
2235
+ (**
2236
+ * @license React
2237
+ * react-jsx-runtime.development.js
2238
+ *
2239
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
2240
+ *
2241
+ * This source code is licensed under the MIT license found in the
2242
+ * LICENSE file in the root directory of this source tree.
2243
+ *)
2244
+ */