@pie-qti/player-elements 0.1.24 → 0.1.25

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 (63) hide show
  1. package/dist/ItemToolBar-d36g3aw4-B6TGPyKt.js +3079 -0
  2. package/dist/ItemToolBar-d36g3aw4-B6TGPyKt.js.map +1 -0
  3. package/dist/{define-D7_K0JFy.js → define-D80uAEx4.js} +1902 -4395
  4. package/dist/define-D80uAEx4.js.map +1 -0
  5. package/dist/dist-BSG0NOza.js +229 -0
  6. package/dist/dist-BSG0NOza.js.map +1 -0
  7. package/dist/{dist-ffJZTPTU.js → dist-C8BDh5vZ.js} +987 -707
  8. package/dist/dist-C8BDh5vZ.js.map +1 -0
  9. package/dist/dist-CQel8-vi.js +2507 -0
  10. package/dist/dist-CQel8-vi.js.map +1 -0
  11. package/dist/{dist-BaQdJU08.js → dist-L-bDDBry.js} +116 -103
  12. package/dist/dist-L-bDDBry.js.map +1 -0
  13. package/dist/{element-DSCNeDLu.js → element-C5rTAwch.js} +2 -2
  14. package/dist/{element-DSCNeDLu.js.map → element-C5rTAwch.js.map} +1 -1
  15. package/dist/{element-class-DQy2cIPM-CldZrSRR.js → element-class-B_qAd8ET-DGj15cBY.js} +5124 -4448
  16. package/dist/element-class-B_qAd8ET-DGj15cBY.js.map +1 -0
  17. package/dist/elements.js +3 -3
  18. package/dist/index.js +2 -2
  19. package/dist/item-toolbar-element-BgqPFwsS.js +1990 -0
  20. package/dist/item-toolbar-element-BgqPFwsS.js.map +1 -0
  21. package/dist/{language-tags-DVlRltrl.js → language-tags-BwFWXo71.js} +3 -3
  22. package/dist/{language-tags-DVlRltrl.js.map → language-tags-BwFWXo71.js.map} +1 -1
  23. package/dist/{nl-NL-BeQBX6yq.js → nl-NL-BRA_1Wcl.js} +5 -3
  24. package/dist/nl-NL-BRA_1Wcl.js.map +1 -0
  25. package/dist/pie-DwmznDHb.js +363 -0
  26. package/dist/pie-DwmznDHb.js.map +1 -0
  27. package/dist/pie-assessment-toolkit-Cruxm385.js +5 -0
  28. package/dist/pie-assessment-toolkit-Cruxm385.js.map +1 -0
  29. package/dist/pie-assessment-toolkit-DJfg6laX.js +5 -0
  30. package/dist/pie-assessment-toolkit-DJfg6laX.js.map +1 -0
  31. package/dist/{pie-assessment-toolkit-element-CpiB3twr.js → pie-assessment-toolkit-element-CT5UuvVY.js} +1364 -1203
  32. package/dist/pie-assessment-toolkit-element-CT5UuvVY.js.map +1 -0
  33. package/dist/pie-tool-calculator-Crfk-IZe.js +378 -0
  34. package/dist/pie-tool-calculator-Crfk-IZe.js.map +1 -0
  35. package/dist/{provider-Y5PhmTAu.js → provider-gBXlGb0d.js} +3 -3
  36. package/dist/{provider-Y5PhmTAu.js.map → provider-gBXlGb0d.js.map} +1 -1
  37. package/dist/register-players.js +1 -1
  38. package/dist/register.js +10246 -9664
  39. package/dist/register.js.map +1 -1
  40. package/dist/{resolveItems-D8DJkv-4.js → resolveItems-CNMvD8LP.js} +2 -2
  41. package/dist/{resolveItems-D8DJkv-4.js.map → resolveItems-CNMvD8LP.js.map} +1 -1
  42. package/dist/{root-DSkIM1v3.js → root-dCY6j_Hh.js} +3 -3
  43. package/dist/{root-DSkIM1v3.js.map → root-dCY6j_Hh.js.map} +1 -1
  44. package/dist/tag-names-DZGvnAgd.js +2495 -0
  45. package/dist/tag-names-DZGvnAgd.js.map +1 -0
  46. package/dist/{tool-tts-inline-B71NTBbb.js → tool-tts-inline-k3hLJUfp.js} +1315 -1303
  47. package/dist/tool-tts-inline-k3hLJUfp.js.map +1 -0
  48. package/package.json +8 -8
  49. package/dist/define-D7_K0JFy.js.map +0 -1
  50. package/dist/dist-BRTWr852.js +0 -5809
  51. package/dist/dist-BRTWr852.js.map +0 -1
  52. package/dist/dist-BaQdJU08.js.map +0 -1
  53. package/dist/dist-DwvskOs6.js +0 -220
  54. package/dist/dist-DwvskOs6.js.map +0 -1
  55. package/dist/dist-ffJZTPTU.js.map +0 -1
  56. package/dist/element-class-DQy2cIPM-CldZrSRR.js.map +0 -1
  57. package/dist/item-toolbar-element-BW9Y_n5x.js +0 -1990
  58. package/dist/item-toolbar-element-BW9Y_n5x.js.map +0 -1
  59. package/dist/nl-NL-BeQBX6yq.js.map +0 -1
  60. package/dist/pie-assessment-toolkit-element-CpiB3twr.js.map +0 -1
  61. package/dist/pie-tool-calculator-BiWMTJe7.js +0 -2992
  62. package/dist/pie-tool-calculator-BiWMTJe7.js.map +0 -1
  63. package/dist/tool-tts-inline-B71NTBbb.js.map +0 -1
@@ -0,0 +1,363 @@
1
+ function e(e) {
2
+ try {
3
+ let t = {
4
+ BASE_URL: "/",
5
+ DEV: !1,
6
+ MODE: "production",
7
+ PROD: !0,
8
+ SSR: !1
9
+ }[e];
10
+ if (typeof t == "string" && t.length > 0) return t;
11
+ } catch {}
12
+ }
13
+ typeof window < "u" && window.PIE_BUILDER_ORIGIN_URL || e("PUBLIC_BUILDER_ORIGIN_URL"), typeof window < "u" && window.PIE_BUILDER_BUNDLE_URL || e("PUBLIC_BUILDER_BUNDLE_URL");
14
+ var t = class {
15
+ initialized = !1;
16
+ config;
17
+ trackError(e, t) {
18
+ if (!this.guardedOperation("trackError", e, t) || !this.applyErrorFilter(e, t)) return;
19
+ let n = this.transformAttributes(t);
20
+ try {
21
+ this.doTrackError(e, n), this.config?.debug && console.log(`[${this.providerName}] Tracked error:`, e, n);
22
+ } catch (e) {
23
+ console.error(`[${this.providerName}] Error tracking error:`, e);
24
+ }
25
+ }
26
+ trackEvent(e, t) {
27
+ if (!this.guardedOperation("trackEvent", e, t) || !this.applyEventFilter(e, t) || !this.applySampling(e)) return;
28
+ let n = this.transformAttributes(t);
29
+ n.timestamp || (n = {
30
+ ...n,
31
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
32
+ });
33
+ try {
34
+ this.doTrackEvent(e, n), this.config?.debug && console.log(`[${this.providerName}] Tracked event:`, e, n);
35
+ } catch (e) {
36
+ console.error(`[${this.providerName}] Error tracking event:`, e);
37
+ }
38
+ }
39
+ trackMetric(e, t, n) {
40
+ this.trackEvent(`metric:${e}`, {
41
+ ...n,
42
+ metricValue: t,
43
+ metricName: e
44
+ });
45
+ }
46
+ setUserContext(e, t) {
47
+ if (this.guardedOperation("setUserContext", e, t)) try {
48
+ this.doSetUserContext(e, t), this.config?.debug && console.log(`[${this.providerName}] Set user context:`, e, t);
49
+ } catch (e) {
50
+ console.error(`[${this.providerName}] Error setting user context:`, e);
51
+ }
52
+ }
53
+ setGlobalAttributes(e) {
54
+ if (this.guardedOperation("setGlobalAttributes", e)) try {
55
+ this.doSetGlobalAttributes(e), this.config?.debug && console.log(`[${this.providerName}] Set global attributes:`, e);
56
+ } catch (e) {
57
+ console.error(`[${this.providerName}] Error setting global attributes:`, e);
58
+ }
59
+ }
60
+ guardedOperation(e, ...t) {
61
+ return this.isReady() ? !0 : (this.config?.debug && console.warn(`[${this.providerName}] Attempted to ${e} but provider not ready:`, ...t), !1);
62
+ }
63
+ applyErrorFilter(e, t) {
64
+ return this.config?.errorFilter && !this.config.errorFilter(e, t) ? (this.config?.debug && console.log(`[${this.providerName}] Error filtered out:`, e, t), !1) : !0;
65
+ }
66
+ applyEventFilter(e, t) {
67
+ return this.config?.eventFilter && !this.config.eventFilter(e, t) ? (this.config?.debug && console.log(`[${this.providerName}] Event filtered out:`, e, t), !1) : !0;
68
+ }
69
+ applySampling(e) {
70
+ return this.config?.sampleRate !== void 0 && this.config.sampleRate < 1 && Math.random() > this.config.sampleRate ? (this.config?.debug && console.log(`[${this.providerName}] Event sampled out:`, e), !1) : !0;
71
+ }
72
+ transformAttributes(e) {
73
+ return this.config?.attributeTransformer ? this.config.attributeTransformer(e) : e;
74
+ }
75
+ }, n = class extends t {
76
+ providerId = "newrelic";
77
+ providerName = "New Relic";
78
+ async initialize(e) {
79
+ this.config = e, typeof window < "u" && window.newrelic ? (this.initialized = !0, this.config?.debug && console.log("[NewRelicProvider] Initialized successfully")) : (this.config?.debug && console.warn("[NewRelicProvider] New Relic not available (window.newrelic not found)"), this.initialized = !1);
80
+ }
81
+ isReady() {
82
+ return this.initialized && typeof window < "u" && !!window.newrelic;
83
+ }
84
+ destroy() {
85
+ this.initialized = !1, this.config?.debug && console.log("[NewRelicProvider] Destroyed");
86
+ }
87
+ doTrackError(e, t) {
88
+ window.newrelic.noticeError(e, t);
89
+ }
90
+ doTrackEvent(e, t) {
91
+ window.newrelic.addPageAction(e, t);
92
+ }
93
+ doSetUserContext(e, t) {
94
+ let n = window.newrelic;
95
+ if (n.setUserId && n.setUserId(e), t && n.setCustomAttribute) for (let [e, r] of Object.entries(t)) n.setCustomAttribute(e, r);
96
+ }
97
+ doSetGlobalAttributes(e) {
98
+ let t = window.newrelic;
99
+ if (t.setCustomAttribute) for (let [n, r] of Object.entries(e)) t.setCustomAttribute(n, r);
100
+ }
101
+ };
102
+ //#endregion
103
+ //#region ../../node_modules/.bun/@pie-players+pie-players-shared@0.3.73/node_modules/@pie-players/pie-players-shared/dist/instrumentation/provider-guards.js
104
+ function r(e) {
105
+ if (!e || typeof e != "object") return !1;
106
+ let t = e;
107
+ return typeof t.providerId == "string" && typeof t.providerName == "string" && typeof t.initialize == "function" && typeof t.trackError == "function" && typeof t.trackEvent == "function" && typeof t.destroy == "function" && typeof t.isReady == "function";
108
+ }
109
+ //#endregion
110
+ //#region ../../node_modules/.bun/@pie-players+pie-players-shared@0.3.73/node_modules/@pie-players/pie-players-shared/dist/loader-config.js
111
+ var i = {
112
+ retryDelayMs: 3e3,
113
+ timeoutMs: 12e4
114
+ }, a;
115
+ (function(e) {
116
+ e.player = "player.js", e.clientPlayer = "client-player.js", e.editor = "editor.js";
117
+ })(a ||= {});
118
+ var o;
119
+ (function(e) {
120
+ e.loading = "loading", e.loaded = "loaded";
121
+ })(o ||= {});
122
+ //#endregion
123
+ //#region ../../node_modules/.bun/@pie-players+pie-players-shared@0.3.73/node_modules/@pie-players/pie-players-shared/dist/types/index.js
124
+ var s;
125
+ (function(e) {
126
+ e.SAVE = "save", e.MODEL = "model", e.SCORE = "score", e.MANUAL_SCORE = "manual-score";
127
+ })(s ||= {});
128
+ var c;
129
+ (function(e) {
130
+ e.AUTO = "auto", e.MANUAL = "manual";
131
+ })(c ||= {});
132
+ var l;
133
+ (function(e) {
134
+ e.GATHER = "gather", e.VIEW = "view", e.EVALUATE = "evaluate";
135
+ })(l ||= {});
136
+ var u;
137
+ (function(e) {
138
+ e.PENDING = "pending", e.IN_PROGRESS = "in_progress", e.COMPLETED = "completed", e.FAILED = "failed";
139
+ })(u ||= {});
140
+ var d;
141
+ (function(e) {
142
+ e[e.ROOT = 0] = "ROOT", e[e.SUBJECT = 1] = "SUBJECT", e[e.LEVEL = 2] = "LEVEL", e[e.STANDARD = 3] = "STANDARD";
143
+ })(d ||= {});
144
+ //#endregion
145
+ //#region ../../node_modules/.bun/@pie-players+pie-players-shared@0.3.73/node_modules/@pie-players/pie-players-shared/dist/pie/logger.js
146
+ function f(e, t) {
147
+ let n = `[${e}]`;
148
+ return {
149
+ debug: (e, ...r) => {
150
+ t() && console.debug(n, e, ...r);
151
+ },
152
+ info: (e, ...t) => console.info(n, e, ...t),
153
+ warn: (e, ...t) => console.warn(n, e, ...t),
154
+ error: (e, ...t) => console.error(n, e, ...t)
155
+ };
156
+ }
157
+ function p() {
158
+ return typeof window < "u" && window.PIE_DEBUG === !0;
159
+ }
160
+ f("pie-scoring", () => p()), f("pie-initialize-element", () => p()), f("math-rendering", () => p()), f("pie-updates", () => p()), f("pie-initialization", () => p()), i.timeoutMs, a.player, f("pie-element-observer", () => p()), f("asset-handler", () => p()), f("authoring", () => p());
161
+ //#endregion
162
+ //#region ../../node_modules/.bun/@pie-players+pie-players-shared@0.3.73/node_modules/@pie-players/pie-players-shared/dist/pie/instrumentation-event-bridge.js
163
+ var m = f("instrumentation-event-bridge", () => p());
164
+ function h(e) {
165
+ return e && typeof e == "object" ? e : e === void 0 ? {} : { value: e };
166
+ }
167
+ function g(e) {
168
+ m.warn(`[InstrumentationEventBridge:${e}] Ignoring invalid instrumentation provider; expected InstrumentationProvider contract`);
169
+ }
170
+ function _(e) {
171
+ try {
172
+ e.provider.trackError(e.error instanceof Error ? e.error : Error(String(e.error ?? "Unknown instrumentation bridge error")), {
173
+ component: e.component,
174
+ errorType: "InstrumentationBridgeError",
175
+ sourceEventName: e.sourceEventName
176
+ });
177
+ } catch {}
178
+ }
179
+ function v(e) {
180
+ if (!e.host || !e.eventMap.length || !e.instrumentationProvider) return () => {};
181
+ if (!r(e.instrumentationProvider)) return e.debug && g(e.component), () => {};
182
+ let t = e.instrumentationProvider, n = [], i = Math.max(0, e.dedupeWindowMs ?? 0), a = /* @__PURE__ */ new Map(), o = (e, t) => {
183
+ let n = [
184
+ t.assessmentId,
185
+ t.sectionId,
186
+ t.attemptId,
187
+ t.itemId,
188
+ t.canonicalItemId,
189
+ t.sourceRuntimeId
190
+ ].map((e) => String(e ?? "")).join("|");
191
+ return `${e.instrumentationEventName}|${n}`;
192
+ };
193
+ for (let r of e.eventMap) {
194
+ let s = (n) => {
195
+ try {
196
+ if (!t.isReady() || e.shouldTrackEvent && !e.shouldTrackEvent(n)) return;
197
+ let s = h(n.detail), c = (/* @__PURE__ */ new Date()).toISOString(), l = {
198
+ ...s,
199
+ ...e.staticAttributes,
200
+ component: e.component,
201
+ sourceEventName: r.sourceEventName,
202
+ timestamp: c
203
+ };
204
+ if (i > 0) {
205
+ let e = Date.now(), t = o(r, l), n = a.get(t);
206
+ if (typeof n == "number" && e - n < i) return;
207
+ a.set(t, e);
208
+ }
209
+ t.trackEvent(r.instrumentationEventName, { ...l });
210
+ } catch (n) {
211
+ _({
212
+ provider: t,
213
+ component: e.component,
214
+ error: n,
215
+ sourceEventName: r.sourceEventName
216
+ });
217
+ }
218
+ };
219
+ e.host.addEventListener(r.sourceEventName, s), n.push(() => {
220
+ e.host?.removeEventListener(r.sourceEventName, s);
221
+ });
222
+ }
223
+ return () => {
224
+ for (let e of n) e();
225
+ };
226
+ }
227
+ //#endregion
228
+ //#region ../../node_modules/.bun/@pie-players+pie-players-shared@0.3.73/node_modules/@pie-players/pie-players-shared/dist/pie/instrumentation-provider-resolution.js
229
+ function y(e) {
230
+ return e && typeof e == "object" ? e : {};
231
+ }
232
+ function b(e) {
233
+ let t = y(y(e).loaderConfig);
234
+ return Object.keys(t).length > 0 ? t : null;
235
+ }
236
+ function x(e) {
237
+ if (!e || !("instrumentationProvider" in e)) return { kind: "unset" };
238
+ let t = e.instrumentationProvider;
239
+ return t === null ? { kind: "null" } : t === void 0 ? { kind: "unset" } : {
240
+ kind: "value",
241
+ value: t
242
+ };
243
+ }
244
+ function S(e) {
245
+ if (!e || !("trackPageActions" in e)) return;
246
+ let t = e.trackPageActions;
247
+ return typeof t == "boolean" ? t : void 0;
248
+ }
249
+ function C(e, t) {
250
+ return e.kind === "value" || e.kind === "null" ? e : t;
251
+ }
252
+ var w, T = f("instrumentation-provider-resolution", () => p());
253
+ function E() {
254
+ return w || (w = new n(), w.initialize()), w;
255
+ }
256
+ function D(e) {
257
+ let t = b(e.runtimePlayer), n = b(e.player), i = S(t), a = S(n), o = i ?? a ?? !1, s = C(x(t), x(n));
258
+ if (s.kind !== "null") {
259
+ if (s.kind === "unset") return o ? E() : void 0;
260
+ if (r(s.value)) return s.value;
261
+ if (e.debug) {
262
+ let t = e.component ? `[${e.component}] ` : "";
263
+ T.warn(`${t}Ignoring invalid instrumentation provider; expected InstrumentationProvider contract`);
264
+ }
265
+ }
266
+ }
267
+ //#endregion
268
+ //#region ../../node_modules/.bun/@pie-players+pie-players-shared@0.3.73/node_modules/@pie-players/pie-players-shared/dist/pie/stages.js
269
+ var O = Object.freeze([
270
+ "composed",
271
+ "engine-ready",
272
+ "interactive",
273
+ "disposed"
274
+ ]);
275
+ function k(e) {
276
+ return O;
277
+ }
278
+ function A(e) {
279
+ let t = O.indexOf(e);
280
+ if (t === -1) throw Error(`Unknown stage \`${e}\``);
281
+ return t;
282
+ }
283
+ //#endregion
284
+ //#region ../../node_modules/.bun/@pie-players+pie-players-shared@0.3.73/node_modules/@pie-players/pie-players-shared/dist/pie/stage-tracker.js
285
+ var j = !1;
286
+ function M(e) {
287
+ j || (j = !0, typeof console < "u" && console.warn && console.warn(`[pie-stage-tracker] Unexpected ${e.reason} stage transition from \`${e.from ?? "<none>"}\` to \`${e.to}\`. Stage transitions are expected to be monotonic within a cohort; call \`reset()\` when \`(sectionId, attemptId)\` changes.`));
288
+ }
289
+ function N(e) {
290
+ let t = k(e.sourceCeShape), n = new Set(t), r = e.now ?? (() => (/* @__PURE__ */ new Date()).toISOString()), i = e.onUnexpectedTransition ?? M, a = null, o = e.sectionId, s = e.attemptId, c = /* @__PURE__ */ new Set();
291
+ function l(t, n) {
292
+ e.emit({
293
+ stage: t,
294
+ status: n,
295
+ runtimeId: e.runtimeId,
296
+ sectionId: o,
297
+ attemptId: s,
298
+ timestamp: r(),
299
+ sourceCe: e.sourceCe
300
+ });
301
+ }
302
+ function u(e) {
303
+ let t = A(e), r = a === null ? 0 : A(a) + 1;
304
+ for (let e = r; e < t; e += 1) {
305
+ let t = O[e];
306
+ n.has(t) || c.has(t) || (c.add(t), l(t, "skipped"));
307
+ }
308
+ }
309
+ function d(e, t = "entered") {
310
+ let r = A(e), o = a === null ? -1 : A(a);
311
+ if (t === "entered") {
312
+ if (c.has(e)) {
313
+ i({
314
+ from: a,
315
+ to: e,
316
+ reason: "duplicate"
317
+ });
318
+ return;
319
+ }
320
+ if (r < o) {
321
+ i({
322
+ from: a,
323
+ to: e,
324
+ reason: "backward"
325
+ });
326
+ return;
327
+ }
328
+ if (!n.has(e)) {
329
+ if (c.has(e)) return;
330
+ c.add(e), l(e, "skipped");
331
+ return;
332
+ }
333
+ u(e), c.add(e), a = e, l(e, "entered");
334
+ return;
335
+ }
336
+ if (t === "failed") {
337
+ u(e), c.add(e), a = e, l(e, "failed");
338
+ return;
339
+ }
340
+ c.has(e) || (c.add(e), l(e, "skipped"));
341
+ }
342
+ function f(e) {
343
+ a = null, c.clear(), e && (o = e.sectionId, s = e.attemptId);
344
+ }
345
+ function p() {
346
+ return a;
347
+ }
348
+ return {
349
+ enter: d,
350
+ reset: f,
351
+ getCurrent: p
352
+ };
353
+ }
354
+ [.../* @__PURE__ */ new Set([
355
+ "complete",
356
+ "component",
357
+ "timestamp",
358
+ "sourceRuntimeId"
359
+ ])], f("pie-overrides", () => p());
360
+ //#endregion
361
+ export { p as a, f as i, D as n, i as o, v as r, r as s, N as t };
362
+
363
+ //# sourceMappingURL=pie-DwmznDHb.js.map