@citolab/qti-components 8.0.1 → 8.0.2

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 (60) hide show
  1. package/cdn/index.global.js +1 -1
  2. package/cdn/index.js +103 -103
  3. package/dist/base.d.ts +3 -3
  4. package/dist/base.js +1 -1
  5. package/dist/chunk-4DB4SC5K.js +100 -0
  6. package/dist/chunk-4DB4SC5K.js.map +1 -0
  7. package/dist/{chunk-WVVMNF74.js → chunk-7AVWRQIS.js} +188 -160
  8. package/dist/{chunk-WVVMNF74.js.map → chunk-7AVWRQIS.js.map} +1 -1
  9. package/dist/{chunk-CAO4JRLY.js → chunk-BQFWCZFH.js} +2 -2
  10. package/dist/{chunk-LVBIQDPM.js → chunk-CK7AV2UJ.js} +147 -101
  11. package/dist/chunk-CK7AV2UJ.js.map +1 -0
  12. package/dist/{chunk-7HC5SMCU.js → chunk-G6GFQDVN.js} +1 -96
  13. package/dist/chunk-G6GFQDVN.js.map +1 -0
  14. package/dist/{chunk-RXGDQDOV.js → chunk-HBSWJC3B.js} +478 -392
  15. package/dist/chunk-HBSWJC3B.js.map +1 -0
  16. package/dist/chunk-HQESINXH.js +834 -0
  17. package/dist/chunk-HQESINXH.js.map +1 -0
  18. package/dist/{chunk-XU7HNT4F.js → chunk-J5SQLKNP.js} +145 -119
  19. package/dist/{chunk-XU7HNT4F.js.map → chunk-J5SQLKNP.js.map} +1 -1
  20. package/dist/{chunk-V5G7X53Y.js → chunk-NJQHUUTN.js} +2 -2
  21. package/dist/{chunk-QECOPVPO.js → chunk-RSVRS5AK.js} +59 -58
  22. package/dist/chunk-RSVRS5AK.js.map +1 -0
  23. package/dist/{chunk-F4BNJWYN.js → chunk-TWPXES3S.js} +642 -673
  24. package/dist/chunk-TWPXES3S.js.map +1 -0
  25. package/dist/{chunk-NA2N2WSG.js → chunk-VAE6HBKR.js} +176 -152
  26. package/dist/{chunk-NA2N2WSG.js.map → chunk-VAE6HBKR.js.map} +1 -1
  27. package/dist/{chunk-3AJOQCDU.js → chunk-ZII6M3SN.js} +2 -2
  28. package/dist/{computed.types.d-rKLSPvVG.d.ts → computed.types.d-DpKIYO6e.d.ts} +2 -0
  29. package/dist/corrections.d.ts +12 -29
  30. package/dist/corrections.js +8 -9
  31. package/dist/elements.d.ts +86 -86
  32. package/dist/elements.js +4 -5
  33. package/dist/index.d.ts +6 -37
  34. package/dist/index.js +13 -14
  35. package/dist/{interaction.d-D4MstYRz.d.ts → interaction.d-CJiMv8H7.d.ts} +13 -2
  36. package/dist/interactions.d.ts +11 -1299
  37. package/dist/interactions.js +4 -5
  38. package/dist/item.d.ts +3 -3
  39. package/dist/item.js +5 -5
  40. package/dist/processing.js +2 -2
  41. package/dist/qti-components-jsx.d.ts +759 -739
  42. package/dist/qti-test.d-_YAlhDbt.d.ts +702 -0
  43. package/dist/qti-text-entry-interaction.d-BGdfV9qG.d.ts +1567 -0
  44. package/dist/test.d.ts +11 -678
  45. package/dist/test.js +6 -7
  46. package/package.json +8 -7
  47. package/dist/chunk-64XSIBGO.js +0 -241
  48. package/dist/chunk-64XSIBGO.js.map +0 -1
  49. package/dist/chunk-7HC5SMCU.js.map +0 -1
  50. package/dist/chunk-F4BNJWYN.js.map +0 -1
  51. package/dist/chunk-H3J7LFRO.js +0 -2243
  52. package/dist/chunk-H3J7LFRO.js.map +0 -1
  53. package/dist/chunk-LVBIQDPM.js.map +0 -1
  54. package/dist/chunk-QECOPVPO.js.map +0 -1
  55. package/dist/chunk-RXGDQDOV.js.map +0 -1
  56. package/dist/chunk-X3E5HXG2.js +0 -20
  57. package/dist/chunk-X3E5HXG2.js.map +0 -1
  58. /package/dist/{chunk-CAO4JRLY.js.map → chunk-BQFWCZFH.js.map} +0 -0
  59. /package/dist/{chunk-V5G7X53Y.js.map → chunk-NJQHUUTN.js.map} +0 -0
  60. /package/dist/{chunk-3AJOQCDU.js.map → chunk-ZII6M3SN.js.map} +0 -0
@@ -1,2243 +0,0 @@
1
- // ../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/lib/context-request-event.js
2
- var s = class extends Event {
3
- constructor(s7, t4, e7, o7) {
4
- super("context-request", { bubbles: true, composed: true }), this.context = s7, this.contextTarget = t4, this.callback = e7, this.subscribe = o7 ?? false;
5
- }
6
- };
7
-
8
- // ../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/lib/create-context.js
9
- function n(n6) {
10
- return n6;
11
- }
12
-
13
- // ../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/lib/controllers/context-consumer.js
14
- var s2 = class {
15
- constructor(t4, s7, i5, h3) {
16
- if (this.subscribe = false, this.provided = false, this.value = void 0, this.t = (t5, s8) => {
17
- this.unsubscribe && (this.unsubscribe !== s8 && (this.provided = false, this.unsubscribe()), this.subscribe || this.unsubscribe()), this.value = t5, this.host.requestUpdate(), this.provided && !this.subscribe || (this.provided = true, this.callback && this.callback(t5, s8)), this.unsubscribe = s8;
18
- }, this.host = t4, void 0 !== s7.context) {
19
- const t5 = s7;
20
- this.context = t5.context, this.callback = t5.callback, this.subscribe = t5.subscribe ?? false;
21
- } else this.context = s7, this.callback = i5, this.subscribe = h3 ?? false;
22
- this.host.addController(this);
23
- }
24
- hostConnected() {
25
- this.dispatchRequest();
26
- }
27
- hostDisconnected() {
28
- this.unsubscribe && (this.unsubscribe(), this.unsubscribe = void 0);
29
- }
30
- dispatchRequest() {
31
- this.host.dispatchEvent(new s(this.context, this.host, this.t, this.subscribe));
32
- }
33
- };
34
-
35
- // ../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/lib/value-notifier.js
36
- var s3 = class {
37
- get value() {
38
- return this.o;
39
- }
40
- set value(s7) {
41
- this.setValue(s7);
42
- }
43
- setValue(s7, t4 = false) {
44
- const i5 = t4 || !Object.is(s7, this.o);
45
- this.o = s7, i5 && this.updateObservers();
46
- }
47
- constructor(s7) {
48
- this.subscriptions = /* @__PURE__ */ new Map(), this.updateObservers = () => {
49
- for (const [s8, { disposer: t4 }] of this.subscriptions) s8(this.o, t4);
50
- }, void 0 !== s7 && (this.value = s7);
51
- }
52
- addCallback(s7, t4, i5) {
53
- if (!i5) return void s7(this.value);
54
- this.subscriptions.has(s7) || this.subscriptions.set(s7, { disposer: () => {
55
- this.subscriptions.delete(s7);
56
- }, consumerHost: t4 });
57
- const { disposer: h3 } = this.subscriptions.get(s7);
58
- s7(this.value, h3);
59
- }
60
- clearCallbacks() {
61
- this.subscriptions.clear();
62
- }
63
- };
64
-
65
- // ../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/lib/controllers/context-provider.js
66
- var e = class extends Event {
67
- constructor(t4, s7) {
68
- super("context-provider", { bubbles: true, composed: true }), this.context = t4, this.contextTarget = s7;
69
- }
70
- };
71
- var i = class extends s3 {
72
- constructor(s7, e7, i5) {
73
- super(void 0 !== e7.context ? e7.initialValue : i5), this.onContextRequest = (t4) => {
74
- if (t4.context !== this.context) return;
75
- const s8 = t4.contextTarget ?? t4.composedPath()[0];
76
- s8 !== this.host && (t4.stopPropagation(), this.addCallback(t4.callback, s8, t4.subscribe));
77
- }, this.onProviderRequest = (s8) => {
78
- if (s8.context !== this.context) return;
79
- if ((s8.contextTarget ?? s8.composedPath()[0]) === this.host) return;
80
- const e8 = /* @__PURE__ */ new Set();
81
- for (const [s9, { consumerHost: i6 }] of this.subscriptions) e8.has(s9) || (e8.add(s9), i6.dispatchEvent(new s(this.context, i6, s9, true)));
82
- s8.stopPropagation();
83
- }, this.host = s7, void 0 !== e7.context ? this.context = e7.context : this.context = e7, this.attachListeners(), this.host.addController?.(this);
84
- }
85
- attachListeners() {
86
- this.host.addEventListener("context-request", this.onContextRequest), this.host.addEventListener("context-provider", this.onProviderRequest);
87
- }
88
- hostConnected() {
89
- this.host.dispatchEvent(new e(this.context, this.host));
90
- }
91
- };
92
-
93
- // ../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/lib/decorators/provide.js
94
- function e2({ context: e7 }) {
95
- return (n6, i5) => {
96
- const r6 = /* @__PURE__ */ new WeakMap();
97
- if ("object" == typeof i5) return { get() {
98
- return n6.get.call(this);
99
- }, set(t4) {
100
- return r6.get(this).setValue(t4), n6.set.call(this, t4);
101
- }, init(n7) {
102
- return r6.set(this, new i(this, { context: e7, initialValue: n7 })), n7;
103
- } };
104
- {
105
- n6.constructor.addInitializer(((n7) => {
106
- r6.set(n7, new i(n7, { context: e7 }));
107
- }));
108
- const o7 = Object.getOwnPropertyDescriptor(n6, i5);
109
- let s7;
110
- if (void 0 === o7) {
111
- const t4 = /* @__PURE__ */ new WeakMap();
112
- s7 = { get() {
113
- return t4.get(this);
114
- }, set(e8) {
115
- r6.get(this).setValue(e8), t4.set(this, e8);
116
- }, configurable: true, enumerable: true };
117
- } else {
118
- const t4 = o7.set;
119
- s7 = { ...o7, set(e8) {
120
- r6.get(this).setValue(e8), t4?.call(this, e8);
121
- } };
122
- }
123
- return void Object.defineProperty(n6, i5, s7);
124
- }
125
- };
126
- }
127
-
128
- // ../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/lib/decorators/consume.js
129
- function c({ context: c5, subscribe: e7 }) {
130
- return (o7, n6) => {
131
- "object" == typeof n6 ? n6.addInitializer((function() {
132
- new s2(this, { context: c5, callback: (t4) => {
133
- o7.set.call(this, t4);
134
- }, subscribe: e7 });
135
- })) : o7.constructor.addInitializer(((o8) => {
136
- new s2(o8, { context: c5, callback: (t4) => {
137
- o8[n6] = t4;
138
- }, subscribe: e7 });
139
- }));
140
- };
141
- }
142
-
143
- // ../qti-base/dist/context/computed-item.context.js
144
- var computedItemContext = n(/* @__PURE__ */ Symbol("computedItemContext"));
145
-
146
- // ../qti-base/dist/context/computed.context.js
147
- var computedContext = n(/* @__PURE__ */ Symbol("computedContext"));
148
-
149
- // ../qti-base/dist/context/config.context.js
150
- var configContext = n(/* @__PURE__ */ Symbol("configContext"));
151
-
152
- // ../qti-base/dist/context/interaction.context.js
153
- var interactionContext = n(/* @__PURE__ */ Symbol("interactionContext"));
154
-
155
- // ../qti-base/dist/context/item.context.js
156
- var itemContext = n(/* @__PURE__ */ Symbol("item"));
157
-
158
- // ../qti-base/dist/context/types/item.types.js
159
- var itemContextVariables = [
160
- {
161
- identifier: "completionStatus",
162
- cardinality: "single",
163
- baseType: "string",
164
- value: "unknown",
165
- type: "outcome"
166
- },
167
- {
168
- identifier: "numAttempts",
169
- cardinality: "single",
170
- baseType: "integer",
171
- value: "0",
172
- type: "response"
173
- }
174
- ];
175
-
176
- // ../qti-base/dist/context/qti.context.js
177
- var SEED_PATTERN = /^[A-Za-z0-9-]+$/;
178
- var isSeed = (value) => typeof value === "string" && SEED_PATTERN.test(value);
179
- var asSeed = (value) => isSeed(value) ? value : void 0;
180
- var qtiContext = n(/* @__PURE__ */ Symbol("qtiContext"));
181
-
182
- // ../qti-base/dist/context/session.context.js
183
- var INITIAL_SESSION_CONTEXT = { view: "candidate" };
184
- var sessionContext = n(/* @__PURE__ */ Symbol("testContext"));
185
-
186
- // ../qti-base/dist/context/test.context.js
187
- var INITIAL_TEST_CONTEXT = { items: [], testOutcomeVariables: [] };
188
- var testContext = n(/* @__PURE__ */ Symbol("testContext"));
189
-
190
- // ../../node_modules/.pnpm/@lit-labs+ssr-dom-shim@1.5.1/node_modules/@lit-labs/ssr-dom-shim/lib/element-internals.js
191
- var ElementInternalsShim = class ElementInternals {
192
- get shadowRoot() {
193
- return this.__host.__shadowRoot;
194
- }
195
- constructor(_host) {
196
- this.ariaActiveDescendantElement = null;
197
- this.ariaAtomic = "";
198
- this.ariaAutoComplete = "";
199
- this.ariaBrailleLabel = "";
200
- this.ariaBrailleRoleDescription = "";
201
- this.ariaBusy = "";
202
- this.ariaChecked = "";
203
- this.ariaColCount = "";
204
- this.ariaColIndex = "";
205
- this.ariaColIndexText = "";
206
- this.ariaColSpan = "";
207
- this.ariaControlsElements = null;
208
- this.ariaCurrent = "";
209
- this.ariaDescribedByElements = null;
210
- this.ariaDescription = "";
211
- this.ariaDetailsElements = null;
212
- this.ariaDisabled = "";
213
- this.ariaErrorMessageElements = null;
214
- this.ariaExpanded = "";
215
- this.ariaFlowToElements = null;
216
- this.ariaHasPopup = "";
217
- this.ariaHidden = "";
218
- this.ariaInvalid = "";
219
- this.ariaKeyShortcuts = "";
220
- this.ariaLabel = "";
221
- this.ariaLabelledByElements = null;
222
- this.ariaLevel = "";
223
- this.ariaLive = "";
224
- this.ariaModal = "";
225
- this.ariaMultiLine = "";
226
- this.ariaMultiSelectable = "";
227
- this.ariaOrientation = "";
228
- this.ariaOwnsElements = null;
229
- this.ariaPlaceholder = "";
230
- this.ariaPosInSet = "";
231
- this.ariaPressed = "";
232
- this.ariaReadOnly = "";
233
- this.ariaRelevant = "";
234
- this.ariaRequired = "";
235
- this.ariaRoleDescription = "";
236
- this.ariaRowCount = "";
237
- this.ariaRowIndex = "";
238
- this.ariaRowIndexText = "";
239
- this.ariaRowSpan = "";
240
- this.ariaSelected = "";
241
- this.ariaSetSize = "";
242
- this.ariaSort = "";
243
- this.ariaValueMax = "";
244
- this.ariaValueMin = "";
245
- this.ariaValueNow = "";
246
- this.ariaValueText = "";
247
- this.role = "";
248
- this.form = null;
249
- this.labels = [];
250
- this.states = /* @__PURE__ */ new Set();
251
- this.validationMessage = "";
252
- this.validity = {};
253
- this.willValidate = true;
254
- this.__host = _host;
255
- }
256
- checkValidity() {
257
- console.warn("`ElementInternals.checkValidity()` was called on the server.This method always returns true.");
258
- return true;
259
- }
260
- reportValidity() {
261
- return true;
262
- }
263
- setFormValue() {
264
- }
265
- setValidity() {
266
- }
267
- };
268
-
269
- // ../../node_modules/.pnpm/@lit-labs+ssr-dom-shim@1.5.1/node_modules/@lit-labs/ssr-dom-shim/lib/events.js
270
- var __classPrivateFieldSet = function(receiver, state, value, kind, f3) {
271
- if (kind === "m") throw new TypeError("Private method is not writable");
272
- if (kind === "a" && !f3) throw new TypeError("Private accessor was defined without a setter");
273
- if (typeof state === "function" ? receiver !== state || !f3 : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
274
- return kind === "a" ? f3.call(receiver, value) : f3 ? f3.value = value : state.set(receiver, value), value;
275
- };
276
- var __classPrivateFieldGet = function(receiver, state, kind, f3) {
277
- if (kind === "a" && !f3) throw new TypeError("Private accessor was defined without a getter");
278
- if (typeof state === "function" ? receiver !== state || !f3 : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
279
- return kind === "m" ? f3 : kind === "a" ? f3.call(receiver) : f3 ? f3.value : state.get(receiver);
280
- };
281
- var _Event_cancelable;
282
- var _Event_bubbles;
283
- var _Event_composed;
284
- var _Event_defaultPrevented;
285
- var _Event_timestamp;
286
- var _Event_propagationStopped;
287
- var _Event_type;
288
- var _Event_target;
289
- var _Event_isBeingDispatched;
290
- var _a;
291
- var _CustomEvent_detail;
292
- var _b;
293
- var isCaptureEventListener = (options) => typeof options === "boolean" ? options : options?.capture ?? false;
294
- var NONE = 0;
295
- var CAPTURING_PHASE = 1;
296
- var AT_TARGET = 2;
297
- var BUBBLING_PHASE = 3;
298
- var EventTarget = class {
299
- constructor() {
300
- this.__eventListeners = /* @__PURE__ */ new Map();
301
- this.__captureEventListeners = /* @__PURE__ */ new Map();
302
- }
303
- addEventListener(type, callback, options) {
304
- if (callback === void 0 || callback === null) {
305
- return;
306
- }
307
- const eventListenersMap = isCaptureEventListener(options) ? this.__captureEventListeners : this.__eventListeners;
308
- let eventListeners = eventListenersMap.get(type);
309
- if (eventListeners === void 0) {
310
- eventListeners = /* @__PURE__ */ new Map();
311
- eventListenersMap.set(type, eventListeners);
312
- } else if (eventListeners.has(callback)) {
313
- return;
314
- }
315
- const normalizedOptions = typeof options === "object" && options ? options : {};
316
- normalizedOptions.signal?.addEventListener("abort", () => this.removeEventListener(type, callback, options));
317
- eventListeners.set(callback, normalizedOptions ?? {});
318
- }
319
- removeEventListener(type, callback, options) {
320
- if (callback === void 0 || callback === null) {
321
- return;
322
- }
323
- const eventListenersMap = isCaptureEventListener(options) ? this.__captureEventListeners : this.__eventListeners;
324
- const eventListeners = eventListenersMap.get(type);
325
- if (eventListeners !== void 0) {
326
- eventListeners.delete(callback);
327
- if (!eventListeners.size) {
328
- eventListenersMap.delete(type);
329
- }
330
- }
331
- }
332
- dispatchEvent(event) {
333
- const composedPath = [this];
334
- let parent = this.__eventTargetParent;
335
- if (event.composed) {
336
- while (parent) {
337
- composedPath.push(parent);
338
- parent = parent.__eventTargetParent;
339
- }
340
- } else {
341
- while (parent && parent !== this.__host) {
342
- composedPath.push(parent);
343
- parent = parent.__eventTargetParent;
344
- }
345
- }
346
- let stopPropagation = false;
347
- let stopImmediatePropagation = false;
348
- let eventPhase = NONE;
349
- let target = null;
350
- let tmpTarget = null;
351
- let currentTarget = null;
352
- const originalStopPropagation = event.stopPropagation;
353
- const originalStopImmediatePropagation = event.stopImmediatePropagation;
354
- Object.defineProperties(event, {
355
- target: {
356
- get() {
357
- return target ?? tmpTarget;
358
- },
359
- ...enumerableProperty
360
- },
361
- srcElement: {
362
- get() {
363
- return event.target;
364
- },
365
- ...enumerableProperty
366
- },
367
- currentTarget: {
368
- get() {
369
- return currentTarget;
370
- },
371
- ...enumerableProperty
372
- },
373
- eventPhase: {
374
- get() {
375
- return eventPhase;
376
- },
377
- ...enumerableProperty
378
- },
379
- composedPath: {
380
- value: () => composedPath,
381
- ...enumerableProperty
382
- },
383
- stopPropagation: {
384
- value: () => {
385
- stopPropagation = true;
386
- originalStopPropagation.call(event);
387
- },
388
- ...enumerableProperty
389
- },
390
- stopImmediatePropagation: {
391
- value: () => {
392
- stopImmediatePropagation = true;
393
- originalStopImmediatePropagation.call(event);
394
- },
395
- ...enumerableProperty
396
- }
397
- });
398
- const invokeEventListener = (listener, options, eventListenerMap) => {
399
- if (typeof listener === "function") {
400
- listener(event);
401
- } else if (typeof listener?.handleEvent === "function") {
402
- listener.handleEvent(event);
403
- }
404
- if (options.once) {
405
- eventListenerMap.delete(listener);
406
- }
407
- };
408
- const finishDispatch = () => {
409
- currentTarget = null;
410
- eventPhase = NONE;
411
- return !event.defaultPrevented;
412
- };
413
- const captureEventPath = composedPath.slice().reverse();
414
- target = !this.__host || !event.composed ? this : null;
415
- const retarget = (eventTargets) => {
416
- tmpTarget = this;
417
- while (tmpTarget.__host && eventTargets.includes(tmpTarget.__host)) {
418
- tmpTarget = tmpTarget.__host;
419
- }
420
- };
421
- for (const eventTarget of captureEventPath) {
422
- if (!target && (!tmpTarget || tmpTarget === eventTarget.__host)) {
423
- retarget(captureEventPath.slice(captureEventPath.indexOf(eventTarget)));
424
- }
425
- currentTarget = eventTarget;
426
- eventPhase = eventTarget === event.target ? AT_TARGET : CAPTURING_PHASE;
427
- const captureEventListeners = eventTarget.__captureEventListeners.get(event.type);
428
- if (captureEventListeners) {
429
- for (const [listener, options] of captureEventListeners) {
430
- invokeEventListener(listener, options, captureEventListeners);
431
- if (stopImmediatePropagation) {
432
- return finishDispatch();
433
- }
434
- }
435
- }
436
- if (stopPropagation) {
437
- return finishDispatch();
438
- }
439
- }
440
- const bubbleEventPath = event.bubbles ? composedPath : [this];
441
- tmpTarget = null;
442
- for (const eventTarget of bubbleEventPath) {
443
- if (!target && (!tmpTarget || eventTarget === tmpTarget.__host)) {
444
- retarget(bubbleEventPath.slice(0, bubbleEventPath.indexOf(eventTarget) + 1));
445
- }
446
- currentTarget = eventTarget;
447
- eventPhase = eventTarget === event.target ? AT_TARGET : BUBBLING_PHASE;
448
- const captureEventListeners = eventTarget.__eventListeners.get(event.type);
449
- if (captureEventListeners) {
450
- for (const [listener, options] of captureEventListeners) {
451
- invokeEventListener(listener, options, captureEventListeners);
452
- if (stopImmediatePropagation) {
453
- return finishDispatch();
454
- }
455
- }
456
- }
457
- if (stopPropagation) {
458
- return finishDispatch();
459
- }
460
- }
461
- return finishDispatch();
462
- }
463
- };
464
- var EventTargetShimWithRealType = EventTarget;
465
- var enumerableProperty = { __proto__: null };
466
- enumerableProperty.enumerable = true;
467
- Object.freeze(enumerableProperty);
468
- var EventShim = (_a = class Event2 {
469
- constructor(type, options = {}) {
470
- _Event_cancelable.set(this, false);
471
- _Event_bubbles.set(this, false);
472
- _Event_composed.set(this, false);
473
- _Event_defaultPrevented.set(this, false);
474
- _Event_timestamp.set(this, Date.now());
475
- _Event_propagationStopped.set(this, false);
476
- _Event_type.set(this, void 0);
477
- _Event_target.set(this, void 0);
478
- _Event_isBeingDispatched.set(this, void 0);
479
- this.NONE = NONE;
480
- this.CAPTURING_PHASE = CAPTURING_PHASE;
481
- this.AT_TARGET = AT_TARGET;
482
- this.BUBBLING_PHASE = BUBBLING_PHASE;
483
- if (arguments.length === 0)
484
- throw new Error(`The type argument must be specified`);
485
- if (typeof options !== "object" || !options) {
486
- throw new Error(`The "options" argument must be an object`);
487
- }
488
- const { bubbles, cancelable, composed } = options;
489
- __classPrivateFieldSet(this, _Event_cancelable, !!cancelable, "f");
490
- __classPrivateFieldSet(this, _Event_bubbles, !!bubbles, "f");
491
- __classPrivateFieldSet(this, _Event_composed, !!composed, "f");
492
- __classPrivateFieldSet(this, _Event_type, `${type}`, "f");
493
- __classPrivateFieldSet(this, _Event_target, null, "f");
494
- __classPrivateFieldSet(this, _Event_isBeingDispatched, false, "f");
495
- }
496
- initEvent(_type, _bubbles, _cancelable) {
497
- throw new Error("Method not implemented.");
498
- }
499
- stopImmediatePropagation() {
500
- this.stopPropagation();
501
- }
502
- preventDefault() {
503
- __classPrivateFieldSet(this, _Event_defaultPrevented, true, "f");
504
- }
505
- get target() {
506
- return __classPrivateFieldGet(this, _Event_target, "f");
507
- }
508
- get currentTarget() {
509
- return __classPrivateFieldGet(this, _Event_target, "f");
510
- }
511
- get srcElement() {
512
- return __classPrivateFieldGet(this, _Event_target, "f");
513
- }
514
- get type() {
515
- return __classPrivateFieldGet(this, _Event_type, "f");
516
- }
517
- get cancelable() {
518
- return __classPrivateFieldGet(this, _Event_cancelable, "f");
519
- }
520
- get defaultPrevented() {
521
- return __classPrivateFieldGet(this, _Event_cancelable, "f") && __classPrivateFieldGet(this, _Event_defaultPrevented, "f");
522
- }
523
- get timeStamp() {
524
- return __classPrivateFieldGet(this, _Event_timestamp, "f");
525
- }
526
- composedPath() {
527
- return __classPrivateFieldGet(this, _Event_isBeingDispatched, "f") ? [__classPrivateFieldGet(this, _Event_target, "f")] : [];
528
- }
529
- get returnValue() {
530
- return !__classPrivateFieldGet(this, _Event_cancelable, "f") || !__classPrivateFieldGet(this, _Event_defaultPrevented, "f");
531
- }
532
- get bubbles() {
533
- return __classPrivateFieldGet(this, _Event_bubbles, "f");
534
- }
535
- get composed() {
536
- return __classPrivateFieldGet(this, _Event_composed, "f");
537
- }
538
- get eventPhase() {
539
- return __classPrivateFieldGet(this, _Event_isBeingDispatched, "f") ? _a.AT_TARGET : _a.NONE;
540
- }
541
- get cancelBubble() {
542
- return __classPrivateFieldGet(this, _Event_propagationStopped, "f");
543
- }
544
- set cancelBubble(value) {
545
- if (value) {
546
- __classPrivateFieldSet(this, _Event_propagationStopped, true, "f");
547
- }
548
- }
549
- stopPropagation() {
550
- __classPrivateFieldSet(this, _Event_propagationStopped, true, "f");
551
- }
552
- get isTrusted() {
553
- return false;
554
- }
555
- }, _Event_cancelable = /* @__PURE__ */ new WeakMap(), _Event_bubbles = /* @__PURE__ */ new WeakMap(), _Event_composed = /* @__PURE__ */ new WeakMap(), _Event_defaultPrevented = /* @__PURE__ */ new WeakMap(), _Event_timestamp = /* @__PURE__ */ new WeakMap(), _Event_propagationStopped = /* @__PURE__ */ new WeakMap(), _Event_type = /* @__PURE__ */ new WeakMap(), _Event_target = /* @__PURE__ */ new WeakMap(), _Event_isBeingDispatched = /* @__PURE__ */ new WeakMap(), _a.NONE = NONE, _a.CAPTURING_PHASE = CAPTURING_PHASE, _a.AT_TARGET = AT_TARGET, _a.BUBBLING_PHASE = BUBBLING_PHASE, _a);
556
- Object.defineProperties(EventShim.prototype, {
557
- initEvent: enumerableProperty,
558
- stopImmediatePropagation: enumerableProperty,
559
- preventDefault: enumerableProperty,
560
- target: enumerableProperty,
561
- currentTarget: enumerableProperty,
562
- srcElement: enumerableProperty,
563
- type: enumerableProperty,
564
- cancelable: enumerableProperty,
565
- defaultPrevented: enumerableProperty,
566
- timeStamp: enumerableProperty,
567
- composedPath: enumerableProperty,
568
- returnValue: enumerableProperty,
569
- bubbles: enumerableProperty,
570
- composed: enumerableProperty,
571
- eventPhase: enumerableProperty,
572
- cancelBubble: enumerableProperty,
573
- stopPropagation: enumerableProperty,
574
- isTrusted: enumerableProperty
575
- });
576
- var CustomEventShim = (_b = class CustomEvent2 extends EventShim {
577
- constructor(type, options = {}) {
578
- super(type, options);
579
- _CustomEvent_detail.set(this, void 0);
580
- __classPrivateFieldSet(this, _CustomEvent_detail, options?.detail ?? null, "f");
581
- }
582
- initCustomEvent(_type, _bubbles, _cancelable, _detail) {
583
- throw new Error("Method not implemented.");
584
- }
585
- get detail() {
586
- return __classPrivateFieldGet(this, _CustomEvent_detail, "f");
587
- }
588
- }, _CustomEvent_detail = /* @__PURE__ */ new WeakMap(), _b);
589
- Object.defineProperties(CustomEventShim.prototype, {
590
- detail: enumerableProperty
591
- });
592
- var EventShimWithRealType = EventShim;
593
- var CustomEventShimWithRealType = CustomEventShim;
594
-
595
- // ../../node_modules/.pnpm/@lit-labs+ssr-dom-shim@1.5.1/node_modules/@lit-labs/ssr-dom-shim/lib/css.js
596
- var _a2;
597
- var CSSRuleShim = (_a2 = class CSSRule {
598
- constructor() {
599
- this.STYLE_RULE = 1;
600
- this.CHARSET_RULE = 2;
601
- this.IMPORT_RULE = 3;
602
- this.MEDIA_RULE = 4;
603
- this.FONT_FACE_RULE = 5;
604
- this.PAGE_RULE = 6;
605
- this.NAMESPACE_RULE = 10;
606
- this.KEYFRAMES_RULE = 7;
607
- this.KEYFRAME_RULE = 8;
608
- this.SUPPORTS_RULE = 12;
609
- this.COUNTER_STYLE_RULE = 11;
610
- this.FONT_FEATURE_VALUES_RULE = 14;
611
- this.__parentStyleSheet = null;
612
- this.cssText = "";
613
- }
614
- get parentRule() {
615
- return null;
616
- }
617
- get parentStyleSheet() {
618
- return this.__parentStyleSheet;
619
- }
620
- get type() {
621
- return 0;
622
- }
623
- }, _a2.STYLE_RULE = 1, _a2.CHARSET_RULE = 2, _a2.IMPORT_RULE = 3, _a2.MEDIA_RULE = 4, _a2.FONT_FACE_RULE = 5, _a2.PAGE_RULE = 6, _a2.NAMESPACE_RULE = 10, _a2.KEYFRAMES_RULE = 7, _a2.KEYFRAME_RULE = 8, _a2.SUPPORTS_RULE = 12, _a2.COUNTER_STYLE_RULE = 11, _a2.FONT_FEATURE_VALUES_RULE = 14, _a2);
624
-
625
- // ../../node_modules/.pnpm/@lit-labs+ssr-dom-shim@1.5.1/node_modules/@lit-labs/ssr-dom-shim/index.js
626
- globalThis.Event ??= EventShimWithRealType;
627
- globalThis.CustomEvent ??= CustomEventShimWithRealType;
628
- var attributes = /* @__PURE__ */ new WeakMap();
629
- var attributesForElement = (element) => {
630
- let attrs = attributes.get(element);
631
- if (attrs === void 0) {
632
- attributes.set(element, attrs = /* @__PURE__ */ new Map());
633
- }
634
- return attrs;
635
- };
636
- var ElementShim = class Element extends EventTargetShimWithRealType {
637
- constructor() {
638
- super(...arguments);
639
- this.__shadowRootMode = null;
640
- this.__shadowRoot = null;
641
- this.__internals = null;
642
- }
643
- get attributes() {
644
- return Array.from(attributesForElement(this)).map(([name, value]) => ({
645
- name,
646
- value
647
- }));
648
- }
649
- get shadowRoot() {
650
- if (this.__shadowRootMode === "closed") {
651
- return null;
652
- }
653
- return this.__shadowRoot;
654
- }
655
- get localName() {
656
- return this.constructor.__localName;
657
- }
658
- get tagName() {
659
- return this.localName?.toUpperCase();
660
- }
661
- setAttribute(name, value) {
662
- attributesForElement(this).set(name, String(value));
663
- }
664
- removeAttribute(name) {
665
- attributesForElement(this).delete(name);
666
- }
667
- toggleAttribute(name, force) {
668
- if (this.hasAttribute(name)) {
669
- if (force === void 0 || !force) {
670
- this.removeAttribute(name);
671
- return false;
672
- }
673
- } else {
674
- if (force === void 0 || force) {
675
- this.setAttribute(name, "");
676
- return true;
677
- } else {
678
- return false;
679
- }
680
- }
681
- return true;
682
- }
683
- hasAttribute(name) {
684
- return attributesForElement(this).has(name);
685
- }
686
- attachShadow(init) {
687
- const shadowRoot = { host: this };
688
- this.__shadowRootMode = init.mode;
689
- if (init && init.mode === "open") {
690
- this.__shadowRoot = shadowRoot;
691
- }
692
- return shadowRoot;
693
- }
694
- attachInternals() {
695
- if (this.__internals !== null) {
696
- throw new Error(`Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.`);
697
- }
698
- const internals = new ElementInternalsShim(this);
699
- this.__internals = internals;
700
- return internals;
701
- }
702
- getAttribute(name) {
703
- const value = attributesForElement(this).get(name);
704
- return value ?? null;
705
- }
706
- };
707
- var HTMLElementShim = class HTMLElement extends ElementShim {
708
- };
709
- var HTMLElementShimWithRealType = HTMLElementShim;
710
- globalThis.litServerRoot ??= Object.defineProperty(new HTMLElementShimWithRealType(), "localName", {
711
- // Patch localName (and tagName) to return a unique name.
712
- get() {
713
- return "lit-server-root";
714
- }
715
- });
716
- function promiseWithResolvers() {
717
- let resolve;
718
- let reject;
719
- const promise = new Promise((res, rej) => {
720
- resolve = res;
721
- reject = rej;
722
- });
723
- return { promise, resolve, reject };
724
- }
725
- var CustomElementRegistry = class {
726
- constructor() {
727
- this.__definitions = /* @__PURE__ */ new Map();
728
- this.__reverseDefinitions = /* @__PURE__ */ new Map();
729
- this.__pendingWhenDefineds = /* @__PURE__ */ new Map();
730
- }
731
- define(name, ctor) {
732
- if (this.__definitions.has(name)) {
733
- if (process.env.NODE_ENV === "development") {
734
- console.warn(`'CustomElementRegistry' already has "${name}" defined. This may have been caused by live reload or hot module replacement in which case it can be safely ignored.
735
- Make sure to test your application with a production build as repeat registrations will throw in production.`);
736
- } else {
737
- throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the name "${name}" has already been used with this registry`);
738
- }
739
- }
740
- if (this.__reverseDefinitions.has(ctor)) {
741
- throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the constructor has already been used with this registry for the tag name ${this.__reverseDefinitions.get(ctor)}`);
742
- }
743
- ctor.__localName = name;
744
- this.__definitions.set(name, {
745
- ctor,
746
- // Note it's important we read `observedAttributes` in case it is a getter
747
- // with side-effects, as is the case in Lit, where it triggers class
748
- // finalization.
749
- //
750
- // TODO(aomarks) To be spec compliant, we should also capture the
751
- // registration-time lifecycle methods like `connectedCallback`. For them
752
- // to be actually accessible to e.g. the Lit SSR element renderer, though,
753
- // we'd need to introduce a new API for accessing them (since `get` only
754
- // returns the constructor).
755
- observedAttributes: ctor.observedAttributes ?? []
756
- });
757
- this.__reverseDefinitions.set(ctor, name);
758
- this.__pendingWhenDefineds.get(name)?.resolve(ctor);
759
- this.__pendingWhenDefineds.delete(name);
760
- }
761
- get(name) {
762
- const definition = this.__definitions.get(name);
763
- return definition?.ctor;
764
- }
765
- getName(ctor) {
766
- return this.__reverseDefinitions.get(ctor) ?? null;
767
- }
768
- upgrade(_element) {
769
- throw new Error(`customElements.upgrade is not currently supported in SSR. Please file a bug if you need it.`);
770
- }
771
- async whenDefined(name) {
772
- const definition = this.__definitions.get(name);
773
- if (definition) {
774
- return definition.ctor;
775
- }
776
- let withResolvers = this.__pendingWhenDefineds.get(name);
777
- if (!withResolvers) {
778
- withResolvers = promiseWithResolvers();
779
- this.__pendingWhenDefineds.set(name, withResolvers);
780
- }
781
- return withResolvers.promise;
782
- }
783
- };
784
- var CustomElementRegistryShimWithRealType = CustomElementRegistry;
785
- var customElements2 = new CustomElementRegistryShimWithRealType();
786
-
787
- // ../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/node/css-tag.js
788
- var t2 = globalThis;
789
- var e3 = t2.ShadowRoot && (void 0 === t2.ShadyCSS || t2.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype;
790
- var s4 = /* @__PURE__ */ Symbol();
791
- var o = /* @__PURE__ */ new WeakMap();
792
- var n2 = class {
793
- constructor(t4, e7, o7) {
794
- if (this._$cssResult$ = true, o7 !== s4) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
795
- this.cssText = t4, this.t = e7;
796
- }
797
- get styleSheet() {
798
- let t4 = this.o;
799
- const s7 = this.t;
800
- if (e3 && void 0 === t4) {
801
- const e7 = void 0 !== s7 && 1 === s7.length;
802
- e7 && (t4 = o.get(s7)), void 0 === t4 && ((this.o = t4 = new CSSStyleSheet()).replaceSync(this.cssText), e7 && o.set(s7, t4));
803
- }
804
- return t4;
805
- }
806
- toString() {
807
- return this.cssText;
808
- }
809
- };
810
- var r = (t4) => new n2("string" == typeof t4 ? t4 : t4 + "", void 0, s4);
811
- var i2 = (t4, ...e7) => {
812
- const o7 = 1 === t4.length ? t4[0] : e7.reduce((e8, s7, o8) => e8 + ((t5) => {
813
- if (true === t5._$cssResult$) return t5.cssText;
814
- if ("number" == typeof t5) return t5;
815
- throw Error("Value passed to 'css' function must be a 'css' function result: " + t5 + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
816
- })(s7) + t4[o8 + 1], t4[0]);
817
- return new n2(o7, t4, s4);
818
- };
819
- var S = (s7, o7) => {
820
- if (e3) s7.adoptedStyleSheets = o7.map((t4) => t4 instanceof CSSStyleSheet ? t4 : t4.styleSheet);
821
- else for (const e7 of o7) {
822
- const o8 = document.createElement("style"), n6 = t2.litNonce;
823
- void 0 !== n6 && o8.setAttribute("nonce", n6), o8.textContent = e7.cssText, s7.appendChild(o8);
824
- }
825
- };
826
- var c2 = e3 || void 0 === t2.CSSStyleSheet ? (t4) => t4 : (t4) => t4 instanceof CSSStyleSheet ? ((t5) => {
827
- let e7 = "";
828
- for (const s7 of t5.cssRules) e7 += s7.cssText;
829
- return r(e7);
830
- })(t4) : t4;
831
-
832
- // ../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/node/reactive-element.js
833
- var { is: h, defineProperty: r2, getOwnPropertyDescriptor: o2, getOwnPropertyNames: n3, getOwnPropertySymbols: a, getPrototypeOf: c3 } = Object;
834
- var l = globalThis;
835
- l.customElements ??= customElements2;
836
- var p = l.trustedTypes;
837
- var d = p ? p.emptyScript : "";
838
- var u = l.reactiveElementPolyfillSupport;
839
- var f = (t4, s7) => t4;
840
- var b = { toAttribute(t4, s7) {
841
- switch (s7) {
842
- case Boolean:
843
- t4 = t4 ? d : null;
844
- break;
845
- case Object:
846
- case Array:
847
- t4 = null == t4 ? t4 : JSON.stringify(t4);
848
- }
849
- return t4;
850
- }, fromAttribute(t4, s7) {
851
- let i5 = t4;
852
- switch (s7) {
853
- case Boolean:
854
- i5 = null !== t4;
855
- break;
856
- case Number:
857
- i5 = null === t4 ? null : Number(t4);
858
- break;
859
- case Object:
860
- case Array:
861
- try {
862
- i5 = JSON.parse(t4);
863
- } catch (t5) {
864
- i5 = null;
865
- }
866
- }
867
- return i5;
868
- } };
869
- var m = (t4, s7) => !h(t4, s7);
870
- var y = { attribute: true, type: String, converter: b, reflect: false, useDefault: false, hasChanged: m };
871
- Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), l.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
872
- var g = class extends (globalThis.HTMLElement ?? HTMLElementShimWithRealType) {
873
- static addInitializer(t4) {
874
- this._$Ei(), (this.l ??= []).push(t4);
875
- }
876
- static get observedAttributes() {
877
- return this.finalize(), this._$Eh && [...this._$Eh.keys()];
878
- }
879
- static createProperty(t4, s7 = y) {
880
- if (s7.state && (s7.attribute = false), this._$Ei(), this.prototype.hasOwnProperty(t4) && ((s7 = Object.create(s7)).wrapped = true), this.elementProperties.set(t4, s7), !s7.noAccessor) {
881
- const i5 = /* @__PURE__ */ Symbol(), e7 = this.getPropertyDescriptor(t4, i5, s7);
882
- void 0 !== e7 && r2(this.prototype, t4, e7);
883
- }
884
- }
885
- static getPropertyDescriptor(t4, s7, i5) {
886
- const { get: e7, set: h3 } = o2(this.prototype, t4) ?? { get() {
887
- return this[s7];
888
- }, set(t5) {
889
- this[s7] = t5;
890
- } };
891
- return { get: e7, set(s8) {
892
- const r6 = e7?.call(this);
893
- h3?.call(this, s8), this.requestUpdate(t4, r6, i5);
894
- }, configurable: true, enumerable: true };
895
- }
896
- static getPropertyOptions(t4) {
897
- return this.elementProperties.get(t4) ?? y;
898
- }
899
- static _$Ei() {
900
- if (this.hasOwnProperty(f("elementProperties"))) return;
901
- const t4 = c3(this);
902
- t4.finalize(), void 0 !== t4.l && (this.l = [...t4.l]), this.elementProperties = new Map(t4.elementProperties);
903
- }
904
- static finalize() {
905
- if (this.hasOwnProperty(f("finalized"))) return;
906
- if (this.finalized = true, this._$Ei(), this.hasOwnProperty(f("properties"))) {
907
- const t5 = this.properties, s7 = [...n3(t5), ...a(t5)];
908
- for (const i5 of s7) this.createProperty(i5, t5[i5]);
909
- }
910
- const t4 = this[Symbol.metadata];
911
- if (null !== t4) {
912
- const s7 = litPropertyMetadata.get(t4);
913
- if (void 0 !== s7) for (const [t5, i5] of s7) this.elementProperties.set(t5, i5);
914
- }
915
- this._$Eh = /* @__PURE__ */ new Map();
916
- for (const [t5, s7] of this.elementProperties) {
917
- const i5 = this._$Eu(t5, s7);
918
- void 0 !== i5 && this._$Eh.set(i5, t5);
919
- }
920
- this.elementStyles = this.finalizeStyles(this.styles);
921
- }
922
- static finalizeStyles(t4) {
923
- const s7 = [];
924
- if (Array.isArray(t4)) {
925
- const e7 = new Set(t4.flat(1 / 0).reverse());
926
- for (const t5 of e7) s7.unshift(c2(t5));
927
- } else void 0 !== t4 && s7.push(c2(t4));
928
- return s7;
929
- }
930
- static _$Eu(t4, s7) {
931
- const i5 = s7.attribute;
932
- return false === i5 ? void 0 : "string" == typeof i5 ? i5 : "string" == typeof t4 ? t4.toLowerCase() : void 0;
933
- }
934
- constructor() {
935
- super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev();
936
- }
937
- _$Ev() {
938
- this._$ES = new Promise((t4) => this.enableUpdating = t4), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((t4) => t4(this));
939
- }
940
- addController(t4) {
941
- (this._$EO ??= /* @__PURE__ */ new Set()).add(t4), void 0 !== this.renderRoot && this.isConnected && t4.hostConnected?.();
942
- }
943
- removeController(t4) {
944
- this._$EO?.delete(t4);
945
- }
946
- _$E_() {
947
- const t4 = /* @__PURE__ */ new Map(), s7 = this.constructor.elementProperties;
948
- for (const i5 of s7.keys()) this.hasOwnProperty(i5) && (t4.set(i5, this[i5]), delete this[i5]);
949
- t4.size > 0 && (this._$Ep = t4);
950
- }
951
- createRenderRoot() {
952
- const t4 = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
953
- return S(t4, this.constructor.elementStyles), t4;
954
- }
955
- connectedCallback() {
956
- this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach((t4) => t4.hostConnected?.());
957
- }
958
- enableUpdating(t4) {
959
- }
960
- disconnectedCallback() {
961
- this._$EO?.forEach((t4) => t4.hostDisconnected?.());
962
- }
963
- attributeChangedCallback(t4, s7, i5) {
964
- this._$AK(t4, i5);
965
- }
966
- _$ET(t4, s7) {
967
- const i5 = this.constructor.elementProperties.get(t4), e7 = this.constructor._$Eu(t4, i5);
968
- if (void 0 !== e7 && true === i5.reflect) {
969
- const h3 = (void 0 !== i5.converter?.toAttribute ? i5.converter : b).toAttribute(s7, i5.type);
970
- this._$Em = t4, null == h3 ? this.removeAttribute(e7) : this.setAttribute(e7, h3), this._$Em = null;
971
- }
972
- }
973
- _$AK(t4, s7) {
974
- const i5 = this.constructor, e7 = i5._$Eh.get(t4);
975
- if (void 0 !== e7 && this._$Em !== e7) {
976
- const t5 = i5.getPropertyOptions(e7), h3 = "function" == typeof t5.converter ? { fromAttribute: t5.converter } : void 0 !== t5.converter?.fromAttribute ? t5.converter : b;
977
- this._$Em = e7;
978
- const r6 = h3.fromAttribute(s7, t5.type);
979
- this[e7] = r6 ?? this._$Ej?.get(e7) ?? r6, this._$Em = null;
980
- }
981
- }
982
- requestUpdate(t4, s7, i5, e7 = false, h3) {
983
- if (void 0 !== t4) {
984
- const r6 = this.constructor;
985
- if (false === e7 && (h3 = this[t4]), i5 ??= r6.getPropertyOptions(t4), !((i5.hasChanged ?? m)(h3, s7) || i5.useDefault && i5.reflect && h3 === this._$Ej?.get(t4) && !this.hasAttribute(r6._$Eu(t4, i5)))) return;
986
- this.C(t4, s7, i5);
987
- }
988
- false === this.isUpdatePending && (this._$ES = this._$EP());
989
- }
990
- C(t4, s7, { useDefault: i5, reflect: e7, wrapped: h3 }, r6) {
991
- i5 && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t4) && (this._$Ej.set(t4, r6 ?? s7 ?? this[t4]), true !== h3 || void 0 !== r6) || (this._$AL.has(t4) || (this.hasUpdated || i5 || (s7 = void 0), this._$AL.set(t4, s7)), true === e7 && this._$Em !== t4 && (this._$Eq ??= /* @__PURE__ */ new Set()).add(t4));
992
- }
993
- async _$EP() {
994
- this.isUpdatePending = true;
995
- try {
996
- await this._$ES;
997
- } catch (t5) {
998
- Promise.reject(t5);
999
- }
1000
- const t4 = this.scheduleUpdate();
1001
- return null != t4 && await t4, !this.isUpdatePending;
1002
- }
1003
- scheduleUpdate() {
1004
- return this.performUpdate();
1005
- }
1006
- performUpdate() {
1007
- if (!this.isUpdatePending) return;
1008
- if (!this.hasUpdated) {
1009
- if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
1010
- for (const [t6, s8] of this._$Ep) this[t6] = s8;
1011
- this._$Ep = void 0;
1012
- }
1013
- const t5 = this.constructor.elementProperties;
1014
- if (t5.size > 0) for (const [s8, i5] of t5) {
1015
- const { wrapped: t6 } = i5, e7 = this[s8];
1016
- true !== t6 || this._$AL.has(s8) || void 0 === e7 || this.C(s8, void 0, i5, e7);
1017
- }
1018
- }
1019
- let t4 = false;
1020
- const s7 = this._$AL;
1021
- try {
1022
- t4 = this.shouldUpdate(s7), t4 ? (this.willUpdate(s7), this._$EO?.forEach((t5) => t5.hostUpdate?.()), this.update(s7)) : this._$EM();
1023
- } catch (s8) {
1024
- throw t4 = false, this._$EM(), s8;
1025
- }
1026
- t4 && this._$AE(s7);
1027
- }
1028
- willUpdate(t4) {
1029
- }
1030
- _$AE(t4) {
1031
- this._$EO?.forEach((t5) => t5.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t4)), this.updated(t4);
1032
- }
1033
- _$EM() {
1034
- this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = false;
1035
- }
1036
- get updateComplete() {
1037
- return this.getUpdateComplete();
1038
- }
1039
- getUpdateComplete() {
1040
- return this._$ES;
1041
- }
1042
- shouldUpdate(t4) {
1043
- return true;
1044
- }
1045
- update(t4) {
1046
- this._$Eq &&= this._$Eq.forEach((t5) => this._$ET(t5, this[t5])), this._$EM();
1047
- }
1048
- updated(t4) {
1049
- }
1050
- firstUpdated(t4) {
1051
- }
1052
- };
1053
- g.elementStyles = [], g.shadowRootOptions = { mode: "open" }, g[f("elementProperties")] = /* @__PURE__ */ new Map(), g[f("finalized")] = /* @__PURE__ */ new Map(), u?.({ ReactiveElement: g }), (l.reactiveElementVersions ??= []).push("2.1.2");
1054
-
1055
- // ../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/node/lit-html.js
1056
- var t3 = globalThis;
1057
- var i3 = (t4) => t4;
1058
- var s5 = t3.trustedTypes;
1059
- var e4 = s5 ? s5.createPolicy("lit-html", { createHTML: (t4) => t4 }) : void 0;
1060
- var h2 = "$lit$";
1061
- var o3 = `lit$${Math.random().toFixed(9).slice(2)}$`;
1062
- var n4 = "?" + o3;
1063
- var r3 = `<${n4}>`;
1064
- var l2 = void 0 === t3.document ? { createTreeWalker: () => ({}) } : document;
1065
- var c4 = () => l2.createComment("");
1066
- var a2 = (t4) => null === t4 || "object" != typeof t4 && "function" != typeof t4;
1067
- var u2 = Array.isArray;
1068
- var d2 = (t4) => u2(t4) || "function" == typeof t4?.[Symbol.iterator];
1069
- var f2 = "[ \n\f\r]";
1070
- var v = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g;
1071
- var _ = /-->/g;
1072
- var m2 = />/g;
1073
- var p2 = RegExp(`>|${f2}(?:([^\\s"'>=/]+)(${f2}*=${f2}*(?:[^
1074
- \f\r"'\`<>=]|("|')|))|$)`, "g");
1075
- var g2 = /'/g;
1076
- var $ = /"/g;
1077
- var y2 = /^(?:script|style|textarea|title)$/i;
1078
- var x = (t4) => (i5, ...s7) => ({ _$litType$: t4, strings: i5, values: s7 });
1079
- var T = x(1);
1080
- var b2 = x(2);
1081
- var w = x(3);
1082
- var E = /* @__PURE__ */ Symbol.for("lit-noChange");
1083
- var A = /* @__PURE__ */ Symbol.for("lit-nothing");
1084
- var C = /* @__PURE__ */ new WeakMap();
1085
- var P = l2.createTreeWalker(l2, 129);
1086
- function V(t4, i5) {
1087
- if (!u2(t4) || !t4.hasOwnProperty("raw")) throw Error("invalid template strings array");
1088
- return void 0 !== e4 ? e4.createHTML(i5) : i5;
1089
- }
1090
- var N = (t4, i5) => {
1091
- const s7 = t4.length - 1, e7 = [];
1092
- let n6, l3 = 2 === i5 ? "<svg>" : 3 === i5 ? "<math>" : "", c5 = v;
1093
- for (let i6 = 0; i6 < s7; i6++) {
1094
- const s8 = t4[i6];
1095
- let a3, u3, d3 = -1, f3 = 0;
1096
- for (; f3 < s8.length && (c5.lastIndex = f3, u3 = c5.exec(s8), null !== u3); ) f3 = c5.lastIndex, c5 === v ? "!--" === u3[1] ? c5 = _ : void 0 !== u3[1] ? c5 = m2 : void 0 !== u3[2] ? (y2.test(u3[2]) && (n6 = RegExp("</" + u3[2], "g")), c5 = p2) : void 0 !== u3[3] && (c5 = p2) : c5 === p2 ? ">" === u3[0] ? (c5 = n6 ?? v, d3 = -1) : void 0 === u3[1] ? d3 = -2 : (d3 = c5.lastIndex - u3[2].length, a3 = u3[1], c5 = void 0 === u3[3] ? p2 : '"' === u3[3] ? $ : g2) : c5 === $ || c5 === g2 ? c5 = p2 : c5 === _ || c5 === m2 ? c5 = v : (c5 = p2, n6 = void 0);
1097
- const x2 = c5 === p2 && t4[i6 + 1].startsWith("/>") ? " " : "";
1098
- l3 += c5 === v ? s8 + r3 : d3 >= 0 ? (e7.push(a3), s8.slice(0, d3) + h2 + s8.slice(d3) + o3 + x2) : s8 + o3 + (-2 === d3 ? i6 : x2);
1099
- }
1100
- return [V(t4, l3 + (t4[s7] || "<?>") + (2 === i5 ? "</svg>" : 3 === i5 ? "</math>" : "")), e7];
1101
- };
1102
- var S2 = class _S {
1103
- constructor({ strings: t4, _$litType$: i5 }, e7) {
1104
- let r6;
1105
- this.parts = [];
1106
- let l3 = 0, a3 = 0;
1107
- const u3 = t4.length - 1, d3 = this.parts, [f3, v2] = N(t4, i5);
1108
- if (this.el = _S.createElement(f3, e7), P.currentNode = this.el.content, 2 === i5 || 3 === i5) {
1109
- const t5 = this.el.content.firstChild;
1110
- t5.replaceWith(...t5.childNodes);
1111
- }
1112
- for (; null !== (r6 = P.nextNode()) && d3.length < u3; ) {
1113
- if (1 === r6.nodeType) {
1114
- if (r6.hasAttributes()) for (const t5 of r6.getAttributeNames()) if (t5.endsWith(h2)) {
1115
- const i6 = v2[a3++], s7 = r6.getAttribute(t5).split(o3), e8 = /([.?@])?(.*)/.exec(i6);
1116
- d3.push({ type: 1, index: l3, name: e8[2], strings: s7, ctor: "." === e8[1] ? I : "?" === e8[1] ? L : "@" === e8[1] ? z : H }), r6.removeAttribute(t5);
1117
- } else t5.startsWith(o3) && (d3.push({ type: 6, index: l3 }), r6.removeAttribute(t5));
1118
- if (y2.test(r6.tagName)) {
1119
- const t5 = r6.textContent.split(o3), i6 = t5.length - 1;
1120
- if (i6 > 0) {
1121
- r6.textContent = s5 ? s5.emptyScript : "";
1122
- for (let s7 = 0; s7 < i6; s7++) r6.append(t5[s7], c4()), P.nextNode(), d3.push({ type: 2, index: ++l3 });
1123
- r6.append(t5[i6], c4());
1124
- }
1125
- }
1126
- } else if (8 === r6.nodeType) if (r6.data === n4) d3.push({ type: 2, index: l3 });
1127
- else {
1128
- let t5 = -1;
1129
- for (; -1 !== (t5 = r6.data.indexOf(o3, t5 + 1)); ) d3.push({ type: 7, index: l3 }), t5 += o3.length - 1;
1130
- }
1131
- l3++;
1132
- }
1133
- }
1134
- static createElement(t4, i5) {
1135
- const s7 = l2.createElement("template");
1136
- return s7.innerHTML = t4, s7;
1137
- }
1138
- };
1139
- function M(t4, i5, s7 = t4, e7) {
1140
- if (i5 === E) return i5;
1141
- let h3 = void 0 !== e7 ? s7._$Co?.[e7] : s7._$Cl;
1142
- const o7 = a2(i5) ? void 0 : i5._$litDirective$;
1143
- return h3?.constructor !== o7 && (h3?._$AO?.(false), void 0 === o7 ? h3 = void 0 : (h3 = new o7(t4), h3._$AT(t4, s7, e7)), void 0 !== e7 ? (s7._$Co ??= [])[e7] = h3 : s7._$Cl = h3), void 0 !== h3 && (i5 = M(t4, h3._$AS(t4, i5.values), h3, e7)), i5;
1144
- }
1145
- var k = class {
1146
- constructor(t4, i5) {
1147
- this._$AV = [], this._$AN = void 0, this._$AD = t4, this._$AM = i5;
1148
- }
1149
- get parentNode() {
1150
- return this._$AM.parentNode;
1151
- }
1152
- get _$AU() {
1153
- return this._$AM._$AU;
1154
- }
1155
- u(t4) {
1156
- const { el: { content: i5 }, parts: s7 } = this._$AD, e7 = (t4?.creationScope ?? l2).importNode(i5, true);
1157
- P.currentNode = e7;
1158
- let h3 = P.nextNode(), o7 = 0, n6 = 0, r6 = s7[0];
1159
- for (; void 0 !== r6; ) {
1160
- if (o7 === r6.index) {
1161
- let i6;
1162
- 2 === r6.type ? i6 = new R(h3, h3.nextSibling, this, t4) : 1 === r6.type ? i6 = new r6.ctor(h3, r6.name, r6.strings, this, t4) : 6 === r6.type && (i6 = new W(h3, this, t4)), this._$AV.push(i6), r6 = s7[++n6];
1163
- }
1164
- o7 !== r6?.index && (h3 = P.nextNode(), o7++);
1165
- }
1166
- return P.currentNode = l2, e7;
1167
- }
1168
- p(t4) {
1169
- let i5 = 0;
1170
- for (const s7 of this._$AV) void 0 !== s7 && (void 0 !== s7.strings ? (s7._$AI(t4, s7, i5), i5 += s7.strings.length - 2) : s7._$AI(t4[i5])), i5++;
1171
- }
1172
- };
1173
- var R = class _R {
1174
- get _$AU() {
1175
- return this._$AM?._$AU ?? this._$Cv;
1176
- }
1177
- constructor(t4, i5, s7, e7) {
1178
- this.type = 2, this._$AH = A, this._$AN = void 0, this._$AA = t4, this._$AB = i5, this._$AM = s7, this.options = e7, this._$Cv = e7?.isConnected ?? true;
1179
- }
1180
- get parentNode() {
1181
- let t4 = this._$AA.parentNode;
1182
- const i5 = this._$AM;
1183
- return void 0 !== i5 && 11 === t4?.nodeType && (t4 = i5.parentNode), t4;
1184
- }
1185
- get startNode() {
1186
- return this._$AA;
1187
- }
1188
- get endNode() {
1189
- return this._$AB;
1190
- }
1191
- _$AI(t4, i5 = this) {
1192
- t4 = M(this, t4, i5), a2(t4) ? t4 === A || null == t4 || "" === t4 ? (this._$AH !== A && this._$AR(), this._$AH = A) : t4 !== this._$AH && t4 !== E && this._(t4) : void 0 !== t4._$litType$ ? this.$(t4) : void 0 !== t4.nodeType ? this.T(t4) : d2(t4) ? this.k(t4) : this._(t4);
1193
- }
1194
- O(t4) {
1195
- return this._$AA.parentNode.insertBefore(t4, this._$AB);
1196
- }
1197
- T(t4) {
1198
- this._$AH !== t4 && (this._$AR(), this._$AH = this.O(t4));
1199
- }
1200
- _(t4) {
1201
- this._$AH !== A && a2(this._$AH) ? this._$AA.nextSibling.data = t4 : this.T(l2.createTextNode(t4)), this._$AH = t4;
1202
- }
1203
- $(t4) {
1204
- const { values: i5, _$litType$: s7 } = t4, e7 = "number" == typeof s7 ? this._$AC(t4) : (void 0 === s7.el && (s7.el = S2.createElement(V(s7.h, s7.h[0]), this.options)), s7);
1205
- if (this._$AH?._$AD === e7) this._$AH.p(i5);
1206
- else {
1207
- const t5 = new k(e7, this), s8 = t5.u(this.options);
1208
- t5.p(i5), this.T(s8), this._$AH = t5;
1209
- }
1210
- }
1211
- _$AC(t4) {
1212
- let i5 = C.get(t4.strings);
1213
- return void 0 === i5 && C.set(t4.strings, i5 = new S2(t4)), i5;
1214
- }
1215
- k(t4) {
1216
- u2(this._$AH) || (this._$AH = [], this._$AR());
1217
- const i5 = this._$AH;
1218
- let s7, e7 = 0;
1219
- for (const h3 of t4) e7 === i5.length ? i5.push(s7 = new _R(this.O(c4()), this.O(c4()), this, this.options)) : s7 = i5[e7], s7._$AI(h3), e7++;
1220
- e7 < i5.length && (this._$AR(s7 && s7._$AB.nextSibling, e7), i5.length = e7);
1221
- }
1222
- _$AR(t4 = this._$AA.nextSibling, s7) {
1223
- for (this._$AP?.(false, true, s7); t4 !== this._$AB; ) {
1224
- const s8 = i3(t4).nextSibling;
1225
- i3(t4).remove(), t4 = s8;
1226
- }
1227
- }
1228
- setConnected(t4) {
1229
- void 0 === this._$AM && (this._$Cv = t4, this._$AP?.(t4));
1230
- }
1231
- };
1232
- var H = class {
1233
- get tagName() {
1234
- return this.element.tagName;
1235
- }
1236
- get _$AU() {
1237
- return this._$AM._$AU;
1238
- }
1239
- constructor(t4, i5, s7, e7, h3) {
1240
- this.type = 1, this._$AH = A, this._$AN = void 0, this.element = t4, this.name = i5, this._$AM = e7, this.options = h3, s7.length > 2 || "" !== s7[0] || "" !== s7[1] ? (this._$AH = Array(s7.length - 1).fill(new String()), this.strings = s7) : this._$AH = A;
1241
- }
1242
- _$AI(t4, i5 = this, s7, e7) {
1243
- const h3 = this.strings;
1244
- let o7 = false;
1245
- if (void 0 === h3) t4 = M(this, t4, i5, 0), o7 = !a2(t4) || t4 !== this._$AH && t4 !== E, o7 && (this._$AH = t4);
1246
- else {
1247
- const e8 = t4;
1248
- let n6, r6;
1249
- for (t4 = h3[0], n6 = 0; n6 < h3.length - 1; n6++) r6 = M(this, e8[s7 + n6], i5, n6), r6 === E && (r6 = this._$AH[n6]), o7 ||= !a2(r6) || r6 !== this._$AH[n6], r6 === A ? t4 = A : t4 !== A && (t4 += (r6 ?? "") + h3[n6 + 1]), this._$AH[n6] = r6;
1250
- }
1251
- o7 && !e7 && this.j(t4);
1252
- }
1253
- j(t4) {
1254
- t4 === A ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t4 ?? "");
1255
- }
1256
- };
1257
- var I = class extends H {
1258
- constructor() {
1259
- super(...arguments), this.type = 3;
1260
- }
1261
- j(t4) {
1262
- this.element[this.name] = t4 === A ? void 0 : t4;
1263
- }
1264
- };
1265
- var L = class extends H {
1266
- constructor() {
1267
- super(...arguments), this.type = 4;
1268
- }
1269
- j(t4) {
1270
- this.element.toggleAttribute(this.name, !!t4 && t4 !== A);
1271
- }
1272
- };
1273
- var z = class extends H {
1274
- constructor(t4, i5, s7, e7, h3) {
1275
- super(t4, i5, s7, e7, h3), this.type = 5;
1276
- }
1277
- _$AI(t4, i5 = this) {
1278
- if ((t4 = M(this, t4, i5, 0) ?? A) === E) return;
1279
- const s7 = this._$AH, e7 = t4 === A && s7 !== A || t4.capture !== s7.capture || t4.once !== s7.once || t4.passive !== s7.passive, h3 = t4 !== A && (s7 === A || e7);
1280
- e7 && this.element.removeEventListener(this.name, this, s7), h3 && this.element.addEventListener(this.name, this, t4), this._$AH = t4;
1281
- }
1282
- handleEvent(t4) {
1283
- "function" == typeof this._$AH ? this._$AH.call(this.options?.host ?? this.element, t4) : this._$AH.handleEvent(t4);
1284
- }
1285
- };
1286
- var W = class {
1287
- constructor(t4, i5, s7) {
1288
- this.element = t4, this.type = 6, this._$AN = void 0, this._$AM = i5, this.options = s7;
1289
- }
1290
- get _$AU() {
1291
- return this._$AM._$AU;
1292
- }
1293
- _$AI(t4) {
1294
- M(this, t4);
1295
- }
1296
- };
1297
- var Z = { M: h2, P: o3, A: n4, C: 1, L: N, R: k, D: d2, V: M, I: R, H, N: L, U: z, B: I, F: W };
1298
- var j = t3.litHtmlPolyfillSupport;
1299
- j?.(S2, R), (t3.litHtmlVersions ??= []).push("3.3.2");
1300
- var B = (t4, i5, s7) => {
1301
- const e7 = s7?.renderBefore ?? i5;
1302
- let h3 = e7._$litPart$;
1303
- if (void 0 === h3) {
1304
- const t5 = s7?.renderBefore ?? null;
1305
- e7._$litPart$ = h3 = new R(i5.insertBefore(c4(), t5), t5, void 0, s7 ?? {});
1306
- }
1307
- return h3._$AI(t4), h3;
1308
- };
1309
-
1310
- // ../../node_modules/.pnpm/lit-element@4.2.2/node_modules/lit-element/lit-element.js
1311
- var s6 = globalThis;
1312
- var i4 = class extends g {
1313
- constructor() {
1314
- super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
1315
- }
1316
- createRenderRoot() {
1317
- const t4 = super.createRenderRoot();
1318
- return this.renderOptions.renderBefore ??= t4.firstChild, t4;
1319
- }
1320
- update(t4) {
1321
- const r6 = this.render();
1322
- this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t4), this._$Do = B(r6, this.renderRoot, this.renderOptions);
1323
- }
1324
- connectedCallback() {
1325
- super.connectedCallback(), this._$Do?.setConnected(true);
1326
- }
1327
- disconnectedCallback() {
1328
- super.disconnectedCallback(), this._$Do?.setConnected(false);
1329
- }
1330
- render() {
1331
- return E;
1332
- }
1333
- };
1334
- i4._$litElement$ = true, i4["finalized"] = true, s6.litElementHydrateSupport?.({ LitElement: i4 });
1335
- var o4 = s6.litElementPolyfillSupport;
1336
- o4?.({ LitElement: i4 });
1337
- (s6.litElementVersions ??= []).push("4.2.2");
1338
-
1339
- // ../qti-base/dist/styles/box-sizing.styles.js
1340
- var boxSizing = i2`
1341
- :host {
1342
- box-sizing: border-box;
1343
- }
1344
-
1345
- *,
1346
- *::before,
1347
- *::after {
1348
- box-sizing: inherit;
1349
- }
1350
- `;
1351
-
1352
- // ../qti-base/dist/styles/drop-region.styles.js
1353
- var dropRegion = i2`
1354
- [part~='drop'] {
1355
- /*
1356
- * The one deliberate opt-out from the border-box reset.
1357
- *
1358
- * --qti-dropzone-min-* is the border-box of the largest chip, and what has to hold that chip is
1359
- * this region's *content* area. Under border-box a theme's dashed drop border is subtracted
1360
- * from the chip's own size, the content comes up short, and the drop grows the moment a chip
1361
- * lands in it. Order's drop did exactly that: 64px empty, 66px full, for a 1px border.
1362
- */
1363
- box-sizing: content-box;
1364
-
1365
- /*
1366
- * No padding, and no token for one.
1367
- *
1368
- * A drop reserves --qti-dropzone-min-*, which is the chip's BORDER-box, as this region's CONTENT
1369
- * area — so the chip already fits exactly, with nothing to spare and nothing squeezed. An inset
1370
- * on top would only make the drop bigger than the thing it holds.
1371
- *
1372
- * There was a 1px one, to make the drop read as a frame a hair outside the chip. It never painted:
1373
- * an EMPTY slot has nothing inside the inset to separate from, and a FILLED one hides its edge
1374
- * (DROP-SIZING.md §4), so both states spent 2px on an invisible ring. The one drop that genuinely
1375
- * wants breathing room — match's category card — declares padding on its own rule, which a
1376
- * theme reaches with ::part(drop). A token in between bought nothing.
1377
- */
1378
- display: flex;
1379
- flex-wrap: wrap;
1380
- align-items: flex-start;
1381
- justify-content: flex-start;
1382
- /* No gap either: 0 is the flex initial value, so the declaration only existed to host a token.
1383
- A drop that wants space between chips sets gap on its own rule. */
1384
- /* Containing block for anything a theme draws over the drop. Was 'position: relative' in the
1385
- theme's 'drop' mixin, which put a document stylesheet in charge of a shadow node's position. */
1386
- position: relative;
1387
- }
1388
-
1389
- [part~='drop'] > * {
1390
- flex: 0 1 auto;
1391
- align-self: flex-start;
1392
- }
1393
- `;
1394
-
1395
- // ../qti-base/dist/styles/validation-message.styles.js
1396
- var validationMessage = i2`
1397
- [part~='message'] {
1398
- display: none;
1399
- }
1400
- `;
1401
-
1402
- // ../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/node/decorators/property.js
1403
- var o5 = { attribute: true, type: String, converter: b, reflect: false, hasChanged: m };
1404
- var r4 = (t4 = o5, e7, r6) => {
1405
- const { kind: n6, metadata: i5 } = r6;
1406
- let s7 = globalThis.litPropertyMetadata.get(i5);
1407
- if (void 0 === s7 && globalThis.litPropertyMetadata.set(i5, s7 = /* @__PURE__ */ new Map()), "setter" === n6 && ((t4 = Object.create(t4)).wrapped = true), s7.set(r6.name, t4), "accessor" === n6) {
1408
- const { name: o7 } = r6;
1409
- return { set(r7) {
1410
- const n7 = e7.get.call(this);
1411
- e7.set.call(this, r7), this.requestUpdate(o7, n7, t4, true, r7);
1412
- }, init(e8) {
1413
- return void 0 !== e8 && this.C(o7, void 0, t4, e8), e8;
1414
- } };
1415
- }
1416
- if ("setter" === n6) {
1417
- const { name: o7 } = r6;
1418
- return function(r7) {
1419
- const n7 = this[o7];
1420
- e7.call(this, r7), this.requestUpdate(o7, n7, t4, true, r7);
1421
- };
1422
- }
1423
- throw Error("Unsupported decorator location: " + n6);
1424
- };
1425
- function n5(t4) {
1426
- return (e7, o7) => "object" == typeof o7 ? r4(t4, e7, o7) : ((t5, e8, o8) => {
1427
- const r6 = e8.hasOwnProperty(o8);
1428
- return e8.constructor.createProperty(o8, t5), r6 ? Object.getOwnPropertyDescriptor(e8, o8) : void 0;
1429
- })(t4, e7, o7);
1430
- }
1431
-
1432
- // ../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/node/decorators/state.js
1433
- function r5(r6) {
1434
- return n5({ ...r6, state: true, attribute: false });
1435
- }
1436
-
1437
- // ../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/node/decorators/base.js
1438
- var e5 = (e7, t4, c5) => (c5.configurable = true, c5.enumerable = true, Reflect.decorate && "object" != typeof t4 && Object.defineProperty(e7, t4, c5), c5);
1439
-
1440
- // ../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/node/decorators/query.js
1441
- function e6(e7, r6) {
1442
- return (n6, s7, i5) => {
1443
- const o7 = (t4) => t4.renderRoot?.querySelector(e7) ?? null;
1444
- if (r6) {
1445
- const { get: e8, set: r7 } = "object" == typeof s7 ? n6 : i5 ?? /* @__PURE__ */ (() => {
1446
- const t4 = /* @__PURE__ */ Symbol();
1447
- return { get() {
1448
- return this[t4];
1449
- }, set(e9) {
1450
- this[t4] = e9;
1451
- } };
1452
- })();
1453
- return e5(n6, s7, { get() {
1454
- let t4 = e8.call(this);
1455
- return void 0 === t4 && (t4 = o7(this), (null !== t4 || this.hasUpdated) && r7.call(this, t4)), t4;
1456
- } });
1457
- }
1458
- return e5(n6, s7, { get() {
1459
- return o7(this);
1460
- } });
1461
- };
1462
- }
1463
-
1464
- // ../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/node/decorators/query-assigned-elements.js
1465
- function o6(o7) {
1466
- return (e7, n6) => {
1467
- const { slot: r6, selector: s7 } = o7 ?? {}, c5 = "slot" + (r6 ? `[name=${r6}]` : ":not([name])");
1468
- return e5(e7, n6, { get() {
1469
- const t4 = this.renderRoot?.querySelector(c5), e8 = t4?.assignedElements(o7) ?? [];
1470
- return void 0 === s7 ? e8 : e8.filter((t5) => t5.matches(s7));
1471
- } });
1472
- };
1473
- }
1474
-
1475
- // ../qti-base/dist/abstract/interaction.js
1476
- var __decorate = function(decorators, target, key, desc) {
1477
- var c5 = arguments.length, r6 = c5 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d3;
1478
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r6 = Reflect.decorate(decorators, target, key, desc);
1479
- else for (var i5 = decorators.length - 1; i5 >= 0; i5--) if (d3 = decorators[i5]) r6 = (c5 < 3 ? d3(r6) : c5 > 3 ? d3(target, key, r6) : d3(target, key)) || r6;
1480
- return c5 > 3 && r6 && Object.defineProperty(target, key, r6), r6;
1481
- };
1482
- var Interaction = class extends i4 {
1483
- #didLogDisableAfterIfMaxChoicesReachedDeprecation;
1484
- static {
1485
- this.formAssociated = true;
1486
- }
1487
- get internals() {
1488
- return this._internals;
1489
- }
1490
- /** Extension point used by wrappers that should not register as candidate inputs. */
1491
- get registersWithItem() {
1492
- return true;
1493
- }
1494
- get isInline() {
1495
- return false;
1496
- }
1497
- get responseVariable() {
1498
- if (!this._context?.variables) {
1499
- return void 0;
1500
- }
1501
- const responseVariables = this._context.variables.filter((v2) => v2.type === "response");
1502
- const responseIdentifier = this.getAttribute("response-identifier");
1503
- return responseVariables.find((v2) => v2.identifier === responseIdentifier);
1504
- }
1505
- get value() {
1506
- return JSON.stringify(this.response);
1507
- }
1508
- set value(val) {
1509
- this.response = val ? JSON.parse(val) : null;
1510
- }
1511
- reportValidity() {
1512
- const isValid = this._internals.validity.valid;
1513
- const mode = this.validationDisplayMode;
1514
- if (mode === "native" || mode === "both") {
1515
- this._internals.reportValidity();
1516
- }
1517
- if (mode === "inline" || mode === "both") {
1518
- this.updateInlineValidationMessage();
1519
- } else {
1520
- this.clearInlineValidationMessage();
1521
- }
1522
- if (mode === "none") {
1523
- this.clearInlineValidationMessage();
1524
- }
1525
- return isValid;
1526
- }
1527
- get validationDisplayMode() {
1528
- return this.configContext?.validationDisplayMode ?? "inline";
1529
- }
1530
- resolveAllowReorder(options) {
1531
- const defaultWhenUnset = options?.defaultWhenUnset ?? true;
1532
- const config = this.configContext;
1533
- if (!config) {
1534
- return defaultWhenUnset;
1535
- }
1536
- if (config.allowReorder !== void 0) {
1537
- return config.allowReorder;
1538
- }
1539
- return defaultWhenUnset;
1540
- }
1541
- resolveDisableAfterMaxReached(options) {
1542
- const defaultWhenUnset = options?.defaultWhenUnset ?? false;
1543
- const config = this.configContext;
1544
- if (!config) {
1545
- return defaultWhenUnset;
1546
- }
1547
- if (config.disableAfterMaxReached !== void 0) {
1548
- return config.disableAfterMaxReached;
1549
- }
1550
- if (config.disableAfterIfMaxChoicesReached !== void 0) {
1551
- if (!this.#didLogDisableAfterIfMaxChoicesReachedDeprecation) {
1552
- this.#didLogDisableAfterIfMaxChoicesReachedDeprecation = true;
1553
- console.log("[QTI Config] `disableAfterIfMaxChoicesReached` is deprecated. Use `disableAfterMaxReached` instead.");
1554
- }
1555
- return config.disableAfterIfMaxChoicesReached;
1556
- }
1557
- return defaultWhenUnset;
1558
- }
1559
- setInteractionValidity(isValid, validityMessage = "", anchor, options) {
1560
- const validityAnchor = anchor ?? this;
1561
- this._internals.setValidity(isValid ? {} : { customError: true }, validityMessage, validityAnchor);
1562
- if (options?.suppressInline !== true && (this.validationDisplayMode === "inline" || this.validationDisplayMode === "both")) {
1563
- this.updateInlineValidationMessage();
1564
- }
1565
- }
1566
- updateInlineValidationMessage() {
1567
- const validationMessageElement = this.getValidationMessageElement();
1568
- if (!validationMessageElement) {
1569
- return;
1570
- }
1571
- if (!this._internals.validity.valid) {
1572
- validationMessageElement.textContent = this._internals.validationMessage;
1573
- validationMessageElement.style.setProperty("display", "block", "important");
1574
- return;
1575
- }
1576
- validationMessageElement.textContent = "";
1577
- validationMessageElement.style.display = "none";
1578
- }
1579
- clearInlineValidationMessage() {
1580
- const validationMessageElement = this.getValidationMessageElement();
1581
- if (!validationMessageElement) {
1582
- return;
1583
- }
1584
- validationMessageElement.textContent = "";
1585
- validationMessageElement.style.display = "none";
1586
- }
1587
- getValidationMessageElement() {
1588
- return this.shadowRoot?.querySelector("#validation-message");
1589
- }
1590
- reset() {
1591
- this.response = null;
1592
- }
1593
- formResetCallback() {
1594
- this.reset();
1595
- }
1596
- connectedCallback() {
1597
- super.connectedCallback();
1598
- if (!this.registersWithItem) {
1599
- return;
1600
- }
1601
- this.dispatchEvent(new CustomEvent("qti-register-interaction", {
1602
- bubbles: true,
1603
- composed: true,
1604
- cancelable: false,
1605
- detail: {
1606
- interactionElement: this,
1607
- responseIdentifier: this.responseIdentifier
1608
- }
1609
- }));
1610
- }
1611
- saveResponse(value, state) {
1612
- this.dispatchEvent(new CustomEvent("qti-interaction-response", {
1613
- bubbles: true,
1614
- composed: true,
1615
- cancelable: false,
1616
- detail: {
1617
- responseIdentifier: this.responseIdentifier,
1618
- response: Array.isArray(value) ? [...value] : value,
1619
- ...state !== void 0 ? { state } : {}
1620
- }
1621
- }));
1622
- }
1623
- constructor() {
1624
- super();
1625
- this.#didLogDisableAfterIfMaxChoicesReachedDeprecation = false;
1626
- this._interactionContext = { choiceRole: null, draggablesSelector: null };
1627
- this.disabled = false;
1628
- this.readonly = false;
1629
- this._internals = this.attachInternals();
1630
- }
1631
- /** Optional lifecycle bridge for interaction subclasses that do not need changed-property data. */
1632
- firstUpdated(_changedProperties) {
1633
- }
1634
- };
1635
- __decorate([
1636
- c({ context: itemContext, subscribe: true })
1637
- ], Interaction.prototype, "_context", void 0);
1638
- __decorate([
1639
- c({ context: configContext, subscribe: true })
1640
- ], Interaction.prototype, "configContext", void 0);
1641
- __decorate([
1642
- e2({ context: interactionContext })
1643
- ], Interaction.prototype, "_interactionContext", void 0);
1644
- __decorate([
1645
- n5({ type: String, attribute: "response-identifier" })
1646
- ], Interaction.prototype, "responseIdentifier", void 0);
1647
- __decorate([
1648
- n5({ reflect: true, type: Boolean })
1649
- ], Interaction.prototype, "disabled", void 0);
1650
- __decorate([
1651
- n5({ reflect: true, type: Boolean })
1652
- ], Interaction.prototype, "readonly", void 0);
1653
- __decorate([
1654
- n5({ type: String })
1655
- ], Interaction.prototype, "name", void 0);
1656
-
1657
- // ../qti-base/dist/abstract/qti-variable-declaration.js
1658
- var QtiVariableDeclaration = class extends i4 {
1659
- render() {
1660
- return T`<slot></slot>`;
1661
- }
1662
- defaultValues(cardinality) {
1663
- const htmlValues = Array.from(this.querySelectorAll("qti-default-value > qti-value"));
1664
- if (htmlValues.length === 0) {
1665
- return null;
1666
- }
1667
- const defaultValues = htmlValues.map((n6) => n6.innerHTML.trim());
1668
- if (defaultValues.length > 1 || cardinality === "multiple" || cardinality === "ordered") {
1669
- return defaultValues;
1670
- }
1671
- return defaultValues[0];
1672
- }
1673
- };
1674
-
1675
- // ../qti-base/dist/abstract/qti-expression.js
1676
- var __decorate2 = function(decorators, target, key, desc) {
1677
- var c5 = arguments.length, r6 = c5 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d3;
1678
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r6 = Reflect.decorate(decorators, target, key, desc);
1679
- else for (var i5 = decorators.length - 1; i5 >= 0; i5--) if (d3 = decorators[i5]) r6 = (c5 < 3 ? d3(r6) : c5 > 3 ? d3(target, key, r6) : d3(target, key)) || r6;
1680
- return c5 > 3 && r6 && Object.defineProperty(target, key, r6), r6;
1681
- };
1682
- var QtiExpression = class extends i4 {
1683
- constructor() {
1684
- super(...arguments);
1685
- this.getVariables = () => (
1686
- // FIXME: if this itself is multiple, this will never enter the qti-multiple switch
1687
- // See this example here: https://github.com/1EdTech/qti-examples/blob/master/qtiv3-examples/packaging/items/Example05-feedbackBlock-adaptive.xml
1688
- Array.from(this.children).map((e7) => {
1689
- console.debug("getVariables", e7.tagName.toLowerCase());
1690
- switch (e7.tagName.toLowerCase()) {
1691
- case "qti-base-value": {
1692
- return {
1693
- baseType: e7.getAttribute("base-type"),
1694
- value: e7.textContent.trim(),
1695
- cardinality: "single"
1696
- };
1697
- }
1698
- case "qti-variable": {
1699
- const identifier = e7.getAttribute("identifier") || "";
1700
- if (identifier === "QTI_CONTEXT") {
1701
- if (!this.qtiContext?.QTI_CONTEXT) {
1702
- console.warn("QTI_CONTEXT not available");
1703
- return {
1704
- identifier: "QTI_CONTEXT",
1705
- baseType: "record",
1706
- value: this.qtiContext.QTI_CONTEXT,
1707
- cardinality: "record",
1708
- type: "context"
1709
- };
1710
- }
1711
- return {
1712
- identifier: "QTI_CONTEXT",
1713
- baseType: "record",
1714
- value: this.qtiContext.QTI_CONTEXT,
1715
- cardinality: "record",
1716
- type: "context"
1717
- };
1718
- }
1719
- const variable = this.context.variables.find((v2) => v2.identifier === identifier) || null;
1720
- return variable;
1721
- }
1722
- case "qti-multiple": {
1723
- const multiple = e7;
1724
- const values = multiple.getResult();
1725
- console.debug("values", values);
1726
- if (values?.length > 0) {
1727
- return {
1728
- identifier: "",
1729
- baseType: values[0].baseType,
1730
- value: values.map((v2) => v2.value),
1731
- cardinality: "multiple",
1732
- type: "response"
1733
- };
1734
- }
1735
- return null;
1736
- }
1737
- case "qti-ordered": {
1738
- const multiple = e7;
1739
- const values = multiple.getResult();
1740
- if (values?.length > 0) {
1741
- return {
1742
- identifier: "",
1743
- baseType: values[0].baseType,
1744
- value: values.map((v2) => v2.value),
1745
- cardinality: "ordered",
1746
- type: "response"
1747
- };
1748
- }
1749
- return null;
1750
- }
1751
- case "qti-repeat": {
1752
- const repeat = e7;
1753
- const values = repeat.getResult();
1754
- if (values?.length > 0) {
1755
- return values;
1756
- }
1757
- return null;
1758
- }
1759
- case "qti-correct": {
1760
- const identifier = e7.getAttribute("identifier") || "";
1761
- const responseVariable = this.context?.variables?.find((v2) => v2.identifier === identifier) || null;
1762
- return {
1763
- baseType: responseVariable.baseType,
1764
- value: responseVariable.correctResponse,
1765
- cardinality: responseVariable.cardinality
1766
- };
1767
- }
1768
- default: {
1769
- try {
1770
- const expression = e7;
1771
- const value = expression.getResult();
1772
- return {
1773
- baseType: "integer",
1774
- value: value?.toString() || null,
1775
- cardinality: "single"
1776
- };
1777
- } catch (error) {
1778
- console.warn("default not sufficient");
1779
- }
1780
- return null;
1781
- }
1782
- }
1783
- }).flatMap((v2) => Array.isArray(v2) ? v2 : [v2]).filter((v2) => v2 !== null)
1784
- );
1785
- }
1786
- static {
1787
- this.styles = i2`
1788
- slot {
1789
- display: none;
1790
- }
1791
- `;
1792
- }
1793
- render() {
1794
- return T`<pre>${JSON.stringify(this.result, null, 2)}</pre>
1795
- <slot></slot>`;
1796
- }
1797
- calculate() {
1798
- this.result = this.getResult();
1799
- return this.result;
1800
- }
1801
- getResult() {
1802
- throw new Error("Not implemented");
1803
- }
1804
- };
1805
- __decorate2([
1806
- r5()
1807
- ], QtiExpression.prototype, "result", void 0);
1808
- __decorate2([
1809
- c({ context: itemContext, subscribe: true }),
1810
- r5()
1811
- ], QtiExpression.prototype, "context", void 0);
1812
- __decorate2([
1813
- c({ context: qtiContext, subscribe: true }),
1814
- r5()
1815
- ], QtiExpression.prototype, "qtiContext", void 0);
1816
-
1817
- // ../qti-base/dist/abstract/qti-condition-expression.js
1818
- var QtiConditionExpression = class extends QtiExpression {
1819
- calculate() {
1820
- this.result = this.getResult();
1821
- return this.result;
1822
- }
1823
- getResult() {
1824
- throw new Error("Not implemented");
1825
- }
1826
- };
1827
-
1828
- // ../qti-base/dist/utils/utils.js
1829
- var decimalSeparator = () => {
1830
- return new Intl.NumberFormat().format(0.1).replace(/\d/g, "");
1831
- };
1832
- var convertNumberToUniversalFormat = (number) => {
1833
- if (typeof number === "string") {
1834
- return number;
1835
- }
1836
- const dSep = decimalSeparator();
1837
- if (dSep === ".") {
1838
- return number.toLocaleString();
1839
- } else {
1840
- return number.toString().replace(".", "").replace(dSep, ".");
1841
- }
1842
- };
1843
- function IsNullOrUndefined(value) {
1844
- return value === null || value === void 0;
1845
- }
1846
- function removeDoubleSlashes(str) {
1847
- const singleForwardSlashes = str.replace(/([^:]\/)\/+/g, "$1").replace(/\/\//g, "/").replace("http:/", "http://").replace("https:/", "https://");
1848
- return singleForwardSlashes;
1849
- }
1850
-
1851
- // ../qti-base/dist/abstract/qti-feedback.js
1852
- var __decorate3 = function(decorators, target, key, desc) {
1853
- var c5 = arguments.length, r6 = c5 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d3;
1854
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r6 = Reflect.decorate(decorators, target, key, desc);
1855
- else for (var i5 = decorators.length - 1; i5 >= 0; i5--) if (d3 = decorators[i5]) r6 = (c5 < 3 ? d3(r6) : c5 > 3 ? d3(target, key, r6) : d3(target, key)) || r6;
1856
- return c5 > 3 && r6 && Object.defineProperty(target, key, r6), r6;
1857
- };
1858
- var QtiFeedback = class extends i4 {
1859
- constructor() {
1860
- super(...arguments);
1861
- this.showHide = "show";
1862
- }
1863
- connectedCallback() {
1864
- super.connectedCallback();
1865
- this.dispatchEvent(new CustomEvent("qti-register-feedback", {
1866
- bubbles: true,
1867
- composed: true,
1868
- detail: this
1869
- }));
1870
- }
1871
- checkShowFeedback(outcomeIdentifier) {
1872
- const outcomeVariable = this._context.variables.find((v2) => v2.identifier === outcomeIdentifier) || null;
1873
- if (this.outcomeIdentifier !== outcomeIdentifier || !outcomeVariable)
1874
- return;
1875
- let isFound = false;
1876
- if (Array.isArray(outcomeVariable.value)) {
1877
- isFound = outcomeVariable.value.includes(this.identifier);
1878
- } else {
1879
- isFound = !IsNullOrUndefined(this.identifier) && !IsNullOrUndefined(outcomeVariable?.value) && this.identifier === outcomeVariable.value || false;
1880
- }
1881
- this.#showFeedback(isFound);
1882
- }
1883
- #showFeedback(value) {
1884
- this.showStatus = value && this.showHide === "show" || !value && this.showHide === "hide" ? "on" : "off";
1885
- }
1886
- };
1887
- __decorate3([
1888
- n5({ type: String, attribute: "show-hide" })
1889
- ], QtiFeedback.prototype, "showHide", void 0);
1890
- __decorate3([
1891
- n5({ type: String, attribute: "outcome-identifier" })
1892
- ], QtiFeedback.prototype, "outcomeIdentifier", void 0);
1893
- __decorate3([
1894
- n5({ type: String })
1895
- ], QtiFeedback.prototype, "identifier", void 0);
1896
- __decorate3([
1897
- n5({ type: String, attribute: false })
1898
- ], QtiFeedback.prototype, "showStatus", void 0);
1899
- __decorate3([
1900
- c({ context: itemContext, subscribe: true }),
1901
- r5()
1902
- ], QtiFeedback.prototype, "_context", void 0);
1903
-
1904
- // ../qti-base/dist/lib/response.js
1905
- function parseResponseAttribute(raw) {
1906
- if (raw == null)
1907
- return null;
1908
- if (!raw.includes(",")) {
1909
- const trimmed = raw.trim();
1910
- return trimmed.length > 0 ? trimmed : null;
1911
- }
1912
- const tokens = raw.split(",").map((token) => token.trim()).filter((token) => token.length > 0);
1913
- if (tokens.length === 0)
1914
- return null;
1915
- if (tokens.length === 1)
1916
- return tokens[0];
1917
- return tokens;
1918
- }
1919
- function serializeResponseAttribute(value) {
1920
- if (value == null)
1921
- return null;
1922
- if (Array.isArray(value)) {
1923
- const tokens = value.map((token) => token.trim()).filter((token) => token.length > 0);
1924
- return tokens.length > 0 ? tokens.join(",") : null;
1925
- }
1926
- const trimmed = value.trim();
1927
- return trimmed.length > 0 ? trimmed : null;
1928
- }
1929
- function* iterResponseValues(raw) {
1930
- if (raw == null)
1931
- return;
1932
- if (Array.isArray(raw)) {
1933
- for (const v2 of raw) {
1934
- const t4 = v2.trim();
1935
- if (t4)
1936
- yield t4;
1937
- }
1938
- return;
1939
- }
1940
- if (!raw.includes(",")) {
1941
- const t4 = raw.trim();
1942
- if (t4)
1943
- yield t4;
1944
- return;
1945
- }
1946
- for (const v2 of raw.split(",")) {
1947
- const t4 = v2.trim();
1948
- if (t4)
1949
- yield t4;
1950
- }
1951
- }
1952
- function parsePair(value) {
1953
- const [source, target, ...rest] = value.trim().split(/\s+/);
1954
- if (!source || !target || rest.length > 0) {
1955
- throw new Error(`malformed directed-pair value: "${value}" (expected "source target")`);
1956
- }
1957
- return { source, target };
1958
- }
1959
- function serializePair(source, target) {
1960
- return `${source} ${target}`;
1961
- }
1962
- function parsePoint(value) {
1963
- const [xStr, yStr, ...rest] = value.trim().split(/\s+/);
1964
- const x2 = Number(xStr);
1965
- const y3 = Number(yStr);
1966
- if (!Number.isFinite(x2) || !Number.isFinite(y3) || rest.length > 0) {
1967
- throw new Error(`malformed point value: "${value}" (expected "x y" numeric coords)`);
1968
- }
1969
- return { x: x2, y: y3 };
1970
- }
1971
- function serializePoint(x2, y3) {
1972
- return `${x2} ${y3}`;
1973
- }
1974
- function responseAttributeConverter(opts) {
1975
- const { emptyAs } = opts;
1976
- const isEmptySentinel = (value) => value === emptyAs || value == null || value === "" || Array.isArray(value) && value.length === 0;
1977
- return {
1978
- fromAttribute: (value) => {
1979
- const parsed = parseResponseAttribute(value);
1980
- return parsed === null ? emptyAs : parsed;
1981
- },
1982
- toAttribute: (value) => {
1983
- if (isEmptySentinel(value))
1984
- return null;
1985
- return serializeResponseAttribute(value);
1986
- }
1987
- };
1988
- }
1989
-
1990
- // ../qti-base/dist/lib/qti-rule-base.js
1991
- var QtiRuleElement = class extends i4 {
1992
- };
1993
-
1994
- // ../qti-base/dist/utils/scoring-helper.js
1995
- var ScoringHelper = class {
1996
- /**
1997
- * Checks if a given point is within a specified area.
1998
- * @param point The point to test, represented as a string "x y" (e.g., "102 113").
1999
- * @param areaKey The area definition, including shape and coordinates (e.g., "circle,102,113,16").
2000
- * @param baseType The base type of the response, must be "point" for this method to proceed.
2001
- * @returns True if the point is within the area; false otherwise.
2002
- */
2003
- static isPointInArea(point, areaKey, baseType) {
2004
- if (baseType !== "point") {
2005
- console.warn(`Base type ${baseType} is not supported for point area mapping.`);
2006
- return false;
2007
- }
2008
- const [px, py] = point.split(" ").map(Number);
2009
- const [shape, ...coords] = areaKey.split(",");
2010
- const coordinates = coords.map(Number);
2011
- switch (shape.toLowerCase()) {
2012
- case "circle":
2013
- case "default": {
2014
- const [cx, cy, radius] = coordinates;
2015
- if (coordinates.length !== 3) {
2016
- console.warn(`Invalid circle definition: ${areaKey}`);
2017
- return false;
2018
- }
2019
- const distance = Math.sqrt((px - cx) ** 2 + (py - cy) ** 2);
2020
- return distance <= radius;
2021
- }
2022
- case "rect": {
2023
- const [x1, y1, x2, y22] = coordinates;
2024
- if (coordinates.length !== 4) {
2025
- console.warn(`Invalid rectangle definition: ${areaKey}`);
2026
- return false;
2027
- }
2028
- return px >= x1 && px <= x2 && py >= y1 && py <= y22;
2029
- }
2030
- case "ellipse": {
2031
- const [cx, cy, rx, ry] = coordinates;
2032
- if (coordinates.length !== 4) {
2033
- console.warn(`Invalid ellipse definition: ${areaKey}`);
2034
- return false;
2035
- }
2036
- const normalizedX = (px - cx) ** 2 / rx ** 2;
2037
- const normalizedY = (py - cy) ** 2 / ry ** 2;
2038
- return normalizedX + normalizedY <= 1;
2039
- }
2040
- case "poly": {
2041
- if (coordinates.length < 6 || coordinates.length % 2 !== 0) {
2042
- console.warn(`Invalid polygon definition: ${areaKey}`);
2043
- return false;
2044
- }
2045
- const vertices = [];
2046
- for (let i5 = 0; i5 < coordinates.length; i5 += 2) {
2047
- vertices.push({ x: coordinates[i5], y: coordinates[i5 + 1] });
2048
- }
2049
- return this.isPointInPolygon({ x: px, y: py }, vertices);
2050
- }
2051
- default:
2052
- console.warn(`Unsupported shape type: ${shape}`);
2053
- return false;
2054
- }
2055
- }
2056
- /**
2057
- * Checks if a point is inside a polygon using the ray-casting algorithm.
2058
- * @param point The point to test.
2059
- * @param vertices The vertices of the polygon in order (array of {x, y} objects).
2060
- * @returns True if the point is inside the polygon; false otherwise.
2061
- */
2062
- static isPointInPolygon(point, vertices) {
2063
- let inside = false;
2064
- for (let i5 = 0, j2 = vertices.length - 1; i5 < vertices.length; j2 = i5++) {
2065
- const xi = vertices[i5].x, yi = vertices[i5].y;
2066
- const xj = vertices[j2].x, yj = vertices[j2].y;
2067
- const intersect = yi > point.y !== yj > point.y && point.x < (xj - xi) * (point.y - yi) / (yj - yi) + xi;
2068
- if (intersect)
2069
- inside = !inside;
2070
- }
2071
- return inside;
2072
- }
2073
- static compareSingleValues(value1, value2, baseType) {
2074
- switch (baseType) {
2075
- case "identifier":
2076
- case "string":
2077
- return value1 === value2;
2078
- case "integer": {
2079
- const int1 = parseInt(value1, 10);
2080
- const int2 = parseInt(value2, 10);
2081
- if (!isNaN(int1) && !isNaN(int2)) {
2082
- return int1 === int2;
2083
- } else {
2084
- console.error(`Cannot convert ${value1} and/or ${value2} to int.`);
2085
- }
2086
- break;
2087
- }
2088
- case "float": {
2089
- const float1 = parseFloat(value1);
2090
- const float2 = parseFloat(value2);
2091
- if (!isNaN(float1) && !isNaN(float2)) {
2092
- return float1 === float2;
2093
- } else {
2094
- console.error(`couldn't convert ${value1} and/or ${value2} to float.`);
2095
- }
2096
- break;
2097
- }
2098
- case "pair":
2099
- case "directedPair": {
2100
- const pair1 = value1.split(" ").sort();
2101
- const pair2 = value2.split(" ").sort();
2102
- if (pair1.length === 2 && pair2.length === 2) {
2103
- if (baseType === "pair") {
2104
- pair1.sort();
2105
- pair2.sort();
2106
- }
2107
- return pair1.join(" ") === pair2.join(" ");
2108
- } else {
2109
- console.error(`compared two pair but one of the values does not have 2 values: 1: ${value1} 2: ${value2}`);
2110
- }
2111
- break;
2112
- }
2113
- }
2114
- return false;
2115
- }
2116
- };
2117
-
2118
- // ../qti-base/dist/elements.js
2119
- var qtiBaseElements = [];
2120
-
2121
- // ../qti-base/dist/register.js
2122
- for (const { tag, ctor } of qtiBaseElements) {
2123
- if (!customElements.get(tag)) {
2124
- customElements.define(tag, ctor);
2125
- }
2126
- }
2127
-
2128
- export {
2129
- n,
2130
- e2 as e,
2131
- c,
2132
- computedItemContext,
2133
- computedContext,
2134
- configContext,
2135
- interactionContext,
2136
- itemContext,
2137
- itemContextVariables,
2138
- isSeed,
2139
- asSeed,
2140
- qtiContext,
2141
- INITIAL_SESSION_CONTEXT,
2142
- sessionContext,
2143
- INITIAL_TEST_CONTEXT,
2144
- testContext,
2145
- i2 as i,
2146
- T,
2147
- b2 as b,
2148
- E,
2149
- A,
2150
- Z,
2151
- i4 as i2,
2152
- boxSizing,
2153
- dropRegion,
2154
- validationMessage,
2155
- n5 as n2,
2156
- r5 as r,
2157
- e6 as e2,
2158
- o6 as o,
2159
- Interaction,
2160
- QtiVariableDeclaration,
2161
- QtiExpression,
2162
- QtiConditionExpression,
2163
- decimalSeparator,
2164
- convertNumberToUniversalFormat,
2165
- IsNullOrUndefined,
2166
- removeDoubleSlashes,
2167
- QtiFeedback,
2168
- parseResponseAttribute,
2169
- serializeResponseAttribute,
2170
- iterResponseValues,
2171
- parsePair,
2172
- serializePair,
2173
- parsePoint,
2174
- serializePoint,
2175
- responseAttributeConverter,
2176
- QtiRuleElement,
2177
- ScoringHelper
2178
- };
2179
- /*! Bundled license information:
2180
-
2181
- @lit/context/lib/context-request-event.js:
2182
- @lit/context/lib/create-context.js:
2183
- @lit/context/lib/controllers/context-consumer.js:
2184
- @lit/context/lib/value-notifier.js:
2185
- @lit/context/lib/controllers/context-provider.js:
2186
- @lit/context/lib/context-root.js:
2187
- @lit/reactive-element/node/decorators/query-assigned-elements.js:
2188
- (**
2189
- * @license
2190
- * Copyright 2021 Google LLC
2191
- * SPDX-License-Identifier: BSD-3-Clause
2192
- *)
2193
-
2194
- @lit/context/lib/decorators/provide.js:
2195
- lit-html/node/lit-html.js:
2196
- lit-element/lit-element.js:
2197
- @lit/reactive-element/node/decorators/custom-element.js:
2198
- @lit/reactive-element/node/decorators/property.js:
2199
- @lit/reactive-element/node/decorators/state.js:
2200
- @lit/reactive-element/node/decorators/event-options.js:
2201
- @lit/reactive-element/node/decorators/base.js:
2202
- @lit/reactive-element/node/decorators/query.js:
2203
- @lit/reactive-element/node/decorators/query-all.js:
2204
- @lit/reactive-element/node/decorators/query-async.js:
2205
- @lit/reactive-element/node/decorators/query-assigned-nodes.js:
2206
- (**
2207
- * @license
2208
- * Copyright 2017 Google LLC
2209
- * SPDX-License-Identifier: BSD-3-Clause
2210
- *)
2211
-
2212
- @lit/context/lib/decorators/consume.js:
2213
- lit-html/node/is-server.js:
2214
- (**
2215
- * @license
2216
- * Copyright 2022 Google LLC
2217
- * SPDX-License-Identifier: BSD-3-Clause
2218
- *)
2219
-
2220
- @lit-labs/ssr-dom-shim/lib/element-internals.js:
2221
- @lit-labs/ssr-dom-shim/lib/events.js:
2222
- (**
2223
- * @license
2224
- * Copyright 2023 Google LLC
2225
- * SPDX-License-Identifier: BSD-3-Clause
2226
- *)
2227
-
2228
- @lit-labs/ssr-dom-shim/lib/css.js:
2229
- (**
2230
- * @license
2231
- * Copyright 2024 Google LLC
2232
- * SPDX-License-Identifier: BSD-3-Clause
2233
- *)
2234
-
2235
- @lit-labs/ssr-dom-shim/index.js:
2236
- @lit/reactive-element/node/css-tag.js:
2237
- (**
2238
- * @license
2239
- * Copyright 2019 Google LLC
2240
- * SPDX-License-Identifier: BSD-3-Clause
2241
- *)
2242
- */
2243
- //# sourceMappingURL=chunk-H3J7LFRO.js.map