@pie-qti/item-player 0.1.17 → 0.1.19
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.
- package/dist/components/utils/stylesheetRender.d.ts +22 -0
- package/dist/components/utils/stylesheetRender.js +251 -21
- package/dist/components/utils/stylesheetRender.js.map +1 -1
- package/dist/core/sanitizer.js +33 -10
- package/dist/core/sanitizer.js.map +1 -1
- package/dist/{element-class-BLaOCHDu.js → element-class-BEpwHdcP.js} +554 -406
- package/dist/{element-class-BLaOCHDu.js.map → element-class-BEpwHdcP.js.map} +1 -1
- package/dist/element-class.js +1 -1
- package/dist/element.js +1 -1
- package/package.json +5 -5
|
@@ -3281,7 +3281,20 @@ function Ds(e) {
|
|
|
3281
3281
|
});
|
|
3282
3282
|
return r || !n || /url\(/i.test(i);
|
|
3283
3283
|
}
|
|
3284
|
-
function Os(e
|
|
3284
|
+
function Os(e) {
|
|
3285
|
+
let t = e.parentNode;
|
|
3286
|
+
for (; t;) {
|
|
3287
|
+
if (t.rawTagName?.toLowerCase() === "svg") return !0;
|
|
3288
|
+
t = t.parentNode;
|
|
3289
|
+
}
|
|
3290
|
+
return !1;
|
|
3291
|
+
}
|
|
3292
|
+
function ks(e, t, n, r) {
|
|
3293
|
+
let i = [...e.childNodes];
|
|
3294
|
+
for (let e of i) e.rawTagName && As(e, t, n, r + 1);
|
|
3295
|
+
e.replaceWith(...e.childNodes);
|
|
3296
|
+
}
|
|
3297
|
+
function As(e, t, n, r) {
|
|
3285
3298
|
if (n.enabled) {
|
|
3286
3299
|
if (r > n.maxDepth) throw new ps(`HTML depth exceeds maxHtmlDepth (${r} > ${n.maxDepth})`);
|
|
3287
3300
|
if (n.nodes++, n.nodes > n.maxNodes) throw new ps(`HTML node count exceeds maxHtmlNodes (${n.nodes} > ${n.maxNodes})`);
|
|
@@ -3292,7 +3305,11 @@ function Os(e, t, n, r) {
|
|
|
3292
3305
|
return;
|
|
3293
3306
|
}
|
|
3294
3307
|
if (i && Es.has(i)) {
|
|
3295
|
-
e
|
|
3308
|
+
if (Os(e)) {
|
|
3309
|
+
e.remove();
|
|
3310
|
+
return;
|
|
3311
|
+
}
|
|
3312
|
+
ks(e, t, n, r);
|
|
3296
3313
|
return;
|
|
3297
3314
|
}
|
|
3298
3315
|
if (i === "iframe" && !gs(t)) {
|
|
@@ -3300,7 +3317,7 @@ function Os(e, t, n, r) {
|
|
|
3300
3317
|
return;
|
|
3301
3318
|
}
|
|
3302
3319
|
if ((i === "object" || i === "embed") && !hs(t)) {
|
|
3303
|
-
let n =
|
|
3320
|
+
let n = Ns(e, t);
|
|
3304
3321
|
if (n) {
|
|
3305
3322
|
e.replaceWith(n);
|
|
3306
3323
|
return;
|
|
@@ -3313,9 +3330,7 @@ function Os(e, t, n, r) {
|
|
|
3313
3330
|
return;
|
|
3314
3331
|
}
|
|
3315
3332
|
if (i?.includes("-") && !ws(i)) {
|
|
3316
|
-
|
|
3317
|
-
for (let e of i) e.rawTagName && Os(e, t, n, r + 1);
|
|
3318
|
-
e.replaceWith(...e.childNodes);
|
|
3333
|
+
ks(e, t, n, r);
|
|
3319
3334
|
return;
|
|
3320
3335
|
}
|
|
3321
3336
|
let a = e.attributes || {};
|
|
@@ -3360,9 +3375,9 @@ function Os(e, t, n, r) {
|
|
|
3360
3375
|
}
|
|
3361
3376
|
}
|
|
3362
3377
|
let o = e.childNodes.filter((e) => e.rawTagName);
|
|
3363
|
-
for (let e of o)
|
|
3378
|
+
for (let e of o) As(e, t, n, r + 1);
|
|
3364
3379
|
}
|
|
3365
|
-
function
|
|
3380
|
+
function js(e, t) {
|
|
3366
3381
|
if (!e || typeof e != "string") return "";
|
|
3367
3382
|
try {
|
|
3368
3383
|
let n = To(t?.security);
|
|
@@ -3376,16 +3391,16 @@ function ks(e, t) {
|
|
|
3376
3391
|
maxNodes: n.maxHtmlNodes,
|
|
3377
3392
|
maxDepth: n.maxHtmlDepth
|
|
3378
3393
|
};
|
|
3379
|
-
for (let e of i)
|
|
3394
|
+
for (let e of i) As(e, t, a, 1);
|
|
3380
3395
|
return r.toString();
|
|
3381
3396
|
} catch (e) {
|
|
3382
3397
|
return e instanceof ps || console.error("HTML sanitization failed:", e), "";
|
|
3383
3398
|
}
|
|
3384
3399
|
}
|
|
3385
|
-
function
|
|
3386
|
-
return !e || typeof e != "string" ? "" : /<[^>]+>/.test(e) ?
|
|
3400
|
+
function Ms(e, t) {
|
|
3401
|
+
return !e || typeof e != "string" ? "" : /<[^>]+>/.test(e) ? js(e, t) : e;
|
|
3387
3402
|
}
|
|
3388
|
-
function
|
|
3403
|
+
function Ns(e, t) {
|
|
3389
3404
|
if (e.rawTagName?.toLowerCase() !== "object") return null;
|
|
3390
3405
|
let n = e.getAttribute("type")?.trim().toLowerCase() ?? "", r = e.getAttribute("data")?.trim() ?? "";
|
|
3391
3406
|
if (!n || !r) return null;
|
|
@@ -3410,7 +3425,7 @@ function js(e, t) {
|
|
|
3410
3425
|
}
|
|
3411
3426
|
//#endregion
|
|
3412
3427
|
//#region src/interactions/hottext/extractor.ts
|
|
3413
|
-
var
|
|
3428
|
+
var Ps = {
|
|
3414
3429
|
id: "qti:hottext-interaction",
|
|
3415
3430
|
name: "QTI Standard Hottext Interaction",
|
|
3416
3431
|
priority: 10,
|
|
@@ -3433,7 +3448,7 @@ var Ms = {
|
|
|
3433
3448
|
};
|
|
3434
3449
|
}), a = n.getNumberAttribute(e, "maxChoices", 1), o = n.getNumberAttribute(e, "minChoices", 0), s = n.getClasses(e), c = n.getAttribute(e, "data-max-selections-message", "") || null, l = n.getAttribute(e, "data-min-selections-message", "") || null, u = n.getChildrenByTag(e, "prompt"), d = u.length > 0 ? n.getHtmlContent(u[0]) : null, f = "";
|
|
3435
3450
|
for (let t of e.childNodes) typeof t != "string" && t.rawTagName !== "prompt" && t.rawTagName !== "qti-prompt" ? f += t.outerHTML || t.toString() : typeof t == "string" && (f += t);
|
|
3436
|
-
return f =
|
|
3451
|
+
return f = js(f, { security: t.config.security }), {
|
|
3437
3452
|
hottextChoices: i,
|
|
3438
3453
|
contentHtml: f,
|
|
3439
3454
|
maxChoices: a,
|
|
@@ -3456,7 +3471,7 @@ var Ms = {
|
|
|
3456
3471
|
warnings: n.length > 0 ? n : void 0
|
|
3457
3472
|
};
|
|
3458
3473
|
}
|
|
3459
|
-
},
|
|
3474
|
+
}, Fs = {
|
|
3460
3475
|
id: "qti:inline-choice-interaction",
|
|
3461
3476
|
name: "QTI Standard Inline Choice Interaction",
|
|
3462
3477
|
priority: 10,
|
|
@@ -3495,7 +3510,7 @@ var Ms = {
|
|
|
3495
3510
|
warnings: n.length > 0 ? n : void 0
|
|
3496
3511
|
};
|
|
3497
3512
|
}
|
|
3498
|
-
},
|
|
3513
|
+
}, Is = {
|
|
3499
3514
|
id: "qti:match-interaction",
|
|
3500
3515
|
name: "QTI Standard Match Interaction",
|
|
3501
3516
|
priority: 10,
|
|
@@ -3574,7 +3589,7 @@ var Ms = {
|
|
|
3574
3589
|
errors: t.length > 0 ? t : void 0
|
|
3575
3590
|
};
|
|
3576
3591
|
}
|
|
3577
|
-
},
|
|
3592
|
+
}, Ls = {
|
|
3578
3593
|
id: "qti:media-interaction",
|
|
3579
3594
|
name: "QTI Standard Media Interaction",
|
|
3580
3595
|
priority: 10,
|
|
@@ -3639,7 +3654,7 @@ var Ms = {
|
|
|
3639
3654
|
warnings: n.length > 0 ? n : void 0
|
|
3640
3655
|
};
|
|
3641
3656
|
}
|
|
3642
|
-
},
|
|
3657
|
+
}, Rs = {
|
|
3643
3658
|
id: "qti:order-interaction",
|
|
3644
3659
|
name: "QTI Standard Order Interaction",
|
|
3645
3660
|
priority: 10,
|
|
@@ -3686,7 +3701,7 @@ var Ms = {
|
|
|
3686
3701
|
};
|
|
3687
3702
|
//#endregion
|
|
3688
3703
|
//#region src/interactions/position-object/extractor.ts
|
|
3689
|
-
function
|
|
3704
|
+
function zs(e, t, n, r) {
|
|
3690
3705
|
if (!e) return null;
|
|
3691
3706
|
let i = t.getAttribute(e, "type", ""), a = t.getAttribute(e, "data", ""), o = t.getAttribute(e, "width", n), s = t.getAttribute(e, "height", r), c = t.getHtmlContent(e);
|
|
3692
3707
|
return i.startsWith("image/svg") && /<svg[\s>]/i.test(c) ? {
|
|
@@ -3701,7 +3716,7 @@ function Ls(e, t, n, r) {
|
|
|
3701
3716
|
height: s
|
|
3702
3717
|
};
|
|
3703
3718
|
}
|
|
3704
|
-
var
|
|
3719
|
+
var Bs = {
|
|
3705
3720
|
id: "qti:position-object-interaction",
|
|
3706
3721
|
name: "QTI Standard Position Object Interaction",
|
|
3707
3722
|
priority: 10,
|
|
@@ -3712,7 +3727,7 @@ var Rs = {
|
|
|
3712
3727
|
return t === "positionobjectinteraction" || t === "qti-position-object-interaction";
|
|
3713
3728
|
},
|
|
3714
3729
|
extract(e, t) {
|
|
3715
|
-
let { utils: n, responseId: r } = t, i = e.parentNode, a = i?.rawTagName?.toLowerCase(), o = i && (a === "positionobjectstage" || a === "qti-position-object-stage") && n.getChildrenByTag(i, "positionObjectInteraction").includes(e) ? i : void 0, s = o ? n.getChildrenByTag(o, "object")[0] : void 0, c = n.getChildrenByTag(e, "object")[0], l =
|
|
3730
|
+
let { utils: n, responseId: r } = t, i = e.parentNode, a = i?.rawTagName?.toLowerCase(), o = i && (a === "positionobjectstage" || a === "qti-position-object-stage") && n.getChildrenByTag(i, "positionObjectInteraction").includes(e) ? i : void 0, s = o ? n.getChildrenByTag(o, "object")[0] : void 0, c = n.getChildrenByTag(e, "object")[0], l = zs(s, n, "500", "300"), u = zs(c, n, "50", "50"), d = n.getNumberAttribute(e, "maxChoices", 1), f = n.getNumberAttribute(e, "minChoices", 0), p = n.getTextContent(c).trim() || r, m = n.getClasses(e), h = n.getPrompt(e);
|
|
3716
3731
|
return {
|
|
3717
3732
|
imageData: l,
|
|
3718
3733
|
positionObjectStages: [{
|
|
@@ -3738,7 +3753,7 @@ var Rs = {
|
|
|
3738
3753
|
warnings: n.length > 0 ? n : void 0
|
|
3739
3754
|
};
|
|
3740
3755
|
}
|
|
3741
|
-
},
|
|
3756
|
+
}, Vs = {
|
|
3742
3757
|
id: "qti:portable-custom-interaction",
|
|
3743
3758
|
name: "QTI Portable Custom Interaction",
|
|
3744
3759
|
priority: 20,
|
|
@@ -3749,29 +3764,29 @@ var Rs = {
|
|
|
3749
3764
|
],
|
|
3750
3765
|
description: "Extracts QTI 2.x/3.0 portable custom interaction module paths, markup, and config",
|
|
3751
3766
|
canHandle(e, t) {
|
|
3752
|
-
let n =
|
|
3753
|
-
return n === "portablecustominteraction" || n === "qti-portable-custom-interaction" || n === "custominteraction" &&
|
|
3767
|
+
let n = Hs(e);
|
|
3768
|
+
return n === "portablecustominteraction" || n === "qti-portable-custom-interaction" || n === "custominteraction" && Us(e, ["portablecustominteraction"]) !== null;
|
|
3754
3769
|
},
|
|
3755
3770
|
extract(e, t) {
|
|
3756
|
-
let { utils: n } = t, r =
|
|
3771
|
+
let { utils: n } = t, r = Hs(e) === "custominteraction" ? Us(e, ["portablecustominteraction"]) : e;
|
|
3757
3772
|
if (!r) throw Error("customInteraction does not contain a portableCustomInteraction payload");
|
|
3758
|
-
let i = n.getAttribute(e, "responseIdentifier") || n.getAttribute(e, "response-identifier") || t.responseId || "", a = n.getAttribute(r, "customInteractionTypeIdentifier") || n.getAttribute(r, "custom-interaction-type-identifier") || n.getAttribute(r, "customInteractionIdentifierType") || n.getAttribute(r, "custom-interaction-identifier-type") || "", o = "", s, c =
|
|
3773
|
+
let i = n.getAttribute(e, "responseIdentifier") || n.getAttribute(e, "response-identifier") || t.responseId || "", a = n.getAttribute(r, "customInteractionTypeIdentifier") || n.getAttribute(r, "custom-interaction-type-identifier") || n.getAttribute(r, "customInteractionIdentifierType") || n.getAttribute(r, "custom-interaction-identifier-type") || "", o = "", s, c = Us(r, ["interactionmodules", "qti-interaction-modules"]);
|
|
3759
3774
|
if (c) {
|
|
3760
|
-
let e =
|
|
3775
|
+
let e = Us(c, ["interactionmodule", "qti-interaction-module"]);
|
|
3761
3776
|
if (e) {
|
|
3762
3777
|
o = n.getAttribute(e, "primaryPath") || n.getAttribute(e, "primary-path") || "";
|
|
3763
3778
|
let t = n.getAttribute(e, "fallbackPath") || n.getAttribute(e, "fallback-path") || "";
|
|
3764
3779
|
t && (s = t);
|
|
3765
3780
|
}
|
|
3766
3781
|
}
|
|
3767
|
-
let l =
|
|
3782
|
+
let l = Us(r, ["instance"]);
|
|
3768
3783
|
if (!o && l) {
|
|
3769
|
-
let e =
|
|
3784
|
+
let e = Ws(l, ["script"]).find((e) => !!n.getAttribute(e, "src"));
|
|
3770
3785
|
o = e ? n.getAttribute(e, "src") : "";
|
|
3771
3786
|
}
|
|
3772
|
-
let u =
|
|
3787
|
+
let u = Us(r, ["interactionmarkup", "qti-interaction-markup"]) ?? l, d = u ? n.getHtmlContent(u) : "", f = {}, p = Us(r, ["pciproperties", "qti-pci-properties"]);
|
|
3773
3788
|
if (p) {
|
|
3774
|
-
let e =
|
|
3789
|
+
let e = Ws(p, ["pciproperty", "qti-pci-property"]);
|
|
3775
3790
|
for (let t of e) {
|
|
3776
3791
|
let e = n.getAttribute(t, "key") || n.getAttribute(t, "name") || "", r = n.getAttribute(t, "value") || (t.textContent ?? "").trim() || "";
|
|
3777
3792
|
e && (f[e] = r);
|
|
@@ -3796,25 +3811,25 @@ var Rs = {
|
|
|
3796
3811
|
};
|
|
3797
3812
|
}
|
|
3798
3813
|
};
|
|
3799
|
-
function
|
|
3814
|
+
function Hs(e) {
|
|
3800
3815
|
let t = e.rawTagName?.toLowerCase() ?? "";
|
|
3801
3816
|
return t.includes(":") ? t.slice(t.lastIndexOf(":") + 1) : t;
|
|
3802
3817
|
}
|
|
3803
|
-
function
|
|
3804
|
-
return
|
|
3818
|
+
function Us(e, t) {
|
|
3819
|
+
return Ws(e, t)[0] ?? null;
|
|
3805
3820
|
}
|
|
3806
|
-
function
|
|
3821
|
+
function Ws(e, t) {
|
|
3807
3822
|
let n = new Set(t.map((e) => e.toLowerCase())), r = [], i = (e) => {
|
|
3808
3823
|
for (let t of e.childNodes ?? []) {
|
|
3809
3824
|
let e = t;
|
|
3810
|
-
e.rawTagName && (n.has(
|
|
3825
|
+
e.rawTagName && (n.has(Hs(e)) && r.push(e), i(e));
|
|
3811
3826
|
}
|
|
3812
3827
|
};
|
|
3813
3828
|
return i(e), r;
|
|
3814
3829
|
}
|
|
3815
3830
|
//#endregion
|
|
3816
3831
|
//#region src/interactions/modules.ts
|
|
3817
|
-
var
|
|
3832
|
+
var Gs = [
|
|
3818
3833
|
{
|
|
3819
3834
|
type: "choiceInteraction",
|
|
3820
3835
|
extractor: No,
|
|
@@ -3860,17 +3875,17 @@ var Us = [
|
|
|
3860
3875
|
},
|
|
3861
3876
|
{
|
|
3862
3877
|
type: "inlineChoiceInteraction",
|
|
3863
|
-
extractor:
|
|
3878
|
+
extractor: Fs,
|
|
3864
3879
|
placement: "inline"
|
|
3865
3880
|
},
|
|
3866
3881
|
{
|
|
3867
3882
|
type: "orderInteraction",
|
|
3868
|
-
extractor:
|
|
3883
|
+
extractor: Rs,
|
|
3869
3884
|
placement: "block"
|
|
3870
3885
|
},
|
|
3871
3886
|
{
|
|
3872
3887
|
type: "matchInteraction",
|
|
3873
|
-
extractor:
|
|
3888
|
+
extractor: Is,
|
|
3874
3889
|
placement: "block"
|
|
3875
3890
|
},
|
|
3876
3891
|
{
|
|
@@ -3977,17 +3992,17 @@ var Us = [
|
|
|
3977
3992
|
},
|
|
3978
3993
|
{
|
|
3979
3994
|
type: "portableCustomInteraction",
|
|
3980
|
-
extractor:
|
|
3995
|
+
extractor: Vs,
|
|
3981
3996
|
placement: "block"
|
|
3982
3997
|
},
|
|
3983
3998
|
{
|
|
3984
3999
|
type: "mediaInteraction",
|
|
3985
|
-
extractor:
|
|
4000
|
+
extractor: Ls,
|
|
3986
4001
|
placement: "block"
|
|
3987
4002
|
},
|
|
3988
4003
|
{
|
|
3989
4004
|
type: "hottextInteraction",
|
|
3990
|
-
extractor:
|
|
4005
|
+
extractor: Ps,
|
|
3991
4006
|
placement: "block"
|
|
3992
4007
|
},
|
|
3993
4008
|
{
|
|
@@ -4056,7 +4071,7 @@ var Us = [
|
|
|
4056
4071
|
},
|
|
4057
4072
|
{
|
|
4058
4073
|
type: "positionObjectInteraction",
|
|
4059
|
-
extractor:
|
|
4074
|
+
extractor: Bs,
|
|
4060
4075
|
placement: "block"
|
|
4061
4076
|
},
|
|
4062
4077
|
{
|
|
@@ -4065,29 +4080,29 @@ var Us = [
|
|
|
4065
4080
|
placement: "block"
|
|
4066
4081
|
}
|
|
4067
4082
|
];
|
|
4068
|
-
function
|
|
4069
|
-
return
|
|
4083
|
+
function Ks() {
|
|
4084
|
+
return Gs.map((e) => e.extractor);
|
|
4070
4085
|
}
|
|
4071
|
-
var
|
|
4072
|
-
function
|
|
4086
|
+
var qs = new Map(Gs.map((e) => [e.type.toLowerCase(), e.type]));
|
|
4087
|
+
function Js(e) {
|
|
4073
4088
|
let t = e.toLowerCase();
|
|
4074
|
-
return t.startsWith("qti-") ? t.slice(4).replace(/-([a-z])/g, (e, t) => t.toUpperCase()) :
|
|
4089
|
+
return t.startsWith("qti-") ? t.slice(4).replace(/-([a-z])/g, (e, t) => t.toUpperCase()) : qs.get(t) ?? e;
|
|
4075
4090
|
}
|
|
4076
|
-
function
|
|
4077
|
-
let t =
|
|
4078
|
-
return
|
|
4091
|
+
function Ys(e) {
|
|
4092
|
+
let t = Js(e);
|
|
4093
|
+
return Gs.find((e) => e.type === t) ?? null;
|
|
4079
4094
|
}
|
|
4080
|
-
function
|
|
4081
|
-
return
|
|
4095
|
+
function Xs(e) {
|
|
4096
|
+
return Ys(e)?.placement === "inline";
|
|
4082
4097
|
}
|
|
4083
|
-
function
|
|
4084
|
-
return Js(
|
|
4098
|
+
function Zs(e) {
|
|
4099
|
+
return Xs(Js(e));
|
|
4085
4100
|
}
|
|
4086
4101
|
//#endregion
|
|
4087
4102
|
//#region src/document/AssessmentItemDocument.ts
|
|
4088
|
-
var
|
|
4103
|
+
var Qs = class {
|
|
4089
4104
|
constructor({ itemXml: e, elementNameMapper: t, attributeNameMapper: n, security: r }) {
|
|
4090
|
-
this.extractionDocument = null, this.extractionRoot = null, this.itemXml = e, this.security = r, this.mathMlPrefixes =
|
|
4105
|
+
this.extractionDocument = null, this.extractionRoot = null, this.itemXml = e, this.security = r, this.mathMlPrefixes = nc(e), this.elementNameMapper = t, this.attributeNameMapper = n, Eo(this.itemXml, this.security), this.xmlDocument = b(this.itemXml), this.assessmentItem = g(this.xmlDocument);
|
|
4091
4106
|
}
|
|
4092
4107
|
getAssessmentItem() {
|
|
4093
4108
|
return this.assessmentItem;
|
|
@@ -4122,7 +4137,7 @@ var Xs = class {
|
|
|
4122
4137
|
return this.assessmentItem.getAttribute(this.attributeNameMapper.toNative(e));
|
|
4123
4138
|
}
|
|
4124
4139
|
serializeChildren(e) {
|
|
4125
|
-
return tc(
|
|
4140
|
+
return rc(tc(this.serializeChildNodes(e)), this.mathMlPrefixes);
|
|
4126
4141
|
}
|
|
4127
4142
|
findExtractionElements(e) {
|
|
4128
4143
|
let t = this.getExtractionRoot();
|
|
@@ -4136,7 +4151,7 @@ var Xs = class {
|
|
|
4136
4151
|
element: e,
|
|
4137
4152
|
contextRoot: t,
|
|
4138
4153
|
responseIdentifier: a,
|
|
4139
|
-
normalizedType:
|
|
4154
|
+
normalizedType: Js(i)
|
|
4140
4155
|
});
|
|
4141
4156
|
}), r;
|
|
4142
4157
|
}
|
|
@@ -4171,7 +4186,7 @@ var Xs = class {
|
|
|
4171
4186
|
walkExtractionChildren(e, t) {
|
|
4172
4187
|
for (let n of e.childNodes ?? []) {
|
|
4173
4188
|
let e = n;
|
|
4174
|
-
e.rawTagName && (
|
|
4189
|
+
e.rawTagName && ($s(e.rawTagName) || (t(e), this.walkExtractionChildren(e, t)));
|
|
4175
4190
|
}
|
|
4176
4191
|
}
|
|
4177
4192
|
getExtractionResponseIdentifier(e) {
|
|
@@ -4179,17 +4194,17 @@ var Xs = class {
|
|
|
4179
4194
|
return e.getAttribute?.("responseIdentifier") || e.getAttribute?.(t) || e.getAttribute?.("response-identifier") || e.getAttribute?.("responseidentifier") || "";
|
|
4180
4195
|
}
|
|
4181
4196
|
};
|
|
4182
|
-
function
|
|
4197
|
+
function $s(e) {
|
|
4183
4198
|
let t = e.toLowerCase();
|
|
4184
4199
|
return t === "rubricblock" || t === "qti-rubric-block";
|
|
4185
4200
|
}
|
|
4186
|
-
function
|
|
4187
|
-
return new
|
|
4201
|
+
function ec(e) {
|
|
4202
|
+
return new Qs(e);
|
|
4188
4203
|
}
|
|
4189
|
-
function
|
|
4204
|
+
function tc(e) {
|
|
4190
4205
|
return e.replace(/<!\[CDATA\[([\s\S]*?)\]\]>/g, (e, t) => t);
|
|
4191
4206
|
}
|
|
4192
|
-
function
|
|
4207
|
+
function nc(e) {
|
|
4193
4208
|
let t = /* @__PURE__ */ new Set();
|
|
4194
4209
|
for (let n of e.matchAll(/\sxmlns:([A-Za-z_][\w.-]*)=(["'])http:\/\/www\.w3\.org\/1998\/Math\/MathML\2/g)) {
|
|
4195
4210
|
let e = n[1];
|
|
@@ -4197,24 +4212,24 @@ function ec(e) {
|
|
|
4197
4212
|
}
|
|
4198
4213
|
return t;
|
|
4199
4214
|
}
|
|
4200
|
-
function
|
|
4215
|
+
function rc(e, t) {
|
|
4201
4216
|
let n = e;
|
|
4202
4217
|
for (let e of t) {
|
|
4203
|
-
let t =
|
|
4218
|
+
let t = ic(e);
|
|
4204
4219
|
n = n.replace(RegExp(`(<\\/?)${t}:([A-Za-z][\\w.-]*)(?=[\\s>/])`, "g"), "$1$2").replace(RegExp(`\\sxmlns:${t}=(["'])http:\\/\\/www\\.w3\\.org\\/1998\\/Math\\/MathML\\1`, "g"), "");
|
|
4205
4220
|
}
|
|
4206
4221
|
return n;
|
|
4207
4222
|
}
|
|
4208
|
-
function
|
|
4223
|
+
function ic(e) {
|
|
4209
4224
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
4210
4225
|
}
|
|
4211
4226
|
//#endregion
|
|
4212
4227
|
//#region src/extraction/types.ts
|
|
4213
|
-
var
|
|
4228
|
+
var ac = class extends Error {
|
|
4214
4229
|
constructor(e, t, n, r) {
|
|
4215
4230
|
super(e), this.extractorId = t, this.elementType = n, this.cause = r, this.name = "ExtractionError";
|
|
4216
4231
|
}
|
|
4217
|
-
},
|
|
4232
|
+
}, oc = class e {
|
|
4218
4233
|
constructor(e) {
|
|
4219
4234
|
this.extractorsById = /* @__PURE__ */ new Map(), this.extractorsByType = /* @__PURE__ */ new Map(), this.extractorCache = /* @__PURE__ */ new WeakMap(), this.qti2xMapper = new t(), this.elementNameMapper = e;
|
|
4220
4235
|
}
|
|
@@ -4263,7 +4278,7 @@ var rc = class extends Error {
|
|
|
4263
4278
|
let t = e.rawTagName || "unknown";
|
|
4264
4279
|
return {
|
|
4265
4280
|
success: !1,
|
|
4266
|
-
error: new
|
|
4281
|
+
error: new ac(`No extractor available for element '${t}'. Registered types: ${Array.from(this.extractorsByType.keys()).join(", ")}`, "none", t)
|
|
4267
4282
|
};
|
|
4268
4283
|
}
|
|
4269
4284
|
try {
|
|
@@ -4272,7 +4287,7 @@ var rc = class extends Error {
|
|
|
4272
4287
|
let t = n.validate(r);
|
|
4273
4288
|
if (!t.valid) return {
|
|
4274
4289
|
success: !1,
|
|
4275
|
-
error: new
|
|
4290
|
+
error: new ac(`Validation failed for extractor '${n.id}': ${t.errors?.join(", ")}`, n.id, e.rawTagName || "unknown")
|
|
4276
4291
|
};
|
|
4277
4292
|
if (t.warnings && t.warnings.length > 0) return {
|
|
4278
4293
|
success: !0,
|
|
@@ -4288,7 +4303,7 @@ var rc = class extends Error {
|
|
|
4288
4303
|
let r = e.rawTagName || "unknown";
|
|
4289
4304
|
return {
|
|
4290
4305
|
success: !1,
|
|
4291
|
-
error: t instanceof
|
|
4306
|
+
error: t instanceof ac ? t : new ac(`Extraction failed for '${r}': ${t instanceof Error ? t.message : String(t)}`, n.id, r, t instanceof Error ? t : void 0)
|
|
4292
4307
|
};
|
|
4293
4308
|
}
|
|
4294
4309
|
}
|
|
@@ -4312,21 +4327,21 @@ var rc = class extends Error {
|
|
|
4312
4327
|
return t;
|
|
4313
4328
|
}
|
|
4314
4329
|
};
|
|
4315
|
-
function
|
|
4316
|
-
return new
|
|
4330
|
+
function sc(e) {
|
|
4331
|
+
return new oc(e);
|
|
4317
4332
|
}
|
|
4318
4333
|
//#endregion
|
|
4319
4334
|
//#region src/extraction/utils.ts
|
|
4320
|
-
function
|
|
4335
|
+
function cc(e) {
|
|
4321
4336
|
return e?.textContent?.trim() || "";
|
|
4322
4337
|
}
|
|
4323
|
-
function
|
|
4324
|
-
return
|
|
4338
|
+
function lc(e) {
|
|
4339
|
+
return Ms(e?.innerHTML?.trim() || "");
|
|
4325
4340
|
}
|
|
4326
|
-
function
|
|
4327
|
-
return e?.childNodes ? e.childNodes.filter((e) =>
|
|
4341
|
+
function uc(e, t, n) {
|
|
4342
|
+
return e?.childNodes ? e.childNodes.filter((e) => hc(e.rawTagName, t, n)) : [];
|
|
4328
4343
|
}
|
|
4329
|
-
function
|
|
4344
|
+
function dc(e, t, n = !1, r) {
|
|
4330
4345
|
let i = e.getAttribute(t);
|
|
4331
4346
|
if (i == null && r) {
|
|
4332
4347
|
let n = r.toNative(t);
|
|
@@ -4334,7 +4349,7 @@ function lc(e, t, n = !1, r) {
|
|
|
4334
4349
|
}
|
|
4335
4350
|
return i == null ? n : i === "true";
|
|
4336
4351
|
}
|
|
4337
|
-
function
|
|
4352
|
+
function fc(e, t, n, r) {
|
|
4338
4353
|
let i = e.getAttribute(t);
|
|
4339
4354
|
if (i == null && r) {
|
|
4340
4355
|
let n = r.toNative(t);
|
|
@@ -4342,7 +4357,7 @@ function uc(e, t, n, r) {
|
|
|
4342
4357
|
}
|
|
4343
4358
|
return i ? Number(i) : n;
|
|
4344
4359
|
}
|
|
4345
|
-
function
|
|
4360
|
+
function pc(e, t, n = "", r) {
|
|
4346
4361
|
let i = e.getAttribute(t);
|
|
4347
4362
|
if (i == null && r) {
|
|
4348
4363
|
let n = r.toNative(t);
|
|
@@ -4350,26 +4365,26 @@ function dc(e, t, n = "", r) {
|
|
|
4350
4365
|
}
|
|
4351
4366
|
return i || n;
|
|
4352
4367
|
}
|
|
4353
|
-
function
|
|
4368
|
+
function mc(e) {
|
|
4354
4369
|
let t = e.getAttribute("class");
|
|
4355
4370
|
return t ? t.split(/\s+/).filter(Boolean) : [];
|
|
4356
4371
|
}
|
|
4357
|
-
function
|
|
4372
|
+
function hc(e, t, n) {
|
|
4358
4373
|
if (!e) return !1;
|
|
4359
4374
|
let r = t.toLowerCase(), i = n.toNative(r);
|
|
4360
4375
|
return e.toLowerCase() === i.toLowerCase();
|
|
4361
4376
|
}
|
|
4362
|
-
function
|
|
4377
|
+
function gc(n, r, i) {
|
|
4363
4378
|
let a = r || new t(), o = i || new e();
|
|
4364
4379
|
return {
|
|
4365
4380
|
getChildrenByTag(e, t) {
|
|
4366
|
-
return
|
|
4381
|
+
return uc(e, t, a);
|
|
4367
4382
|
},
|
|
4368
4383
|
querySelectorAll(e, t) {
|
|
4369
4384
|
let n = t.split(/\s+/), r = [e];
|
|
4370
4385
|
for (let e of n) {
|
|
4371
4386
|
let t = [];
|
|
4372
|
-
for (let n of r) if (
|
|
4387
|
+
for (let n of r) if (hc(n.rawTagName, e, a) && t.push(n), n.childNodes) for (let r of n.childNodes) typeof r != "string" && hc(r.rawTagName, e, a) && t.push(r);
|
|
4373
4388
|
r = t;
|
|
4374
4389
|
}
|
|
4375
4390
|
return r;
|
|
@@ -4380,69 +4395,69 @@ function mc(n, r, i) {
|
|
|
4380
4395
|
},
|
|
4381
4396
|
hasChildWithTag(e, t) {
|
|
4382
4397
|
if (!e.childNodes) return !1;
|
|
4383
|
-
for (let n of e.childNodes) if (typeof n != "string" &&
|
|
4398
|
+
for (let n of e.childNodes) if (typeof n != "string" && hc(n.rawTagName, t, a)) return !0;
|
|
4384
4399
|
return !1;
|
|
4385
4400
|
},
|
|
4386
4401
|
getHtmlContent(e) {
|
|
4387
|
-
return
|
|
4402
|
+
return Ms(e?.innerHTML?.trim() || "", { security: n });
|
|
4388
4403
|
},
|
|
4389
4404
|
getTextContent(e) {
|
|
4390
|
-
return
|
|
4405
|
+
return cc(e);
|
|
4391
4406
|
},
|
|
4392
4407
|
getAttribute(e, t, n = "") {
|
|
4393
|
-
return
|
|
4408
|
+
return pc(e, t, n, o);
|
|
4394
4409
|
},
|
|
4395
4410
|
getBooleanAttribute(e, t, n = !1) {
|
|
4396
|
-
return
|
|
4411
|
+
return dc(e, t, n, o);
|
|
4397
4412
|
},
|
|
4398
4413
|
getNumberAttribute(e, t, n = 0) {
|
|
4399
|
-
return
|
|
4414
|
+
return fc(e, t, n, o);
|
|
4400
4415
|
},
|
|
4401
4416
|
getPrompt(e) {
|
|
4402
|
-
let t =
|
|
4403
|
-
return t ?
|
|
4417
|
+
let t = uc(e, "prompt", a)[0];
|
|
4418
|
+
return t ? lc(t) : null;
|
|
4404
4419
|
},
|
|
4405
4420
|
getClasses(e) {
|
|
4406
|
-
return
|
|
4421
|
+
return mc(e);
|
|
4407
4422
|
}
|
|
4408
4423
|
};
|
|
4409
4424
|
}
|
|
4410
4425
|
//#endregion
|
|
4411
4426
|
//#region src/extraction/createContext.ts
|
|
4412
|
-
function
|
|
4427
|
+
function _c(e, t, n, r, i, a) {
|
|
4413
4428
|
let o = i.elementNameMapper, s = i.attributeNameMapper;
|
|
4414
4429
|
return {
|
|
4415
4430
|
element: e,
|
|
4416
4431
|
responseId: t,
|
|
4417
4432
|
dom: n,
|
|
4418
4433
|
declarations: r,
|
|
4419
|
-
utils:
|
|
4434
|
+
utils: gc(i.security, o, s),
|
|
4420
4435
|
config: i,
|
|
4421
4436
|
...a ? { shuffleRng: ko(a, t) } : {}
|
|
4422
4437
|
};
|
|
4423
4438
|
}
|
|
4424
4439
|
//#endregion
|
|
4425
4440
|
//#region src/core/trustedTypes.ts
|
|
4426
|
-
function
|
|
4441
|
+
function vc() {
|
|
4427
4442
|
return globalThis.trustedTypes;
|
|
4428
4443
|
}
|
|
4429
|
-
var
|
|
4430
|
-
function
|
|
4431
|
-
let t =
|
|
4444
|
+
var yc = /* @__PURE__ */ new Map();
|
|
4445
|
+
function bc(e) {
|
|
4446
|
+
let t = yc.get(e);
|
|
4432
4447
|
if (t) return t;
|
|
4433
|
-
let n =
|
|
4448
|
+
let n = vc();
|
|
4434
4449
|
if (!n?.createPolicy) return null;
|
|
4435
4450
|
try {
|
|
4436
4451
|
let t = n.createPolicy(e, { createHTML: (e) => e });
|
|
4437
|
-
return t?.createHTML ? (
|
|
4452
|
+
return t?.createHTML ? (yc.set(e, t), t) : null;
|
|
4438
4453
|
} catch {
|
|
4439
4454
|
return null;
|
|
4440
4455
|
}
|
|
4441
4456
|
}
|
|
4442
|
-
function
|
|
4457
|
+
function xc(e, t) {
|
|
4443
4458
|
if (!t) return e;
|
|
4444
4459
|
if (!e) return "";
|
|
4445
|
-
let n =
|
|
4460
|
+
let n = bc(t);
|
|
4446
4461
|
if (!n) return e;
|
|
4447
4462
|
try {
|
|
4448
4463
|
return n.createHTML(e);
|
|
@@ -4452,39 +4467,39 @@ function yc(e, t) {
|
|
|
4452
4467
|
}
|
|
4453
4468
|
//#endregion
|
|
4454
4469
|
//#region src/extraction/interactionSecurity.ts
|
|
4455
|
-
function
|
|
4470
|
+
function Sc(e, t) {
|
|
4456
4471
|
let n = t?.urlPolicy, r = t?.allowObjectEmbeds === !0, i = t?.trustedTypesPolicyName;
|
|
4457
4472
|
for (let t of e) {
|
|
4458
|
-
if (t.type === "choiceInteraction" && Array.isArray(t.choices)) for (let e of t.choices) typeof e?.text == "string" && (e.text =
|
|
4459
|
-
if (t.imageData?.src && (t.imageData.src = ls(t.imageData.src, n, "img") ?? ""), t.imageData?.content && typeof t.imageData.content == "string" && (t.imageData.content =
|
|
4473
|
+
if (t.type === "choiceInteraction" && Array.isArray(t.choices)) for (let e of t.choices) typeof e?.text == "string" && (e.text = xc(e.text, i));
|
|
4474
|
+
if (t.imageData?.src && (t.imageData.src = ls(t.imageData.src, n, "img") ?? ""), t.imageData?.content && typeof t.imageData.content == "string" && (t.imageData.content = xc(t.imageData.content, i)), Array.isArray(t.positionObjectStages)) for (let e of t.positionObjectStages) e?.objectData?.src && (e.objectData.src = ls(e.objectData.src, n, "img") ?? ""), e?.objectData?.content && typeof e.objectData.content == "string" && (e.objectData.content = xc(e.objectData.content, i));
|
|
4460
4475
|
if (t.type === "mediaInteraction" && t.mediaElement?.src) {
|
|
4461
4476
|
let e = t.mediaElement.type === "object" ? "object" : "media";
|
|
4462
4477
|
t.mediaElement.src = ls(t.mediaElement.src, n, e) ?? "", t.allowObjectEmbeds = r;
|
|
4463
4478
|
}
|
|
4464
|
-
t.type === "hottextInteraction" && typeof t.contentHtml == "string" && (t.contentHtml =
|
|
4479
|
+
t.type === "hottextInteraction" && typeof t.contentHtml == "string" && (t.contentHtml = xc(t.contentHtml, i));
|
|
4465
4480
|
}
|
|
4466
4481
|
return e;
|
|
4467
4482
|
}
|
|
4468
4483
|
//#endregion
|
|
4469
4484
|
//#region src/extraction/interactionExtractionPipeline.ts
|
|
4470
|
-
function
|
|
4471
|
-
let a =
|
|
4485
|
+
function Cc({ document: e, extractionRegistry: t, declarations: n, config: r, sessionGuid: i }) {
|
|
4486
|
+
let a = Tc(n), o = e.findExtractionElements(wc(t)), s = [];
|
|
4472
4487
|
for (let e of o) {
|
|
4473
|
-
let n =
|
|
4488
|
+
let n = _c(e.element, e.responseIdentifier, e.contextRoot, a, r, i), o = t.extract(e.element, n);
|
|
4474
4489
|
o.success && s.push({
|
|
4475
4490
|
type: o.data?.type ?? e.normalizedType,
|
|
4476
4491
|
responseId: e.responseIdentifier,
|
|
4477
4492
|
...o.data
|
|
4478
4493
|
});
|
|
4479
4494
|
}
|
|
4480
|
-
return
|
|
4495
|
+
return Sc(s, r.security);
|
|
4481
4496
|
}
|
|
4482
|
-
function
|
|
4497
|
+
function wc(e) {
|
|
4483
4498
|
let t = /* @__PURE__ */ new Set();
|
|
4484
4499
|
for (let n of e.getExtractors()) for (let e of n.elementTypes) t.add(e);
|
|
4485
4500
|
return [...t];
|
|
4486
4501
|
}
|
|
4487
|
-
function
|
|
4502
|
+
function Tc(e) {
|
|
4488
4503
|
let t = /* @__PURE__ */ new Map();
|
|
4489
4504
|
for (let n of Object.values(e)) t.set(n.identifier, {
|
|
4490
4505
|
identifier: n.identifier,
|
|
@@ -4495,7 +4510,7 @@ function Cc(e) {
|
|
|
4495
4510
|
}
|
|
4496
4511
|
//#endregion
|
|
4497
4512
|
//#region src/core/ComponentRegistry.ts
|
|
4498
|
-
var
|
|
4513
|
+
var Ec = {
|
|
4499
4514
|
choiceInteraction: {
|
|
4500
4515
|
name: "default-choice",
|
|
4501
4516
|
tagName: "pie-qti-choice"
|
|
@@ -4580,7 +4595,7 @@ var wc = {
|
|
|
4580
4595
|
name: "default-catalog-popup",
|
|
4581
4596
|
tagName: "pie-qti-catalog-popup"
|
|
4582
4597
|
}
|
|
4583
|
-
},
|
|
4598
|
+
}, Dc = class {
|
|
4584
4599
|
constructor() {
|
|
4585
4600
|
this.components = /* @__PURE__ */ new Map(), this.definedElements = /* @__PURE__ */ new Set();
|
|
4586
4601
|
}
|
|
@@ -4622,12 +4637,12 @@ var wc = {
|
|
|
4622
4637
|
return !t || t.length === 0 ? null : t[0].config.tagName;
|
|
4623
4638
|
}
|
|
4624
4639
|
};
|
|
4625
|
-
function
|
|
4626
|
-
let e = new
|
|
4627
|
-
return
|
|
4640
|
+
function Oc() {
|
|
4641
|
+
let e = new Dc();
|
|
4642
|
+
return kc(e), e;
|
|
4628
4643
|
}
|
|
4629
|
-
function
|
|
4630
|
-
for (let [t, n] of Object.entries(
|
|
4644
|
+
function kc(e) {
|
|
4645
|
+
for (let [t, n] of Object.entries(Ec)) e.register(t, {
|
|
4631
4646
|
...n,
|
|
4632
4647
|
description: `Default web component tag for ${t}`,
|
|
4633
4648
|
priority: -100
|
|
@@ -4635,30 +4650,30 @@ function Dc(e) {
|
|
|
4635
4650
|
}
|
|
4636
4651
|
//#endregion
|
|
4637
4652
|
//#region src/pnp/applyPnp.ts
|
|
4638
|
-
var
|
|
4639
|
-
function
|
|
4653
|
+
var Ac = "data-qti-colorscheme", jc = "data-qti-magnification";
|
|
4654
|
+
function Mc(e, t) {
|
|
4640
4655
|
let n = t?.display?.colorScheme;
|
|
4641
|
-
!n || n === "default" ? e.removeAttribute(
|
|
4656
|
+
!n || n === "default" ? e.removeAttribute(Ac) : e.setAttribute(Ac, n);
|
|
4642
4657
|
let r = t?.display?.magnification;
|
|
4643
|
-
r !== void 0 && Number.isFinite(r) && r > 0 ? (e.setAttribute(
|
|
4658
|
+
r !== void 0 && Number.isFinite(r) && r > 0 ? (e.setAttribute(jc, String(r)), e.style?.setProperty?.("--qti-magnification", String(r))) : (e.removeAttribute(jc), e.style?.removeProperty?.("--qti-magnification"));
|
|
4644
4659
|
}
|
|
4645
4660
|
//#endregion
|
|
4646
4661
|
//#region src/catalog/catalogExtractor.ts
|
|
4647
|
-
function
|
|
4662
|
+
function Nc(e) {
|
|
4648
4663
|
if (!e.trim()) return /* @__PURE__ */ new Map();
|
|
4649
4664
|
let t = ie(`<root>${e}</root>`, { lowerCaseTagName: !0 }).querySelector("qti-catalog-info");
|
|
4650
|
-
return t ?
|
|
4665
|
+
return t ? Ic(t) : /* @__PURE__ */ new Map();
|
|
4651
4666
|
}
|
|
4652
|
-
function
|
|
4667
|
+
function Pc(e) {
|
|
4653
4668
|
let t = ie(e, { lowerCaseTagName: !0 }).querySelector("qti-catalog-info");
|
|
4654
|
-
return t ?
|
|
4669
|
+
return t ? Ic(t) : /* @__PURE__ */ new Map();
|
|
4655
4670
|
}
|
|
4656
|
-
function
|
|
4671
|
+
function Fc(e, t) {
|
|
4657
4672
|
let n = new Map(e);
|
|
4658
4673
|
for (let [e, r] of t) n.set(e, r);
|
|
4659
4674
|
return n;
|
|
4660
4675
|
}
|
|
4661
|
-
function
|
|
4676
|
+
function Ic(e) {
|
|
4662
4677
|
let t = /* @__PURE__ */ new Map();
|
|
4663
4678
|
for (let n of e.querySelectorAll("qti-catalog")) {
|
|
4664
4679
|
let e = n.getAttribute("id") ?? n.getAttribute("identifier");
|
|
@@ -4666,14 +4681,14 @@ function Pc(e) {
|
|
|
4666
4681
|
let r = [];
|
|
4667
4682
|
for (let e of n.querySelectorAll("qti-card")) {
|
|
4668
4683
|
let t = e.getAttribute("support") ?? e.getAttribute("usage");
|
|
4669
|
-
for (let n of
|
|
4684
|
+
for (let n of Lc(e, t ?? void 0)) r.push(n);
|
|
4670
4685
|
}
|
|
4671
4686
|
r.length > 0 && t.set(e, { entries: r });
|
|
4672
4687
|
}
|
|
4673
4688
|
for (let n of e.querySelectorAll("qti-card")) {
|
|
4674
4689
|
let e = n.getAttribute("identifier");
|
|
4675
4690
|
if (!e) continue;
|
|
4676
|
-
let r =
|
|
4691
|
+
let r = Lc(n);
|
|
4677
4692
|
if (r.length > 0) {
|
|
4678
4693
|
let n = t.get(e);
|
|
4679
4694
|
n ? n.entries.push(...r) : t.set(e, { entries: r });
|
|
@@ -4681,35 +4696,35 @@ function Pc(e) {
|
|
|
4681
4696
|
}
|
|
4682
4697
|
return t;
|
|
4683
4698
|
}
|
|
4684
|
-
function
|
|
4699
|
+
function Lc(e, t) {
|
|
4685
4700
|
let n = e.querySelectorAll("qti-card-entry"), r = [];
|
|
4686
4701
|
if (n.length > 0) {
|
|
4687
4702
|
for (let e of n) {
|
|
4688
4703
|
let n = e.getAttribute("usage") ?? e.getAttribute("data-reading-type") ?? t;
|
|
4689
4704
|
n && r.push({
|
|
4690
4705
|
usage: n,
|
|
4691
|
-
lang:
|
|
4692
|
-
html:
|
|
4706
|
+
lang: Rc(e),
|
|
4707
|
+
html: zc(e)
|
|
4693
4708
|
});
|
|
4694
4709
|
}
|
|
4695
4710
|
return r;
|
|
4696
4711
|
}
|
|
4697
4712
|
return t && r.push({
|
|
4698
4713
|
usage: t,
|
|
4699
|
-
lang:
|
|
4700
|
-
html:
|
|
4714
|
+
lang: Rc(e),
|
|
4715
|
+
html: zc(e)
|
|
4701
4716
|
}), r;
|
|
4702
4717
|
}
|
|
4703
|
-
function
|
|
4718
|
+
function Rc(e) {
|
|
4704
4719
|
return e.getAttribute("xml:lang") ?? e.getAttribute("xmllang") ?? e.getAttribute("lang") ?? void 0;
|
|
4705
4720
|
}
|
|
4706
|
-
function
|
|
4721
|
+
function zc(e) {
|
|
4707
4722
|
let t = e.querySelector("qti-html-content"), n = e.querySelector("qti-file-href");
|
|
4708
4723
|
return t ? t.innerHTML ?? t.text ?? "" : n ? n.getAttribute("src") ?? n.text?.trim() ?? "" : "";
|
|
4709
4724
|
}
|
|
4710
4725
|
//#endregion
|
|
4711
4726
|
//#region src/catalog/catalogLookup.ts
|
|
4712
|
-
function
|
|
4727
|
+
function Bc(e, t, n, r) {
|
|
4713
4728
|
let i = e.get(t);
|
|
4714
4729
|
if (!i) return null;
|
|
4715
4730
|
let a = i.entries.filter((e) => e.usage === n);
|
|
@@ -4725,11 +4740,11 @@ function Rc(e, t, n, r) {
|
|
|
4725
4740
|
}
|
|
4726
4741
|
//#endregion
|
|
4727
4742
|
//#region src/pci/types.ts
|
|
4728
|
-
var
|
|
4743
|
+
var Vc = class extends Error {
|
|
4729
4744
|
constructor(e, t) {
|
|
4730
4745
|
super(`PCI module loading is disabled for response '${e}'. Provide a host-controlled moduleResolver before loading '${t}'.`), this.responseIdentifier = e, this.authoredPath = t, this.name = "PciModuleResolverRequiredError";
|
|
4731
4746
|
}
|
|
4732
|
-
},
|
|
4747
|
+
}, Hc = class extends Error {
|
|
4733
4748
|
constructor(e, t, n) {
|
|
4734
4749
|
super(t ? `PCI module failed to load from '${e}' and fallback '${t}'` : `PCI module failed to load from '${e}'`), this.primaryPath = e, this.fallbackPath = t, this.name = "PciLoadError", n && Object.defineProperty(this, "cause", {
|
|
4735
4750
|
value: n,
|
|
@@ -4737,7 +4752,7 @@ var zc = class extends Error {
|
|
|
4737
4752
|
configurable: !0
|
|
4738
4753
|
});
|
|
4739
4754
|
}
|
|
4740
|
-
},
|
|
4755
|
+
}, Uc = class {
|
|
4741
4756
|
constructor(e, t = {}) {
|
|
4742
4757
|
this.module = null, this.destroyed = !1, this.loadGeneration = 0, this._response = null, this._hasResponse = !1, this._responseChangeListeners = /* @__PURE__ */ new Set(), this.data = e, this.baseUrl = typeof t == "string" ? t : t.baseUrl ?? "", this.moduleResolver = typeof t == "string" ? void 0 : t.moduleResolver;
|
|
4743
4758
|
}
|
|
@@ -4746,7 +4761,7 @@ var zc = class extends Error {
|
|
|
4746
4761
|
}
|
|
4747
4762
|
async load() {
|
|
4748
4763
|
if (this.destroyed) throw Error("Cannot load a destroyed PciHost");
|
|
4749
|
-
if (!this.moduleResolver) throw new
|
|
4764
|
+
if (!this.moduleResolver) throw new Vc(this.data.responseIdentifier, this.data.primaryPath);
|
|
4750
4765
|
let e = ++this.loadGeneration, t = this.resolveUrl(this.data.primaryPath);
|
|
4751
4766
|
try {
|
|
4752
4767
|
let n = await this.resolveModule(t, this.data.primaryPath, "primary");
|
|
@@ -4754,14 +4769,14 @@ var zc = class extends Error {
|
|
|
4754
4769
|
return;
|
|
4755
4770
|
} catch (t) {
|
|
4756
4771
|
if (!this.isCurrentLoad(e)) throw t;
|
|
4757
|
-
if (!this.data.fallbackPath) throw new
|
|
4772
|
+
if (!this.data.fallbackPath) throw new Hc(this.data.primaryPath, void 0, t);
|
|
4758
4773
|
}
|
|
4759
4774
|
let n = this.resolveUrl(this.data.fallbackPath);
|
|
4760
4775
|
try {
|
|
4761
4776
|
let t = await this.resolveModule(n, this.data.fallbackPath, "fallback");
|
|
4762
4777
|
this.adoptResolvedModule(t, this.data.fallbackPath, e);
|
|
4763
4778
|
} catch (t) {
|
|
4764
|
-
throw this.isCurrentLoad(e) ? new
|
|
4779
|
+
throw this.isCurrentLoad(e) ? new Hc(this.data.primaryPath, this.data.fallbackPath, t) : t;
|
|
4765
4780
|
}
|
|
4766
4781
|
}
|
|
4767
4782
|
initialize(e) {
|
|
@@ -4832,15 +4847,15 @@ var zc = class extends Error {
|
|
|
4832
4847
|
if (r.length > 0) throw Error(`PCI module at '${t}' does not export a valid PciModule interface; missing: ${r.join(", ")}`);
|
|
4833
4848
|
return n;
|
|
4834
4849
|
}
|
|
4835
|
-
},
|
|
4850
|
+
}, Wc = class {
|
|
4836
4851
|
constructor(i) {
|
|
4837
|
-
this.responseProcessingProgram = null, this.templateProcessingProgram = null, this.outcomeProcessingProgram = null, this._catalogIndex = /* @__PURE__ */ new Map(), this._stimulusCatalogIndexes = /* @__PURE__ */ new Map(), this._pciHosts = /* @__PURE__ */ new Map(), this._pnpChangeListeners = /* @__PURE__ */ new Set(), this.lifecycleStatus = "initial", this.accumulatedDurationMs = 0, this.config = i, this.itemXml = i.itemXml ?? "", this.role = i.role ?? "candidate", this.sessionGuid =
|
|
4852
|
+
this.responseProcessingProgram = null, this.templateProcessingProgram = null, this.outcomeProcessingProgram = null, this._catalogIndex = /* @__PURE__ */ new Map(), this._stimulusCatalogIndexes = /* @__PURE__ */ new Map(), this._pciHosts = /* @__PURE__ */ new Map(), this._pnpChangeListeners = /* @__PURE__ */ new Set(), this.lifecycleStatus = "initial", this.accumulatedDurationMs = 0, this.config = i, this.itemXml = i.itemXml ?? "", this.role = i.role ?? "candidate", this.sessionGuid = Kc(), this.sessionStartedAt = Date.now(), this.rng = i.rng ?? (typeof i.seed == "number" ? Do(i.seed) : Math.random), i.elementNameMapper ? (this.mapper = i.elementNameMapper, i.attributeNameMapper || (i.attributeNameMapper = this.mapper.version === "3.0" ? new n() : new e())) : o(this.itemXml) === "3.0" ? (this.mapper = new r(), i.elementNameMapper = this.mapper, i.attributeNameMapper || (i.attributeNameMapper = new n())) : (this.mapper = new t(), i.elementNameMapper = this.mapper, i.attributeNameMapper || (i.attributeNameMapper = new e())), this.itemDocument = ec({
|
|
4838
4853
|
itemXml: this.itemXml,
|
|
4839
4854
|
elementNameMapper: this.mapper,
|
|
4840
4855
|
attributeNameMapper: i.attributeNameMapper,
|
|
4841
4856
|
security: this.config.security
|
|
4842
|
-
}), this.assessmentItem = this.itemDocument.getAssessmentItem(), this.decls = this.buildDeclarations(), this.ensureBuiltinDeclarations(this.decls), this.ctx = new s(this.decls), this.ops = new c(), i.sessionState && this.applySessionState(i.sessionState), this.extractionRegistry = i.extractionRegistry ??
|
|
4843
|
-
for (let e of
|
|
4857
|
+
}), this.assessmentItem = this.itemDocument.getAssessmentItem(), this.decls = this.buildDeclarations(), this.ensureBuiltinDeclarations(this.decls), this.ctx = new s(this.decls), this.ops = new c(), i.sessionState && this.applySessionState(i.sessionState), this.extractionRegistry = i.extractionRegistry ?? sc(this.mapper), this.componentRegistry = i.componentRegistry ?? Oc(), this.i18nProvider = i.i18nProvider ?? this.createDefaultI18nProvider();
|
|
4858
|
+
for (let e of Ks()) try {
|
|
4844
4859
|
this.extractionRegistry.register(e);
|
|
4845
4860
|
} catch {}
|
|
4846
4861
|
for (let e of i.plugins ?? []) try {
|
|
@@ -4861,19 +4876,19 @@ var zc = class extends Error {
|
|
|
4861
4876
|
h === "unknown" ? console.warn("[QTI Player] Could not detect QTI version. Assuming QTI 2.2 compatibility.") : h === "2.0" ? console.warn("[QTI Player] QTI 2.0 detected. Some features may not be fully supported. QTI 2.2 is recommended.") : h === "2.1" && console.info("[QTI Player] QTI 2.1 detected. Using QTI 2.2 compatibility mode with CC2 template support."), this._pnp = i.pnp;
|
|
4862
4877
|
let g = /* @__PURE__ */ new Map(), _ = /* @__PURE__ */ new Map();
|
|
4863
4878
|
for (let e of i.deliveryContext?.catalogSources ?? []) {
|
|
4864
|
-
let t =
|
|
4879
|
+
let t = Nc(e.xml);
|
|
4865
4880
|
if (e.scope === "stimulus" && e.stimulusIdentifier) {
|
|
4866
4881
|
let n = this._stimulusCatalogIndexes.get(e.stimulusIdentifier) ?? /* @__PURE__ */ new Map();
|
|
4867
|
-
this._stimulusCatalogIndexes.set(e.stimulusIdentifier,
|
|
4868
|
-
} else _ =
|
|
4882
|
+
this._stimulusCatalogIndexes.set(e.stimulusIdentifier, Fc(n, t));
|
|
4883
|
+
} else _ = Fc(_, t);
|
|
4869
4884
|
}
|
|
4870
|
-
i.catalogXml && (g =
|
|
4885
|
+
i.catalogXml && (g = Fc(g, Pc(i.catalogXml))), g = Fc(g, Pc(this.itemXml)), this._catalogIndex = Fc(g, _), this.config.strictQtiCompliance?.enabled && this.validateStrictCompliance();
|
|
4871
4886
|
}
|
|
4872
4887
|
applyPnp(e) {
|
|
4873
|
-
this._rootEl = e,
|
|
4888
|
+
this._rootEl = e, Mc(e, this._pnp);
|
|
4874
4889
|
}
|
|
4875
4890
|
updatePnp(e) {
|
|
4876
|
-
this._pnp =
|
|
4891
|
+
this._pnp = Gc(this._pnp, e), this._rootEl && Mc(this._rootEl, this._pnp);
|
|
4877
4892
|
for (let e of this._pnpChangeListeners) e(this._pnp);
|
|
4878
4893
|
}
|
|
4879
4894
|
getPnp() {
|
|
@@ -4886,14 +4901,14 @@ var zc = class extends Error {
|
|
|
4886
4901
|
return this.config.deliveryContext;
|
|
4887
4902
|
}
|
|
4888
4903
|
getCatalogEntry(e, t, n, r) {
|
|
4889
|
-
let i = (r?.stimulusIdentifier ?
|
|
4890
|
-
return i === null ? null :
|
|
4904
|
+
let i = (r?.stimulusIdentifier ? Bc(this._stimulusCatalogIndexes.get(r.stimulusIdentifier) ?? /* @__PURE__ */ new Map(), e, t, n) : null) ?? Bc(this._catalogIndex, e, t, n);
|
|
4905
|
+
return i === null ? null : qc(i) ? ls(i.trim(), this.config.security?.urlPolicy, "img") : this.sanitizeHtmlContent(i);
|
|
4891
4906
|
}
|
|
4892
4907
|
sanitizeHtmlContent(e) {
|
|
4893
|
-
return
|
|
4908
|
+
return js(e, { security: this.config.security });
|
|
4894
4909
|
}
|
|
4895
4910
|
createPciHost(e) {
|
|
4896
|
-
let t = new
|
|
4911
|
+
let t = new Uc(e, {
|
|
4897
4912
|
baseUrl: this.config.pci?.baseUrl ?? this.config.pciBaseUrl,
|
|
4898
4913
|
moduleResolver: this.config.pci?.moduleResolver
|
|
4899
4914
|
});
|
|
@@ -5100,7 +5115,7 @@ var zc = class extends Error {
|
|
|
5100
5115
|
if (e.scope && e.scope !== "all" && n !== e.scope) continue;
|
|
5101
5116
|
let a = (y(i, "view") || "").trim(), o = a ? a.split(/[\s,]+/).filter(Boolean) : [], s = (y(i, "use") || "").trim() || void 0;
|
|
5102
5117
|
if (o.length > 0 && t && !o.includes(t)) continue;
|
|
5103
|
-
let c = this.itemDocument.serializeChildren(i) || i.textContent || "", l =
|
|
5118
|
+
let c = this.itemDocument.serializeChildren(i) || i.textContent || "", l = xc(js(this.renderPrintedVariables(c), { security: this.config.security }), this.config.security?.trustedTypesPolicyName);
|
|
5104
5119
|
r.push({
|
|
5105
5120
|
view: o,
|
|
5106
5121
|
html: l,
|
|
@@ -5117,7 +5132,7 @@ var zc = class extends Error {
|
|
|
5117
5132
|
return this.extractionRegistry;
|
|
5118
5133
|
}
|
|
5119
5134
|
getInteractionData() {
|
|
5120
|
-
return
|
|
5135
|
+
return Cc({
|
|
5121
5136
|
document: this.itemDocument,
|
|
5122
5137
|
extractionRegistry: this.extractionRegistry,
|
|
5123
5138
|
declarations: this.decls,
|
|
@@ -5742,12 +5757,12 @@ var zc = class extends Error {
|
|
|
5742
5757
|
return r = r.replace(/<printedVariable\b([^>]*)\/>/gi, (e, r) => n(t(String(r)))), r;
|
|
5743
5758
|
}
|
|
5744
5759
|
renderHtmlContent(e) {
|
|
5745
|
-
return
|
|
5760
|
+
return xc(js(this.renderPrintedVariables(e), { security: this.config.security }), this.config.security?.trustedTypesPolicyName);
|
|
5746
5761
|
}
|
|
5747
5762
|
getModalFeedback(e) {
|
|
5748
5763
|
let t = this.itemDocument.findModalFeedbackElements(), n = [];
|
|
5749
5764
|
for (let r of t) {
|
|
5750
|
-
let t = this.getAttrMapped(r, "identifier") || "", i = this.getAttrMapped(r, "outcomeIdentifier") || "", a = this.getAttrMapped(r, "showHide") || "show", o = this.getAttrMapped(r, "title") || void 0, s =
|
|
5765
|
+
let t = this.getAttrMapped(r, "identifier") || "", i = this.getAttrMapped(r, "outcomeIdentifier") || "", a = this.getAttrMapped(r, "showHide") || "show", o = this.getAttrMapped(r, "title") || void 0, s = xc(js(this.itemDocument.serializeChildren(r) || r.textContent || "", { security: this.config.security }), this.config.security?.trustedTypesPolicyName), c = e[i];
|
|
5751
5766
|
(a === "show" ? c === t : c !== t) && s && n.push({
|
|
5752
5767
|
identifier: t,
|
|
5753
5768
|
outcomeIdentifier: i,
|
|
@@ -5759,7 +5774,7 @@ var zc = class extends Error {
|
|
|
5759
5774
|
return n;
|
|
5760
5775
|
}
|
|
5761
5776
|
};
|
|
5762
|
-
function
|
|
5777
|
+
function Gc(e, t) {
|
|
5763
5778
|
return {
|
|
5764
5779
|
display: {
|
|
5765
5780
|
...e?.display ?? {},
|
|
@@ -5775,7 +5790,7 @@ function Uc(e, t) {
|
|
|
5775
5790
|
}
|
|
5776
5791
|
};
|
|
5777
5792
|
}
|
|
5778
|
-
function
|
|
5793
|
+
function Kc() {
|
|
5779
5794
|
let e = typeof crypto < "u" ? crypto : void 0;
|
|
5780
5795
|
if (typeof e?.randomUUID == "function") return e.randomUUID();
|
|
5781
5796
|
if (typeof e?.getRandomValues == "function") {
|
|
@@ -5784,13 +5799,13 @@ function Wc() {
|
|
|
5784
5799
|
}
|
|
5785
5800
|
throw Error("No Web Crypto API available: cannot generate a session GUID. @pie-qti/item-player requires crypto.randomUUID or crypto.getRandomValues (present in all supported browsers and in Node >= 20).");
|
|
5786
5801
|
}
|
|
5787
|
-
function
|
|
5802
|
+
function qc(e) {
|
|
5788
5803
|
let t = e.trim();
|
|
5789
5804
|
return /^(https?:\/\/|\/\/|\/|\.{0,2}\/|data:|blob:)/i.test(t) || /\.(png|jpe?g|gif|webp|svg|mp3|wav|ogg|mp4|webm|pdf)(\?.*)?$/i.test(t);
|
|
5790
5805
|
}
|
|
5791
5806
|
//#endregion
|
|
5792
5807
|
//#region src/components/actions/typesetAction.ts
|
|
5793
|
-
function
|
|
5808
|
+
function Jc(e, t) {
|
|
5794
5809
|
if (!(typeof window < "u" && typeof MutationObserver < "u")) return {
|
|
5795
5810
|
update() {},
|
|
5796
5811
|
destroy() {}
|
|
@@ -5821,7 +5836,7 @@ function Kc(e, t) {
|
|
|
5821
5836
|
}
|
|
5822
5837
|
//#endregion
|
|
5823
5838
|
//#region src/catalog/applyGlossaryTriggers.ts
|
|
5824
|
-
var
|
|
5839
|
+
var Yc = [
|
|
5825
5840
|
{
|
|
5826
5841
|
usage: "tts-pronunciation",
|
|
5827
5842
|
flag: "ttsPronunciation",
|
|
@@ -5852,90 +5867,90 @@ var qc = [
|
|
|
5852
5867
|
label: "Request extended description",
|
|
5853
5868
|
text: "D"
|
|
5854
5869
|
}
|
|
5855
|
-
],
|
|
5870
|
+
], Xc = "illustrated-glossary", Zc = new Set([
|
|
5856
5871
|
"glossary-on-screen",
|
|
5857
5872
|
"keyword-translation",
|
|
5858
|
-
|
|
5859
|
-
]),
|
|
5860
|
-
function
|
|
5861
|
-
|
|
5873
|
+
Xc
|
|
5874
|
+
]), Qc = new Set(Yc.map((e) => e.flag)), $c = new Set(Yc.map((e) => e.usage)), el = /^[a-z][a-z0-9._-]*$/;
|
|
5875
|
+
function tl(e, t) {
|
|
5876
|
+
nl(e);
|
|
5862
5877
|
let n = t.getPnp();
|
|
5863
|
-
if (!n) return () =>
|
|
5864
|
-
let r = n.content?.glossaryOnScreen === !0, i = n.content?.keywordTranslation, a = i?.active === !0 && !!i.languageCode, o = n.content?.illustratedGlossary === !0, s = n.content?.catalogSupports ?? {}, c =
|
|
5865
|
-
if (!r && !a && !o && !l && c.length === 0) return () =>
|
|
5878
|
+
if (!n) return () => nl(e);
|
|
5879
|
+
let r = n.content?.glossaryOnScreen === !0, i = n.content?.keywordTranslation, a = i?.active === !0 && !!i.languageCode, o = n.content?.illustratedGlossary === !0, s = n.content?.catalogSupports ?? {}, c = ol(s), l = Yc.some((e) => cl(sl(s, e)));
|
|
5880
|
+
if (!r && !a && !o && !l && c.length === 0) return () => nl(e);
|
|
5866
5881
|
let u = e.querySelectorAll("[data-catalog-idref]");
|
|
5867
|
-
if (u.length === 0) return () =>
|
|
5882
|
+
if (u.length === 0) return () => nl(e);
|
|
5868
5883
|
let d = null;
|
|
5869
5884
|
for (let e of Array.from(u)) {
|
|
5870
5885
|
let n = e.getAttribute("data-catalog-idref");
|
|
5871
5886
|
if (!n) continue;
|
|
5872
|
-
let l =
|
|
5887
|
+
let l = al(e), u = document.createElement("span");
|
|
5873
5888
|
if (u.className = "qti-catalog-term", u.style.cssText = "position:relative;display:inline", e.parentNode?.insertBefore(u, e), u.appendChild(e), r) {
|
|
5874
|
-
let r =
|
|
5889
|
+
let r = rl(e.textContent ?? n, "glossary-on-screen", "Show definition");
|
|
5875
5890
|
u.appendChild(r), r.addEventListener("click", () => {
|
|
5876
5891
|
if (d) {
|
|
5877
5892
|
d(), d = null;
|
|
5878
5893
|
return;
|
|
5879
5894
|
}
|
|
5880
5895
|
let i = t.getCatalogEntry(n, "glossary-on-screen", void 0, { stimulusIdentifier: l });
|
|
5881
|
-
i !== null && (d =
|
|
5896
|
+
i !== null && (d = fl(u, e.textContent ?? n, i, r, t, () => {
|
|
5882
5897
|
d = null;
|
|
5883
5898
|
}));
|
|
5884
5899
|
});
|
|
5885
5900
|
}
|
|
5886
5901
|
if (a) {
|
|
5887
|
-
let r = i.languageCode, a =
|
|
5902
|
+
let r = i.languageCode, a = rl(e.textContent ?? n, "keyword-translation", "Show translation");
|
|
5888
5903
|
u.appendChild(a), a.addEventListener("click", () => {
|
|
5889
5904
|
if (d) {
|
|
5890
5905
|
d(), d = null;
|
|
5891
5906
|
return;
|
|
5892
5907
|
}
|
|
5893
5908
|
let i = t.getCatalogEntry(n, "keyword-translation", r, { stimulusIdentifier: l });
|
|
5894
|
-
i !== null && (d =
|
|
5909
|
+
i !== null && (d = fl(u, e.textContent ?? n, i, a, t, () => {
|
|
5895
5910
|
d = null;
|
|
5896
5911
|
}));
|
|
5897
5912
|
});
|
|
5898
5913
|
}
|
|
5899
5914
|
if (o) {
|
|
5900
|
-
let r =
|
|
5915
|
+
let r = rl(e.textContent ?? n, Xc, "Show illustrated glossary");
|
|
5901
5916
|
u.appendChild(r), r.addEventListener("click", () => {
|
|
5902
5917
|
if (d) {
|
|
5903
5918
|
d(), d = null;
|
|
5904
5919
|
return;
|
|
5905
5920
|
}
|
|
5906
|
-
let i = t.getCatalogEntry(n,
|
|
5907
|
-
i !== null && (d =
|
|
5921
|
+
let i = t.getCatalogEntry(n, Xc, void 0, { stimulusIdentifier: l });
|
|
5922
|
+
i !== null && (d = fl(u, e.textContent ?? n, i, r, t, () => {
|
|
5908
5923
|
d = null;
|
|
5909
5924
|
}));
|
|
5910
5925
|
});
|
|
5911
5926
|
}
|
|
5912
|
-
for (let r of
|
|
5913
|
-
let i =
|
|
5914
|
-
|
|
5927
|
+
for (let r of Yc) {
|
|
5928
|
+
let i = sl(s, r);
|
|
5929
|
+
cl(i) && il(u, e, n, {
|
|
5915
5930
|
...r,
|
|
5916
|
-
languageCode:
|
|
5931
|
+
languageCode: ll(i)
|
|
5917
5932
|
}, t, l);
|
|
5918
5933
|
}
|
|
5919
|
-
for (let r of c)
|
|
5934
|
+
for (let r of c) il(u, e, n, r, t, l);
|
|
5920
5935
|
}
|
|
5921
5936
|
return () => {
|
|
5922
|
-
d?.(),
|
|
5937
|
+
d?.(), nl(e);
|
|
5923
5938
|
};
|
|
5924
5939
|
}
|
|
5925
|
-
function
|
|
5940
|
+
function nl(e) {
|
|
5926
5941
|
for (let t of Array.from(e.querySelectorAll(".qti-catalog-term"))) {
|
|
5927
5942
|
let e = Array.from(t.children).find((e) => e.getAttribute?.("data-catalog-idref") !== null);
|
|
5928
5943
|
e && t.parentNode && t.parentNode.insertBefore(e, t), t.remove();
|
|
5929
5944
|
}
|
|
5930
5945
|
}
|
|
5931
|
-
function
|
|
5946
|
+
function rl(e, t, n, r) {
|
|
5932
5947
|
let i = document.createElement("button");
|
|
5933
|
-
return i.type = "button", i.className = "qti-catalog-trigger", i.style.cssText = "display:inline-flex;align-items:center;justify-content:center;min-width:1.75rem;min-height:1.75rem;margin-inline:0.25rem;line-height:1;", i.setAttribute("aria-label", `${n}: ${e}`), i.setAttribute("data-catalog-usage", t), i.textContent = r ?? (t === "keyword-translation" ? "T" : t ===
|
|
5948
|
+
return i.type = "button", i.className = "qti-catalog-trigger", i.style.cssText = "display:inline-flex;align-items:center;justify-content:center;min-width:1.75rem;min-height:1.75rem;margin-inline:0.25rem;line-height:1;", i.setAttribute("aria-label", `${n}: ${e}`), i.setAttribute("data-catalog-usage", t), i.textContent = r ?? (t === "keyword-translation" ? "T" : t === Xc ? "I" : "?"), i;
|
|
5934
5949
|
}
|
|
5935
|
-
function
|
|
5950
|
+
function il(e, t, n, r, i, a) {
|
|
5936
5951
|
let o = i.getCatalogEntry(n, r.usage, r.languageCode, { stimulusIdentifier: a });
|
|
5937
5952
|
if (o === null) return;
|
|
5938
|
-
let s =
|
|
5953
|
+
let s = rl(t.textContent ?? n, r.usage, r.label, r.text);
|
|
5939
5954
|
e.appendChild(s), s.addEventListener("click", () => {
|
|
5940
5955
|
s.dispatchEvent(new CustomEvent("qti-catalog-lookup", {
|
|
5941
5956
|
bubbles: !0,
|
|
@@ -5950,39 +5965,39 @@ function nl(e, t, n, r, i, a) {
|
|
|
5950
5965
|
}));
|
|
5951
5966
|
});
|
|
5952
5967
|
}
|
|
5953
|
-
function
|
|
5968
|
+
function al(e) {
|
|
5954
5969
|
return (e.closest?.("[data-stimulus-idref]"))?.getAttribute?.("data-stimulus-idref")?.trim() || void 0;
|
|
5955
5970
|
}
|
|
5956
|
-
function
|
|
5971
|
+
function ol(e) {
|
|
5957
5972
|
return Object.entries(e).map(([e, t]) => ({
|
|
5958
|
-
usage:
|
|
5973
|
+
usage: ul(e),
|
|
5959
5974
|
preference: t
|
|
5960
|
-
})).filter(({ usage: e, preference: t }) => e !== null &&
|
|
5975
|
+
})).filter(({ usage: e, preference: t }) => e !== null && cl(t) && !dl(e)).map(({ usage: e, preference: t }) => ({
|
|
5961
5976
|
usage: e,
|
|
5962
5977
|
label: `Request ${e.replace(/[-_]+/g, " ")}`,
|
|
5963
5978
|
text: e.slice(0, 1).toUpperCase(),
|
|
5964
|
-
languageCode:
|
|
5979
|
+
languageCode: ll(t)
|
|
5965
5980
|
}));
|
|
5966
5981
|
}
|
|
5967
|
-
function
|
|
5982
|
+
function sl(e, t) {
|
|
5968
5983
|
return e[t.flag] ?? e[t.usage];
|
|
5969
5984
|
}
|
|
5970
|
-
function
|
|
5985
|
+
function cl(e) {
|
|
5971
5986
|
return e === void 0 ? !1 : typeof e == "boolean" ? e : e.active !== !1;
|
|
5972
5987
|
}
|
|
5973
|
-
function
|
|
5988
|
+
function ll(e) {
|
|
5974
5989
|
if (!e || typeof e == "boolean") return;
|
|
5975
5990
|
let t = e.languageCode?.trim();
|
|
5976
5991
|
if (!(!t || !/^[a-zA-Z]{2,8}(?:-[a-zA-Z0-9]{1,8})*$/.test(t))) return t;
|
|
5977
5992
|
}
|
|
5978
|
-
function
|
|
5993
|
+
function ul(e) {
|
|
5979
5994
|
let t = e.trim().toLowerCase();
|
|
5980
|
-
return
|
|
5995
|
+
return el.test(t) ? t : null;
|
|
5981
5996
|
}
|
|
5982
|
-
function
|
|
5983
|
-
return
|
|
5997
|
+
function dl(e) {
|
|
5998
|
+
return Qc.has(e) || $c.has(e) || Zc.has(e);
|
|
5984
5999
|
}
|
|
5985
|
-
function
|
|
6000
|
+
function fl(e, t, n, r, i, a) {
|
|
5986
6001
|
let o = i.getComponentRegistry(), s, c = !1;
|
|
5987
6002
|
function l() {
|
|
5988
6003
|
c || (c = !0, s.remove(), r.focus(), a());
|
|
@@ -5991,10 +6006,10 @@ function ul(e, t, n, r, i, a) {
|
|
|
5991
6006
|
if (u !== null) {
|
|
5992
6007
|
let r = document.createElement(u);
|
|
5993
6008
|
r.content = n, r.label = t, r.onClose = l, e.appendChild(r), s = r;
|
|
5994
|
-
} else s =
|
|
6009
|
+
} else s = pl(t, n, l), e.appendChild(s);
|
|
5995
6010
|
return l;
|
|
5996
6011
|
}
|
|
5997
|
-
function
|
|
6012
|
+
function pl(e, t, n) {
|
|
5998
6013
|
let r = document.createElement("div");
|
|
5999
6014
|
r.className = "card card-bordered bg-base-100 shadow-lg qti-catalog-popup", r.setAttribute("role", "dialog"), r.setAttribute("aria-label", e), r.setAttribute("aria-modal", "true"), r.style.cssText = "position:absolute;z-index:1000;min-width:16rem;max-width:24rem";
|
|
6000
6015
|
let i = document.createElement("div");
|
|
@@ -6028,14 +6043,14 @@ function dl(e, t, n) {
|
|
|
6028
6043
|
}
|
|
6029
6044
|
//#endregion
|
|
6030
6045
|
//#region src/catalog/glossaryAction.ts
|
|
6031
|
-
function
|
|
6032
|
-
let n =
|
|
6033
|
-
n(), n =
|
|
6046
|
+
function ml(e, t) {
|
|
6047
|
+
let n = tl(e, t.player), r = t.player.onPnpChange?.(() => {
|
|
6048
|
+
n(), n = tl(e, t.player);
|
|
6034
6049
|
}) ?? (() => {});
|
|
6035
6050
|
return {
|
|
6036
6051
|
update(t) {
|
|
6037
|
-
n(), r(), n =
|
|
6038
|
-
n(), n =
|
|
6052
|
+
n(), r(), n = tl(e, t.player), r = t.player.onPnpChange?.(() => {
|
|
6053
|
+
n(), n = tl(e, t.player);
|
|
6039
6054
|
}) ?? (() => {});
|
|
6040
6055
|
},
|
|
6041
6056
|
destroy() {
|
|
@@ -6045,23 +6060,23 @@ function fl(e, t) {
|
|
|
6045
6060
|
}
|
|
6046
6061
|
//#endregion
|
|
6047
6062
|
//#region src/interactions/inline-choice/InlineChoice.svelte
|
|
6048
|
-
var
|
|
6063
|
+
var hl = /* @__PURE__ */ J("<option> </option>"), gl = /* @__PURE__ */ J("<span class=\"qti-inline-choice-correct-badge svelte-p2969z\"> </span>"), _l = /* @__PURE__ */ J("<span class=\"inline-choice-wrapper svelte-p2969z\"><select><option> </option><!></select> <!></span>"), vl = {
|
|
6049
6064
|
hash: "svelte-p2969z",
|
|
6050
6065
|
code: ".inline-choice-wrapper.svelte-p2969z {position:relative;display:inline-block;}.qti-inline-select.svelte-p2969z {display:inline-block;width:auto;min-width:120px;margin:0 4px;padding:0.25rem 1.75rem 0.25rem 0.5rem;border:1px solid var(--pie-qti-base-300, oklch(95% 0 0));border-radius:0.5rem;background:var(--pie-qti-base-100, oklch(100% 0 0));color:var(--pie-qti-base-content, oklch(21% 0 0));font:inherit;}.qti-inline-select.svelte-p2969z:focus-visible {outline:2px solid var(--pie-qti-focus, var(--pie-qti-primary, oklch(45% 0.24 277)));outline-offset:2px;}.qti-inline-select-correct.svelte-p2969z {border-color:var(--pie-qti-success, oklch(76% 0.177 163.223));background:color-mix(in oklch, var(--pie-qti-success, oklch(76% 0.177 163.223)) 10%, transparent);}.qti-inline-choice-correct-badge.svelte-p2969z {position:absolute;top:-1.5rem;left:0;display:inline-flex;align-items:center;white-space:nowrap;min-height:1.1rem;padding:0 0.5rem;border:1px solid var(--pie-qti-success, oklch(76% 0.177 163.223));border-radius:9999px;background:color-mix(in oklch, var(--pie-qti-success, oklch(76% 0.177 163.223)) 12%, transparent);color:var(--pie-qti-base-content, oklch(21% 0 0));font-size:0.7rem;font-weight:600;}"
|
|
6051
6066
|
};
|
|
6052
|
-
function
|
|
6053
|
-
Ot(t, !0), Ba(e,
|
|
6067
|
+
function yl(e, t) {
|
|
6068
|
+
Ot(t, !0), Ba(e, vl);
|
|
6054
6069
|
let n = Z(t, "response", 3, ""), r = Z(t, "correctAnswer", 3, null), i = Z(t, "disabled", 3, !1), a = Z(t, "onResponseChange", 3, () => {}), o = /* @__PURE__ */ F(() => r() === null ? n() : r()), s = /* @__PURE__ */ F(() => r() ? t.interaction.choices.find((e) => e.identifier === r()) : null);
|
|
6055
6070
|
function c(e) {
|
|
6056
6071
|
let n = e.currentTarget?.value ?? "";
|
|
6057
6072
|
a()(t.interaction.responseId, n);
|
|
6058
6073
|
}
|
|
6059
|
-
var l =
|
|
6074
|
+
var l = _l(), u = V(l);
|
|
6060
6075
|
let d;
|
|
6061
6076
|
var f = V(u), p = V(f, !0);
|
|
6062
6077
|
D(f), f.value = f.__value = "", Ma(qr(f), 17, () => t.interaction.choices, Oa, (e, t) => {
|
|
6063
6078
|
let n = /* @__PURE__ */ F(() => r() === q(t).identifier);
|
|
6064
|
-
var i =
|
|
6079
|
+
var i = hl(), a = V(i);
|
|
6065
6080
|
D(i);
|
|
6066
6081
|
var o = {};
|
|
6067
6082
|
H(() => {
|
|
@@ -6071,7 +6086,7 @@ function _l(e, t) {
|
|
|
6071
6086
|
var m;
|
|
6072
6087
|
eo(u);
|
|
6073
6088
|
var h = qr(u, 2), g = (e) => {
|
|
6074
|
-
var n =
|
|
6089
|
+
var n = gl(), r = V(n);
|
|
6075
6090
|
D(n), H((e) => pa(r, `${e ?? ""}: ${q(s).text ?? ""}`), [() => t.i18n?.t("interactions.choice.correct", "Correct") ?? "Correct"]), Y(e, n);
|
|
6076
6091
|
};
|
|
6077
6092
|
Da(h, (e) => {
|
|
@@ -6086,12 +6101,12 @@ function _l(e, t) {
|
|
|
6086
6101
|
aa(["change"]);
|
|
6087
6102
|
//#endregion
|
|
6088
6103
|
//#region src/interactions/text-entry/InlineTextEntry.svelte
|
|
6089
|
-
var
|
|
6104
|
+
var bl = /* @__PURE__ */ J("<span role=\"alert\" class=\"qti-text-entry-error svelte-v4bfxs\"> </span>"), xl = /* @__PURE__ */ J("<input type=\"text\"/> <!>", 1), Sl = {
|
|
6090
6105
|
hash: "svelte-v4bfxs",
|
|
6091
6106
|
code: ".qti-inline-input.svelte-v4bfxs {box-sizing:border-box;padding:0.25rem 0.5rem;border:1px solid var(--pie-qti-base-300, oklch(95% 0 0));border-radius:0.5rem;background:var(--pie-qti-base-100, oklch(100% 0 0));color:var(--pie-qti-base-content, oklch(21% 0 0));font:inherit;}.qti-inline-input.svelte-v4bfxs:focus-visible {outline:2px solid var(--pie-qti-focus, var(--pie-qti-primary, oklch(45% 0.24 277)));outline-offset:2px;}.qti-inline-input-correct.svelte-v4bfxs {border-color:var(--pie-qti-success, oklch(76% 0.177 163.223));background:color-mix(in oklch, var(--pie-qti-success, oklch(76% 0.177 163.223)) 10%, transparent);}.qti-text-entry-error.svelte-v4bfxs {display:block;color:var(--pie-qti-error, oklch(71% 0.194 13.428));font-size:0.75rem;}"
|
|
6092
6107
|
};
|
|
6093
|
-
function
|
|
6094
|
-
Ot(t, !0), Ba(e,
|
|
6108
|
+
function Cl(e, t) {
|
|
6109
|
+
Ot(t, !0), Ba(e, Sl);
|
|
6095
6110
|
let n = Z(t, "response", 3, ""), r = Z(t, "correctAnswer", 3, null), i = Z(t, "disabled", 3, !1), a = Z(t, "onResponseChange", 3, () => {}), o = /* @__PURE__ */ z(null), s = /* @__PURE__ */ F(() => r() === null ? n() : r()), c = /* @__PURE__ */ F(() => (t.interaction.interactionClasses ?? []).find((e) => e.startsWith("qti-input-width-"))), l = /* @__PURE__ */ F(() => (t.interaction.interactionClasses ?? []).filter((e) => !e.startsWith("qti-input-width-")).join(" ")), u = /* @__PURE__ */ F(() => `${t.interaction.responseId}-error`);
|
|
6096
6111
|
function d(e) {
|
|
6097
6112
|
let n = e.currentTarget, r = n?.value ?? "";
|
|
@@ -6103,10 +6118,10 @@ function xl(e, t) {
|
|
|
6103
6118
|
function p(e) {
|
|
6104
6119
|
e.currentTarget?.checkValidity();
|
|
6105
6120
|
}
|
|
6106
|
-
var m =
|
|
6121
|
+
var m = xl(), h = Kr(m);
|
|
6107
6122
|
oo(h);
|
|
6108
6123
|
var g = qr(h, 2), _ = (e) => {
|
|
6109
|
-
var t =
|
|
6124
|
+
var t = bl(), n = V(t, !0);
|
|
6110
6125
|
D(t), H(() => {
|
|
6111
6126
|
X(t, "id", q(u)), pa(n, q(o));
|
|
6112
6127
|
}), Y(e, t);
|
|
@@ -6125,14 +6140,14 @@ function xl(e, t) {
|
|
|
6125
6140
|
aa(["input"]);
|
|
6126
6141
|
//#endregion
|
|
6127
6142
|
//#region src/core/rolePolicy.ts
|
|
6128
|
-
var
|
|
6143
|
+
var wl = new Set([
|
|
6129
6144
|
"scorer",
|
|
6130
6145
|
"author",
|
|
6131
6146
|
"tutor",
|
|
6132
6147
|
"testConstructor"
|
|
6133
6148
|
]);
|
|
6134
|
-
function
|
|
6135
|
-
let t = e === "candidate", n =
|
|
6149
|
+
function Tl(e) {
|
|
6150
|
+
let t = e === "candidate", n = wl.has(e);
|
|
6136
6151
|
return {
|
|
6137
6152
|
isCandidate: t,
|
|
6138
6153
|
isReadOnly: !t,
|
|
@@ -6141,7 +6156,7 @@ function Cl(e) {
|
|
|
6141
6156
|
}
|
|
6142
6157
|
//#endregion
|
|
6143
6158
|
//#region src/components/utils/feedbackUtils.ts
|
|
6144
|
-
var
|
|
6159
|
+
var El = [
|
|
6145
6160
|
{
|
|
6146
6161
|
pattern: /<strong>Incorrect;<\/strong>/gi,
|
|
6147
6162
|
replacement: "<strong>Incorrect</strong> "
|
|
@@ -6159,114 +6174,247 @@ var wl = [
|
|
|
6159
6174
|
replacement: "Correct "
|
|
6160
6175
|
}
|
|
6161
6176
|
];
|
|
6162
|
-
function
|
|
6177
|
+
function Dl(e, t = El) {
|
|
6163
6178
|
if (!e) return e;
|
|
6164
6179
|
let n = e;
|
|
6165
6180
|
for (let e of t) n = n.replace(e.pattern, e.replacement);
|
|
6166
6181
|
return n;
|
|
6167
6182
|
}
|
|
6168
|
-
function
|
|
6183
|
+
function Ol(e, t) {
|
|
6169
6184
|
let { outcomeValues: n, applyHeuristics: r = !1, wrapWithSpan: i = !1, transforms: a } = t;
|
|
6170
6185
|
return e && e.replace(/<feedbackInline\b([^>]*)>([\s\S]*?)<\/feedbackInline>/gi, (e, t, o) => {
|
|
6171
|
-
let s =
|
|
6186
|
+
let s = kl(t, "outcomeIdentifier"), c = kl(t, "identifier"), l = kl(t, "showHide") ?? "show", u = s ? n[s] : void 0;
|
|
6172
6187
|
if (s === null || c === null || u == null || u === "") return "";
|
|
6173
6188
|
let d = Array.isArray(u) ? u.includes(c) : u === c;
|
|
6174
|
-
return (l.toLowerCase() === "show" ? d : !d) ? (r && (o =
|
|
6189
|
+
return (l.toLowerCase() === "show" ? d : !d) ? (r && (o = Dl(o, a)), i ? ` <span class="qti-feedback-inline">${o}</span>` : o) : "";
|
|
6175
6190
|
});
|
|
6176
6191
|
}
|
|
6177
|
-
function
|
|
6192
|
+
function kl(e, t) {
|
|
6178
6193
|
return (RegExp(`\\b${t}\\s*=\\s*"([^"]*)"`, "i").exec(e) ?? RegExp(`\\b${t}\\s*=\\s*'([^']*)'`, "i").exec(e))?.[1] ?? null;
|
|
6179
6194
|
}
|
|
6180
6195
|
//#endregion
|
|
6181
6196
|
//#region src/components/utils/stylesheetRender.ts
|
|
6182
|
-
function
|
|
6183
|
-
return e ? e.stylesheets.map((e) =>
|
|
6197
|
+
function Al(e, t = "[data-qti-item-body-scope]") {
|
|
6198
|
+
return e ? e.stylesheets.map((e) => jl(e, t)).filter(Boolean).join("\n") : "";
|
|
6184
6199
|
}
|
|
6185
|
-
function
|
|
6200
|
+
function jl(e, t) {
|
|
6186
6201
|
let n = e.cssText?.trim();
|
|
6187
|
-
return !n || oe(n) ? "" :
|
|
6202
|
+
return !n || oe(n) ? "" : Fl(n, Rl(e, t)) || "";
|
|
6203
|
+
}
|
|
6204
|
+
var Ml = new Set([
|
|
6205
|
+
"media",
|
|
6206
|
+
"supports",
|
|
6207
|
+
"container",
|
|
6208
|
+
"layer",
|
|
6209
|
+
"scope"
|
|
6210
|
+
]), Nl = /^(?::root|html|body)(?![\w-])/, Pl = /^@(?:-[a-z]+-)?([\w-]+)/i;
|
|
6211
|
+
function Fl(e, t = "[data-qti-item-body-scope]") {
|
|
6212
|
+
if (!e) return "";
|
|
6213
|
+
let n = t?.trim();
|
|
6214
|
+
return n ? Il(Ul(e), n).trim() : e;
|
|
6188
6215
|
}
|
|
6189
|
-
function
|
|
6190
|
-
let n =
|
|
6191
|
-
for (
|
|
6192
|
-
let
|
|
6193
|
-
if (
|
|
6194
|
-
|
|
6195
|
-
a.length !== 0 && (r += `${a.join(", ")} { ${i} }\n`);
|
|
6216
|
+
function Il(e, t) {
|
|
6217
|
+
let n = "", r = 0;
|
|
6218
|
+
for (; r < e.length;) {
|
|
6219
|
+
let i = Bl(e, r);
|
|
6220
|
+
if (i.end <= r) break;
|
|
6221
|
+
n += Ll(i, t), r = i.end;
|
|
6196
6222
|
}
|
|
6197
|
-
return
|
|
6223
|
+
return n;
|
|
6198
6224
|
}
|
|
6199
|
-
function
|
|
6200
|
-
|
|
6225
|
+
function Ll(e, t) {
|
|
6226
|
+
if (e.kind === "statement") {
|
|
6227
|
+
let t = e.text.trim();
|
|
6228
|
+
return t === ";" ? "" : `${t}\n`;
|
|
6229
|
+
}
|
|
6230
|
+
if (e.kind === "trailing") return e.text.trim() ? `${e.text.trim()}\n` : "";
|
|
6231
|
+
let n = e.prelude.trim();
|
|
6232
|
+
if (!n) return "";
|
|
6233
|
+
if (n.startsWith("@")) {
|
|
6234
|
+
let r = Pl.exec(n)?.[1]?.toLowerCase();
|
|
6235
|
+
if (r && Ml.has(r)) {
|
|
6236
|
+
let r = Il(e.block, t);
|
|
6237
|
+
return r.trim() ? `${n} {\n${r}}\n` : "";
|
|
6238
|
+
}
|
|
6239
|
+
return `${n} {${e.block}}\n`;
|
|
6240
|
+
}
|
|
6241
|
+
let r = e.block.trim();
|
|
6242
|
+
if (!r) return "";
|
|
6243
|
+
let i = Hl(n, ",").map((e) => zl(e.trim(), t)).filter(Boolean);
|
|
6244
|
+
return i.length === 0 ? "" : `${i.join(", ")} { ${r} }\n`;
|
|
6245
|
+
}
|
|
6246
|
+
function Rl(e, t) {
|
|
6247
|
+
return e.source !== "stimulus" || !e.stimulusIdentifier ? t : `${t} [data-stimulus-idref="${Wl(e.stimulusIdentifier)}"]`;
|
|
6248
|
+
}
|
|
6249
|
+
function zl(e, t) {
|
|
6250
|
+
if (!e) return "";
|
|
6251
|
+
if (e === t || e.startsWith(`${t} `)) return e;
|
|
6252
|
+
let n = Nl.exec(e);
|
|
6253
|
+
return n ? `${t}${e.slice(n[0].length)}` : `${t} ${e}`;
|
|
6254
|
+
}
|
|
6255
|
+
function Bl(e, t) {
|
|
6256
|
+
let n = t, r = null, i = 0;
|
|
6257
|
+
for (; n < e.length;) {
|
|
6258
|
+
let a = e[n];
|
|
6259
|
+
if (r) a === "\\" ? n += 1 : a === r && (r = null);
|
|
6260
|
+
else if (a === "\"" || a === "'") r = a;
|
|
6261
|
+
else if (a === "(") i += 1;
|
|
6262
|
+
else if (a === ")") i > 0 && --i;
|
|
6263
|
+
else if (i === 0 && a === ";") return {
|
|
6264
|
+
kind: "statement",
|
|
6265
|
+
text: e.slice(t, n + 1),
|
|
6266
|
+
end: n + 1
|
|
6267
|
+
};
|
|
6268
|
+
else if (i === 0 && a === "{") {
|
|
6269
|
+
let r = Vl(e, n);
|
|
6270
|
+
return {
|
|
6271
|
+
kind: "rule",
|
|
6272
|
+
prelude: e.slice(t, n),
|
|
6273
|
+
block: e.slice(n + 1, r.contentEnd),
|
|
6274
|
+
end: r.end
|
|
6275
|
+
};
|
|
6276
|
+
}
|
|
6277
|
+
n += 1;
|
|
6278
|
+
}
|
|
6279
|
+
return {
|
|
6280
|
+
kind: "trailing",
|
|
6281
|
+
text: e.slice(t),
|
|
6282
|
+
end: e.length
|
|
6283
|
+
};
|
|
6284
|
+
}
|
|
6285
|
+
function Vl(e, t) {
|
|
6286
|
+
let n = 0, r = null;
|
|
6287
|
+
for (let i = t; i < e.length; i += 1) {
|
|
6288
|
+
let t = e[i];
|
|
6289
|
+
if (r) {
|
|
6290
|
+
t === "\\" ? i += 1 : t === r && (r = null);
|
|
6291
|
+
continue;
|
|
6292
|
+
}
|
|
6293
|
+
if (t === "\"" || t === "'") {
|
|
6294
|
+
r = t;
|
|
6295
|
+
continue;
|
|
6296
|
+
}
|
|
6297
|
+
if (t === "{") n += 1;
|
|
6298
|
+
else if (t === "}" && (--n, n === 0)) return {
|
|
6299
|
+
contentEnd: i,
|
|
6300
|
+
end: i + 1
|
|
6301
|
+
};
|
|
6302
|
+
}
|
|
6303
|
+
return {
|
|
6304
|
+
contentEnd: e.length,
|
|
6305
|
+
end: e.length
|
|
6306
|
+
};
|
|
6201
6307
|
}
|
|
6202
|
-
function
|
|
6203
|
-
|
|
6308
|
+
function Hl(e, t) {
|
|
6309
|
+
let n = [], r = "", i = null, a = 0;
|
|
6310
|
+
for (let o = 0; o < e.length; o += 1) {
|
|
6311
|
+
let s = e[o];
|
|
6312
|
+
if (i) {
|
|
6313
|
+
r += s, s === "\\" && o + 1 < e.length ? (r += e[o + 1], o += 1) : s === i && (i = null);
|
|
6314
|
+
continue;
|
|
6315
|
+
}
|
|
6316
|
+
if (s === "\"" || s === "'") {
|
|
6317
|
+
i = s, r += s;
|
|
6318
|
+
continue;
|
|
6319
|
+
}
|
|
6320
|
+
if (s === "(" ? a += 1 : s === ")" && a > 0 && --a, s === t && a === 0) {
|
|
6321
|
+
n.push(r), r = "";
|
|
6322
|
+
continue;
|
|
6323
|
+
}
|
|
6324
|
+
r += s;
|
|
6325
|
+
}
|
|
6326
|
+
return n.push(r), n;
|
|
6327
|
+
}
|
|
6328
|
+
function Ul(e) {
|
|
6329
|
+
let t = "", n = null, r = 0;
|
|
6330
|
+
for (; r < e.length;) {
|
|
6331
|
+
let i = e[r];
|
|
6332
|
+
if (n) {
|
|
6333
|
+
if (t += i, i === "\\" && r + 1 < e.length) {
|
|
6334
|
+
t += e[r + 1], r += 2;
|
|
6335
|
+
continue;
|
|
6336
|
+
}
|
|
6337
|
+
i === n && (n = null), r += 1;
|
|
6338
|
+
continue;
|
|
6339
|
+
}
|
|
6340
|
+
if (i === "\"" || i === "'") {
|
|
6341
|
+
n = i, t += i, r += 1;
|
|
6342
|
+
continue;
|
|
6343
|
+
}
|
|
6344
|
+
if (i === "/" && e[r + 1] === "*") {
|
|
6345
|
+
let n = e.indexOf("*/", r + 2);
|
|
6346
|
+
r = n === -1 ? e.length : n + 2, t += " ";
|
|
6347
|
+
continue;
|
|
6348
|
+
}
|
|
6349
|
+
t += i, r += 1;
|
|
6350
|
+
}
|
|
6351
|
+
return t;
|
|
6204
6352
|
}
|
|
6205
|
-
function
|
|
6353
|
+
function Wl(e) {
|
|
6206
6354
|
return e.replace(/\\/g, "\\\\").replace(/"/g, "\\\"").replace(/\n|\r|\f/g, " ");
|
|
6207
6355
|
}
|
|
6208
6356
|
//#endregion
|
|
6209
6357
|
//#region src/components/utils/stimulusRender.ts
|
|
6210
|
-
function
|
|
6358
|
+
function Gl(e, t, n) {
|
|
6211
6359
|
let r = Object.fromEntries(Object.entries(e?.stimuli ?? {}).map(([e, t]) => [e, n(t.bodyHtml)])), i = Object.fromEntries(Object.entries(t).map(([e, t]) => [e, n(t)]));
|
|
6212
6360
|
return {
|
|
6213
6361
|
...r,
|
|
6214
6362
|
...i
|
|
6215
6363
|
};
|
|
6216
6364
|
}
|
|
6217
|
-
function
|
|
6365
|
+
function Kl(e, t) {
|
|
6218
6366
|
if (Object.keys(t).length === 0) return e;
|
|
6219
6367
|
let n = /* @__PURE__ */ new Set(), r = e.replace(/<([a-z][\w:-]*)([^>]*\bdata-stimulus-idref=(["'])([^"']+)\3[^>]*)>\s*<\/\1>/gi, (e, r, i, a, o) => {
|
|
6220
6368
|
let s = t[o];
|
|
6221
|
-
return s ? (n.add(o), `<${r}${
|
|
6369
|
+
return s ? (n.add(o), `<${r}${Jl(i, "qti-stimulus-dock")}>${s}</${r}>`) : e;
|
|
6222
6370
|
});
|
|
6223
6371
|
r = r.replace(/<qti-assessment-stimulus-ref\b([^>]*)\/?>\s*(?:<\/qti-assessment-stimulus-ref>)?/gi, (e, r) => {
|
|
6224
|
-
let i =
|
|
6372
|
+
let i = ql(r, "identifier");
|
|
6225
6373
|
if (!i) return e;
|
|
6226
6374
|
if (n.has(i)) return "";
|
|
6227
6375
|
let a = t[i];
|
|
6228
|
-
return a ? (n.add(i), `<div data-stimulus-idref="${
|
|
6376
|
+
return a ? (n.add(i), `<div data-stimulus-idref="${Yl(i)}" class="qti-stimulus-dock">${a}</div>`) : e;
|
|
6229
6377
|
});
|
|
6230
|
-
let i = Object.entries(t).filter(([e]) => !n.has(e)).map(([e, t]) => `<div data-stimulus-idref="${
|
|
6378
|
+
let i = Object.entries(t).filter(([e]) => !n.has(e)).map(([e, t]) => `<div data-stimulus-idref="${Yl(e)}" class="qti-stimulus-block">${t}</div>`).join("");
|
|
6231
6379
|
return i ? i + r : r;
|
|
6232
6380
|
}
|
|
6233
|
-
function
|
|
6381
|
+
function ql(e, t) {
|
|
6234
6382
|
return e.match(RegExp(`\\b${t}\\s*=\\s*["']([^"']+)["']`, "i"))?.[1] ?? null;
|
|
6235
6383
|
}
|
|
6236
|
-
function
|
|
6384
|
+
function Jl(e, t) {
|
|
6237
6385
|
let n = e.match(/\bclass\s*=\s*(["'])([^"']*)\1/i);
|
|
6238
6386
|
if (!n) return `${e} class="${t}"`;
|
|
6239
6387
|
let r = n[1], i = n[2] ?? "", a = new Set(i.split(/\s+/).filter(Boolean));
|
|
6240
6388
|
return a.add(t), e.replace(n[0], `class=${r}${Array.from(a).join(" ")}${r}`);
|
|
6241
6389
|
}
|
|
6242
|
-
function
|
|
6390
|
+
function Yl(e) {
|
|
6243
6391
|
return e.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
|
6244
6392
|
}
|
|
6245
6393
|
//#endregion
|
|
6246
6394
|
//#region src/interactions/inline/render-plan.ts
|
|
6247
|
-
function
|
|
6248
|
-
return
|
|
6395
|
+
function Xl(e) {
|
|
6396
|
+
return Xs(e);
|
|
6249
6397
|
}
|
|
6250
|
-
function
|
|
6251
|
-
return
|
|
6398
|
+
function Zl(e) {
|
|
6399
|
+
return Zs(e);
|
|
6252
6400
|
}
|
|
6253
|
-
function
|
|
6254
|
-
return e.replace(/<textEntryInteraction[^>]*responseIdentifier="([^"]+)"[^>]*?(?:\/>|><\/textEntryInteraction>)/gi, (e, n) =>
|
|
6401
|
+
function Ql(e, t) {
|
|
6402
|
+
return e.replace(/<textEntryInteraction[^>]*responseIdentifier="([^"]+)"[^>]*?(?:\/>|><\/textEntryInteraction>)/gi, (e, n) => tu(t, n, "textEntryInteraction") ? eu("textEntry", n) : e).replace(/<qti-text-entry-interaction[^>]*response-identifier="([^"]+)"[^>]*?(?:\/>|><\/qti-text-entry-interaction>)/gi, (e, n) => tu(t, n, "textEntryInteraction") ? eu("textEntry", n) : e).replace(/<inlineChoiceInteraction[^>]*responseIdentifier="([^"]+)"[^>]*>[\s\S]*?<\/inlineChoiceInteraction>/gi, (e, n) => tu(t, n, "inlineChoiceInteraction") ? eu("inlineChoice", n) : e).replace(/<qti-inline-choice-interaction[^>]*response-identifier="([^"]+)"[^>]*>[\s\S]*?<\/qti-inline-choice-interaction>/gi, (e, n) => tu(t, n, "inlineChoiceInteraction") ? eu("inlineChoice", n) : e);
|
|
6255
6403
|
}
|
|
6256
|
-
function
|
|
6257
|
-
let n =
|
|
6404
|
+
function $l(e, t) {
|
|
6405
|
+
let n = Ql(e, t), r = [], i = /\[TEXTENTRY:([^\]]+)\]|\[INLINECHOICE:([^\]]+)\]/g, a = 0, o;
|
|
6258
6406
|
for (; (o = i.exec(n)) !== null;) {
|
|
6259
6407
|
if (o.index > a && r.push({
|
|
6260
6408
|
type: "html",
|
|
6261
6409
|
content: n.substring(a, o.index)
|
|
6262
6410
|
}), o[0].startsWith("[TEXTENTRY:")) {
|
|
6263
|
-
let e =
|
|
6411
|
+
let e = nu(t, o[1], "textEntryInteraction");
|
|
6264
6412
|
e && r.push({
|
|
6265
6413
|
type: "textEntry",
|
|
6266
6414
|
interaction: e
|
|
6267
6415
|
});
|
|
6268
6416
|
} else {
|
|
6269
|
-
let e =
|
|
6417
|
+
let e = nu(t, o[2], "inlineChoiceInteraction");
|
|
6270
6418
|
e && r.push({
|
|
6271
6419
|
type: "inlineChoice",
|
|
6272
6420
|
interaction: e
|
|
@@ -6282,19 +6430,19 @@ function Hl(e, t) {
|
|
|
6282
6430
|
content: n
|
|
6283
6431
|
}];
|
|
6284
6432
|
}
|
|
6285
|
-
function
|
|
6433
|
+
function eu(e, t) {
|
|
6286
6434
|
return e === "textEntry" ? `[TEXTENTRY:${t}]` : `[INLINECHOICE:${t}]`;
|
|
6287
6435
|
}
|
|
6288
|
-
function
|
|
6289
|
-
return !!
|
|
6436
|
+
function tu(e, t, n) {
|
|
6437
|
+
return !!nu(e, t, n);
|
|
6290
6438
|
}
|
|
6291
|
-
function
|
|
6439
|
+
function nu(e, t, n) {
|
|
6292
6440
|
return e.find((e) => e.responseId === t && e.type === n) ?? null;
|
|
6293
6441
|
}
|
|
6294
6442
|
//#endregion
|
|
6295
6443
|
//#region src/presentation/itemPresentationPlan.ts
|
|
6296
|
-
function
|
|
6297
|
-
let d = e.getInteractionData(), f =
|
|
6444
|
+
function ru({ player: e, responses: t = {}, disabled: n = !1, role: r = "candidate", outcomeValues: i = {}, heuristicsConfig: a, stimulusContent: o = {}, deliveryContext: s, itemBodyScopeSelector: c = "[data-qti-item-body-scope]", renderItemBodyRubrics: l = !0, onComponentError: u }) {
|
|
6445
|
+
let d = e.getInteractionData(), f = Tl(r), p = n || f.isReadOnly, m = f.canViewCorrectResponses ? e.getCorrectResponses() : {}, h = iu({
|
|
6298
6446
|
player: e,
|
|
6299
6447
|
role: r,
|
|
6300
6448
|
outcomeValues: i,
|
|
@@ -6309,8 +6457,8 @@ function Kl({ player: e, responses: t = {}, disabled: n = !1, role: r = "candida
|
|
|
6309
6457
|
effectiveDisabled: p,
|
|
6310
6458
|
correctResponses: m,
|
|
6311
6459
|
itemBodyHtml: h,
|
|
6312
|
-
inlineSegments:
|
|
6313
|
-
blockInteractions:
|
|
6460
|
+
inlineSegments: $l(h, d),
|
|
6461
|
+
blockInteractions: mu({
|
|
6314
6462
|
interactions: d,
|
|
6315
6463
|
player: e,
|
|
6316
6464
|
responses: t,
|
|
@@ -6321,75 +6469,75 @@ function Kl({ player: e, responses: t = {}, disabled: n = !1, role: r = "candida
|
|
|
6321
6469
|
})
|
|
6322
6470
|
};
|
|
6323
6471
|
}
|
|
6324
|
-
function
|
|
6325
|
-
let c = String(e.getItemBodyHtml()), l = a ?? e.getDeliveryContext(), u =
|
|
6326
|
-
c =
|
|
6472
|
+
function iu({ player: e, role: t, outcomeValues: n, heuristicsConfig: r, stimulusContent: i, deliveryContext: a, itemBodyScopeSelector: o, renderItemBodyRubrics: s }) {
|
|
6473
|
+
let c = String(e.getItemBodyHtml()), l = a ?? e.getDeliveryContext(), u = Al(l, o), d = Gl(l, i, (t) => e.sanitizeHtmlContent(t));
|
|
6474
|
+
c = Kl(c, d), u && (c = `<style data-qti-stylesheets="resolved">${u}</style>${c}`), c = au(c, t, { renderRubrics: s });
|
|
6327
6475
|
let f = ce(r);
|
|
6328
|
-
return c =
|
|
6476
|
+
return c = Ol(c, {
|
|
6329
6477
|
outcomeValues: n,
|
|
6330
6478
|
applyHeuristics: f.feedbackTextFormatting,
|
|
6331
6479
|
wrapWithSpan: !1
|
|
6332
|
-
}),
|
|
6480
|
+
}), pu(c);
|
|
6333
6481
|
}
|
|
6334
|
-
function
|
|
6482
|
+
function au(e, t, { renderRubrics: n }) {
|
|
6335
6483
|
if (!e || !/rubric-?block/i.test(e)) return e;
|
|
6336
6484
|
try {
|
|
6337
6485
|
let r = ie(e, {
|
|
6338
6486
|
lowerCaseTagName: !1,
|
|
6339
6487
|
comment: !1
|
|
6340
6488
|
});
|
|
6341
|
-
return
|
|
6489
|
+
return ou(r, t, { renderRubrics: n }), r.toString();
|
|
6342
6490
|
} catch {
|
|
6343
6491
|
return e;
|
|
6344
6492
|
}
|
|
6345
6493
|
}
|
|
6346
|
-
function
|
|
6494
|
+
function ou(e, t, { renderRubrics: n }) {
|
|
6347
6495
|
let r = [...e.childNodes];
|
|
6348
6496
|
for (let e of r) {
|
|
6349
6497
|
let r = e.rawTagName?.toLowerCase();
|
|
6350
|
-
if (r &&
|
|
6498
|
+
if (r && su(r) && (!n || !cu(e, t))) {
|
|
6351
6499
|
e.remove();
|
|
6352
6500
|
continue;
|
|
6353
6501
|
}
|
|
6354
|
-
e.childNodes?.length &&
|
|
6502
|
+
e.childNodes?.length && ou(e, t, { renderRubrics: n }), r && su(r) && e.replaceWith(lu(e));
|
|
6355
6503
|
}
|
|
6356
6504
|
}
|
|
6357
|
-
function
|
|
6505
|
+
function su(e) {
|
|
6358
6506
|
return e === "rubricblock" || e === "qti-rubric-block";
|
|
6359
6507
|
}
|
|
6360
|
-
function
|
|
6508
|
+
function cu(e, t) {
|
|
6361
6509
|
let n = e.getAttribute("view")?.trim();
|
|
6362
|
-
return n ?
|
|
6510
|
+
return n ? uu(n).includes(t) : !0;
|
|
6363
6511
|
}
|
|
6364
|
-
function
|
|
6512
|
+
function lu(e) {
|
|
6365
6513
|
let t = e.getAttribute("view")?.trim(), n = e.getAttribute("use")?.trim();
|
|
6366
6514
|
return `<div ${[
|
|
6367
6515
|
"class=\"qti-rubric-block\"",
|
|
6368
|
-
t ? `data-qti-rubric-view="${
|
|
6369
|
-
n ? `data-qti-rubric-use="${
|
|
6370
|
-
].filter(Boolean).join(" ")}>${
|
|
6516
|
+
t ? `data-qti-rubric-view="${fu(t)}"` : "",
|
|
6517
|
+
n ? `data-qti-rubric-use="${fu(n)}"` : ""
|
|
6518
|
+
].filter(Boolean).join(" ")}>${du(e)}</div>`;
|
|
6371
6519
|
}
|
|
6372
|
-
function
|
|
6520
|
+
function uu(e) {
|
|
6373
6521
|
return e.split(/[\s,]+/).filter(Boolean);
|
|
6374
6522
|
}
|
|
6375
|
-
function
|
|
6523
|
+
function du(e) {
|
|
6376
6524
|
return [...e.childNodes].map((e) => e.toString()).join("");
|
|
6377
6525
|
}
|
|
6378
|
-
function
|
|
6526
|
+
function fu(e) {
|
|
6379
6527
|
return e.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
|
6380
6528
|
}
|
|
6381
|
-
function
|
|
6382
|
-
return e.replace(/<(\w+Interaction|qti-[\w-]+-interaction)(\s[^>]*)?>[\s\S]*?<\/\1>/gi, (e, t) =>
|
|
6529
|
+
function pu(e) {
|
|
6530
|
+
return e.replace(/<(\w+Interaction|qti-[\w-]+-interaction)(\s[^>]*)?>[\s\S]*?<\/\1>/gi, (e, t) => Zl(t.toLowerCase()) ? e : `<span class="qti-hidden-interaction">${e}</span>`);
|
|
6383
6531
|
}
|
|
6384
|
-
function
|
|
6532
|
+
function mu({ interactions: e, player: t, responses: n, correctResponses: r, roleCapabilities: i, effectiveDisabled: a, onComponentError: o }) {
|
|
6385
6533
|
let s = t.getComponentRegistry();
|
|
6386
|
-
return e.filter((e) => !
|
|
6534
|
+
return e.filter((e) => !Xl(e.type)).map((e) => {
|
|
6387
6535
|
try {
|
|
6388
6536
|
let o = "stringIdentifier" in e && typeof e.stringIdentifier == "string" ? e.stringIdentifier : void 0;
|
|
6389
6537
|
return {
|
|
6390
6538
|
interaction: e,
|
|
6391
6539
|
tagName: s.getTagName(e),
|
|
6392
|
-
key:
|
|
6540
|
+
key: hu(e),
|
|
6393
6541
|
response: n[e.responseId] ?? null,
|
|
6394
6542
|
...o ? { stringResponse: n[o] ?? null } : {},
|
|
6395
6543
|
correctResponse: i.canViewCorrectResponses ? r[e.responseId] ?? null : null,
|
|
@@ -6403,19 +6551,19 @@ function ru({ interactions: e, player: t, responses: n, correctResponses: r, rol
|
|
|
6403
6551
|
}
|
|
6404
6552
|
}).filter((e) => e !== null);
|
|
6405
6553
|
}
|
|
6406
|
-
function
|
|
6554
|
+
function hu(e) {
|
|
6407
6555
|
let t = e, n = Array.isArray(t?.choices) && t.choices.length > 0 ? t.choices.map((e) => e?.identifier).filter(Boolean).join(",") : "", r = typeof t?.prompt == "string" ? t.prompt : "";
|
|
6408
6556
|
return `${e.type}|${e.responseId}|${n}|${r}`;
|
|
6409
6557
|
}
|
|
6410
6558
|
//#endregion
|
|
6411
6559
|
//#region src/components/ItemBody.svelte
|
|
6412
|
-
var
|
|
6560
|
+
var gu = 0, _u = /* @__PURE__ */ J("<div class=\"qti-item-body svelte-11qbngh\"><div class=\"qti-item-body-content svelte-11qbngh\"><div class=\"inline-interaction-container svelte-11qbngh\"></div></div> <!></div>"), vu = {
|
|
6413
6561
|
hash: "svelte-11qbngh",
|
|
6414
6562
|
code: "\n /* Allow the whole item body to shrink inside flex/grid layouts (prevents overflow). */.qti-item-body.svelte-11qbngh {max-width:100%;min-width:0;}.qti-item-body-content.svelte-11qbngh {max-width:none;margin-bottom:1rem;}\n\n /*\n * Custom elements default to inline; force them to be block-level and width-contained.\n * This prevents wide interactions (SVGs, tables, canvases) from spilling outside panels.\n */.qti-item-body :is(\n pie-qti-choice,\n pie-qti-slider,\n pie-qti-order,\n pie-qti-match,\n pie-qti-associate,\n pie-qti-gap-match,\n pie-qti-hotspot,\n pie-qti-hottext,\n pie-qti-media,\n pie-qti-custom,\n pie-qti-portable-custom,\n pie-qti-end-attempt,\n pie-qti-position-object,\n pie-qti-graphic-gap-match,\n pie-qti-graphic-order,\n pie-qti-graphic-associate,\n pie-qti-select-point,\n pie-qti-extended-text\n ) {display:block;max-width:100%;min-width:0;}\n\n /* Keep inline interactions from breaking paragraph flow */.inline-interaction-container.svelte-11qbngh p {display:inline;}\n\n /*\n * Hide all QTI interaction elements wrapped with qti-hidden-interaction.\n * These are rendered separately as web components above.\n * Keeping them in the HTML (but hidden) makes debugging easier and is fully extensible.\n * Any *Interaction element will be automatically wrapped and hidden - no hardcoded list needed!\n */.qti-item-body .qti-hidden-interaction {display:none !important;}\n\n /*\n * Style for inline feedback elements that appear within choice text or other content.\n * Provides visual distinction and spacing for feedback that appears inline with content.\n */.qti-feedback-inline {display:inline-block;margin-left:0.5rem;padding-left:0.5rem;border-left:2px solid var(--pie-qti-base-content, currentColor);opacity:0.8;}\n\n /* QTI 3.0 Shared Stimulus: stimulus blocks that were prepended before the item body */.qti-stimulus-block {margin-bottom:1rem;}\n\n /* QTI rubricBlock / qti-rubric-block content rendered in item-body source order. */.qti-item-body .qti-rubric-block {display:block;max-width:100%;min-width:0;margin:1rem 0;padding:1rem;overflow-x:auto;border:1px solid var(--pie-qti-base-300, #d1d5db);border-inline-start:4px solid var(--pie-qti-primary, #2563eb);border-radius:0.5rem;background:var(--pie-qti-base-200, #f8fafc);}.qti-item-body .qti-rubric-block > :first-child {margin-top:0;}.qti-item-body .qti-rubric-block > :last-child {margin-bottom:0;}.qti-item-body .qti-rubric-block table {max-width:100%;border-collapse:collapse;}.qti-item-body .qti-rubric-block th,\n .qti-item-body .qti-rubric-block td {padding:0.5rem;border:1px solid var(--pie-qti-base-300, #d1d5db);vertical-align:top;}\n\n /* QTI 3.0 Shared Vocabulary: qti-input-width-N sets minimum input width in character units. */.qti-input-width-1 {min-width:1ch;}.qti-input-width-2 {min-width:2ch;}.qti-input-width-3 {min-width:3ch;}.qti-input-width-4 {min-width:4ch;}.qti-input-width-5 {min-width:5ch;}.qti-input-width-6 {min-width:6ch;}.qti-input-width-10 {min-width:10ch;}.qti-input-width-15 {min-width:15ch;}.qti-input-width-20 {min-width:20ch;}.qti-input-width-25 {min-width:25ch;}.qti-input-width-30 {min-width:30ch;}.qti-input-width-35 {min-width:35ch;}.qti-input-width-40 {min-width:40ch;}.qti-input-width-45 {min-width:45ch;}.qti-input-width-50 {min-width:50ch;}.qti-input-width-72 {min-width:72ch;}"
|
|
6415
6563
|
};
|
|
6416
|
-
function
|
|
6417
|
-
Ot(t, !0), Ba(e,
|
|
6418
|
-
let n = Z(t, "responses", 19, () => ({})), r = Z(t, "disabled", 3, !1), a = Z(t, "role", 3, "candidate"), o = Z(t, "onResponseChange", 3, () => {}), s = Z(t, "outcomeValues", 19, () => ({})), c = Z(t, "stimulusContent", 19, () => ({})), l = Z(t, "renderItemBodyRubrics", 3, !0), u = `qti-item-body-${++
|
|
6564
|
+
function yu(e, t) {
|
|
6565
|
+
Ot(t, !0), Ba(e, vu);
|
|
6566
|
+
let n = Z(t, "responses", 19, () => ({})), r = Z(t, "disabled", 3, !1), a = Z(t, "role", 3, "candidate"), o = Z(t, "onResponseChange", 3, () => {}), s = Z(t, "outcomeValues", 19, () => ({})), c = Z(t, "stimulusContent", 19, () => ({})), l = Z(t, "renderItemBodyRubrics", 3, !0), u = `qti-item-body-${++gu}`, d = `[data-qti-item-body-scope="${u}"]`, f = /* @__PURE__ */ F(() => ru({
|
|
6419
6567
|
player: t.player,
|
|
6420
6568
|
responses: n(),
|
|
6421
6569
|
disabled: r(),
|
|
@@ -6458,7 +6606,7 @@ function cu(e, t) {
|
|
|
6458
6606
|
destroy() {}
|
|
6459
6607
|
};
|
|
6460
6608
|
}
|
|
6461
|
-
var y =
|
|
6609
|
+
var y = _u(), b = V(y), x = V(b);
|
|
6462
6610
|
Ma(x, 21, () => q(f).inlineSegments, Oa, (e, n) => {
|
|
6463
6611
|
var r = fa(), i = Kr(r), a = (e) => {
|
|
6464
6612
|
var t = fa();
|
|
@@ -6467,7 +6615,7 @@ function cu(e, t) {
|
|
|
6467
6615
|
let r = /* @__PURE__ */ F(() => q(f).roleCapabilities.canViewCorrectResponses ? q(f).correctResponses[q(n).interaction.responseId] ?? null : null);
|
|
6468
6616
|
{
|
|
6469
6617
|
let i = /* @__PURE__ */ F(() => p(q(n).interaction.responseId)), a = /* @__PURE__ */ F(() => q(f).roleCapabilities.canViewCorrectResponses ? q(r) : null);
|
|
6470
|
-
|
|
6618
|
+
Cl(e, {
|
|
6471
6619
|
get interaction() {
|
|
6472
6620
|
return q(n).interaction;
|
|
6473
6621
|
},
|
|
@@ -6490,7 +6638,7 @@ function cu(e, t) {
|
|
|
6490
6638
|
let r = /* @__PURE__ */ F(() => q(f).roleCapabilities.canViewCorrectResponses ? q(f).correctResponses[q(n).interaction.responseId] ?? null : null);
|
|
6491
6639
|
{
|
|
6492
6640
|
let i = /* @__PURE__ */ F(() => p(q(n).interaction.responseId)), a = /* @__PURE__ */ F(() => q(f).roleCapabilities.canViewCorrectResponses ? q(r) : null);
|
|
6493
|
-
|
|
6641
|
+
yl(e, {
|
|
6494
6642
|
get interaction() {
|
|
6495
6643
|
return q(n).interaction;
|
|
6496
6644
|
},
|
|
@@ -6531,16 +6679,16 @@ function cu(e, t) {
|
|
|
6531
6679
|
createPciHost: g
|
|
6532
6680
|
}));
|
|
6533
6681
|
}), Y(e, r);
|
|
6534
|
-
}), D(y), bo(y, (e) => B(_, e), () => q(_)), Va(y, (e, t) =>
|
|
6682
|
+
}), D(y), bo(y, (e) => B(_, e), () => q(_)), Va(y, (e, t) => Jc?.(e, t), () => ({ typeset: t.typeset })), Va(y, (e, t) => ml?.(e, t), () => ({ player: t.player })), H(() => X(y, "data-qti-item-body-scope", u)), Y(e, y), kt();
|
|
6535
6683
|
}
|
|
6536
6684
|
//#endregion
|
|
6537
6685
|
//#region src/components/ModalFeedbackDisplay.svelte
|
|
6538
|
-
var
|
|
6686
|
+
var bu = /* @__PURE__ */ J("<h3 class=\"qti-feedback-title svelte-i66ia0\"> </h3>"), xu = /* @__PURE__ */ J("<div class=\"qti-feedback-content svelte-i66ia0\"></div>"), Su = /* @__PURE__ */ J("<div><!> <!></div>"), Cu = /* @__PURE__ */ J("<dialog open=\"\" class=\"qti-feedback-modal svelte-i66ia0\" aria-modal=\"true\"><div class=\"qti-feedback-modal-box svelte-i66ia0\"><button class=\"qti-feedback-close-button svelte-i66ia0\" type=\"button\">✕</button> <!> <div class=\"qti-feedback-actions svelte-i66ia0\"><button class=\"qti-feedback-primary-button svelte-i66ia0\" type=\"button\"> </button></div></div></dialog>"), wu = {
|
|
6539
6687
|
hash: "svelte-i66ia0",
|
|
6540
6688
|
code: ".qti-feedback-modal.svelte-i66ia0 {box-sizing:border-box;width:100%;height:100%;max-width:none;max-height:none;margin:0;padding:0;border:0;background-color:rgba(0, 0, 0, 0.5);color:var(--pie-qti-base-content, oklch(21% 0 0));}.qti-feedback-modal[open].svelte-i66ia0 {display:grid;place-items:center;}.qti-feedback-modal-box.svelte-i66ia0 {position:relative;box-sizing:border-box;width:min(48rem, calc(100vw - 2rem));max-height:80vh;overflow-y:auto;padding:1.5rem;border:1px solid var(--pie-qti-base-300, oklch(95% 0 0));border-radius:1rem;background:var(--pie-qti-base-100, oklch(100% 0 0));box-shadow:0 20px 45px rgba(0, 0, 0, 0.2);}.qti-feedback-close-button.svelte-i66ia0,\n .qti-feedback-primary-button.svelte-i66ia0 {display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--pie-qti-base-300, oklch(95% 0 0));background:var(--pie-qti-base-100, oklch(100% 0 0));color:var(--pie-qti-base-content, oklch(21% 0 0));font:inherit;cursor:pointer;}.qti-feedback-close-button.svelte-i66ia0 {position:absolute;top:0.5rem;right:0.5rem;width:2rem;height:2rem;padding:0;border-radius:9999px;background:transparent;border-color:transparent;}.qti-feedback-close-button.svelte-i66ia0:hover {background:var(--pie-qti-base-200, oklch(98% 0 0));border-color:var(--pie-qti-base-300, oklch(95% 0 0));}.qti-feedback-primary-button.svelte-i66ia0 {gap:0.5rem;padding:0.5rem 0.75rem;border-radius:0.75rem;border-color:var(--pie-qti-primary, oklch(45% 0.24 277));background:color-mix(in oklch, var(--pie-qti-primary, oklch(45% 0.24 277)) 12%, transparent);}.qti-feedback-close-button.svelte-i66ia0:focus-visible,\n .qti-feedback-primary-button.svelte-i66ia0:focus-visible {outline:2px solid var(--pie-qti-focus, var(--pie-qti-primary, oklch(45% 0.24 277)));outline-offset:2px;}.qti-feedback-item.svelte-i66ia0 {margin-bottom:1rem;}.qti-feedback-item-bordered.svelte-i66ia0 {padding-bottom:1rem;border-bottom:1px solid var(--pie-qti-base-300, oklch(95% 0 0));}.qti-feedback-title.svelte-i66ia0 {margin:0 0 0.5rem;font-size:1.125rem;font-weight:700;}.qti-feedback-content.svelte-i66ia0 {max-width:none;}.qti-feedback-actions.svelte-i66ia0 {display:flex;justify-content:flex-end;margin-top:1rem;}"
|
|
6541
6689
|
};
|
|
6542
|
-
function
|
|
6543
|
-
Ot(t, !0), Ba(e,
|
|
6690
|
+
function Tu(e, t) {
|
|
6691
|
+
Ot(t, !0), Ba(e, wu);
|
|
6544
6692
|
let n = Z(t, "feedback", 19, () => []), r = /* @__PURE__ */ F(() => n().length > 0), i = "item-player-modal-feedback-title", a = /* @__PURE__ */ F(() => n().find((e) => e.title)?.title);
|
|
6545
6693
|
function o() {
|
|
6546
6694
|
t.onClose?.();
|
|
@@ -6549,12 +6697,12 @@ function mu(e, t) {
|
|
|
6549
6697
|
e.target === e.currentTarget && o();
|
|
6550
6698
|
}
|
|
6551
6699
|
var c = fa(), l = Kr(c), u = (e) => {
|
|
6552
|
-
var r =
|
|
6700
|
+
var r = Cu(), c = V(r), l = V(c), u = qr(l, 2);
|
|
6553
6701
|
Ma(u, 17, n, Oa, (e, r, a) => {
|
|
6554
|
-
var o =
|
|
6702
|
+
var o = Su();
|
|
6555
6703
|
let s;
|
|
6556
6704
|
var c = V(o), l = (e) => {
|
|
6557
|
-
var t =
|
|
6705
|
+
var t = bu();
|
|
6558
6706
|
X(t, "id", a === 0 ? i : void 0);
|
|
6559
6707
|
var n = V(t, !0);
|
|
6560
6708
|
D(t), H(() => pa(n, q(r).title)), Y(e, t);
|
|
@@ -6563,10 +6711,10 @@ function mu(e, t) {
|
|
|
6563
6711
|
q(r).title && e(l);
|
|
6564
6712
|
});
|
|
6565
6713
|
var u = qr(c, 2), d = (e) => {
|
|
6566
|
-
var n =
|
|
6567
|
-
Ra(n, () => q(r).content, !0), D(n), Va(n, (e, t) =>
|
|
6714
|
+
var n = xu();
|
|
6715
|
+
Ra(n, () => q(r).content, !0), D(n), Va(n, (e, t) => Jc?.(e, t), () => ({ typeset: t.typeset })), Y(e, n);
|
|
6568
6716
|
}, f = (e) => {
|
|
6569
|
-
var t =
|
|
6717
|
+
var t = xu();
|
|
6570
6718
|
Ra(t, () => q(r).content, !0), D(t), Y(e, t);
|
|
6571
6719
|
};
|
|
6572
6720
|
Da(u, (e) => {
|
|
@@ -6592,16 +6740,16 @@ function mu(e, t) {
|
|
|
6592
6740
|
aa(["click"]);
|
|
6593
6741
|
//#endregion
|
|
6594
6742
|
//#region src/components/ItemPlayer.svelte
|
|
6595
|
-
var
|
|
6743
|
+
var Eu = /* @__PURE__ */ J("<div class=\"qti-player-alert qti-player-alert-error svelte-129urwy\"><span> </span></div>"), Du = /* @__PURE__ */ J("<span class=\"qti-player-badge qti-player-badge-success svelte-129urwy\"> </span>"), Ou = /* @__PURE__ */ J("<span> </span>"), ku = /* @__PURE__ */ J("<div class=\"qti-player-attempt-status svelte-129urwy\"><!></div>"), Au = /* @__PURE__ */ J("<div class=\"qti-player-actions svelte-129urwy\"><button class=\"qti-player-button qti-player-button-primary svelte-129urwy\"> </button> <!></div>"), ju = /* @__PURE__ */ J("<!> <!> <!>", 1), Mu = /* @__PURE__ */ J("<div class=\"qti-player-alert qti-player-alert-info svelte-129urwy\"><span> </span></div>"), Nu = /* @__PURE__ */ J("<div class=\"qti-item-player svelte-129urwy\"><!></div>"), Pu = {
|
|
6596
6744
|
hash: "svelte-129urwy",
|
|
6597
6745
|
code: ".qti-item-player.svelte-129urwy {color:var(--pie-qti-base-content, oklch(21% 0 0));}.qti-player-alert.svelte-129urwy {display:flex;align-items:center;gap:0.5rem;padding:0.75rem 1rem;border:1px solid var(--pie-qti-base-300, oklch(95% 0 0));border-radius:0.75rem;background:var(--pie-qti-base-200, oklch(98% 0 0));color:var(--pie-qti-base-content, oklch(21% 0 0));}.qti-player-alert-error.svelte-129urwy {border-color:var(--pie-qti-error, oklch(71% 0.194 13.428));background:color-mix(in oklch, var(--pie-qti-error, oklch(71% 0.194 13.428)) 8%, transparent);}.qti-player-alert-info.svelte-129urwy {border-color:var(--pie-qti-info, oklch(74% 0.16 232.661));background:color-mix(in oklch, var(--pie-qti-info, oklch(74% 0.16 232.661)) 8%, transparent);}.qti-player-actions.svelte-129urwy {display:flex;align-items:center;gap:1rem;margin-top:1.5rem;}.qti-player-button.svelte-129urwy {display:inline-flex;align-items:center;justify-content:center;gap:0.5rem;padding:0.5rem 0.75rem;border:1px solid var(--pie-qti-base-300, oklch(95% 0 0));border-radius:0.75rem;background:var(--pie-qti-base-200, oklch(98% 0 0));color:var(--pie-qti-base-content, oklch(21% 0 0));font:inherit;line-height:1.1;cursor:pointer;}.qti-player-button-primary.svelte-129urwy {border-color:var(--pie-qti-primary, oklch(45% 0.24 277));background:color-mix(in oklch, var(--pie-qti-primary, oklch(45% 0.24 277)) 12%, transparent);}.qti-player-button.svelte-129urwy:disabled {opacity:0.55;cursor:not-allowed;}.qti-player-button.svelte-129urwy:focus-visible {outline:2px solid var(--pie-qti-focus, var(--pie-qti-primary, oklch(45% 0.24 277)));outline-offset:2px;}.qti-player-attempt-status.svelte-129urwy {color:color-mix(in oklch, var(--pie-qti-base-content, oklch(21% 0 0)) 70%, transparent);font-size:0.875rem;}.qti-player-badge.svelte-129urwy {display:inline-flex;align-items:center;justify-content:center;min-height:1.25rem;padding:0 0.5rem;border:1px solid var(--pie-qti-base-300, oklch(95% 0 0));border-radius:9999px;font-size:0.75rem;font-weight:600;}.qti-player-badge-success.svelte-129urwy {border-color:var(--pie-qti-success, oklch(76% 0.177 163.223));background:color-mix(in oklch, var(--pie-qti-success, oklch(76% 0.177 163.223)) 12%, transparent);}"
|
|
6598
6746
|
};
|
|
6599
|
-
function
|
|
6600
|
-
Ot(t, !0), Ba(e,
|
|
6747
|
+
function Fu(e, t) {
|
|
6748
|
+
Ot(t, !0), Ba(e, Pu);
|
|
6601
6749
|
let n = Z(t, "role", 3, "candidate"), r = Z(t, "responses", 19, () => ({})), i = Z(t, "disabled", 3, !1), a = Z(t, "renderItemBodyRubrics", 3, !0), o = /* @__PURE__ */ F(() => t.showSubmit ?? !!t.onSubmit), s = /* @__PURE__ */ z(null), c = /* @__PURE__ */ z(Fr({})), l = /* @__PURE__ */ z(null), u = /* @__PURE__ */ z(Fr([])), d = /* @__PURE__ */ z(Fr({})), f = /* @__PURE__ */ z(!1), p = /* @__PURE__ */ z(!1), m = /* @__PURE__ */ z(0);
|
|
6602
6750
|
ri(() => {
|
|
6603
6751
|
try {
|
|
6604
|
-
let e = Ki(() => r()), i = new
|
|
6752
|
+
let e = Ki(() => r()), i = new Wc({
|
|
6605
6753
|
itemXml: t.itemXml,
|
|
6606
6754
|
role: n(),
|
|
6607
6755
|
security: t.security,
|
|
@@ -6643,12 +6791,12 @@ function wu(e, t) {
|
|
|
6643
6791
|
function _() {
|
|
6644
6792
|
B(u, [], !0);
|
|
6645
6793
|
}
|
|
6646
|
-
var v = { submit: g }, y =
|
|
6647
|
-
var t =
|
|
6794
|
+
var v = { submit: g }, y = Nu(), b = V(y), x = (e) => {
|
|
6795
|
+
var t = Eu(), n = V(t), r = V(n, !0);
|
|
6648
6796
|
D(n), D(t), H(() => pa(r, q(l))), Y(e, t);
|
|
6649
6797
|
}, S = (e) => {
|
|
6650
|
-
var r =
|
|
6651
|
-
|
|
6798
|
+
var r = ju(), l = Kr(r);
|
|
6799
|
+
yu(l, {
|
|
6652
6800
|
get player() {
|
|
6653
6801
|
return q(s);
|
|
6654
6802
|
},
|
|
@@ -6680,14 +6828,14 @@ function wu(e, t) {
|
|
|
6680
6828
|
});
|
|
6681
6829
|
var v = qr(l, 2), y = (e) => {
|
|
6682
6830
|
let n = /* @__PURE__ */ F(() => q(s).canSubmitResponses(q(c)));
|
|
6683
|
-
var r =
|
|
6831
|
+
var r = Au(), i = V(r), a = V(i, !0);
|
|
6684
6832
|
D(i);
|
|
6685
6833
|
var o = qr(i, 2), l = (e) => {
|
|
6686
|
-
var n =
|
|
6687
|
-
var n =
|
|
6834
|
+
var n = ku(), r = V(n), i = (e) => {
|
|
6835
|
+
var n = Du(), r = V(n, !0);
|
|
6688
6836
|
D(n), H((e) => pa(r, e), [() => t.i18n?.t("item.complete") ?? "item.complete"]), Y(e, n);
|
|
6689
6837
|
}, a = (e) => {
|
|
6690
|
-
var n =
|
|
6838
|
+
var n = Ou(), r = V(n, !0);
|
|
6691
6839
|
D(n), H((e) => pa(r, e), [() => t.i18n?.t("item.attempt", { numAttempts: q(m) + 1 }) ?? `item.attempt (${q(m) + 1})`]), Y(e, n);
|
|
6692
6840
|
};
|
|
6693
6841
|
Da(r, (e) => {
|
|
@@ -6702,7 +6850,7 @@ function wu(e, t) {
|
|
|
6702
6850
|
};
|
|
6703
6851
|
Da(v, (e) => {
|
|
6704
6852
|
n() === "candidate" && !i() && q(o) && e(y);
|
|
6705
|
-
}),
|
|
6853
|
+
}), Tu(qr(v, 2), {
|
|
6706
6854
|
get feedback() {
|
|
6707
6855
|
return q(u);
|
|
6708
6856
|
},
|
|
@@ -6715,7 +6863,7 @@ function wu(e, t) {
|
|
|
6715
6863
|
}
|
|
6716
6864
|
}), Y(e, r);
|
|
6717
6865
|
}, ee = (e) => {
|
|
6718
|
-
var n =
|
|
6866
|
+
var n = Mu(), r = V(n), i = V(r, !0);
|
|
6719
6867
|
D(r), D(n), H((e) => pa(i, e), [() => t.i18n?.t("item.loading") ?? "item.loading"]), Y(e, n);
|
|
6720
6868
|
};
|
|
6721
6869
|
return Da(b, (e) => {
|
|
@@ -6725,16 +6873,16 @@ function wu(e, t) {
|
|
|
6725
6873
|
aa(["click"]);
|
|
6726
6874
|
//#endregion
|
|
6727
6875
|
//#region src/element-class.ts
|
|
6728
|
-
var
|
|
6876
|
+
var Iu = globalThis.HTMLElement ?? class {}, Lu = /* @__PURE__ */ new WeakMap(), Ru = /* @__PURE__ */ new WeakMap(), zu = /* @__PURE__ */ new WeakMap(), Bu = /* @__PURE__ */ new WeakMap(), Vu = /* @__PURE__ */ new WeakMap(), Hu = /* @__PURE__ */ new WeakMap(), Uu = /* @__PURE__ */ new WeakMap(), Wu = /* @__PURE__ */ new WeakMap(), Gu = /* @__PURE__ */ new WeakMap(), Ku = /* @__PURE__ */ new WeakMap(), qu = /* @__PURE__ */ new WeakMap(), Ju = /* @__PURE__ */ new WeakMap(), Yu = /* @__PURE__ */ new WeakMap(), Xu = /* @__PURE__ */ new WeakMap(), Zu = /* @__PURE__ */ new WeakMap(), Qu = /* @__PURE__ */ new WeakMap(), $u = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakSet(), ed = class extends Iu {
|
|
6729
6877
|
constructor(...e) {
|
|
6730
|
-
super(...e), Jt(this, Q), A(this,
|
|
6878
|
+
super(...e), Jt(this, Q), A(this, Lu, a({
|
|
6731
6879
|
host: this,
|
|
6732
|
-
mount: (e, t) => ma(
|
|
6880
|
+
mount: (e, t) => ma(Fu, {
|
|
6733
6881
|
target: e,
|
|
6734
6882
|
props: t
|
|
6735
6883
|
}),
|
|
6736
6884
|
unmount: va
|
|
6737
|
-
})), A(this,
|
|
6885
|
+
})), A(this, Ru, ""), A(this, zu, "candidate"), A(this, Bu, !1), A(this, Vu, !0), A(this, Hu, void 0), A(this, Uu, void 0), A(this, Wu, void 0), A(this, Gu, void 0), A(this, Ku, void 0), A(this, qu, void 0), A(this, Ju, void 0), A(this, Yu, void 0), A(this, Xu, void 0), A(this, Zu, void 0), A(this, Qu, void 0), A(this, $u, void 0);
|
|
6738
6886
|
}
|
|
6739
6887
|
static get observedAttributes() {
|
|
6740
6888
|
return [
|
|
@@ -6744,103 +6892,103 @@ var Tu = globalThis.HTMLElement ?? class {}, Eu = /* @__PURE__ */ new WeakMap(),
|
|
|
6744
6892
|
];
|
|
6745
6893
|
}
|
|
6746
6894
|
get itemXml() {
|
|
6747
|
-
return N(
|
|
6895
|
+
return N(Ru, this);
|
|
6748
6896
|
}
|
|
6749
6897
|
set itemXml(e) {
|
|
6750
|
-
M(
|
|
6898
|
+
M(Ru, this, e ?? ""), j(Q, this, $).call(this);
|
|
6751
6899
|
}
|
|
6752
6900
|
get role() {
|
|
6753
|
-
return N(
|
|
6901
|
+
return N(zu, this);
|
|
6754
6902
|
}
|
|
6755
6903
|
set role(e) {
|
|
6756
|
-
M(
|
|
6904
|
+
M(zu, this, e ?? "candidate"), j(Q, this, $).call(this);
|
|
6757
6905
|
}
|
|
6758
6906
|
get disabled() {
|
|
6759
|
-
return N(
|
|
6907
|
+
return N(Bu, this);
|
|
6760
6908
|
}
|
|
6761
6909
|
set disabled(e) {
|
|
6762
|
-
M(
|
|
6910
|
+
M(Bu, this, !!e), j(Q, this, $).call(this);
|
|
6763
6911
|
}
|
|
6764
6912
|
get renderItemBodyRubrics() {
|
|
6765
|
-
return N(
|
|
6913
|
+
return N(Vu, this);
|
|
6766
6914
|
}
|
|
6767
6915
|
set renderItemBodyRubrics(e) {
|
|
6768
|
-
M(
|
|
6916
|
+
M(Vu, this, e !== !1), j(Q, this, $).call(this);
|
|
6769
6917
|
}
|
|
6770
6918
|
get typeset() {
|
|
6771
|
-
return N(
|
|
6919
|
+
return N(Hu, this);
|
|
6772
6920
|
}
|
|
6773
6921
|
set typeset(e) {
|
|
6774
|
-
M(
|
|
6922
|
+
M(Hu, this, e), j(Q, this, $).call(this);
|
|
6775
6923
|
}
|
|
6776
6924
|
get i18n() {
|
|
6777
|
-
return N(
|
|
6925
|
+
return N(Uu, this);
|
|
6778
6926
|
}
|
|
6779
6927
|
set i18n(e) {
|
|
6780
|
-
M(
|
|
6928
|
+
M(Uu, this, e), j(Q, this, $).call(this);
|
|
6781
6929
|
}
|
|
6782
6930
|
get security() {
|
|
6783
|
-
return N(
|
|
6931
|
+
return N(Wu, this);
|
|
6784
6932
|
}
|
|
6785
6933
|
set security(e) {
|
|
6786
|
-
M(
|
|
6934
|
+
M(Wu, this, e), j(Q, this, $).call(this);
|
|
6787
6935
|
}
|
|
6788
6936
|
get pnp() {
|
|
6789
|
-
return N(
|
|
6937
|
+
return N(Gu, this);
|
|
6790
6938
|
}
|
|
6791
6939
|
set pnp(e) {
|
|
6792
|
-
M(
|
|
6940
|
+
M(Gu, this, e), j(Q, this, $).call(this);
|
|
6793
6941
|
}
|
|
6794
6942
|
get deliveryContext() {
|
|
6795
|
-
return N(
|
|
6943
|
+
return N(Ku, this);
|
|
6796
6944
|
}
|
|
6797
6945
|
set deliveryContext(e) {
|
|
6798
|
-
M(
|
|
6946
|
+
M(Ku, this, e), j(Q, this, $).call(this);
|
|
6799
6947
|
}
|
|
6800
6948
|
get pci() {
|
|
6801
|
-
return N(
|
|
6949
|
+
return N(Yu, this);
|
|
6802
6950
|
}
|
|
6803
6951
|
set pci(e) {
|
|
6804
|
-
M(
|
|
6952
|
+
M(Yu, this, e), j(Q, this, $).call(this);
|
|
6805
6953
|
}
|
|
6806
6954
|
get resolveProcessingFragment() {
|
|
6807
|
-
return N(
|
|
6955
|
+
return N(qu, this);
|
|
6808
6956
|
}
|
|
6809
6957
|
set resolveProcessingFragment(e) {
|
|
6810
|
-
M(
|
|
6958
|
+
M(qu, this, e), j(Q, this, $).call(this);
|
|
6811
6959
|
}
|
|
6812
6960
|
get processingFragmentLimits() {
|
|
6813
|
-
return N(
|
|
6961
|
+
return N(Ju, this);
|
|
6814
6962
|
}
|
|
6815
6963
|
set processingFragmentLimits(e) {
|
|
6816
|
-
M(
|
|
6964
|
+
M(Ju, this, e), j(Q, this, $).call(this);
|
|
6817
6965
|
}
|
|
6818
6966
|
get responses() {
|
|
6819
|
-
return N(
|
|
6967
|
+
return N(Xu, this);
|
|
6820
6968
|
}
|
|
6821
6969
|
set responses(e) {
|
|
6822
|
-
M(
|
|
6970
|
+
M(Xu, this, e ? { ...e } : void 0), j(Q, this, $).call(this);
|
|
6823
6971
|
}
|
|
6824
6972
|
get onResponseChange() {
|
|
6825
|
-
return N(
|
|
6973
|
+
return N(Zu, this);
|
|
6826
6974
|
}
|
|
6827
6975
|
set onResponseChange(e) {
|
|
6828
|
-
M(
|
|
6976
|
+
M(Zu, this, e);
|
|
6829
6977
|
}
|
|
6830
6978
|
get onSubmit() {
|
|
6831
|
-
return N(
|
|
6979
|
+
return N(Qu, this);
|
|
6832
6980
|
}
|
|
6833
6981
|
set onSubmit(e) {
|
|
6834
|
-
M(
|
|
6982
|
+
M(Qu, this, e), j(Q, this, $).call(this);
|
|
6835
6983
|
}
|
|
6836
6984
|
get onComplete() {
|
|
6837
|
-
return N(
|
|
6985
|
+
return N($u, this);
|
|
6838
6986
|
}
|
|
6839
6987
|
set onComplete(e) {
|
|
6840
|
-
M(
|
|
6988
|
+
M($u, this, e);
|
|
6841
6989
|
}
|
|
6842
6990
|
connectedCallback() {
|
|
6843
|
-
N(
|
|
6991
|
+
N(Lu, this).mountOrUpdate(j(Q, this, td).call(this)), queueMicrotask(() => {
|
|
6844
6992
|
this.isConnected && this.dispatchEvent(new CustomEvent("ready", {
|
|
6845
6993
|
bubbles: !0,
|
|
6846
6994
|
composed: !0
|
|
@@ -6848,45 +6996,45 @@ var Tu = globalThis.HTMLElement ?? class {}, Eu = /* @__PURE__ */ new WeakMap(),
|
|
|
6848
6996
|
});
|
|
6849
6997
|
}
|
|
6850
6998
|
disconnectedCallback() {
|
|
6851
|
-
N(
|
|
6999
|
+
N(Lu, this).teardown({ removeContainer: !0 });
|
|
6852
7000
|
}
|
|
6853
7001
|
attributeChangedCallback(e, t, n) {
|
|
6854
|
-
e === "item-xml" ? M(
|
|
7002
|
+
e === "item-xml" ? M(Ru, this, n ?? "") : e === "role" ? M(zu, this, n ?? "candidate") : e === "disabled" && M(Bu, this, n !== null), j(Q, this, $).call(this);
|
|
6855
7003
|
}
|
|
6856
7004
|
submit(e = !0) {
|
|
6857
|
-
return N(
|
|
7005
|
+
return N(Lu, this).instance?.submit(e);
|
|
6858
7006
|
}
|
|
6859
7007
|
addEventListener(e, t, n) {
|
|
6860
7008
|
super.addEventListener(e, t, n);
|
|
6861
7009
|
}
|
|
6862
7010
|
};
|
|
6863
|
-
function
|
|
7011
|
+
function td() {
|
|
6864
7012
|
return {
|
|
6865
|
-
itemXml: N(
|
|
6866
|
-
role: N(
|
|
6867
|
-
disabled: N(
|
|
6868
|
-
renderItemBodyRubrics: N(
|
|
6869
|
-
typeset: N(
|
|
6870
|
-
i18n: N(
|
|
7013
|
+
itemXml: N(Ru, this),
|
|
7014
|
+
role: N(zu, this),
|
|
7015
|
+
disabled: N(Bu, this),
|
|
7016
|
+
renderItemBodyRubrics: N(Vu, this),
|
|
7017
|
+
typeset: N(Hu, this),
|
|
7018
|
+
i18n: N(Uu, this),
|
|
6871
7019
|
security: {
|
|
6872
|
-
...N(
|
|
7020
|
+
...N(Wu, this) ?? {},
|
|
6873
7021
|
parsingLimits: {
|
|
6874
7022
|
enabled: !0,
|
|
6875
|
-
...N(
|
|
7023
|
+
...N(Wu, this)?.parsingLimits ?? {}
|
|
6876
7024
|
}
|
|
6877
7025
|
},
|
|
6878
|
-
pnp: N(
|
|
6879
|
-
deliveryContext: N(
|
|
6880
|
-
resolveProcessingFragment: N(
|
|
6881
|
-
processingFragmentLimits: N(
|
|
6882
|
-
pci: N(
|
|
6883
|
-
responses: N(
|
|
7026
|
+
pnp: N(Gu, this),
|
|
7027
|
+
deliveryContext: N(Ku, this),
|
|
7028
|
+
resolveProcessingFragment: N(qu, this),
|
|
7029
|
+
processingFragmentLimits: N(Ju, this),
|
|
7030
|
+
pci: N(Yu, this),
|
|
7031
|
+
responses: N(Xu, this),
|
|
6884
7032
|
onResponseChange: (e, t) => {
|
|
6885
7033
|
let n = {
|
|
6886
|
-
...N(
|
|
7034
|
+
...N(Xu, this) ?? {},
|
|
6887
7035
|
[e]: t
|
|
6888
7036
|
};
|
|
6889
|
-
M(
|
|
7037
|
+
M(Xu, this, n), N(Zu, this)?.call(this, e, t), this.dispatchEvent(new CustomEvent("response-change", {
|
|
6890
7038
|
detail: {
|
|
6891
7039
|
responseId: e,
|
|
6892
7040
|
value: t,
|
|
@@ -6898,7 +7046,7 @@ function Wu() {
|
|
|
6898
7046
|
},
|
|
6899
7047
|
onSubmit: (e, t) => {
|
|
6900
7048
|
let n = { ...e };
|
|
6901
|
-
M(
|
|
7049
|
+
M(Xu, this, n), N(Qu, this)?.call(this, n, t), this.dispatchEvent(new CustomEvent("submit", {
|
|
6902
7050
|
detail: {
|
|
6903
7051
|
responses: n,
|
|
6904
7052
|
result: t
|
|
@@ -6907,9 +7055,9 @@ function Wu() {
|
|
|
6907
7055
|
composed: !0
|
|
6908
7056
|
}));
|
|
6909
7057
|
},
|
|
6910
|
-
showSubmit: !!N(
|
|
7058
|
+
showSubmit: !!N(Qu, this),
|
|
6911
7059
|
onComplete: (e) => {
|
|
6912
|
-
N(
|
|
7060
|
+
N($u, this)?.call(this, e), this.dispatchEvent(new CustomEvent("complete", {
|
|
6913
7061
|
detail: { result: e },
|
|
6914
7062
|
bubbles: !0,
|
|
6915
7063
|
composed: !0
|
|
@@ -6918,9 +7066,9 @@ function Wu() {
|
|
|
6918
7066
|
};
|
|
6919
7067
|
}
|
|
6920
7068
|
function $() {
|
|
6921
|
-
N(
|
|
7069
|
+
N(Lu, this).update(j(Q, this, td).call(this));
|
|
6922
7070
|
}
|
|
6923
7071
|
//#endregion
|
|
6924
|
-
export {
|
|
7072
|
+
export { ed as t };
|
|
6925
7073
|
|
|
6926
|
-
//# sourceMappingURL=element-class-
|
|
7074
|
+
//# sourceMappingURL=element-class-BEpwHdcP.js.map
|