@pie-element/placement-ordering 14.1.2-next.5 → 14.1.2-next.7
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/author/choice-editor.js +2 -2
- package/dist/author/choice-tile.js +3 -2
- package/dist/author/design.js +1 -1
- package/dist/author/index.d.ts +1 -0
- package/dist/author/index.js +5 -2
- package/dist/browser/author/index.js +22660 -25834
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/{browser-DHPggtaA.js → browser-Bd36Xf5z.js} +2 -2
- package/dist/browser/browser-Bd36Xf5z.js.map +1 -0
- package/dist/browser/controller/index.js +3 -3
- package/dist/browser/controller/index.js.map +1 -1
- package/dist/browser/delivery/index.js +436 -307
- package/dist/browser/delivery/index.js.map +1 -1
- package/dist/browser/{dist-D9ARZhQk.js → dist-DiGNNRzu.js} +2 -2
- package/dist/browser/{dist-D9ARZhQk.js.map → dist-DiGNNRzu.js.map} +1 -1
- package/dist/browser/{drag-provider-C1slTlsc.js → drag-provider-BdfhGCEU.js} +2474 -2529
- package/dist/browser/drag-provider-BdfhGCEU.js.map +1 -0
- package/dist/controller/scoring.js +1 -1
- package/dist/delivery/index.js +2 -2
- package/dist/delivery/keyboard-coordinates.d.ts +35 -0
- package/dist/delivery/keyboard-coordinates.js +48 -0
- package/dist/delivery/main.js +1 -1
- package/dist/delivery/ordering.js +1 -1
- package/dist/delivery/placement-ordering.d.ts +11 -0
- package/dist/delivery/placement-ordering.js +147 -79
- package/dist/delivery/tile.d.ts +3 -0
- package/dist/delivery/tile.js +66 -57
- package/dist/delivery/tiler.d.ts +6 -0
- package/dist/delivery/tiler.js +6 -3
- package/dist/index.iife.js +35 -35
- package/package.json +17 -9
- package/dist/browser/browser-DHPggtaA.js.map +0 -1
- package/dist/browser/drag-provider-C1slTlsc.js.map +0 -1
|
@@ -111,7 +111,7 @@ function D(e) {
|
|
|
111
111
|
return Array.isArray(e);
|
|
112
112
|
}
|
|
113
113
|
function O(e) {
|
|
114
|
-
return e == null ? !0 : typeof e == "string" || Array.isArray(e) ? e.length === 0 : e instanceof Map || e instanceof Set ? e.size === 0 : f(e)
|
|
114
|
+
return e == null ? !0 : typeof e == "string" || Array.isArray(e) ? e.length === 0 : e instanceof Map || e instanceof Set ? e.size === 0 : !f(e) || Object.keys(e).length === 0;
|
|
115
115
|
}
|
|
116
116
|
function k(e, t, n) {
|
|
117
117
|
let r = n?.(e, t);
|
|
@@ -373,4 +373,4 @@ var U = /* @__PURE__ */ o(((e, t) => {
|
|
|
373
373
|
//#endregion
|
|
374
374
|
export { y as C, s as D, o as E, u as O, x as S, T, v as _, D as a, _ as b, j as c, P as d, L as f, B as g, C as h, N as i, l as k, O as l, w as m, V as n, I as o, b as p, A as r, F as s, G as t, M as u, S as v, E as w, H as x, R as y };
|
|
375
375
|
|
|
376
|
-
//# sourceMappingURL=browser-
|
|
376
|
+
//# sourceMappingURL=browser-Bd36Xf5z.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-Bd36Xf5z.js","names":[],"sources":["../../../../shared/lodash/dist/index.js","../../../../../node_modules/.bun/ms@2.1.3/node_modules/ms/index.js","../../../../../node_modules/.bun/debug@4.4.3/node_modules/debug/src/common.js","../../../../../node_modules/.bun/debug@4.4.3/node_modules/debug/src/browser.js"],"sourcesContent":["//#region src/index.ts\nvar e = Object.prototype;\nfunction t(e) {\n\treturn typeof e == \"object\" && !!e;\n}\nfunction n(e) {\n\treturn Array.isArray(e) ? e : typeof e == \"number\" ? [e] : e.replace(/\\[(\\d+)\\]/g, \".$1\").split(\".\").filter(Boolean);\n}\nfunction r(e) {\n\treturn (t) => x(t, e);\n}\nfunction i(e) {\n\treturn (n) => t(n) ? Object.entries(e).every(([e, t]) => A(n[e], t)) : !1;\n}\nfunction a(e) {\n\treturn typeof e == \"function\" ? e : typeof e == \"string\" ? r(e) : t(e) ? i(e) : ((e) => e);\n}\nfunction o(e, ...t) {\n\treturn Object.assign(e, ...t.filter(Boolean));\n}\nfunction s(e, t = 1) {\n\tif (!e?.length || t < 1) return [];\n\tlet n = [];\n\tfor (let r = 0; r < e.length; r += t) n.push(e.slice(r, r + t));\n\treturn n;\n}\nfunction c(e) {\n\treturn Array.isArray(e) ? e.slice() : t(e) ? { ...e } : e;\n}\nfunction l(e) {\n\tif (!t(e)) return e;\n\tif (e instanceof Date) return new Date(e.getTime());\n\tif (Array.isArray(e)) return e.map((e) => l(e));\n\tlet n = {};\n\tfor (let [t, r] of Object.entries(e)) n[t] = l(r);\n\treturn n;\n}\nfunction u(e) {\n\treturn (e ?? []).filter(Boolean);\n}\nfunction d(e, ...t) {\n\tlet n = [...e ?? []];\n\tfor (let e of t) Array.isArray(e) ? n.push(...e) : n.push(e);\n\treturn n;\n}\nfunction f(e, t = 0, n = {}) {\n\tlet r, i, a, o, s, c = n.leading === !0, l = n.trailing !== !1, u = () => {\n\t\tif (!a) return s;\n\t\tlet t = a, n = o;\n\t\treturn a = void 0, o = void 0, s = e.apply(n, t), s;\n\t}, d = () => {\n\t\tr && clearTimeout(r), i && clearTimeout(i), r = void 0, i = void 0, a = void 0, o = void 0;\n\t}, f = function(...e) {\n\t\tlet d = c && !r;\n\t\treturn a = e, o = this, d && u(), r && clearTimeout(r), r = setTimeout(() => {\n\t\t\tr = void 0, i &&= (clearTimeout(i), void 0), l ? u() : (a = void 0, o = void 0);\n\t\t}, t), n.maxWait !== void 0 && !i && (i = setTimeout(() => {\n\t\t\tr && clearTimeout(r), r = void 0, i = void 0, l || !c ? u() : (a = void 0, o = void 0);\n\t\t}, n.maxWait)), s;\n\t};\n\treturn f.cancel = d, f.flush = () => (r &&= (clearTimeout(r), void 0), i &&= (clearTimeout(i), void 0), u()), f;\n}\nfunction p(e, ...t) {\n\tfor (let n of t) if (n) for (let [t, r] of Object.entries(n)) e[t] === void 0 && (e[t] = r);\n\treturn e;\n}\nfunction m(e, ...t) {\n\tlet n = new Set(t.flat());\n\treturn (e ?? []).filter((e) => !n.has(e));\n}\nfunction h(e, t, n) {\n\treturn (e ?? []).filter((e) => !(t ?? []).some((t) => n(e, t)));\n}\nfunction g(e, t) {\n\tlet n = a(t), r = Array.isArray(e) ? e.entries() : Object.entries(e ?? {});\n\tfor (let [t, i] of r) if (!n(i, t, e)) return !1;\n\treturn !0;\n}\nfunction ee(e) {\n\treturn String(e).replace(/&/g, \"&\").replace(/</g, \"<\").replace(/>/g, \">\").replace(/\"/g, \""\").replace(/'/g, \"'\");\n}\nfunction _(e, t) {\n\tlet n = a(t), r = Array.isArray(e) ? e.entries() : Object.entries(e ?? {});\n\tfor (let [t, i] of r) if (n(i, t, e)) return i;\n}\nfunction v(e, t) {\n\tlet n = a(t);\n\tfor (let [t, r] of Object.entries(e ?? {})) if (n(r, t, e)) return t;\n}\nfunction y(e) {\n\tlet t = [];\n\tfor (let n of e ?? []) Array.isArray(n) ? t.push(...n) : t.push(n);\n\treturn t;\n}\nfunction te(e, t) {\n\treturn R(e, t).flat();\n}\nfunction b(e, t) {\n\tlet n = Array.isArray(e) ? e.entries() : Object.entries(e ?? {});\n\tfor (let [r, i] of n) t(i, r, e);\n\treturn e;\n}\nfunction x(e, t, r) {\n\tif (!Array.isArray(t) && e != null && Object.prototype.hasOwnProperty.call(Object(e), t)) {\n\t\tlet n = e[t];\n\t\treturn n === void 0 ? r : n;\n\t}\n\tlet i = e;\n\tfor (let e of n(t)) {\n\t\tif (i == null) return r;\n\t\ti = i[e];\n\t}\n\treturn i === void 0 ? r : i;\n}\nfunction S(e, t) {\n\tlet n = a(t);\n\treturn K(e, (t, r, i) => {\n\t\tlet a = String(n(r, i, e));\n\t\treturn (t[a] ??= []).push(r), t;\n\t}, {});\n}\nfunction C(e) {\n\treturn e?.[0];\n}\nfunction w(e) {\n\treturn (e ?? []).slice(0, -1);\n}\nfunction T(e, t) {\n\treturn typeof e == \"string\" ? e.includes(String(t)) : Array.isArray(e) ? e.includes(t) : Object.values(e ?? {}).includes(t);\n}\nfunction E(...e) {\n\tlet [t, ...n] = e;\n\treturn $((t ?? []).filter((e) => n.every((t) => (t ?? []).includes(e))));\n}\nfunction D(e) {\n\treturn Array.isArray(e);\n}\nfunction O(e) {\n\treturn e == null ? !0 : typeof e == \"string\" || Array.isArray(e) ? e.length === 0 : e instanceof Map || e instanceof Set ? e.size === 0 : !t(e) || Object.keys(e).length === 0;\n}\nfunction k(n, r, i) {\n\tlet a = i?.(n, r);\n\tif (a !== void 0) return !!a;\n\tif (Object.is(n, r)) return !0;\n\tif (!t(n) || !t(r)) return !1;\n\tif (n instanceof Date || r instanceof Date) return n instanceof Date && r instanceof Date && n.getTime() === r.getTime();\n\tif (Array.isArray(n) || Array.isArray(r)) return Array.isArray(n) && Array.isArray(r) && n.length === r.length && n.every((e, t) => k(e, r[t], i));\n\tlet o = Object.keys(n), s = Object.keys(r);\n\treturn o.length === s.length && o.every((t) => e.hasOwnProperty.call(r, t) && k(n[t], r[t], i));\n}\nfunction A(e, t) {\n\treturn k(e, t);\n}\nfunction j(e, t, n) {\n\treturn k(e, t, n);\n}\nfunction M(e) {\n\treturn Number.isFinite(e);\n}\nfunction N(e) {\n\treturn typeof e == \"function\";\n}\nfunction P(e) {\n\treturn typeof e == \"number\" || e instanceof Number;\n}\nfunction F(e) {\n\treturn typeof e == \"object\" && !!e || typeof e == \"function\";\n}\nfunction I(e) {\n\treturn typeof e == \"string\" || e instanceof String;\n}\nfunction L(e) {\n\treturn e === void 0;\n}\nfunction R(e, t) {\n\tlet n = a(t), r = Array.isArray(e) ? e.entries() : Object.entries(e ?? {}), i = [];\n\tfor (let [t, a] of r) i.push(n(a, t, e));\n\treturn i;\n}\nfunction z(e) {\n\treturn e?.length ? Math.max(...e) : void 0;\n}\nfunction B(e, ...n) {\n\tfor (let r of n) if (r) for (let [n, i] of Object.entries(r)) t(i) && !Array.isArray(i) && t(e[n]) ? B(e[n], i) : e[n] = l(i);\n\treturn e;\n}\nfunction V(e, t) {\n\tlet n = { ...e ?? {} };\n\tfor (let e of Array.isArray(t) ? t : [t]) delete n[e];\n\treturn n;\n}\nfunction H(e, t) {\n\tlet n = a(t), r = {};\n\tfor (let [t, i] of Object.entries(e ?? {})) n(i, t, e) || (r[t] = i);\n\treturn r;\n}\nfunction U(e, ...t) {\n\tlet n = {};\n\tfor (let r of t.flat()) e && r in e && (n[r] = e[r]);\n\treturn n;\n}\nfunction W(e, t, n = 1) {\n\tlet r = t ?? e, i = t === void 0 ? 0 : e;\n\tif (n === 0) return [];\n\tlet a = [], o = n > 0;\n\tfor (let e = i; o ? e < r : e > r; e += n) a.push(e);\n\treturn a;\n}\nfunction G(e, t, n = 1) {\n\treturn W(e, t, n).reverse();\n}\nfunction K(e, t, n) {\n\tlet r = n, i = Array.isArray(e) ? e.entries() : Object.entries(e ?? {});\n\tfor (let [n, a] of i) r = t(r, a, n, e);\n\treturn r;\n}\nfunction q(e, t) {\n\tlet n = a(t), r = [];\n\tfor (let t = e.length - 1; t >= 0; t--) n(e[t], t, e) && r.unshift(...e.splice(t, 1));\n\treturn r;\n}\nfunction J(e, t, r) {\n\tlet i = n(t), a = e;\n\treturn i.forEach((e, t) => {\n\t\tif (t === i.length - 1) {\n\t\t\ta[e] = r;\n\t\t\treturn;\n\t\t}\n\t\tlet n = i[t + 1];\n\t\ta[e] ??= typeof n == \"number\" || /^\\d+$/.test(String(n)) ? [] : {}, a = a[e];\n\t}), e;\n}\nfunction Y(e) {\n\tlet t = [...e ?? []];\n\tfor (let e = t.length - 1; e > 0; e--) {\n\t\tlet n = Math.floor(Math.random() * (e + 1));\n\t\t[t[e], t[n]] = [t[n], t[e]];\n\t}\n\treturn t;\n}\nfunction X(e) {\n\treturn (e ?? []).slice(1);\n}\nfunction Z(e, t = 1) {\n\treturn t <= 0 ? [] : (e ?? []).slice(-t);\n}\nfunction Q(e, t = 0, n = {}) {\n\treturn f(e, t, {\n\t\tleading: n.leading !== !1,\n\t\ttrailing: n.trailing !== !1,\n\t\tmaxWait: t\n\t});\n}\nfunction ne(e, t) {\n\tlet n = t ?? ((e) => e);\n\treturn Array.from({ length: Math.max(0, e) }, (e, t) => n(t));\n}\nvar re = 0;\nfunction ie(e = \"\") {\n\treturn re += 1, `${e}${re}`;\n}\nfunction $(e) {\n\treturn Array.from(new Set(e ?? []));\n}\nfunction ae(e, t) {\n\tlet n = [];\n\tfor (let r of e ?? []) n.some((e) => t(r, e)) || n.push(r);\n\treturn n;\n}\nfunction oe(...e) {\n\tlet t = Math.max(0, ...e.map((e) => e.length));\n\treturn Array.from({ length: t }, (t, n) => e.map((e) => e[n]));\n}\nvar se = {\n\tassign: o,\n\tchunk: s,\n\tclone: c,\n\tcloneDeep: l,\n\tcompact: u,\n\tconcat: d,\n\tdebounce: f,\n\tdefaults: p,\n\tdifference: m,\n\tdifferenceWith: h,\n\tevery: g,\n\tescape: ee,\n\tfind: _,\n\tfindKey: v,\n\tflatten: y,\n\tflatMap: te,\n\tforEach: b,\n\tget: x,\n\tgroupBy: S,\n\thead: C,\n\tincludes: T,\n\tinitial: w,\n\tintersection: E,\n\tisArray: D,\n\tisEmpty: O,\n\tisEqual: A,\n\tisEqualWith: j,\n\tisFinite: M,\n\tisFunction: N,\n\tisNumber: P,\n\tisObject: F,\n\tisString: I,\n\tisUndefined: L,\n\tmap: R,\n\tmax: z,\n\tmerge: B,\n\tomit: V,\n\tomitBy: H,\n\tpick: U,\n\trange: W,\n\trangeRight: G,\n\treduce: K,\n\tremove: q,\n\tset: J,\n\tshuffle: Y,\n\ttail: X,\n\ttakeRight: Z,\n\tthrottle: Q,\n\ttimes: ne,\n\tuniqueId: ie,\n\tuniq: $,\n\tuniqWith: ae,\n\tzip: oe\n};\n//#endregion\nexport { o as assign, s as chunk, c as clone, l as cloneDeep, u as compact, d as concat, f as debounce, se as default, p as defaults, m as difference, h as differenceWith, ee as escape, g as every, _ as find, v as findKey, te as flatMap, y as flatten, b as forEach, x as get, S as groupBy, C as head, T as includes, w as initial, E as intersection, D as isArray, O as isEmpty, A as isEqual, j as isEqualWith, M as isFinite, N as isFunction, P as isNumber, F as isObject, I as isString, L as isUndefined, R as map, z as max, B as merge, V as omit, H as omitBy, U as pick, W as range, G as rangeRight, K as reduce, q as remove, J as set, Y as shuffle, X as tail, Z as takeRight, Q as throttle, ne as times, $ as uniq, ae as uniqWith, ie as uniqueId, oe as zip };\n","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function (val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '')\n\t\t\t.trim()\n\t\t\t.replace(/\\s+/g, ',')\n\t\t\t.split(',')\n\t\t\t.filter(Boolean);\n\n\t\tfor (const ns of split) {\n\t\t\tif (ns[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(ns.slice(1));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(ns);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Checks if the given string matches a namespace template, honoring\n\t * asterisks as wildcards.\n\t *\n\t * @param {String} search\n\t * @param {String} template\n\t * @return {Boolean}\n\t */\n\tfunction matchesTemplate(search, template) {\n\t\tlet searchIndex = 0;\n\t\tlet templateIndex = 0;\n\t\tlet starIndex = -1;\n\t\tlet matchIndex = 0;\n\n\t\twhile (searchIndex < search.length) {\n\t\t\tif (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {\n\t\t\t\t// Match character or proceed with wildcard\n\t\t\t\tif (template[templateIndex] === '*') {\n\t\t\t\t\tstarIndex = templateIndex;\n\t\t\t\t\tmatchIndex = searchIndex;\n\t\t\t\t\ttemplateIndex++; // Skip the '*'\n\t\t\t\t} else {\n\t\t\t\t\tsearchIndex++;\n\t\t\t\t\ttemplateIndex++;\n\t\t\t\t}\n\t\t\t} else if (starIndex !== -1) { // eslint-disable-line no-negated-condition\n\t\t\t\t// Backtrack to the last '*' and try to match more characters\n\t\t\t\ttemplateIndex = starIndex + 1;\n\t\t\t\tmatchIndex++;\n\t\t\t\tsearchIndex = matchIndex;\n\t\t\t} else {\n\t\t\t\treturn false; // No match\n\t\t\t}\n\t\t}\n\n\t\t// Handle trailing '*' in template\n\t\twhile (templateIndex < template.length && template[templateIndex] === '*') {\n\t\t\ttemplateIndex++;\n\t\t}\n\n\t\treturn templateIndex === template.length;\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names,\n\t\t\t...createDebug.skips.map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tfor (const skip of createDebug.skips) {\n\t\t\tif (matchesTemplate(name, skip)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (const ns of createDebug.names) {\n\t\t\tif (matchesTemplate(name, ns)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n","/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\tlet m;\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\t// eslint-disable-next-line no-return-assign\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)) && parseInt(m[1], 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG') ;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n"],"x_google_ignoreList":[1,2,3],"mappings":";;;;;;;;;;;;;;;;;;;;IACI,IAAI,OAAO;AACf,SAAS,EAAE,GAAG;CACb,OAAO,OAAO,KAAK,YAAY,CAAC,CAAC;AAClC;AACA,SAAS,EAAE,GAAG;CACb,OAAO,MAAM,QAAQ,CAAC,IAAI,IAAI,OAAO,KAAK,WAAW,CAAC,CAAC,IAAI,EAAE,QAAQ,cAAc,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,OAAO,OAAO;AACpH;AACA,SAAS,EAAE,GAAG;CACb,QAAQ,MAAM,EAAE,GAAG,CAAC;AACrB;AACA,SAAS,EAAE,GAAG;CACb,QAAQ,MAAM,EAAE,CAAC,IAAI,OAAO,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,OAAO,EAAE,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC;AACzE;AACA,SAAS,EAAE,GAAG;CACb,OAAO,OAAO,KAAK,aAAa,IAAI,OAAO,KAAK,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,MAAM,MAAM;AACzF;AACA,SAAS,EAAE,GAAG,GAAG,GAAG;CACnB,OAAO,OAAO,OAAO,GAAG,GAAG,EAAE,OAAO,OAAO,CAAC;AAC7C;AAUA,SAAS,EAAE,GAAG;CACb,IAAI,CAAC,EAAE,CAAC,GAAG,OAAO;CAClB,IAAI,aAAa,MAAM,OAAO,IAAI,KAAK,EAAE,QAAQ,CAAC;CAClD,IAAI,MAAM,QAAQ,CAAC,GAAG,OAAO,EAAE,KAAK,MAAM,EAAE,CAAC,CAAC;CAC9C,IAAI,IAAI,CAAC;CACT,KAAK,IAAI,CAAC,GAAG,MAAM,OAAO,QAAQ,CAAC,GAAG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,cAAc,CAAC;CAQtD,SAAS,EAAK,GAAY;EACzB,IAAI;GACH,AAAI,IACH,EAAQ,QAAQ,QAAQ,SAAS,CAAU,IAE3C,EAAQ,QAAQ,WAAW,OAAO;EAEpC,QAAgB,CAGhB;CACD;CAQA,SAAS,IAAO;EACf,IAAI;EACJ,IAAI;GACH,IAAI,EAAQ,QAAQ,QAAQ,OAAO,KAAK,EAAQ,QAAQ,QAAQ,OAAO;EACxE,QAAgB,CAGhB;EAOA,OAJI,CAAC,KAAK,OAAO,UAAY,OAAe,SAAS,YACpD,IAAI,QAAQ,IAAI,QAGV;CACR;CAaA,SAAS,IAAe;EACvB,IAAI;GAGH,OAAO;EACR,QAAgB,CAGhB;CACD;CAEA,EAAO,UAAA,EAAA,CAAA,CAA8B,CAAO;CAE5C,IAAM,EAAC,kBAAc,EAAO;CAM5B,EAAW,IAAI,SAAU,GAAG;EAC3B,IAAI;GACH,OAAO,KAAK,UAAU,CAAC;EACxB,SAAS,GAAO;GACf,OAAO,iCAAiC,EAAM;EAC/C;CACD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as e, h as t, k as n, l as r, m as i, n as a, r as o, s, t as c, u as l } from "../browser-
|
|
2
|
-
import { t as u } from "../dist-
|
|
1
|
+
import { a as e, h as t, k as n, l as r, m as i, n as a, r as o, s, t as c, u as l } from "../browser-Bd36Xf5z.js";
|
|
2
|
+
import { t as u } from "../dist-DiGNNRzu.js";
|
|
3
3
|
//#region ../../../node_modules/.bun/js-combinatorics@2.1.2/node_modules/js-combinatorics/combinatorics.js
|
|
4
4
|
function d(e, t) {
|
|
5
5
|
if (e < 0) throw RangeError(`${e} is out of range`);
|
|
@@ -98,7 +98,7 @@ var T = Object.defineProperty, E = /* @__PURE__ */ ((e, t) => {
|
|
|
98
98
|
return t || T(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
99
99
|
})({ enabled: () => D });
|
|
100
100
|
function D(e, t, n) {
|
|
101
|
-
return e?.partialScoring === !1 || t?.partialScoring === !1 ? !1 : typeof n
|
|
101
|
+
return e?.partialScoring === !1 || t?.partialScoring === !1 ? !1 : typeof n != "boolean" || n;
|
|
102
102
|
}
|
|
103
103
|
//#endregion
|
|
104
104
|
//#region src/controller/defaults.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../../node_modules/.bun/js-combinatorics@2.1.2/node_modules/js-combinatorics/combinatorics.js","../../../src/controller/scoring.ts","../../../../../shared/feedback/dist/index.js","../../../../../shared/controller-utils/dist/index.js","../../../src/controller/defaults.ts","../../../src/controller/index.ts"],"sourcesContent":["/**\n * combinatorics.js\n *\n * Licensed under the MIT license.\n * http://www.opensource.org/licenses/mit-license.php\n *\n * @author: Dan Kogai <dankogai+github@gmail.com>\n *\n * References:\n * @link: http://www.ruby-doc.org/core-2.0/Array.html#method-i-combination\n * @link: http://www.ruby-doc.org/core-2.0/Array.html#method-i-permutation\n * @link: http://en.wikipedia.org/wiki/Factorial_number_system\n * @link: https://en.wikipedia.org/wiki/Combinatorial_number_system\n */\nexport const version = '2.1.2';\n/**\n * calculates `P(n, k)`.\n *\n * @link https://en.wikipedia.org/wiki/Permutation\n */\nexport function permutation(n, k) {\n if (n < 0)\n throw new RangeError(`${n} is out of range`);\n if (k < 0)\n throw new RangeError(`${k} is out of range`);\n if (0 == k)\n return 1n;\n if (n < k)\n return 0n;\n let [bn, bk, bp] = [BigInt(n), BigInt(k), 1n];\n while (bk--)\n bp *= bn--;\n return bp;\n}\n/**\n * calculates `C(n, k)`.\n *\n * @link https://en.wikipedia.org/wiki/Combination\n */\nexport function combination(n, k) {\n if (0 == k)\n return 1n;\n if (n == k)\n return 1n;\n if (n < k)\n return 0n;\n return permutation(n, k) / permutation(k, k);\n}\n/**\n * calculates `n!` === `P(n, n)`.\n *\n * @link https://en.wikipedia.org/wiki/Factorial\n */\nexport function factorial(n) {\n return permutation(n, n);\n}\n/**\n * returns the factoradic representation of `n`, least significant order.\n *\n * @link https://en.wikipedia.org/wiki/Factorial_number_system\n * @param {number} l the number of digits\n */\nexport function factoradic(n, l = 0) {\n if (n < 0)\n throw new RangeError(`${n} is out of range`);\n let [bn, bf] = [BigInt(n), 1n];\n if (!l) {\n for (l = 1; bf < bn; bf *= BigInt(++l))\n ;\n if (bn < bf)\n bf /= BigInt(l--);\n }\n else {\n bf = BigInt(factorial(l));\n }\n let digits = [0];\n for (; l; bf /= BigInt(l--)) {\n digits[l] = Number(bn / bf);\n bn %= bf;\n }\n return digits;\n}\n/**\n * `combinadic(n, k)` returns a function\n * that takes `m` as an argument and\n * returns the combinadics representation of `m` for `n C k`.\n *\n * @link https://en.wikipedia.org/wiki/Combinatorial_number_system\n */\nexport function combinadic(n, k) {\n const count = combination(n, k);\n const [bn, bk] = [BigInt(n), BigInt(k)];\n return (m) => {\n if (m < 0 || count <= m)\n throw new RangeError(`${m} is out of range`);\n let digits = [];\n let [ba, bb] = [bn, bk];\n let x = BigInt(count) - 1n - BigInt(m);\n for (let i = 0; i < k; i++) {\n ba--;\n while (x < combination(ba, bb))\n ba--;\n digits.push(Number(bn - 1n - ba));\n x -= combination(ba, bb);\n bb--;\n }\n return digits;\n };\n}\n/**\n *\n */\nconst _crypto = typeof crypto !== 'undefined' ? crypto : {};\nconst _randomBytes = typeof _crypto['randomBytes'] === 'function'\n ? (len) => Uint8Array.from(_crypto['randomBytes'](len))\n : typeof _crypto['getRandomValues'] === 'function'\n ? (len) => _crypto['getRandomValues'](new Uint8Array(len))\n : (len) => Uint8Array.from(Array(len), () => Math.random() * 256);\n/**\n * returns random integer `n` where `min` <= `n` < `max`:\n *\n * if the argument is `BigInt` the result is also `BigInt`.\n *\n * @param {anyint} min\n * @param {anyint} max\n */\nexport function randomInteger(min = 0, max = Math.pow(2, 53)) {\n let ctor = min.constructor;\n if (arguments.length === 0) {\n return Math.floor(Math.random() * ctor(max));\n }\n if (arguments.length == 1) {\n [min, max] = [ctor(0), min];\n }\n if (typeof min == 'number') { // number\n [min, max] = [Math.ceil(Number(min)), Math.ceil(Number(max))];\n return Math.floor(Math.random() * (max - min)) + min;\n }\n const mag = ctor(max) - ctor(min);\n const len = mag.toString(16).length;\n const u8s = _randomBytes(len);\n const rnd = u8s.reduce((a, v) => ((a << ctor(8)) + ctor(v)), ctor(0));\n return ((ctor(rnd) * mag) >> ctor(len * 8)) + ctor(min);\n}\n;\n/**\n * Base Class of `js-combinatorics`\n */\nclass _CBase {\n /**\n * does `new`\n * @param args\n */\n static of(...args) {\n return new (Function.prototype.bind.apply(this, [null].concat(args)));\n }\n /**\n * Same as `of` but takes a single array `arg`\n *\n * cf. https://stackoverflow.com/questions/1606797/use-of-apply-with-new-operator-is-this-possible\n */\n static from(arg) {\n return new (Function.prototype.bind.apply(this, [null].concat(arg)));\n }\n /**\n * Common iterator\n */\n [Symbol.iterator]() {\n return function* (it, len) {\n for (let i = 0n; i < len; i++)\n yield it.at(i);\n }(this, this.length);\n }\n /**\n * returns `[...this]`.\n */\n toArray() {\n return [...this];\n }\n /**\n * @deprecated\n * tells wether you need `BigInt` to access all elements.\n */\n get isBig() {\n return Number.MAX_SAFE_INTEGER < this.length;\n }\n /**\n * @deprecated\n * tells wether it is safe to work on this instance.\n *\n * * always `true` unless your platform does not support `BigInt`.\n * * if not, `true` iff `.isBig` is `false`.\n */\n get isSafe() {\n return typeof BigInt !== 'undefined' || !this.isBig;\n }\n /**\n * check n for nth\n */\n _check(n) {\n if (n < 0) {\n if (this.length < -n)\n throw new RangeError(`${n} is out of range`);\n return BigInt(this.length) + BigInt(n);\n }\n if (this.length <= n)\n throw new RangeError(`${n} is out of range`);\n return n;\n }\n /**\n * get the `n`th element of the iterator.\n * negative `n` goes backwards\n * like `Array.prototype.at()`\n * @link: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at\n */\n at(n) { return undefined; }\n /**\n * an alias of `at`\n */\n nth(n) { return this.at(n); }\n /**\n * the seed iterable\n */\n seed;\n /**\n * the size (# of elements) of each element.\n */\n size;\n /**\n * the number of elements\n */\n length;\n /**\n * pick random element\n */\n sample() {\n return this.at(randomInteger(this.length));\n }\n /**\n * an infinite steam of random elements\n */\n samples() {\n return function* (it) {\n while (true)\n yield it.sample();\n }(this);\n }\n}\n/**\n * Permutation\n */\nexport class Permutation extends _CBase {\n constructor(seed, size = 0) {\n super();\n this.seed = [...seed];\n this.size = 0 < size ? size : this.seed.length;\n this.length = permutation(this.seed.length, this.size);\n Object.freeze(this);\n }\n at(n) {\n n = this._check(n);\n if (n === undefined)\n return undefined;\n const offset = this.seed.length - this.size;\n const skip = factorial(offset);\n let digits = factoradic(BigInt(n) * BigInt(skip), this.seed.length);\n let source = this.seed.slice();\n let result = [];\n for (let i = this.seed.length - 1; offset <= i; i--) {\n result.push(source.splice(digits[i], 1)[0]);\n }\n return result;\n }\n}\n/**\n * Combination\n */\nexport class Combination extends _CBase {\n comb;\n constructor(seed, size = 0) {\n super();\n this.seed = [...seed];\n this.size = 0 < size ? size : this.seed.length;\n this.size = size;\n this.length = combination(this.seed.length, this.size);\n this.comb = combinadic(this.seed.length, this.size);\n Object.freeze(this);\n }\n /**\n * returns an iterator which is more efficient\n * than the default iterator that uses .nth\n *\n * @link https://en.wikipedia.org/wiki/Combinatorial_number_system#Applications\n */\n bitwiseIterator() {\n // [Symbol.iterator]() {\n // console.log('overriding _CBase');\n const inc = (x) => {\n if (x <= 0n)\n return 0n;\n const u = x & -x;\n const v = u + x;\n return v + (((v ^ x) / u) >> 2n);\n };\n let x = (1n << BigInt(this.size)) - 1n; // 0b11...1\n return function* (it, len) {\n for (let i = 0n; i < BigInt(len); i++, x = inc(x)) {\n let result = [];\n for (let y = x, j = 0; 0n < y; y >>= 1n, j++) {\n if (y & 1n)\n result.push(it.seed[j]);\n }\n // console.log(`x = ${x}`);\n yield result;\n }\n }(this, this.length);\n }\n at(n) {\n n = this._check(n);\n if (n === undefined)\n return undefined;\n let result = [];\n for (let i of this.comb(n)) {\n result.push(this.seed[i]);\n }\n return result;\n }\n}\n/**\n * Base N\n */\nexport class BaseN extends _CBase {\n base;\n constructor(seed, size = 1) {\n if (size < 1)\n throw new RangeError(`${size} is out of range`);\n super();\n this.seed = [...seed];\n this.size = size;\n let base = this.seed.length;\n this.base = base;\n this.length = BigInt(base) ** BigInt(size);\n Object.freeze(this);\n }\n at(n) {\n n = this._check(n);\n if (n === undefined)\n return undefined;\n let bn = BigInt(n);\n const bb = BigInt(this.base);\n let result = [];\n for (let i = 0; i < this.size; i++) {\n let bd = bn % bb;\n result.push(this.seed[Number(bd)]);\n bn -= bd;\n bn /= bb;\n }\n return result;\n }\n}\n/**\n * Power Set\n */\nexport class PowerSet extends _CBase {\n constructor(seed) {\n super();\n this.seed = [...seed];\n const length = 1n << BigInt(this.seed.length);\n this.length = length;\n Object.freeze(this);\n }\n at(n) {\n n = this._check(n);\n if (n === undefined)\n return undefined;\n let bn = BigInt(n);\n let result = [];\n for (let bi = 0n; bn; bn >>= 1n, bi++)\n if (bn & 1n)\n result.push(this.seed[Number(bi)]);\n return result;\n }\n}\n/**\n * Cartesian Product\n */\nexport class CartesianProduct extends _CBase {\n constructor(...args) {\n super();\n this.seed = args.map(v => [...v]);\n this.size = this.seed.length;\n const length = this.seed.reduce((a, v) => a * BigInt(v.length), 1n);\n this.length = length;\n Object.freeze(this);\n }\n at(n) {\n n = this._check(n);\n if (n === undefined)\n return undefined;\n let bn = BigInt(n);\n let result = [];\n for (let i = 0; i < this.size; i++) {\n const base = this.seed[i].length;\n const bb = BigInt(base);\n const bd = bn % bb;\n result.push(this.seed[i][Number(bd)]);\n bn -= bd;\n bn /= bb;\n }\n return result;\n }\n}\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/placement-ordering/controller/src/scoring.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport { differenceWith, isEqual, uniq } from '@pie-element/shared-lodash';\nimport { combination } from 'js-combinatorics';\nimport debug from 'debug';\n\nconst log = debug('pie-elements:placement-ordering:controller');\n\nexport const illegalArgumentError = (answer) =>\n new Error(`Cant score answer: ${answer} it has duplicates and allowDuplicates is false`);\nexport const pairwiseCombinationScore = (correct, answer, opts) => {\n opts = { allowDuplicates: false, orderMustBeComplete: false, ...opts };\n\n if (!opts.allowDuplicates && !isEqual(uniq(correct), correct)) {\n throw illegalArgumentError(answer);\n }\n\n if (opts.allowDuplicates === false && answer.length !== uniq(answer).length) {\n return 0;\n }\n\n answer = opts.allowDuplicates !== false ? answer : uniq(answer);\n\n log('answer:', answer);\n if (!Array.isArray(correct) || correct.length === 0) {\n throw new Error('correct must be non empty an array');\n }\n\n if (correct.length === 1) {\n return isEqual(correct, answer) ? 1 : 0;\n }\n\n if (!Array.isArray(answer) || answer.length < 2) {\n return 0;\n }\n\n if (answer.length > correct.length) {\n return 0;\n }\n\n if (correct.length !== answer.length && opts.orderMustBeComplete) {\n return 0;\n }\n\n const correctCombo = combination(correct, 2).toArray();\n const answerCombo = combination(answer, 2).toArray();\n\n const diff = differenceWith(answerCombo, correctCombo, isEqual);\n\n const comboLengthDiff = correctCombo.length - answerCombo.length;\n\n const total = correctCombo.length;\n const actual = total - diff.length - comboLengthDiff;\n\n const n = (actual / total).toFixed(2);\n\n return parseFloat(n);\n};\n\n/**\n * Flattens the correctResponse into an array of ordered identifiers representing the\n * correct response.\n */\nexport const flattenCorrect = (question) =>\n question.correctResponse ? question.correctResponse.map((r) => (r && r.id ? r.id : r)) : [];\n\n/**\n * Returns all correct responses for this question\n * @param question - array\n */\nexport const getAllCorrectResponses = (question) => {\n const alternates = (question.alternateResponses || [])\n .map((alternate) => {\n if (Array.isArray(alternate)) {\n return alternate;\n }\n\n return alternate.response;\n })\n .filter((item) => item !== undefined);\n\n return [flattenCorrect(question), ...alternates];\n};\n\n/**\n * Returns the score for a session. If weighted scoring is present in the correctResponse\n * field for the question, this will be used. If partial scoring is present in the question\n * model, this will be used. Otherwise the default scoring mechanism (0 for any incorrect, 1\n * for all correct) will be used.\n */\n\nexport const score = (question, session) => {\n const { value } = session || {};\n\n if (!value) {\n return 0;\n }\n\n const allCorrectResponse = getAllCorrectResponses(question);\n const allowDuplicates = (question.configure && question.configure.removeTilesAfterPlacing) !== false;\n\n /**\n * We require this to be the case - locking\n */\n //const orderMustBeComplete = true;\n\n let bestScore = 0;\n\n allCorrectResponse.forEach((cr) => {\n const currentScore = pairwiseCombinationScore(cr, value, {\n allowDuplicates,\n });\n\n if (currentScore >= bestScore) {\n bestScore = currentScore;\n }\n });\n\n return bestScore;\n};\n","//#region src/defaults.ts\nvar e = {\n\tcorrect: {\n\t\ttype: \"default\",\n\t\tdefault: \"Correct\",\n\t\tcustom: \"Correct\"\n\t},\n\tincorrect: {\n\t\ttype: \"default\",\n\t\tdefault: \"Incorrect\",\n\t\tcustom: \"Incorrect\"\n\t},\n\tpartial: {\n\t\ttype: \"default\",\n\t\tdefault: \"Nearly\",\n\t\tcustom: \"Nearly\"\n\t},\n\tunanswered: {\n\t\ttype: \"default\",\n\t\tdefault: \"You have not entered a response\",\n\t\tcustom: \"You have not entered a response\"\n\t}\n};\n//#endregion\n//#region src/utils.ts\nfunction t(e) {\n\treturn e === \"partially-correct\" ? \"partial\" : e;\n}\n//#endregion\n//#region src/index.ts\nfunction n(n, i = {}) {\n\treturn new Promise((a) => {\n\t\tlet o = {\n\t\t\t...e,\n\t\t\t...i\n\t\t}, s = t(n), c = o[s], l = e[s];\n\t\tr(c, l[c.type]).then(a);\n\t});\n}\nfunction r(e, t) {\n\treturn new Promise((n) => {\n\t\tif (!e || e.type === \"none\") {\n\t\t\tn(void 0);\n\t\t\treturn;\n\t\t}\n\t\tn(e[e.type] || t);\n\t});\n}\nfunction i(n, r = {}) {\n\tlet i = {\n\t\t...e,\n\t\t...r\n\t}, o = t(n), s = i[o], c = e[o];\n\treturn a(s, c[s.type]);\n}\nfunction a(e, t) {\n\tif (!(!e || e.type === \"none\")) return e[e.type] || t;\n}\n//#endregion\nexport { e as defaultFeedback, a as getActualFeedback, i as getActualFeedbackForCorrectness, r as getFeedback, n as getFeedbackForCorrectness, t as normalizeCorrectness };\n","//#region \\0rolldown/runtime.js\nvar e = Object.defineProperty, t = (t, n) => {\n\tlet r = {};\n\tfor (var i in t) e(r, i, {\n\t\tget: t[i],\n\t\tenumerable: !0\n\t});\n\treturn n || e(r, Symbol.toStringTag, { value: \"Module\" }), r;\n};\n//#endregion\n//#region src/persistence.ts\nfunction n(e) {\n\treturn Array.isArray(e) ? e.filter((e) => e != null) : [];\n}\nfunction r(e) {\n\tlet t = [...e];\n\tfor (let e = t.length - 1; e > 0; e--) {\n\t\tlet n = Math.floor(Math.random() * (e + 1));\n\t\t[t[e], t[n]] = [t[n], t[e]];\n\t}\n\treturn t;\n}\nfunction i(e) {\n\treturn e == null ? !0 : Array.isArray(e) ? e.length === 0 : typeof e == \"object\" ? Object.keys(e).length === 0 : !1;\n}\nasync function a(e, t, a, o = \"value\") {\n\tlet s = n(t?.data?.shuffledValues ?? t?.shuffledValues ?? []);\n\tif (!t) {\n\t\tconsole.warn(\"Unable to save shuffled choices because there's no session.\");\n\t\treturn;\n\t}\n\tif (!i(s)) return n(s.map((t) => e.find((e) => e[o] === t)));\n\tlet c = r(e);\n\tif (a && typeof a == \"function\") try {\n\t\tlet e = n(c.map((e) => e[o]));\n\t\ti(e) ? console.error(`shuffledValues is an empty array - refusing to call updateSession. shuffledChoices: ${JSON.stringify(c)}, key: ${o}`) : t.id && t.element && await a(t.id, t.element, { shuffledValues: e });\n\t} catch (e) {\n\t\tconsole.warn(\"Unable to save shuffled order for choices\"), console.error(e);\n\t}\n\telse console.warn(\"Unable to save shuffled choices, shuffle will happen every time.\");\n\treturn c;\n}\nfunction o(e, t, n) {\n\treturn !!(e.lockChoiceOrder || n[\"@pie-element\"]?.lockChoiceOrder || (n.role ?? \"student\") === \"instructor\");\n}\n//#endregion\n//#region src/partial-scoring.ts\nvar s = /* @__PURE__ */ t({ enabled: () => c });\nfunction c(e, t, n) {\n\treturn e?.partialScoring === !1 || t?.partialScoring === !1 ? !1 : typeof n == \"boolean\" ? n : !0;\n}\n//#endregion\nexport { a as getShuffledChoices, o as lockChoices, s as partialScoring };\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/placement-ordering/controller/src/defaults.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nexport default {\n choiceLabel: '',\n choiceLabelEnabled: true,\n choices: [],\n correctResponse: [],\n feedbackEnabled: false,\n numberedGuides: false,\n orientation: 'vertical',\n partialScoring: true,\n placementArea: false,\n prompt: '',\n promptEnabled: true,\n rationale: '',\n rationaleEnabled: true,\n removeTilesAfterPlacing: true,\n scoringType: 'auto',\n studentInstructionsEnabled: true,\n targetLabel: '',\n teacherInstructions: '',\n teacherInstructionsEnabled: true,\n toolbarEditorPosition: 'bottom',\n};\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/placement-ordering/controller/src/index.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport { flattenCorrect, getAllCorrectResponses, score } from './scoring.js';\n\nimport { every, isArray, isEmpty, isEqual, map, reduce } from '@pie-element/shared-lodash';\nimport { getFeedbackForCorrectness } from '@pie-element/shared-feedback';\nimport { partialScoring } from '@pie-element/shared-controller-utils';\nimport debug from 'debug';\n\nimport defaults from './defaults.js';\n\nconst log = debug('@pie-element:placement-ordering:controller');\nimport Translator from '@pie-lib/translator';\n\nconst { translator } = Translator;\n\nexport const questionError = () => new Error('Question is missing required array: correctResponse');\n\n/**\n * Generates detailed trace log for placement-ordering scoring evaluation\n * @param {Object} question - the question model\n * @param {Object} session - the student session\n * @param {Object} env - the environment\n * @returns {Array<string>} traceLog\n */\nexport const getLogTrace = (question, session, env) => {\n const traceLog = [];\n\n const value = session?.value || [];\n const correctResponse = question?.correctResponse || [];\n const hasPlacementArea = question?.placementArea === true;\n\n if (!value.length) {\n if (hasPlacementArea) {\n traceLog.push('Student did not place any tiles in the target area.');\n } else {\n traceLog.push('Student did not reorder any tiles.');\n }\n traceLog.push('Final score: 0.');\n return traceLog;\n }\n\n const allCorrectResponses = getAllCorrectResponses(question);\n\n let bestMatch = { score: 0, response: [] };\n\n allCorrectResponses.forEach((cr) => {\n let matchCount = 0;\n value.forEach((v, idx) => {\n if (cr[idx] === v) {\n matchCount++;\n }\n });\n\n if (matchCount > bestMatch.score) {\n bestMatch = { score: matchCount, response: cr };\n }\n });\n\n const correctCount = bestMatch.score;\n const incorrectCount = value.length - correctCount;\n\n if (correctCount > 0) {\n traceLog.push(`${correctCount} tile(s) placed in the correct order.`);\n }\n\n if (incorrectCount > 0) {\n traceLog.push(`${incorrectCount} tile(s) placed in an incorrect order.`);\n }\n\n const isFullyCorrect = allCorrectResponses.some((cr) => isEqual(cr, value));\n\n const partialScoringEnabled = partialScoring.enabled(question, env || {});\n\n if (partialScoringEnabled) {\n traceLog.push('Score calculated using partial scoring.');\n traceLog.push(\n 'Each tile placed in the correct position contributes to the score.',\n );\n } else {\n traceLog.push('Score calculated using all-or-nothing scoring.');\n if (hasPlacementArea) {\n traceLog.push(\n 'Student must place all tiles in the correct positions within the target area to receive full credit.',\n );\n } else {\n traceLog.push(\n 'Student must arrange all tiles in the correct order to receive full credit.',\n );\n }\n }\n\n const rawScore = score(question, session);\n const finalScore = partialScoringEnabled ? rawScore : rawScore === 1 ? 1 : 0;\n\n traceLog.push(`Final score: ${finalScore}.`);\n\n return traceLog;\n};\n\nexport function outcome(question, session, env) {\n return new Promise((resolve, reject) => {\n if (!session || isEmpty(session)) {\n resolve({ \n score: 0, \n empty: true, \n logTrace: ['Student did not interact with the placement-ordering item.'] \n });\n return;\n }\n\n if (!question || !question.correctResponse || isEmpty(question.correctResponse)) {\n reject(questionError());\n } else {\n try {\n const s = score(question, session);\n const finalScore = partialScoring.enabled(question, env || {}) ? s : s === 1 ? 1 : 0;\n resolve({\n score: finalScore,\n logTrace: getLogTrace(question, session, env)\n });\n } catch (e) {\n reject(e);\n }\n }\n });\n}\n\nexport function createDefaultModel(model = {}) {\n return new Promise((resolve) => {\n resolve({\n ...defaults,\n ...model,\n });\n });\n}\n\nexport const normalize = (question) => ({\n ...defaults,\n rationaleEnabled: true,\n feedbackEnabled: false,\n promptEnabled: true,\n teacherInstructionsEnabled: true,\n studentInstructionsEnabled: true,\n ...question,\n});\n\n/**\n *\n * @param {*} question\n * @param {*} session\n * @param {*} env\n */\nexport async function model(question, session, env) {\n const normalizedQuestion = normalize(question);\n const base = {};\n\n if (question.alternateResponses && every(question.alternateResponses, isArray)) {\n log('Deprecated structure of alternateResponses is in use');\n // eslint-disable-next-line no-console\n console.error('Deprecated structure of alternateResponses is in use');\n }\n\n base.env = env;\n base.extraCSSRules = normalizedQuestion.extraCSSRules;\n base.outcomes = [];\n base.completeLength = (normalizedQuestion.correctResponse || []).length;\n base.choices = (normalizedQuestion.choices || []).filter((choice) => choice.label);\n base.note = normalizedQuestion.note;\n base.showNote = normalizedQuestion.alternateResponses && normalizedQuestion.alternateResponses.length > 0;\n base.language = normalizedQuestion.language;\n\n log('[model] removing tileSize for the moment.');\n\n base.prompt = normalizedQuestion.promptEnabled ? normalizedQuestion.prompt : null;\n base.config = {\n orientation: normalizedQuestion.orientation || 'vertical',\n includeTargets: normalizedQuestion.placementArea,\n choiceLabelEnabled: normalizedQuestion.choiceLabelEnabled,\n targetLabel: normalizedQuestion.targetLabel,\n choiceLabel: normalizedQuestion.choiceLabel,\n showOrdering: normalizedQuestion.numberedGuides,\n allowSameChoiceInTargets: !normalizedQuestion.removeTilesAfterPlacing,\n };\n\n base.disabled = env.mode !== 'gather';\n\n if (!base.note) {\n base.note = translator.t('common:commonCorrectAnswerWithAlternates', { lng: normalizedQuestion.language });\n }\n\n if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {\n base.rationale = normalizedQuestion.rationaleEnabled ? normalizedQuestion.rationale : null;\n base.teacherInstructions = normalizedQuestion.teacherInstructionsEnabled\n ? normalizedQuestion.teacherInstructions\n : null;\n } else {\n base.rationale = null;\n base.teacherInstructions = null;\n }\n\n if (env.mode === 'evaluate') {\n const value = (session && session.value) || [];\n const allCorrectResponses = getAllCorrectResponses(normalizedQuestion);\n\n const bestSetOfResponses = allCorrectResponses.reduce(\n (info, cr) => {\n const currentScore = reduce(value, (acc, c, idx) => acc + (Array.isArray(cr) && cr[idx] === c ? 1 : 0), 0);\n\n if (currentScore > info.score) {\n return {\n arr: cr,\n score: currentScore,\n };\n }\n\n return info;\n },\n { arr: [], score: 0 },\n );\n\n base.outcomes = map(value, (c, idx) => {\n return {\n id: c,\n outcome: bestSetOfResponses.arr[idx] === c ? 'correct' : 'incorrect',\n };\n });\n\n const isResponseCorrect = allCorrectResponses.some((response) => isEqual(response, value));\n const responseScore = score(question, session);\n const isCorrect = responseScore === 1;\n const isPartialCorrect = !isCorrect && partialScoring.enabled(normalizedQuestion, env || {}) && responseScore !== 0;\n\n base.correctness = isCorrect ? 'correct' : isPartialCorrect ? 'partial' : 'incorrect';\n\n if (!isResponseCorrect) {\n base.correctResponse = flattenCorrect(normalizedQuestion);\n }\n\n // requirement made in PD-2182\n if (!normalizedQuestion.feedback) {\n normalizedQuestion.feedbackEnabled = false;\n }\n\n const feedback = normalizedQuestion.feedbackEnabled\n ? await getFeedbackForCorrectness(base.correctness, normalizedQuestion.feedback)\n : undefined;\n\n base.feedback = feedback;\n return base;\n } else {\n return base;\n }\n}\n\nexport const createCorrectResponseSession = (question, env) => {\n return new Promise((resolve) => {\n if (env.mode !== 'evaluate' && env.role === 'instructor') {\n resolve({\n id: '1',\n value: flattenCorrect(question),\n });\n } else {\n resolve(null);\n }\n });\n};\n\n// remove all html tags\nconst getInnerText = (html) => (html || '').replaceAll(/<[^>]*>/g, '');\n\n// remove all html tags except img, iframe and source tag for audio\nconst getContent = (html) => (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');\n\nexport const validate = (model = {}, config = {}) => {\n const { choices, correctResponse } = model;\n const errors = {};\n\n ['teacherInstructions', 'prompt', 'rationale'].forEach((field) => {\n if (config[field]?.required && !getContent(model[field])) {\n errors[field] = 'This field is required.';\n }\n });\n\n const reversedChoices = [...(choices || [])].reverse();\n const choicesErrors = {};\n\n reversedChoices.forEach((choice, index) => {\n const { id, label } = choice;\n\n if (!getContent(label)) {\n choicesErrors[id] = 'Content should not be empty.';\n } else {\n const identicalAnswer = reversedChoices.slice(index + 1).some((c) => c.label === label);\n\n if (identicalAnswer) {\n choicesErrors[id] = 'Content should be unique.';\n }\n }\n });\n\n const choicesIds = (choices || []).map((choice) => choice.id);\n const correctResponseIds = (correctResponse || []).map((response) => response.id || response);\n\n if (isEqual(choicesIds, correctResponseIds)) {\n errors.orderError = 'The correct ordering should not be identical to the initial ordering.';\n }\n\n if (!isEmpty(choicesErrors)) {\n errors.choicesErrors = choicesErrors;\n }\n\n return errors;\n};\n"],"x_google_ignoreList":[0],"mappings":";;;AAoBA,SAAgB,EAAY,GAAG,GAAG;CAC9B,IAAI,IAAI,GACJ,MAAU,WAAW,GAAG,EAAE,iBAAiB;CAC/C,IAAI,IAAI,GACJ,MAAU,WAAW,GAAG,EAAE,iBAAiB;CAC/C,IAAS,KAAL,GACA,OAAO;CACX,IAAI,IAAI,GACJ,OAAO;CACX,IAAI,CAAC,GAAI,GAAI,KAAM;EAAC,OAAO,CAAC;EAAG,OAAO,CAAC;EAAG;CAAE;CAC5C,OAAO,MACH,KAAM;CACV,OAAO;AACX;AAMA,SAAgB,EAAY,GAAG,GAAG;CAO9B,OANS,KAAL,KAEA,KAAK,IACE,KACP,IAAI,IACG,KACJ,EAAY,GAAG,CAAC,IAAI,EAAY,GAAG,CAAC;AAC/C;AAiEA,IAAM,IAAU,OAAO,SAAW,MAAc,SAAS,CAAC;AACrC,OAAO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W,EAAE,SAAS,MAAU;EAChE,AAAI,EAAO,IAAQ,YAAY,CAAC,EAAW,EAAM,EAAM,MACrD,EAAO,KAAS;CAEpB,CAAC;CAED,IAAM,IAAkB,CAAC,GAAI,KAAW,CAAC,CAAE,EAAE,QAAQ,GAC/C,IAAgB,CAAC;CA2BvB,OAzBA,EAAgB,SAAS,GAAQ,MAAU;EACzC,IAAM,EAAE,OAAI,aAAU;EAEtB,AAAK,EAAW,CAAK,IAGK,EAAgB,MAAM,IAAQ,CAAC,EAAE,MAAM,MAAM,EAAE,UAAU,CAE7E,MACF,EAAc,KAAM,+BALtB,EAAc,KAAM;CAQxB,CAAC,GAKG,GAHgB,KAAW,CAAC,GAAG,KAAK,MAAW,EAAO,EAG9C,IAFgB,KAAmB,CAAC,GAAG,KAAK,MAAa,EAAS,MAAM,CAE5D,CAAkB,MACxC,EAAO,aAAa,0EAGjB,EAAQ,CAAa,MACxB,EAAO,gBAAgB,IAGlB;AACT"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../../node_modules/.bun/js-combinatorics@2.1.2/node_modules/js-combinatorics/combinatorics.js","../../../src/controller/scoring.ts","../../../../../shared/feedback/dist/index.js","../../../../../shared/controller-utils/dist/index.js","../../../src/controller/defaults.ts","../../../src/controller/index.ts"],"sourcesContent":["/**\n * combinatorics.js\n *\n * Licensed under the MIT license.\n * http://www.opensource.org/licenses/mit-license.php\n *\n * @author: Dan Kogai <dankogai+github@gmail.com>\n *\n * References:\n * @link: http://www.ruby-doc.org/core-2.0/Array.html#method-i-combination\n * @link: http://www.ruby-doc.org/core-2.0/Array.html#method-i-permutation\n * @link: http://en.wikipedia.org/wiki/Factorial_number_system\n * @link: https://en.wikipedia.org/wiki/Combinatorial_number_system\n */\nexport const version = '2.1.2';\n/**\n * calculates `P(n, k)`.\n *\n * @link https://en.wikipedia.org/wiki/Permutation\n */\nexport function permutation(n, k) {\n if (n < 0)\n throw new RangeError(`${n} is out of range`);\n if (k < 0)\n throw new RangeError(`${k} is out of range`);\n if (0 == k)\n return 1n;\n if (n < k)\n return 0n;\n let [bn, bk, bp] = [BigInt(n), BigInt(k), 1n];\n while (bk--)\n bp *= bn--;\n return bp;\n}\n/**\n * calculates `C(n, k)`.\n *\n * @link https://en.wikipedia.org/wiki/Combination\n */\nexport function combination(n, k) {\n if (0 == k)\n return 1n;\n if (n == k)\n return 1n;\n if (n < k)\n return 0n;\n return permutation(n, k) / permutation(k, k);\n}\n/**\n * calculates `n!` === `P(n, n)`.\n *\n * @link https://en.wikipedia.org/wiki/Factorial\n */\nexport function factorial(n) {\n return permutation(n, n);\n}\n/**\n * returns the factoradic representation of `n`, least significant order.\n *\n * @link https://en.wikipedia.org/wiki/Factorial_number_system\n * @param {number} l the number of digits\n */\nexport function factoradic(n, l = 0) {\n if (n < 0)\n throw new RangeError(`${n} is out of range`);\n let [bn, bf] = [BigInt(n), 1n];\n if (!l) {\n for (l = 1; bf < bn; bf *= BigInt(++l))\n ;\n if (bn < bf)\n bf /= BigInt(l--);\n }\n else {\n bf = BigInt(factorial(l));\n }\n let digits = [0];\n for (; l; bf /= BigInt(l--)) {\n digits[l] = Number(bn / bf);\n bn %= bf;\n }\n return digits;\n}\n/**\n * `combinadic(n, k)` returns a function\n * that takes `m` as an argument and\n * returns the combinadics representation of `m` for `n C k`.\n *\n * @link https://en.wikipedia.org/wiki/Combinatorial_number_system\n */\nexport function combinadic(n, k) {\n const count = combination(n, k);\n const [bn, bk] = [BigInt(n), BigInt(k)];\n return (m) => {\n if (m < 0 || count <= m)\n throw new RangeError(`${m} is out of range`);\n let digits = [];\n let [ba, bb] = [bn, bk];\n let x = BigInt(count) - 1n - BigInt(m);\n for (let i = 0; i < k; i++) {\n ba--;\n while (x < combination(ba, bb))\n ba--;\n digits.push(Number(bn - 1n - ba));\n x -= combination(ba, bb);\n bb--;\n }\n return digits;\n };\n}\n/**\n *\n */\nconst _crypto = typeof crypto !== 'undefined' ? crypto : {};\nconst _randomBytes = typeof _crypto['randomBytes'] === 'function'\n ? (len) => Uint8Array.from(_crypto['randomBytes'](len))\n : typeof _crypto['getRandomValues'] === 'function'\n ? (len) => _crypto['getRandomValues'](new Uint8Array(len))\n : (len) => Uint8Array.from(Array(len), () => Math.random() * 256);\n/**\n * returns random integer `n` where `min` <= `n` < `max`:\n *\n * if the argument is `BigInt` the result is also `BigInt`.\n *\n * @param {anyint} min\n * @param {anyint} max\n */\nexport function randomInteger(min = 0, max = Math.pow(2, 53)) {\n let ctor = min.constructor;\n if (arguments.length === 0) {\n return Math.floor(Math.random() * ctor(max));\n }\n if (arguments.length == 1) {\n [min, max] = [ctor(0), min];\n }\n if (typeof min == 'number') { // number\n [min, max] = [Math.ceil(Number(min)), Math.ceil(Number(max))];\n return Math.floor(Math.random() * (max - min)) + min;\n }\n const mag = ctor(max) - ctor(min);\n const len = mag.toString(16).length;\n const u8s = _randomBytes(len);\n const rnd = u8s.reduce((a, v) => ((a << ctor(8)) + ctor(v)), ctor(0));\n return ((ctor(rnd) * mag) >> ctor(len * 8)) + ctor(min);\n}\n;\n/**\n * Base Class of `js-combinatorics`\n */\nclass _CBase {\n /**\n * does `new`\n * @param args\n */\n static of(...args) {\n return new (Function.prototype.bind.apply(this, [null].concat(args)));\n }\n /**\n * Same as `of` but takes a single array `arg`\n *\n * cf. https://stackoverflow.com/questions/1606797/use-of-apply-with-new-operator-is-this-possible\n */\n static from(arg) {\n return new (Function.prototype.bind.apply(this, [null].concat(arg)));\n }\n /**\n * Common iterator\n */\n [Symbol.iterator]() {\n return function* (it, len) {\n for (let i = 0n; i < len; i++)\n yield it.at(i);\n }(this, this.length);\n }\n /**\n * returns `[...this]`.\n */\n toArray() {\n return [...this];\n }\n /**\n * @deprecated\n * tells wether you need `BigInt` to access all elements.\n */\n get isBig() {\n return Number.MAX_SAFE_INTEGER < this.length;\n }\n /**\n * @deprecated\n * tells wether it is safe to work on this instance.\n *\n * * always `true` unless your platform does not support `BigInt`.\n * * if not, `true` iff `.isBig` is `false`.\n */\n get isSafe() {\n return typeof BigInt !== 'undefined' || !this.isBig;\n }\n /**\n * check n for nth\n */\n _check(n) {\n if (n < 0) {\n if (this.length < -n)\n throw new RangeError(`${n} is out of range`);\n return BigInt(this.length) + BigInt(n);\n }\n if (this.length <= n)\n throw new RangeError(`${n} is out of range`);\n return n;\n }\n /**\n * get the `n`th element of the iterator.\n * negative `n` goes backwards\n * like `Array.prototype.at()`\n * @link: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at\n */\n at(n) { return undefined; }\n /**\n * an alias of `at`\n */\n nth(n) { return this.at(n); }\n /**\n * the seed iterable\n */\n seed;\n /**\n * the size (# of elements) of each element.\n */\n size;\n /**\n * the number of elements\n */\n length;\n /**\n * pick random element\n */\n sample() {\n return this.at(randomInteger(this.length));\n }\n /**\n * an infinite steam of random elements\n */\n samples() {\n return function* (it) {\n while (true)\n yield it.sample();\n }(this);\n }\n}\n/**\n * Permutation\n */\nexport class Permutation extends _CBase {\n constructor(seed, size = 0) {\n super();\n this.seed = [...seed];\n this.size = 0 < size ? size : this.seed.length;\n this.length = permutation(this.seed.length, this.size);\n Object.freeze(this);\n }\n at(n) {\n n = this._check(n);\n if (n === undefined)\n return undefined;\n const offset = this.seed.length - this.size;\n const skip = factorial(offset);\n let digits = factoradic(BigInt(n) * BigInt(skip), this.seed.length);\n let source = this.seed.slice();\n let result = [];\n for (let i = this.seed.length - 1; offset <= i; i--) {\n result.push(source.splice(digits[i], 1)[0]);\n }\n return result;\n }\n}\n/**\n * Combination\n */\nexport class Combination extends _CBase {\n comb;\n constructor(seed, size = 0) {\n super();\n this.seed = [...seed];\n this.size = 0 < size ? size : this.seed.length;\n this.size = size;\n this.length = combination(this.seed.length, this.size);\n this.comb = combinadic(this.seed.length, this.size);\n Object.freeze(this);\n }\n /**\n * returns an iterator which is more efficient\n * than the default iterator that uses .nth\n *\n * @link https://en.wikipedia.org/wiki/Combinatorial_number_system#Applications\n */\n bitwiseIterator() {\n // [Symbol.iterator]() {\n // console.log('overriding _CBase');\n const inc = (x) => {\n if (x <= 0n)\n return 0n;\n const u = x & -x;\n const v = u + x;\n return v + (((v ^ x) / u) >> 2n);\n };\n let x = (1n << BigInt(this.size)) - 1n; // 0b11...1\n return function* (it, len) {\n for (let i = 0n; i < BigInt(len); i++, x = inc(x)) {\n let result = [];\n for (let y = x, j = 0; 0n < y; y >>= 1n, j++) {\n if (y & 1n)\n result.push(it.seed[j]);\n }\n // console.log(`x = ${x}`);\n yield result;\n }\n }(this, this.length);\n }\n at(n) {\n n = this._check(n);\n if (n === undefined)\n return undefined;\n let result = [];\n for (let i of this.comb(n)) {\n result.push(this.seed[i]);\n }\n return result;\n }\n}\n/**\n * Base N\n */\nexport class BaseN extends _CBase {\n base;\n constructor(seed, size = 1) {\n if (size < 1)\n throw new RangeError(`${size} is out of range`);\n super();\n this.seed = [...seed];\n this.size = size;\n let base = this.seed.length;\n this.base = base;\n this.length = BigInt(base) ** BigInt(size);\n Object.freeze(this);\n }\n at(n) {\n n = this._check(n);\n if (n === undefined)\n return undefined;\n let bn = BigInt(n);\n const bb = BigInt(this.base);\n let result = [];\n for (let i = 0; i < this.size; i++) {\n let bd = bn % bb;\n result.push(this.seed[Number(bd)]);\n bn -= bd;\n bn /= bb;\n }\n return result;\n }\n}\n/**\n * Power Set\n */\nexport class PowerSet extends _CBase {\n constructor(seed) {\n super();\n this.seed = [...seed];\n const length = 1n << BigInt(this.seed.length);\n this.length = length;\n Object.freeze(this);\n }\n at(n) {\n n = this._check(n);\n if (n === undefined)\n return undefined;\n let bn = BigInt(n);\n let result = [];\n for (let bi = 0n; bn; bn >>= 1n, bi++)\n if (bn & 1n)\n result.push(this.seed[Number(bi)]);\n return result;\n }\n}\n/**\n * Cartesian Product\n */\nexport class CartesianProduct extends _CBase {\n constructor(...args) {\n super();\n this.seed = args.map(v => [...v]);\n this.size = this.seed.length;\n const length = this.seed.reduce((a, v) => a * BigInt(v.length), 1n);\n this.length = length;\n Object.freeze(this);\n }\n at(n) {\n n = this._check(n);\n if (n === undefined)\n return undefined;\n let bn = BigInt(n);\n let result = [];\n for (let i = 0; i < this.size; i++) {\n const base = this.seed[i].length;\n const bb = BigInt(base);\n const bd = bn % bb;\n result.push(this.seed[i][Number(bd)]);\n bn -= bd;\n bn /= bb;\n }\n return result;\n }\n}\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/placement-ordering/controller/src/scoring.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport { differenceWith, isEqual, uniq } from '@pie-element/shared-lodash';\nimport { combination } from 'js-combinatorics';\nimport debug from 'debug';\n\nconst log = debug('pie-elements:placement-ordering:controller');\n\nexport const illegalArgumentError = (answer) =>\n new Error(`Cant score answer: ${answer} it has duplicates and allowDuplicates is false`);\nexport const pairwiseCombinationScore = (correct, answer, opts) => {\n opts = { allowDuplicates: false, orderMustBeComplete: false, ...opts };\n\n if (!opts.allowDuplicates && !isEqual(uniq(correct), correct)) {\n throw illegalArgumentError(answer);\n }\n\n if (opts.allowDuplicates === false && answer.length !== uniq(answer).length) {\n return 0;\n }\n\n answer = opts.allowDuplicates !== false ? answer : uniq(answer);\n\n log('answer:', answer);\n if (!Array.isArray(correct) || correct.length === 0) {\n throw new Error('correct must be non empty an array');\n }\n\n if (correct.length === 1) {\n return isEqual(correct, answer) ? 1 : 0;\n }\n\n if (!Array.isArray(answer) || answer.length < 2) {\n return 0;\n }\n\n if (answer.length > correct.length) {\n return 0;\n }\n\n if (correct.length !== answer.length && opts.orderMustBeComplete) {\n return 0;\n }\n\n const correctCombo = combination(correct, 2).toArray();\n const answerCombo = combination(answer, 2).toArray();\n\n const diff = differenceWith(answerCombo, correctCombo, isEqual);\n\n const comboLengthDiff = correctCombo.length - answerCombo.length;\n\n const total = correctCombo.length;\n const actual = total - diff.length - comboLengthDiff;\n\n const n = (actual / total).toFixed(2);\n\n return parseFloat(n);\n};\n\n/**\n * Flattens the correctResponse into an array of ordered identifiers representing the\n * correct response.\n */\nexport const flattenCorrect = (question) =>\n question.correctResponse ? question.correctResponse.map((r) => (r && r.id ? r.id : r)) : [];\n\n/**\n * Returns all correct responses for this question\n * @param question - array\n */\nexport const getAllCorrectResponses = (question) => {\n const alternates = (question.alternateResponses || [])\n .map((alternate) => {\n if (Array.isArray(alternate)) {\n return alternate;\n }\n\n return alternate.response;\n })\n .filter((item) => item !== undefined);\n\n return [flattenCorrect(question), ...alternates];\n};\n\n/**\n * Returns the score for a session. If weighted scoring is present in the correctResponse\n * field for the question, this will be used. If partial scoring is present in the question\n * model, this will be used. Otherwise the default scoring mechanism (0 for any incorrect, 1\n * for all correct) will be used.\n */\n\nexport const score = (question, session) => {\n const { value } = session || {};\n\n if (!value) {\n return 0;\n }\n\n const allCorrectResponse = getAllCorrectResponses(question);\n const allowDuplicates = (question.configure && question.configure.removeTilesAfterPlacing) !== false;\n\n /**\n * We require this to be the case - locking\n */\n //const orderMustBeComplete = true;\n\n let bestScore = 0;\n\n allCorrectResponse.forEach((cr) => {\n const currentScore = pairwiseCombinationScore(cr, value, {\n allowDuplicates,\n });\n\n if (currentScore >= bestScore) {\n bestScore = currentScore;\n }\n });\n\n return bestScore;\n};\n","//#region src/defaults.ts\nvar e = {\n\tcorrect: {\n\t\ttype: \"default\",\n\t\tdefault: \"Correct\",\n\t\tcustom: \"Correct\"\n\t},\n\tincorrect: {\n\t\ttype: \"default\",\n\t\tdefault: \"Incorrect\",\n\t\tcustom: \"Incorrect\"\n\t},\n\tpartial: {\n\t\ttype: \"default\",\n\t\tdefault: \"Nearly\",\n\t\tcustom: \"Nearly\"\n\t},\n\tunanswered: {\n\t\ttype: \"default\",\n\t\tdefault: \"You have not entered a response\",\n\t\tcustom: \"You have not entered a response\"\n\t}\n};\n//#endregion\n//#region src/utils.ts\nfunction t(e) {\n\treturn e === \"partially-correct\" ? \"partial\" : e;\n}\n//#endregion\n//#region src/index.ts\nfunction n(n, i = {}) {\n\treturn new Promise((a) => {\n\t\tlet o = {\n\t\t\t...e,\n\t\t\t...i\n\t\t}, s = t(n), c = o[s], l = e[s];\n\t\tr(c, l[c.type]).then(a);\n\t});\n}\nfunction r(e, t) {\n\treturn new Promise((n) => {\n\t\tif (!e || e.type === \"none\") {\n\t\t\tn(void 0);\n\t\t\treturn;\n\t\t}\n\t\tn(e[e.type] || t);\n\t});\n}\nfunction i(n, r = {}) {\n\tlet i = {\n\t\t...e,\n\t\t...r\n\t}, o = t(n), s = i[o], c = e[o];\n\treturn a(s, c[s.type]);\n}\nfunction a(e, t) {\n\tif (!(!e || e.type === \"none\")) return e[e.type] || t;\n}\n//#endregion\nexport { e as defaultFeedback, a as getActualFeedback, i as getActualFeedbackForCorrectness, r as getFeedback, n as getFeedbackForCorrectness, t as normalizeCorrectness };\n","//#region \\0rolldown/runtime.js\nvar e = Object.defineProperty, t = (t, n) => {\n\tlet r = {};\n\tfor (var i in t) e(r, i, {\n\t\tget: t[i],\n\t\tenumerable: !0\n\t});\n\treturn n || e(r, Symbol.toStringTag, { value: \"Module\" }), r;\n};\n//#endregion\n//#region src/persistence.ts\nfunction n(e) {\n\treturn Array.isArray(e) ? e.filter((e) => e != null) : [];\n}\nfunction r(e) {\n\tlet t = [...e];\n\tfor (let e = t.length - 1; e > 0; e--) {\n\t\tlet n = Math.floor(Math.random() * (e + 1));\n\t\t[t[e], t[n]] = [t[n], t[e]];\n\t}\n\treturn t;\n}\nfunction i(e) {\n\treturn e == null ? !0 : Array.isArray(e) ? e.length === 0 : typeof e == \"object\" && Object.keys(e).length === 0;\n}\nasync function a(e, t, a, o = \"value\") {\n\tlet s = n(t?.data?.shuffledValues ?? t?.shuffledValues ?? []);\n\tif (!t) {\n\t\tconsole.warn(\"Unable to save shuffled choices because there's no session.\");\n\t\treturn;\n\t}\n\tif (!i(s)) return n(s.map((t) => e.find((e) => e[o] === t)));\n\tlet c = r(e);\n\tif (a && typeof a == \"function\") try {\n\t\tlet e = n(c.map((e) => e[o]));\n\t\ti(e) ? console.error(`shuffledValues is an empty array - refusing to call updateSession. shuffledChoices: ${JSON.stringify(c)}, key: ${o}`) : t.id && t.element && await a(t.id, t.element, { shuffledValues: e });\n\t} catch (e) {\n\t\tconsole.warn(\"Unable to save shuffled order for choices\"), console.error(e);\n\t}\n\telse console.warn(\"Unable to save shuffled choices, shuffle will happen every time.\");\n\treturn c;\n}\nfunction o(e, t, n) {\n\treturn !!(e.lockChoiceOrder || n[\"@pie-element\"]?.lockChoiceOrder || (n.role ?? \"student\") === \"instructor\");\n}\n//#endregion\n//#region src/partial-scoring.ts\nvar s = /* @__PURE__ */ t({ enabled: () => c });\nfunction c(e, t, n) {\n\treturn e?.partialScoring === !1 || t?.partialScoring === !1 ? !1 : typeof n != \"boolean\" || n;\n}\n//#endregion\nexport { a as getShuffledChoices, o as lockChoices, s as partialScoring };\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/placement-ordering/controller/src/defaults.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nexport default {\n choiceLabel: '',\n choiceLabelEnabled: true,\n choices: [],\n correctResponse: [],\n feedbackEnabled: false,\n numberedGuides: false,\n orientation: 'vertical',\n partialScoring: true,\n placementArea: false,\n prompt: '',\n promptEnabled: true,\n rationale: '',\n rationaleEnabled: true,\n removeTilesAfterPlacing: true,\n scoringType: 'auto',\n studentInstructionsEnabled: true,\n targetLabel: '',\n teacherInstructions: '',\n teacherInstructionsEnabled: true,\n toolbarEditorPosition: 'bottom',\n};\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/placement-ordering/controller/src/index.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport { flattenCorrect, getAllCorrectResponses, score } from './scoring.js';\n\nimport { every, isArray, isEmpty, isEqual, map, reduce } from '@pie-element/shared-lodash';\nimport { getFeedbackForCorrectness } from '@pie-element/shared-feedback';\nimport { partialScoring } from '@pie-element/shared-controller-utils';\nimport debug from 'debug';\n\nimport defaults from './defaults.js';\n\nconst log = debug('@pie-element:placement-ordering:controller');\nimport Translator from '@pie-lib/translator';\n\nconst { translator } = Translator;\n\nexport const questionError = () => new Error('Question is missing required array: correctResponse');\n\n/**\n * Generates detailed trace log for placement-ordering scoring evaluation\n * @param {Object} question - the question model\n * @param {Object} session - the student session\n * @param {Object} env - the environment\n * @returns {Array<string>} traceLog\n */\nexport const getLogTrace = (question, session, env) => {\n const traceLog = [];\n\n const value = session?.value || [];\n const correctResponse = question?.correctResponse || [];\n const hasPlacementArea = question?.placementArea === true;\n\n if (!value.length) {\n if (hasPlacementArea) {\n traceLog.push('Student did not place any tiles in the target area.');\n } else {\n traceLog.push('Student did not reorder any tiles.');\n }\n traceLog.push('Final score: 0.');\n return traceLog;\n }\n\n const allCorrectResponses = getAllCorrectResponses(question);\n\n let bestMatch = { score: 0, response: [] };\n\n allCorrectResponses.forEach((cr) => {\n let matchCount = 0;\n value.forEach((v, idx) => {\n if (cr[idx] === v) {\n matchCount++;\n }\n });\n\n if (matchCount > bestMatch.score) {\n bestMatch = { score: matchCount, response: cr };\n }\n });\n\n const correctCount = bestMatch.score;\n const incorrectCount = value.length - correctCount;\n\n if (correctCount > 0) {\n traceLog.push(`${correctCount} tile(s) placed in the correct order.`);\n }\n\n if (incorrectCount > 0) {\n traceLog.push(`${incorrectCount} tile(s) placed in an incorrect order.`);\n }\n\n const isFullyCorrect = allCorrectResponses.some((cr) => isEqual(cr, value));\n\n const partialScoringEnabled = partialScoring.enabled(question, env || {});\n\n if (partialScoringEnabled) {\n traceLog.push('Score calculated using partial scoring.');\n traceLog.push(\n 'Each tile placed in the correct position contributes to the score.',\n );\n } else {\n traceLog.push('Score calculated using all-or-nothing scoring.');\n if (hasPlacementArea) {\n traceLog.push(\n 'Student must place all tiles in the correct positions within the target area to receive full credit.',\n );\n } else {\n traceLog.push(\n 'Student must arrange all tiles in the correct order to receive full credit.',\n );\n }\n }\n\n const rawScore = score(question, session);\n const finalScore = partialScoringEnabled ? rawScore : rawScore === 1 ? 1 : 0;\n\n traceLog.push(`Final score: ${finalScore}.`);\n\n return traceLog;\n};\n\nexport function outcome(question, session, env) {\n return new Promise((resolve, reject) => {\n if (!session || isEmpty(session)) {\n resolve({ \n score: 0, \n empty: true, \n logTrace: ['Student did not interact with the placement-ordering item.'] \n });\n return;\n }\n\n if (!question || !question.correctResponse || isEmpty(question.correctResponse)) {\n reject(questionError());\n } else {\n try {\n const s = score(question, session);\n const finalScore = partialScoring.enabled(question, env || {}) ? s : s === 1 ? 1 : 0;\n resolve({\n score: finalScore,\n logTrace: getLogTrace(question, session, env)\n });\n } catch (e) {\n reject(e);\n }\n }\n });\n}\n\nexport function createDefaultModel(model = {}) {\n return new Promise((resolve) => {\n resolve({\n ...defaults,\n ...model,\n });\n });\n}\n\nexport const normalize = (question) => ({\n ...defaults,\n rationaleEnabled: true,\n feedbackEnabled: false,\n promptEnabled: true,\n teacherInstructionsEnabled: true,\n studentInstructionsEnabled: true,\n ...question,\n});\n\n/**\n *\n * @param {*} question\n * @param {*} session\n * @param {*} env\n */\nexport async function model(question, session, env) {\n const normalizedQuestion = normalize(question);\n const base = {};\n\n if (question.alternateResponses && every(question.alternateResponses, isArray)) {\n log('Deprecated structure of alternateResponses is in use');\n // eslint-disable-next-line no-console\n console.error('Deprecated structure of alternateResponses is in use');\n }\n\n base.env = env;\n base.extraCSSRules = normalizedQuestion.extraCSSRules;\n base.outcomes = [];\n base.completeLength = (normalizedQuestion.correctResponse || []).length;\n base.choices = (normalizedQuestion.choices || []).filter((choice) => choice.label);\n base.note = normalizedQuestion.note;\n base.showNote = normalizedQuestion.alternateResponses && normalizedQuestion.alternateResponses.length > 0;\n base.language = normalizedQuestion.language;\n\n log('[model] removing tileSize for the moment.');\n\n base.prompt = normalizedQuestion.promptEnabled ? normalizedQuestion.prompt : null;\n base.config = {\n orientation: normalizedQuestion.orientation || 'vertical',\n includeTargets: normalizedQuestion.placementArea,\n choiceLabelEnabled: normalizedQuestion.choiceLabelEnabled,\n targetLabel: normalizedQuestion.targetLabel,\n choiceLabel: normalizedQuestion.choiceLabel,\n showOrdering: normalizedQuestion.numberedGuides,\n allowSameChoiceInTargets: !normalizedQuestion.removeTilesAfterPlacing,\n };\n\n base.disabled = env.mode !== 'gather';\n\n if (!base.note) {\n base.note = translator.t('common:commonCorrectAnswerWithAlternates', { lng: normalizedQuestion.language });\n }\n\n if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {\n base.rationale = normalizedQuestion.rationaleEnabled ? normalizedQuestion.rationale : null;\n base.teacherInstructions = normalizedQuestion.teacherInstructionsEnabled\n ? normalizedQuestion.teacherInstructions\n : null;\n } else {\n base.rationale = null;\n base.teacherInstructions = null;\n }\n\n if (env.mode === 'evaluate') {\n const value = (session && session.value) || [];\n const allCorrectResponses = getAllCorrectResponses(normalizedQuestion);\n\n const bestSetOfResponses = allCorrectResponses.reduce(\n (info, cr) => {\n const currentScore = reduce(value, (acc, c, idx) => acc + (Array.isArray(cr) && cr[idx] === c ? 1 : 0), 0);\n\n if (currentScore > info.score) {\n return {\n arr: cr,\n score: currentScore,\n };\n }\n\n return info;\n },\n { arr: [], score: 0 },\n );\n\n base.outcomes = map(value, (c, idx) => {\n return {\n id: c,\n outcome: bestSetOfResponses.arr[idx] === c ? 'correct' : 'incorrect',\n };\n });\n\n const isResponseCorrect = allCorrectResponses.some((response) => isEqual(response, value));\n const responseScore = score(question, session);\n const isCorrect = responseScore === 1;\n const isPartialCorrect = !isCorrect && partialScoring.enabled(normalizedQuestion, env || {}) && responseScore !== 0;\n\n base.correctness = isCorrect ? 'correct' : isPartialCorrect ? 'partial' : 'incorrect';\n\n if (!isResponseCorrect) {\n base.correctResponse = flattenCorrect(normalizedQuestion);\n }\n\n // requirement made in PD-2182\n if (!normalizedQuestion.feedback) {\n normalizedQuestion.feedbackEnabled = false;\n }\n\n const feedback = normalizedQuestion.feedbackEnabled\n ? await getFeedbackForCorrectness(base.correctness, normalizedQuestion.feedback)\n : undefined;\n\n base.feedback = feedback;\n return base;\n } else {\n return base;\n }\n}\n\nexport const createCorrectResponseSession = (question, env) => {\n return new Promise((resolve) => {\n if (env.mode !== 'evaluate' && env.role === 'instructor') {\n resolve({\n id: '1',\n value: flattenCorrect(question),\n });\n } else {\n resolve(null);\n }\n });\n};\n\n// remove all html tags\nconst getInnerText = (html) => (html || '').replaceAll(/<[^>]*>/g, '');\n\n// remove all html tags except img, iframe and source tag for audio\nconst getContent = (html) => (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');\n\nexport const validate = (model = {}, config = {}) => {\n const { choices, correctResponse } = model;\n const errors = {};\n\n ['teacherInstructions', 'prompt', 'rationale'].forEach((field) => {\n if (config[field]?.required && !getContent(model[field])) {\n errors[field] = 'This field is required.';\n }\n });\n\n const reversedChoices = [...(choices || [])].reverse();\n const choicesErrors = {};\n\n reversedChoices.forEach((choice, index) => {\n const { id, label } = choice;\n\n if (!getContent(label)) {\n choicesErrors[id] = 'Content should not be empty.';\n } else {\n const identicalAnswer = reversedChoices.slice(index + 1).some((c) => c.label === label);\n\n if (identicalAnswer) {\n choicesErrors[id] = 'Content should be unique.';\n }\n }\n });\n\n const choicesIds = (choices || []).map((choice) => choice.id);\n const correctResponseIds = (correctResponse || []).map((response) => response.id || response);\n\n if (isEqual(choicesIds, correctResponseIds)) {\n errors.orderError = 'The correct ordering should not be identical to the initial ordering.';\n }\n\n if (!isEmpty(choicesErrors)) {\n errors.choicesErrors = choicesErrors;\n }\n\n return errors;\n};\n"],"x_google_ignoreList":[0],"mappings":";;;AAoBA,SAAgB,EAAY,GAAG,GAAG;CAC9B,IAAI,IAAI,GACJ,MAAU,WAAW,GAAG,EAAE,iBAAiB;CAC/C,IAAI,IAAI,GACJ,M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