@pie-element/multiple-choice 12.2.0-next.1 → 12.2.0-next.11

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.
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "@pie-element/multiple-choice",
3
+ "version": "12.2.0-next.10",
4
+ "modules": [
5
+ {
6
+ "name": "@pie-lib/shared-module",
7
+ "version": "^4.1.3"
8
+ },
9
+ {
10
+ "name": "@pie-lib/math-rendering-module",
11
+ "version": "^4.1.3"
12
+ }
13
+ ]
14
+ }
@@ -0,0 +1,124 @@
1
+ import PrintElement from './print.js';
2
+
3
+ var generate = {};
4
+
5
+ generate.model = (id, element) => ({
6
+ id,
7
+ element,
8
+ choiceMode: 'checkbox',
9
+ choicePrefix: 'numbers',
10
+ choices: [
11
+ {
12
+ correct: true,
13
+ value: 'sweden',
14
+ label: 'Sweden',
15
+ feedback: {
16
+ type: 'none',
17
+ value: '',
18
+ },
19
+ },
20
+ {
21
+ value: 'iceland',
22
+ label: 'Iceland',
23
+ feedback: {
24
+ type: 'none',
25
+ value: '',
26
+ },
27
+ rationale: 'Rationale for Iceland',
28
+ },
29
+ {
30
+ value: 'norway',
31
+ label: 'Norway',
32
+ feedback: {
33
+ type: 'none',
34
+ value: '',
35
+ },
36
+ rationale: 'Rationale for Norway',
37
+ },
38
+ {
39
+ correct: true,
40
+ value: 'finland',
41
+ label: 'Finland',
42
+ feedback: {
43
+ type: 'none',
44
+ value: '',
45
+ },
46
+ rationale: 'Rationale for Finland',
47
+ },
48
+ ],
49
+ extraCSSRules: {
50
+ names: ['red', 'blue'],
51
+ rules: `
52
+ .red {
53
+ color: red !important;
54
+ }
55
+
56
+ .blue {
57
+ color: blue !important;
58
+ }
59
+ `,
60
+ },
61
+ prompt: '',
62
+ promptEnabled: true,
63
+ toolbarEditorPosition: 'bottom',
64
+ rubricEnabled: false,
65
+ });
66
+
67
+ const { model } = generate;
68
+
69
+ var config = {
70
+ elements: {
71
+ 'multiple-choice': '../..',
72
+ },
73
+ models: [model('1', 'multiple-choice')],
74
+ };
75
+
76
+ // new init - just shows off print!
77
+
78
+ const init = async () => {
79
+ console.log('define the element...');
80
+ await Promise.all(
81
+ config.models.map(async (m) => {
82
+ try {
83
+ const printTag = `${m.element}-print`;
84
+ if (customElements.get(printTag)) {
85
+ return true;
86
+ } else {
87
+ customElements.define(printTag, PrintElement);
88
+ await customElements.whenDefined(printTag);
89
+ return true;
90
+ }
91
+ } catch (e) {
92
+ return false;
93
+ }
94
+ })
95
+ );
96
+
97
+ console.log('now apply the model...');
98
+ config.models.forEach((m) => {
99
+ const printTag = `${m.element}-print`;
100
+ const h3s = document.createElement('h3');
101
+ h3s.textContent = 'student mode';
102
+ document.body.appendChild(h3s);
103
+ const de = document.createElement(printTag);
104
+ document.body.appendChild(de);
105
+ de.options = {};
106
+ de.model = m;
107
+
108
+ const h3 = document.createElement('h3');
109
+ h3.textContent = 'instructor mode';
110
+ document.body.appendChild(h3);
111
+ const instr = document.createElement(printTag);
112
+ document.body.appendChild(instr);
113
+ instr.options = { mode: 'instructor' };
114
+ instr.model = JSON.parse(JSON.stringify(m));
115
+ });
116
+ };
117
+
118
+ init()
119
+ .then(() => {
120
+ console.log('ready');
121
+ })
122
+ .catch((e) => {
123
+ console.error(e);
124
+ });
@@ -0,0 +1,18 @@
1
+
2
+ <!doctype html>
3
+ <html>
4
+ <head>
5
+ <title>@pie-element/multiple-choice@12.2.0-next.10</title>
6
+ <link
7
+ href="https://fonts.googleapis.com/css?family=Roboto&display=swap"
8
+ rel="stylesheet"
9
+ />
10
+ <style>
11
+ html, body {
12
+ font-family: 'Roboto', sans-serif;
13
+ }
14
+ </style>
15
+ <script type="module" src="./print-demo.js"></script>
16
+ </head>
17
+ <body></body>
18
+ </html>
@@ -0,0 +1 @@
1
+ import{_dll_react as e,_dll_react_dom as t,_dll_mui__material_styles as o,_dll_mui__material as n,_dll_prop_types as r,_dll_pie_lib__render_ui as s,_dll_classnames as i,_dll_pie_lib__correct_answer_toggle as a,_dll_debug as c,_dll_react_dom_client as l}from"../../../@pie-lib/shared-module@^4.1.3/module/index.js";import{_dll_pie_lib__math_rendering as u}from"../../../@pie-lib/math-rendering-module@^4.1.3/module/index.js";var p="object"==typeof global&&global&&global.Object===Object&&global,h="object"==typeof self&&self&&self.Object===Object&&self,d=p||h||Function("return this")(),g=d.Symbol,f=Object.prototype,m=f.hasOwnProperty,b=f.toString,y=g?g.toStringTag:void 0;var v=Object.prototype.toString;var x=g?g.toStringTag:void 0;function S(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":x&&x in Object(e)?function(e){var t=m.call(e,y),o=e[y];try{e[y]=void 0;var n=!0}catch(e){}var r=b.call(e);return n&&(t?e[y]=o:delete e[y]),r}(e):function(e){return v.call(e)}(e)}function C(e){return null!=e&&"object"==typeof e}var k=Array.isArray,w=/\s/;var E=/^\s+/;function O(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&w.test(e.charAt(t)););return t}(e)+1).replace(E,""):e}function A(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var _=/^[-+]0x[0-9a-f]+$/i,j=/^0b[01]+$/i,L=/^0o[0-7]+$/i,N=parseInt;function R(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||C(e)&&"[object Symbol]"==S(e)}(e))return NaN;if(A(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=A(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=O(e);var o=j.test(e);return o||L.test(e)?N(e.slice(2),o?2:8):_.test(e)?NaN:+e}function P(e){if(!A(e))return!1;var t=S(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var $,T=d["__core-js_shared__"],I=($=/[^.]+$/.exec(T&&T.keys&&T.keys.IE_PROTO||""))?"Symbol(src)_1."+$:"";var M=Function.prototype.toString;function F(e){if(null!=e){try{return M.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var B=/^\[object .+?Constructor\]$/,D=Function.prototype,V=Object.prototype,z=D.toString,U=V.hasOwnProperty,K=RegExp("^"+z.call(U).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function H(e){return!(!A(e)||(t=e,I&&I in t))&&(P(e)?K:B).test(F(e));var t}function W(e,t){var o=function(e,t){return null==e?void 0:e[t]}(e,t);return H(o)?o:void 0}var q=W(d,"WeakMap"),J=Object.create,Y=function(){function e(){}return function(t){if(!A(t))return{};if(J)return J(t);e.prototype=t;var o=new e;return e.prototype=void 0,o}}();var G=function(){try{var e=W(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var Q=/^(?:0|[1-9]\d*)$/;function X(e,t){var o=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==o||"symbol"!=o&&Q.test(e))&&e>-1&&e%1==0&&e<t}function Z(e,t,o){"__proto__"==t&&G?G(e,t,{configurable:!0,enumerable:!0,value:o,writable:!0}):e[t]=o}function ee(e,t){return e===t||e!=e&&t!=t}var te=Object.prototype.hasOwnProperty;function oe(e,t,o){var n=e[t];te.call(e,t)&&ee(n,o)&&(void 0!==o||t in e)||Z(e,t,o)}function ne(e,t,o,n){var r=!o;o||(o={});for(var s=-1,i=t.length;++s<i;){var a=t[s],c=n?n(o[a],e[a],a,o,e):void 0;void 0===c&&(c=e[a]),r?Z(o,a,c):oe(o,a,c)}return o}function re(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function se(e){return null!=e&&re(e.length)&&!P(e)}var ie=Object.prototype;function ae(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ie)}function ce(e){return C(e)&&"[object Arguments]"==S(e)}var le=Object.prototype,ue=le.hasOwnProperty,pe=le.propertyIsEnumerable,he=ce(function(){return arguments}())?ce:function(e){return C(e)&&ue.call(e,"callee")&&!pe.call(e,"callee")};var de="object"==typeof exports&&exports&&!exports.nodeType&&exports,ge=de&&"object"==typeof module&&module&&!module.nodeType&&module,fe=ge&&ge.exports===de?d.Buffer:void 0,me=(fe?fe.isBuffer:void 0)||function(){return!1},be={};function ye(e){return function(t){return e(t)}}be["[object Float32Array]"]=be["[object Float64Array]"]=be["[object Int8Array]"]=be["[object Int16Array]"]=be["[object Int32Array]"]=be["[object Uint8Array]"]=be["[object Uint8ClampedArray]"]=be["[object Uint16Array]"]=be["[object Uint32Array]"]=!0,be["[object Arguments]"]=be["[object Array]"]=be["[object ArrayBuffer]"]=be["[object Boolean]"]=be["[object DataView]"]=be["[object Date]"]=be["[object Error]"]=be["[object Function]"]=be["[object Map]"]=be["[object Number]"]=be["[object Object]"]=be["[object RegExp]"]=be["[object Set]"]=be["[object String]"]=be["[object WeakMap]"]=!1;var ve="object"==typeof exports&&exports&&!exports.nodeType&&exports,xe=ve&&"object"==typeof module&&module&&!module.nodeType&&module,Se=xe&&xe.exports===ve&&p.process,Ce=function(){try{var e=xe&&xe.require&&xe.require("util").types;return e||Se&&Se.binding&&Se.binding("util")}catch(e){}}(),ke=Ce&&Ce.isTypedArray,we=ke?ye(ke):function(e){return C(e)&&re(e.length)&&!!be[S(e)]},Ee=Object.prototype.hasOwnProperty;function Oe(e,t){var o=k(e),n=!o&&he(e),r=!o&&!n&&me(e),s=!o&&!n&&!r&&we(e),i=o||n||r||s,a=i?function(e,t){for(var o=-1,n=Array(e);++o<e;)n[o]=t(o);return n}(e.length,String):[],c=a.length;for(var l in e)!t&&!Ee.call(e,l)||i&&("length"==l||r&&("offset"==l||"parent"==l)||s&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||X(l,c))||a.push(l);return a}function Ae(e,t){return function(o){return e(t(o))}}var _e=Ae(Object.keys,Object),je=Object.prototype.hasOwnProperty;function Le(e){return se(e)?Oe(e):function(e){if(!ae(e))return _e(e);var t=[];for(var o in Object(e))je.call(e,o)&&"constructor"!=o&&t.push(o);return t}(e)}var Ne=Object.prototype.hasOwnProperty;function Re(e){if(!A(e))return function(e){var t=[];if(null!=e)for(var o in Object(e))t.push(o);return t}(e);var t=ae(e),o=[];for(var n in e)("constructor"!=n||!t&&Ne.call(e,n))&&o.push(n);return o}function Pe(e){return se(e)?Oe(e,!0):Re(e)}var $e=W(Object,"create");var Te=Object.prototype.hasOwnProperty;var Ie=Object.prototype.hasOwnProperty;function Me(e){var t=-1,o=null==e?0:e.length;for(this.clear();++t<o;){var n=e[t];this.set(n[0],n[1])}}function Fe(e,t){for(var o=e.length;o--;)if(ee(e[o][0],t))return o;return-1}Me.prototype.clear=function(){this.__data__=$e?$e(null):{},this.size=0},Me.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Me.prototype.get=function(e){var t=this.__data__;if($e){var o=t[e];return"__lodash_hash_undefined__"===o?void 0:o}return Te.call(t,e)?t[e]:void 0},Me.prototype.has=function(e){var t=this.__data__;return $e?void 0!==t[e]:Ie.call(t,e)},Me.prototype.set=function(e,t){var o=this.__data__;return this.size+=this.has(e)?0:1,o[e]=$e&&void 0===t?"__lodash_hash_undefined__":t,this};var Be=Array.prototype.splice;function De(e){var t=-1,o=null==e?0:e.length;for(this.clear();++t<o;){var n=e[t];this.set(n[0],n[1])}}De.prototype.clear=function(){this.__data__=[],this.size=0},De.prototype.delete=function(e){var t=this.__data__,o=Fe(t,e);return!(o<0)&&(o==t.length-1?t.pop():Be.call(t,o,1),--this.size,!0)},De.prototype.get=function(e){var t=this.__data__,o=Fe(t,e);return o<0?void 0:t[o][1]},De.prototype.has=function(e){return Fe(this.__data__,e)>-1},De.prototype.set=function(e,t){var o=this.__data__,n=Fe(o,e);return n<0?(++this.size,o.push([e,t])):o[n][1]=t,this};var Ve=W(d,"Map");function ze(e,t){var o,n,r=e.__data__;return("string"==(n=typeof(o=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==o:null===o)?r["string"==typeof t?"string":"hash"]:r.map}function Ue(e){var t=-1,o=null==e?0:e.length;for(this.clear();++t<o;){var n=e[t];this.set(n[0],n[1])}}function Ke(e,t){for(var o=-1,n=t.length,r=e.length;++o<n;)e[r+o]=t[o];return e}Ue.prototype.clear=function(){this.size=0,this.__data__={hash:new Me,map:new(Ve||De),string:new Me}},Ue.prototype.delete=function(e){var t=ze(this,e).delete(e);return this.size-=t?1:0,t},Ue.prototype.get=function(e){return ze(this,e).get(e)},Ue.prototype.has=function(e){return ze(this,e).has(e)},Ue.prototype.set=function(e,t){var o=ze(this,e),n=o.size;return o.set(e,t),this.size+=o.size==n?0:1,this};var He=Ae(Object.getPrototypeOf,Object);function We(e){var t=this.__data__=new De(e);this.size=t.size}We.prototype.clear=function(){this.__data__=new De,this.size=0},We.prototype.delete=function(e){var t=this.__data__,o=t.delete(e);return this.size=t.size,o},We.prototype.get=function(e){return this.__data__.get(e)},We.prototype.has=function(e){return this.__data__.has(e)},We.prototype.set=function(e,t){var o=this.__data__;if(o instanceof De){var n=o.__data__;if(!Ve||n.length<199)return n.push([e,t]),this.size=++o.size,this;o=this.__data__=new Ue(n)}return o.set(e,t),this.size=o.size,this};var qe="object"==typeof exports&&exports&&!exports.nodeType&&exports,Je=qe&&"object"==typeof module&&module&&!module.nodeType&&module,Ye=Je&&Je.exports===qe?d.Buffer:void 0,Ge=Ye?Ye.allocUnsafe:void 0;function Qe(){return[]}var Xe=Object.prototype.propertyIsEnumerable,Ze=Object.getOwnPropertySymbols,et=Ze?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var o=-1,n=null==e?0:e.length,r=0,s=[];++o<n;){var i=e[o];t(i,o,e)&&(s[r++]=i)}return s}(Ze(e),function(t){return Xe.call(e,t)}))}:Qe;var tt=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)Ke(t,et(e)),e=He(e);return t}:Qe;function ot(e,t,o){var n=t(e);return k(e)?n:Ke(n,o(e))}function nt(e){return ot(e,Le,et)}function rt(e){return ot(e,Pe,tt)}var st=W(d,"DataView"),it=W(d,"Promise"),at=W(d,"Set"),ct="[object Map]",lt="[object Promise]",ut="[object Set]",pt="[object WeakMap]",ht="[object DataView]",dt=F(st),gt=F(Ve),ft=F(it),mt=F(at),bt=F(q),yt=S;(st&&yt(new st(new ArrayBuffer(1)))!=ht||Ve&&yt(new Ve)!=ct||it&&yt(it.resolve())!=lt||at&&yt(new at)!=ut||q&&yt(new q)!=pt)&&(yt=function(e){var t=S(e),o="[object Object]"==t?e.constructor:void 0,n=o?F(o):"";if(n)switch(n){case dt:return ht;case gt:return ct;case ft:return lt;case mt:return ut;case bt:return pt}return t});var vt=yt,xt=Object.prototype.hasOwnProperty;var St=d.Uint8Array;function Ct(e){var t=new e.constructor(e.byteLength);return new St(t).set(new St(e)),t}var kt=/\w*$/;var wt=g?g.prototype:void 0,Et=wt?wt.valueOf:void 0;function Ot(e,t,o){var n,r,s,i=e.constructor;switch(t){case"[object ArrayBuffer]":return Ct(e);case"[object Boolean]":case"[object Date]":return new i(+e);case"[object DataView]":return function(e,t){var o=t?Ct(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.byteLength)}(e,o);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(e,t){var o=t?Ct(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.length)}(e,o);case"[object Map]":case"[object Set]":return new i;case"[object Number]":case"[object String]":return new i(e);case"[object RegExp]":return(s=new(r=e).constructor(r.source,kt.exec(r))).lastIndex=r.lastIndex,s;case"[object Symbol]":return n=e,Et?Object(Et.call(n)):{}}}var At=Ce&&Ce.isMap,_t=At?ye(At):function(e){return C(e)&&"[object Map]"==vt(e)};var jt=Ce&&Ce.isSet,Lt=jt?ye(jt):function(e){return C(e)&&"[object Set]"==vt(e)},Nt="[object Arguments]",Rt="[object Function]",Pt="[object Object]",$t={};function Tt(e,t,o,n,r,s){var i,a=1&t,c=2&t,l=4&t;if(o&&(i=r?o(e,n,r,s):o(e)),void 0!==i)return i;if(!A(e))return e;var u=k(e);if(u){if(i=function(e){var t=e.length,o=new e.constructor(t);return t&&"string"==typeof e[0]&&xt.call(e,"index")&&(o.index=e.index,o.input=e.input),o}(e),!a)return function(e,t){var o=-1,n=e.length;for(t||(t=Array(n));++o<n;)t[o]=e[o];return t}(e,i)}else{var p=vt(e),h=p==Rt||"[object GeneratorFunction]"==p;if(me(e))return function(e,t){if(t)return e.slice();var o=e.length,n=Ge?Ge(o):new e.constructor(o);return e.copy(n),n}(e,a);if(p==Pt||p==Nt||h&&!r){if(i=c||h?{}:function(e){return"function"!=typeof e.constructor||ae(e)?{}:Y(He(e))}(e),!a)return c?function(e,t){return ne(e,tt(e),t)}(e,function(e,t){return e&&ne(t,Pe(t),e)}(i,e)):function(e,t){return ne(e,et(e),t)}(e,function(e,t){return e&&ne(t,Le(t),e)}(i,e))}else{if(!$t[p])return r?e:{};i=Ot(e,p,a)}}s||(s=new We);var d=s.get(e);if(d)return d;s.set(e,i),Lt(e)?e.forEach(function(n){i.add(Tt(n,t,o,n,e,s))}):_t(e)&&e.forEach(function(n,r){i.set(r,Tt(n,t,o,r,e,s))});var g=u?void 0:(l?c?rt:nt:c?Pe:Le)(e);return function(e,t){for(var o=-1,n=null==e?0:e.length;++o<n&&!1!==t(e[o],o,e););}(g||e,function(n,r){g&&(n=e[r=n]),oe(i,r,Tt(n,t,o,r,e,s))}),i}$t[Nt]=$t["[object Array]"]=$t["[object ArrayBuffer]"]=$t["[object DataView]"]=$t["[object Boolean]"]=$t["[object Date]"]=$t["[object Float32Array]"]=$t["[object Float64Array]"]=$t["[object Int8Array]"]=$t["[object Int16Array]"]=$t["[object Int32Array]"]=$t["[object Map]"]=$t["[object Number]"]=$t[Pt]=$t["[object RegExp]"]=$t["[object Set]"]=$t["[object String]"]=$t["[object Symbol]"]=$t["[object Uint8Array]"]=$t["[object Uint8ClampedArray]"]=$t["[object Uint16Array]"]=$t["[object Uint32Array]"]=!0,$t["[object Error]"]=$t[Rt]=$t["[object WeakMap]"]=!1;var It=function(){return d.Date.now()},Mt=Math.max,Ft=Math.min;function Bt(e,t,o){var n,r,s,i,a,c,l=0,u=!1,p=!1,h=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function d(t){var o=n,s=r;return n=r=void 0,l=t,i=e.apply(s,o)}function g(e){var o=e-c;return void 0===c||o>=t||o<0||p&&e-l>=s}function f(){var e=It();if(g(e))return m(e);a=setTimeout(f,function(e){var o=t-(e-c);return p?Ft(o,s-(e-l)):o}(e))}function m(e){return a=void 0,h&&n?d(e):(n=r=void 0,i)}function b(){var e=It(),o=g(e);if(n=arguments,r=this,c=e,o){if(void 0===a)return function(e){return l=e,a=setTimeout(f,t),u?d(e):i}(c);if(p)return clearTimeout(a),a=setTimeout(f,t),d(c)}return void 0===a&&(a=setTimeout(f,t)),i}return t=R(t)||0,A(o)&&(u=!!o.leading,s=(p="maxWait"in o)?Mt(R(o.maxWait)||0,t):s,h="trailing"in o?!!o.trailing:h),b.cancel=function(){void 0!==a&&clearTimeout(a),l=0,n=c=r=a=void 0},b.flush=function(){return void 0===a?i:m(It())},b}function Dt(e,t){return null!=e?e:t()}function Vt(e){let t,o=e[0],n=1;for(;n<e.length;){const r=e[n],s=e[n+1];if(n+=2,("optionalAccess"===r||"optionalCall"===r)&&null==o)return;"access"===r||"optionalAccess"===r?(t=o,o=s(o)):"call"!==r&&"optionalCall"!==r||(o=s((...e)=>o.call(t,...e)),t=void 0)}return o}const zt=e=>"string"==typeof e,Ut=()=>{let e,t;const o=new Promise((o,n)=>{e=o,t=n});return o.resolve=e,o.reject=t,o},Kt=e=>null==e?"":""+e,Ht=/###/g,Wt=e=>e&&e.indexOf("###")>-1?e.replace(Ht,"."):e,qt=e=>!e||zt(e),Jt=(e,t,o)=>{const n=zt(t)?t.split("."):t;let r=0;for(;r<n.length-1;){if(qt(e))return{};const t=Wt(n[r]);!e[t]&&o&&(e[t]=new o),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++r}return qt(e)?{}:{obj:e,k:Wt(n[r])}},Yt=(e,t,o)=>{const{obj:n,k:r}=Jt(e,t,Object);if(void 0!==n||1===t.length)return void(n[r]=o);let s=t[t.length-1],i=t.slice(0,t.length-1),a=Jt(e,i,Object);for(;void 0===a.obj&&i.length;)s=`${i[i.length-1]}.${s}`,i=i.slice(0,i.length-1),a=Jt(e,i,Object),Vt([a,"optionalAccess",e=>e.obj])&&void 0!==a.obj[`${a.k}.${s}`]&&(a.obj=void 0);a.obj[`${a.k}.${s}`]=o},Gt=(e,t)=>{const{obj:o,k:n}=Jt(e,t);if(o&&Object.prototype.hasOwnProperty.call(o,n))return o[n]},Qt=(e,t,o)=>{for(const n in t)"__proto__"!==n&&"constructor"!==n&&(n in e?zt(e[n])||e[n]instanceof String||zt(t[n])||t[n]instanceof String?o&&(e[n]=t[n]):Qt(e[n],t[n],o):e[n]=t[n]);return e},Xt=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Zt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const eo=e=>zt(e)?e.replace(/[&<>"'\/]/g,e=>Zt[e]):e;const to=[" ",",","?","!",";"],oo=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const o=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,o),this.regExpQueue.push(e),o}}(20),no=(e,t,o=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}const n=t.split(o);let r=e;for(let e=0;e<n.length;){if(!r||"object"!=typeof r)return;let t,s="";for(let i=e;i<n.length;++i)if(i!==e&&(s+=o),s+=n[i],t=r[s],void 0!==t){if(["string","number","boolean"].indexOf(typeof t)>-1&&i<n.length-1)continue;e+=i-e+1;break}r=t}return r},ro=e=>Vt([e,"optionalAccess",e=>e.replace,"call",e=>e("_","-")]),so={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){Vt([console,"optionalAccess",t=>t[e],"optionalAccess",e=>e.apply,"optionalCall",e=>e(console,t)])}};class io{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||so,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,o,n){return n&&!this.debug?null:(zt(e[0])&&(e[0]=`${o}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new io(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new io(this.logger,e)}}var ao=new io;class co{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);const o=this.observers[e].get(t)||0;this.observers[e].set(t,o+1)}),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}emit(e,...t){if(this.observers[e]){Array.from(this.observers[e].entries()).forEach(([e,o])=>{for(let n=0;n<o;n++)e(...t)})}if(this.observers["*"]){Array.from(this.observers["*"].entries()).forEach(([o,n])=>{for(let r=0;r<n;r++)o.apply(o,[e,...t])})}}}class lo extends co{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,o,n={}){const r=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,s=void 0!==n.ignoreJSONStructure?n.ignoreJSONStructure:this.options.ignoreJSONStructure;let i;e.indexOf(".")>-1?i=e.split("."):(i=[e,t],o&&(Array.isArray(o)?i.push(...o):zt(o)&&r?i.push(...o.split(r)):i.push(o)));const a=Gt(this.data,i);return!a&&!t&&!o&&e.indexOf(".")>-1&&(e=i[0],t=i[1],o=i.slice(2).join(".")),!a&&s&&zt(o)?no(Vt([this,"access",e=>e.data,"optionalAccess",t=>t[e],"optionalAccess",e=>e[t]]),o,r):a}addResource(e,t,o,n,r={silent:!1}){const s=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator;let i=[e,t];o&&(i=i.concat(s?o.split(s):o)),e.indexOf(".")>-1&&(i=e.split("."),n=t,t=i[1]),this.addNamespaces(t),Yt(this.data,i,n),r.silent||this.emit("added",e,t,o,n)}addResources(e,t,o,n={silent:!1}){for(const n in o)(zt(o[n])||Array.isArray(o[n]))&&this.addResource(e,t,n,o[n],{silent:!0});n.silent||this.emit("added",e,t,o)}addResourceBundle(e,t,o,n,r,s={silent:!1,skipCopy:!1}){let i=[e,t];e.indexOf(".")>-1&&(i=e.split("."),n=o,o=t,t=i[1]),this.addNamespaces(t);let a=Gt(this.data,i)||{};s.skipCopy||(o=JSON.parse(JSON.stringify(o))),n?Qt(a,o,r):a={...a,...o},Yt(this.data,i,a),s.silent||this.emit("added",e,t,o)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}}var uo={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,o,n,r){return e.forEach(e=>{t=Dt(Vt([this,"access",e=>e.processors,"access",t=>t[e],"optionalAccess",e=>e.process,"call",e=>e(t,o,n,r)]),()=>t)}),t}};const po=Symbol("i18next/PATH_KEY");function ho(e,t){const{[po]:o}=e(function(){const e=[],t=Object.create(null);let o;return t.get=(n,r)=>(Vt([o,"optionalAccess",e=>e.revoke,"optionalCall",e=>e()]),r===po?e:(e.push(r),o=Proxy.revocable(n,t),o.proxy)),Proxy.revocable(Object.create(null),t).proxy}());return o.join(Dt(Vt([t,"optionalAccess",e=>e.keySeparator]),()=>"."))}const go={},fo=e=>!zt(e)&&"boolean"!=typeof e&&"number"!=typeof e;class mo extends co{constructor(e,t={}){var o,n;super(),o=e,n=this,["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach(e=>{o[e]&&(n[e]=o[e])}),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=ao.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const o={...t};if(null==e)return!1;const n=this.resolve(e,o);if(void 0===Vt([n,"optionalAccess",e=>e.res]))return!1;const r=fo(n.res);return!1!==o.returnObjects||!r}extractFromKey(e,t){let o=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===o&&(o=":");const n=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let r=t.ns||this.options.defaultNS||[];const s=o&&e.indexOf(o)>-1,i=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,o)=>{t=t||"",o=o||"";const n=to.filter(e=>t.indexOf(e)<0&&o.indexOf(e)<0);if(0===n.length)return!0;const r=oo.getRegExp(`(${n.map(e=>"?"===e?"\\?":e).join("|")})`);let s=!r.test(e);if(!s){const t=e.indexOf(o);t>0&&!r.test(e.substring(0,t))&&(s=!0)}return s})(e,o,n));if(s&&!i){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:zt(r)?[r]:r};const s=e.split(o);(o!==n||o===n&&this.options.ns.indexOf(s[0])>-1)&&(r=s.shift()),e=s.join(n)}return{key:e,namespaces:zt(r)?[r]:r}}translate(e,t,o){let n="object"==typeof t?{...t}:t;if("object"!=typeof n&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof n&&(n={...n}),n||(n={}),null==e)return"";"function"==typeof e&&(e=ho(e,{...this.options,...n})),Array.isArray(e)||(e=[String(e)]);const r=void 0!==n.returnDetails?n.returnDetails:this.options.returnDetails,s=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,{key:i,namespaces:a}=this.extractFromKey(e[e.length-1],n),c=a[a.length-1];let l=void 0!==n.nsSeparator?n.nsSeparator:this.options.nsSeparator;void 0===l&&(l=":");const u=n.lng||this.language,p=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===Vt([u,"optionalAccess",e=>e.toLowerCase,"call",e=>e()]))return p?r?{res:`${c}${l}${i}`,usedKey:i,exactUsedKey:i,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:`${c}${l}${i}`:r?{res:i,usedKey:i,exactUsedKey:i,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:i;const h=this.resolve(e,n);let d=Vt([h,"optionalAccess",e=>e.res]);const g=Vt([h,"optionalAccess",e=>e.usedKey])||i,f=Vt([h,"optionalAccess",e=>e.exactUsedKey])||i,m=void 0!==n.joinArrays?n.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,y=void 0!==n.count&&!zt(n.count),v=mo.hasDefaultValue(n),x=y?this.pluralResolver.getSuffix(u,n.count,n):"",S=n.ordinal&&y?this.pluralResolver.getSuffix(u,n.count,{ordinal:!1}):"",C=y&&!n.ordinal&&0===n.count,k=C&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${x}`]||n[`defaultValue${S}`]||n.defaultValue;let w=d;b&&!d&&v&&(w=k);const E=fo(w),O=Object.prototype.toString.apply(w);if(!(b&&w&&E&&["[object Number]","[object Function]","[object RegExp]"].indexOf(O)<0)||zt(m)&&Array.isArray(w))if(b&&zt(m)&&Array.isArray(d))d=d.join(m),d&&(d=this.extendTranslation(d,e,n,o));else{let t=!1,r=!1;!this.isValidLookup(d)&&v&&(t=!0,d=k),this.isValidLookup(d)||(r=!0,d=i);const a=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&r?void 0:d,p=v&&k!==d&&this.options.updateMissing;if(r||t||p){if(this.logger.log(p?"updateKey":"missingKey",u,c,i,p?k:d),s){const e=this.resolve(i,{...n,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let o=0;o<t.length;o++)e.push(t[o]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(n.lng||this.language):e.push(n.lng||this.language);const o=(e,t,o)=>{const r=v&&o!==d?o:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,c,t,r,p,n):Vt([this,"access",e=>e.backendConnector,"optionalAccess",e=>e.saveMissing])&&this.backendConnector.saveMissing(e,c,t,r,p,n),this.emit("missingKey",e,c,t,d)};this.options.saveMissing&&(this.options.saveMissingPlurals&&y?e.forEach(e=>{const t=this.pluralResolver.getSuffixes(e,n);C&&n[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{o([e],i+t,n[`defaultValue${t}`]||k)})}):o(e,i,k))}d=this.extendTranslation(d,e,n,h,o),r&&d===i&&this.options.appendNamespaceToMissingKey&&(d=`${c}${l}${i}`),(r||t)&&this.options.parseMissingKeyHandler&&(d=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}${l}${i}`:i,t?d:void 0,n))}else{if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,w,{...n,ns:a}):`key '${i} (${this.language})' returned an object instead of string.`;return r?(h.res=e,h.usedParams=this.getUsedParamsDetails(n),h):e}if(s){const e=Array.isArray(w),t=e?[]:{},o=e?f:g;for(const e in w)if(Object.prototype.hasOwnProperty.call(w,e)){const r=`${o}${s}${e}`;t[e]=v&&!d?this.translate(r,{...n,defaultValue:fo(k)?k[e]:void 0,joinArrays:!1,ns:a}):this.translate(r,{...n,joinArrays:!1,ns:a}),t[e]===r&&(t[e]=w[e])}d=t}}return r?(h.res=d,h.usedParams=this.getUsedParamsDetails(n),h):d}extendTranslation(e,t,o,n,r){if(Vt([this,"access",e=>e.i18nFormat,"optionalAccess",e=>e.parse]))e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...o},o.lng||this.language||n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!o.skipInterpolation){o.interpolation&&this.interpolator.init({...o,interpolation:{...this.options.interpolation,...o.interpolation}});const s=zt(e)&&(void 0!==Vt([o,"optionalAccess",e=>e.interpolation,"optionalAccess",e=>e.skipOnVariables])?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let i;if(s){const t=e.match(this.interpolator.nestingRegexp);i=t&&t.length}let a=o.replace&&!zt(o.replace)?o.replace:o;if(this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),e=this.interpolator.interpolate(e,a,o.lng||this.language||n.usedLng,o),s){const t=e.match(this.interpolator.nestingRegexp);i<(t&&t.length)&&(o.nest=!1)}!o.lng&&n&&n.res&&(o.lng=this.language||n.usedLng),!1!==o.nest&&(e=this.interpolator.nest(e,(...e)=>Vt([r,"optionalAccess",e=>e[0]])!==e[0]||o.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null),o)),o.interpolation&&this.interpolator.reset()}const s=o.postProcess||this.options.postProcess,i=zt(s)?[s]:s;return null!=e&&Vt([i,"optionalAccess",e=>e.length])&&!1!==o.applyPostProcessor&&(e=uo.handle(i,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...n,usedParams:this.getUsedParamsDetails(o)},...o}:o,this)),e}resolve(e,t={}){let o,n,r,s,i;return zt(e)&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(o))return;const a=this.extractFromKey(e,t),c=a.key;n=c;let l=a.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));const u=void 0!==t.count&&!zt(t.count),p=u&&!t.ordinal&&0===t.count,h=void 0!==t.context&&(zt(t.context)||"number"==typeof t.context)&&""!==t.context,d=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);l.forEach(e=>{this.isValidLookup(o)||(i=e,go[`${d[0]}-${e}`]||!Vt([this,"access",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace])||Vt([this,"access",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace,"call",e=>e(i)])||(go[`${d[0]}-${e}`]=!0,this.logger.warn(`key "${n}" for languages "${d.join(", ")}" won't get resolved as namespace "${i}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),d.forEach(n=>{if(this.isValidLookup(o))return;s=n;const i=[c];if(Vt([this,"access",e=>e.i18nFormat,"optionalAccess",e=>e.addLookupKeys]))this.i18nFormat.addLookupKeys(i,c,n,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(n,t.count,t));const o=`${this.options.pluralSeparator}zero`,r=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(t.ordinal&&0===e.indexOf(r)&&i.push(c+e.replace(r,this.options.pluralSeparator)),i.push(c+e),p&&i.push(c+o)),h){const n=`${c}${this.options.contextSeparator||"_"}${t.context}`;i.push(n),u&&(t.ordinal&&0===e.indexOf(r)&&i.push(n+e.replace(r,this.options.pluralSeparator)),i.push(n+e),p&&i.push(n+o))}}let a;for(;a=i.pop();)this.isValidLookup(o)||(r=a,o=this.getResource(n,e,a,t))}))})}),{res:o,usedKey:n,exactUsedKey:r,usedLng:s,usedNS:i}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,o,n={}){return Vt([this,"access",e=>e.i18nFormat,"optionalAccess",e=>e.getResource])?this.i18nFormat.getResource(e,t,o,n):this.resourceStore.getResource(e,t,o,n)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],o=e.replace&&!zt(e.replace);let n=o?e.replace:e;if(o&&void 0!==e.count&&(n.count=e.count),this.options.interpolation.defaultVariables&&(n={...this.options.interpolation.defaultVariables,...n}),!o){n={...n};for(const e of t)delete n[e]}return n}static hasDefaultValue(e){const t="defaultValue";for(const o in e)if(Object.prototype.hasOwnProperty.call(e,o)&&t===o.substring(0,12)&&void 0!==e[o])return!0;return!1}}class bo{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ao.create("languageUtils")}getScriptPartFromCode(e){if(!(e=ro(e))||e.indexOf("-")<0)return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=ro(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(zt(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(e){}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;const o=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(o)||(t=o)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;const o=this.getScriptPartFromCode(e);if(this.isSupportedCode(o))return t=o;const n=this.getLanguagePartFromCode(e);if(this.isSupportedCode(n))return t=n;t=this.options.supportedLngs.find(e=>e===n?e:e.indexOf("-")<0&&n.indexOf("-")<0?void 0:e.indexOf("-")>0&&n.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===n||0===e.indexOf(n)&&n.length>1?e:void 0)}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),zt(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let o=e[t];return o||(o=e[this.getScriptPartFromCode(t)]),o||(o=e[this.formatLanguageCode(t)]),o||(o=e[this.getLanguagePartFromCode(t)]),o||(o=e.default),o||[]}toResolveHierarchy(e,t){const o=this.getFallbackCodes((!1===t?[]:t)||this.options.fallbackLng||[],e),n=[],r=e=>{e&&(this.isSupportedCode(e)?n.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return zt(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&r(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&r(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&r(this.getLanguagePartFromCode(e))):zt(e)&&r(this.formatLanguageCode(e)),o.forEach(e=>{n.indexOf(e)<0&&r(this.formatLanguageCode(e))}),n}}const yo={zero:0,one:1,two:2,few:3,many:4,other:5},vo={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class xo{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=ao.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const o=ro("dev"===e?"en":e),n=t.ordinal?"ordinal":"cardinal",r=JSON.stringify({cleanedCode:o,type:n});if(r in this.pluralRulesCache)return this.pluralRulesCache[r];let s;try{s=new Intl.PluralRules(o,{type:n})}catch(o){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),vo;if(!e.match(/-|_/))return vo;const n=this.languageUtils.getLanguagePartFromCode(e);s=this.getRule(n,t)}return this.pluralRulesCache[r]=s,s}needsPlural(e,t={}){let o=this.getRule(e,t);return o||(o=this.getRule("dev",t)),Vt([o,"optionalAccess",e=>e.resolvedOptions,"call",e=>e(),"access",e=>e.pluralCategories,"access",e=>e.length])>1}getPluralFormsOfKey(e,t,o={}){return this.getSuffixes(e,o).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let o=this.getRule(e,t);return o||(o=this.getRule("dev",t)),o?o.resolvedOptions().pluralCategories.sort((e,t)=>yo[e]-yo[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):[]}getSuffix(e,t,o={}){const n=this.getRule(e,o);return n?`${this.options.prepend}${o.ordinal?`ordinal${this.options.prepend}`:""}${n.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,o))}}const So=(e,t,o,n=".",r=!0)=>{let s=((e,t,o)=>{const n=Gt(e,o);return void 0!==n?n:Gt(t,o)})(e,t,o);return!s&&r&&zt(o)&&(s=no(e,o,n),void 0===s&&(s=no(t,o,n))),s},Co=e=>e.replace(/\$/g,"$$$$");class ko{constructor(e={}){this.logger=ao.create("interpolator"),this.options=e,this.format=Vt([e,"optionalAccess",e=>e.interpolation,"optionalAccess",e=>e.format])||(e=>e),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:o,useRawValueToEscape:n,prefix:r,prefixEscaped:s,suffix:i,suffixEscaped:a,formatSeparator:c,unescapeSuffix:l,unescapePrefix:u,nestingPrefix:p,nestingPrefixEscaped:h,nestingSuffix:d,nestingSuffixEscaped:g,nestingOptionsSeparator:f,maxReplaces:m,alwaysFormat:b}=e.interpolation;this.escape=void 0!==t?t:eo,this.escapeValue=void 0===o||o,this.useRawValueToEscape=void 0!==n&&n,this.prefix=r?Xt(r):s||"{{",this.suffix=i?Xt(i):a||"}}",this.formatSeparator=c||",",this.unescapePrefix=l?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":l||"",this.nestingPrefix=p?Xt(p):h||Xt("$t("),this.nestingSuffix=d?Xt(d):g||Xt(")"),this.nestingOptionsSeparator=f||",",this.maxReplaces=m||1e3,this.alwaysFormat=void 0!==b&&b,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>Vt([e,"optionalAccess",e=>e.source])===t?(e.lastIndex=0,e):new RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,o,n){let r,s,i;const a=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(e.indexOf(this.formatSeparator)<0){const r=So(t,a,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(r,void 0,o,{...n,...t,interpolationkey:e}):r}const r=e.split(this.formatSeparator),s=r.shift().trim(),i=r.join(this.formatSeparator).trim();return this.format(So(t,a,s,this.options.keySeparator,this.options.ignoreJSONStructure),i,o,{...n,...t,interpolationkey:s})};this.resetRegExp();const l=Vt([n,"optionalAccess",e=>e.missingInterpolationHandler])||this.options.missingInterpolationHandler,u=void 0!==Vt([n,"optionalAccess",e=>e.interpolation,"optionalAccess",e=>e.skipOnVariables])?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>Co(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?Co(this.escape(e)):Co(e)}].forEach(t=>{for(i=0;r=t.regex.exec(e);){const o=r[1].trim();if(s=c(o),void 0===s)if("function"==typeof l){const t=l(e,r,n);s=zt(t)?t:""}else if(n&&Object.prototype.hasOwnProperty.call(n,o))s="";else{if(u){s=r[0];continue}this.logger.warn(`missed to pass in variable ${o} for interpolating ${e}`),s=""}else zt(s)||this.useRawValueToEscape||(s=Kt(s));const a=t.safeValue(s);if(e=e.replace(r[0],a),u?(t.regex.lastIndex+=s.length,t.regex.lastIndex-=r[0].length):t.regex.lastIndex=0,i++,i>=this.maxReplaces)break}}),e}nest(e,t,o={}){let n,r,s;const i=(e,t)=>{const o=this.nestingOptionsSeparator;if(e.indexOf(o)<0)return e;const n=e.split(new RegExp(`${o}[ ]*{`));let r=`{${n[1]}`;e=n[0],r=this.interpolate(r,s);const i=r.match(/'/g),a=r.match(/"/g);(Dt(Vt([i,"optionalAccess",e=>e.length]),()=>0)%2==0&&!a||a.length%2!=0)&&(r=r.replace(/'/g,'"'));try{s=JSON.parse(r),t&&(s={...t,...s})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${o}${r}`}return s.defaultValue&&s.defaultValue.indexOf(this.prefix)>-1&&delete s.defaultValue,e};for(;n=this.nestingRegexp.exec(e);){let a=[];s={...o},s=s.replace&&!zt(s.replace)?s.replace:s,s.applyPostProcessor=!1,delete s.defaultValue;const c=/{.*}/.test(n[1])?n[1].lastIndexOf("}")+1:n[1].indexOf(this.formatSeparator);if(-1!==c&&(a=n[1].slice(c).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),n[1]=n[1].slice(0,c)),r=t(i.call(this,n[1].trim(),s),s),r&&n[0]===e&&!zt(r))return r;zt(r)||(r=Kt(r)),r||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),r=""),a.length&&(r=a.reduce((e,t)=>this.format(e,t,o.lng,{...o,interpolationkey:n[1].trim()}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}const wo=e=>{const t={};return(o,n,r)=>{let s=r;r&&r.interpolationkey&&r.formatParams&&r.formatParams[r.interpolationkey]&&r[r.interpolationkey]&&(s={...s,[r.interpolationkey]:void 0});const i=n+JSON.stringify(s);let a=t[i];return a||(a=e(ro(n),r),t[i]=a),a(o)}},Eo=e=>(t,o,n)=>e(ro(o),n)(t);class Oo{constructor(e={}){this.logger=ao.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const o=t.cacheInBuiltFormats?wo:Eo;this.formats={number:o((e,t)=>{const o=new Intl.NumberFormat(e,{...t});return e=>o.format(e)}),currency:o((e,t)=>{const o=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>o.format(e)}),datetime:o((e,t)=>{const o=new Intl.DateTimeFormat(e,{...t});return e=>o.format(e)}),relativetime:o((e,t)=>{const o=new Intl.RelativeTimeFormat(e,{...t});return e=>o.format(e,t.range||"day")}),list:o((e,t)=>{const o=new Intl.ListFormat(e,{...t});return e=>o.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=wo(t)}format(e,t,o,n={}){const r=t.split(this.formatSeparator);if(r.length>1&&r[0].indexOf("(")>1&&r[0].indexOf(")")<0&&r.find(e=>e.indexOf(")")>-1)){const e=r.findIndex(e=>e.indexOf(")")>-1);r[0]=[r[0],...r.splice(1,e)].join(this.formatSeparator)}return r.reduce((e,t)=>{const{formatName:r,formatOptions:s}=(e=>{let t=e.toLowerCase().trim();const o={};if(e.indexOf("(")>-1){const n=e.split("(");t=n[0].toLowerCase().trim();const r=n[1].substring(0,n[1].length-1);"currency"===t&&r.indexOf(":")<0?o.currency||(o.currency=r.trim()):"relativetime"===t&&r.indexOf(":")<0?o.range||(o.range=r.trim()):r.split(";").forEach(e=>{if(e){const[t,...n]=e.split(":"),r=n.join(":").trim().replace(/^'+|'+$/g,""),s=t.trim();o[s]||(o[s]=r),"false"===r&&(o[s]=!1),"true"===r&&(o[s]=!0),isNaN(r)||(o[s]=parseInt(r,10))}})}return{formatName:t,formatOptions:o}})(t);if(this.formats[r]){let t=e;try{const i=Vt([n,"optionalAccess",e=>e.formatParams,"optionalAccess",e=>e[n.interpolationkey]])||{},a=i.locale||i.lng||n.locale||n.lng||o;t=this.formats[r](e,a,{...s,...n,...i})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${r}`),e},e)}}class Ao extends co{constructor(e,t,o,n={}){super(),this.backend=e,this.store=t,this.services=o,this.languageUtils=o.languageUtils,this.options=n,this.logger=ao.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=n.maxParallelReads||10,this.readingCalls=0,this.maxRetries=n.maxRetries>=0?n.maxRetries:5,this.retryTimeout=n.retryTimeout>=1?n.retryTimeout:350,this.state={},this.queue=[],Vt([this,"access",e=>e.backend,"optionalAccess",e=>e.init,"optionalCall",e=>e(o,n.backend,n)])}queueLoad(e,t,o,n){const r={},s={},i={},a={};return e.forEach(e=>{let n=!0;t.forEach(t=>{const i=`${e}|${t}`;!o.reload&&this.store.hasResourceBundle(e,t)?this.state[i]=2:this.state[i]<0||(1===this.state[i]?void 0===s[i]&&(s[i]=!0):(this.state[i]=1,n=!1,void 0===s[i]&&(s[i]=!0),void 0===r[i]&&(r[i]=!0),void 0===a[t]&&(a[t]=!0)))}),n||(i[e]=!0)}),(Object.keys(r).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(r),pending:Object.keys(s),toLoadLanguages:Object.keys(i),toLoadNamespaces:Object.keys(a)}}loaded(e,t,o){const n=e.split("|"),r=n[0],s=n[1];t&&this.emit("failedLoading",r,s,t),!t&&o&&this.store.addResourceBundle(r,s,o,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&o&&(this.state[e]=0);const i={};this.queue.forEach(o=>{((e,t,o)=>{const{obj:n,k:r}=Jt(e,t,Object);n[r]=n[r]||[],n[r].push(o)})(o.loaded,[r],s),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(o,e),t&&o.errors.push(t),0!==o.pendingCount||o.done||(Object.keys(o.loaded).forEach(e=>{i[e]||(i[e]={});const t=o.loaded[e];t.length&&t.forEach(t=>{void 0===i[e][t]&&(i[e][t]=!0)})}),o.done=!0,o.errors.length?o.callback(o.errors):o.callback())}),this.emit("loaded",i),this.queue=this.queue.filter(e=>!e.done)}read(e,t,o,n=0,r=this.retryTimeout,s){if(!e.length)return s(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:o,tried:n,wait:r,callback:s});this.readingCalls++;const i=(i,a)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}i&&a&&n<this.maxRetries?setTimeout(()=>{this.read.call(this,e,t,o,n+1,2*r,s)},r):s(i,a)},a=this.backend[o].bind(this.backend);if(2!==a.length)return a(e,t,i);try{const o=a(e,t);o&&"function"==typeof o.then?o.then(e=>i(null,e)).catch(i):i(null,o)}catch(e){i(e)}}prepareLoading(e,t,o={},n){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),n&&n();zt(e)&&(e=this.languageUtils.toResolveHierarchy(e)),zt(t)&&(t=[t]);const r=this.queueLoad(e,t,o,n);if(!r.toLoad.length)return r.pending.length||n(),null;r.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,o){this.prepareLoading(e,t,{},o)}reload(e,t,o){this.prepareLoading(e,t,{reload:!0},o)}loadOne(e,t=""){const o=e.split("|"),n=o[0],r=o[1];this.read(n,r,"read",void 0,void 0,(o,s)=>{o&&this.logger.warn(`${t}loading namespace ${r} for language ${n} failed`,o),!o&&s&&this.logger.log(`${t}loaded namespace ${r} for language ${n}`,s),this.loaded(e,o,s)})}saveMissing(e,t,o,n,r,s={},i=()=>{}){if(!Vt([this,"access",e=>e.services,"optionalAccess",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace])||Vt([this,"access",e=>e.services,"optionalAccess",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace,"call",e=>e(t)])){if(null!=o&&""!==o){if(Vt([this,"access",e=>e.backend,"optionalAccess",e=>e.create])){const a={...s,isUpdate:r},c=this.backend.create.bind(this.backend);if(c.length<6)try{let r;r=5===c.length?c(e,t,o,n,a):c(e,t,o,n),r&&"function"==typeof r.then?r.then(e=>i(null,e)).catch(i):i(null,r)}catch(e){i(e)}else c(e,t,o,n,i,a)}e&&e[0]&&this.store.addResource(e[0],t,o,n)}}else this.logger.warn(`did not save key "${o}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")}}const _o=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),zt(e[1])&&(t.defaultValue=e[1]),zt(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const o=e[3]||e[2];Object.keys(o).forEach(e=>{t[e]=o[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),jo=e=>(zt(e.ns)&&(e.ns=[e.ns]),zt(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),zt(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),Vt([e,"access",e=>e.supportedLngs,"optionalAccess",e=>e.indexOf,"optionalCall",e=>e("cimode")])<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),"boolean"==typeof e.initImmediate&&(e.initAsync=e.initImmediate),e),Lo=()=>{};class No extends co{constructor(e={},t){var o;if(super(),this.options=jo(e),this.services={},this.logger=ao,this.modules={external:[]},o=this,Object.getOwnPropertyNames(Object.getPrototypeOf(o)).forEach(e=>{"function"==typeof o[e]&&(o[e]=o[e].bind(o))}),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,"function"==typeof e&&(t=e,e={}),null==e.defaultNS&&e.ns&&(zt(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const o=_o();var n;this.options={...o,...this.options,...jo(e)},this.options.interpolation={...o.interpolation,...this.options.interpolation},void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator),"function"!=typeof this.options.overloadTranslationOptionHandler&&(this.options.overloadTranslationOptionHandler=o.overloadTranslationOptionHandler),!1===this.options.showSupportNotice||(Vt([n=this,"optionalAccess",e=>e.modules,"optionalAccess",e=>e.backend,"optionalAccess",e=>e.name,"optionalAccess",e=>e.indexOf,"call",e=>e("Locize")])>0||Vt([n,"optionalAccess",e=>e.modules,"optionalAccess",e=>e.backend,"optionalAccess",e=>e.constructor,"optionalAccess",e=>e.name,"optionalAccess",e=>e.indexOf,"call",e=>e("Locize")])>0||Vt([n,"optionalAccess",e=>e.options,"optionalAccess",e=>e.backend,"optionalAccess",e=>e.backends])&&n.options.backend.backends.some(e=>Vt([e,"optionalAccess",e=>e.name,"access",e=>e.indexOf,"call",e=>e("Locize")])>0||Vt([e,"optionalAccess",e=>e.constructor,"optionalAccess",e=>e.name,"access",e=>e.indexOf,"call",e=>e("Locize")])>0))||"undefined"!=typeof console&&void 0!==console.info&&console.info("🌐 i18next is maintained with support from locize.com — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙");const r=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?ao.init(r(this.modules.logger),this.options):ao.init(null,this.options),e=this.modules.formatter?this.modules.formatter:Oo;const t=new bo(this.options);this.store=new lo(this.options.resources,this.options);const n=this.services;n.logger=ao,n.resourceStore=this.store,n.languageUtils=t,n.pluralResolver=new xo(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix});this.options.interpolation.format&&this.options.interpolation.format!==o.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),!e||this.options.interpolation.format&&this.options.interpolation.format!==o.interpolation.format||(n.formatter=r(e),n.formatter.init&&n.formatter.init(n,this.options),this.options.interpolation.format=n.formatter.format.bind(n.formatter)),n.interpolator=new ko(this.options),n.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},n.backendConnector=new Ao(r(this.modules.backend),n.resourceStore,n,this.options),n.backendConnector.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(n.languageDetector=r(this.modules.languageDetector),n.languageDetector.init&&n.languageDetector.init(n,this.options.detection,this.options)),this.modules.i18nFormat&&(n.i18nFormat=r(this.modules.i18nFormat),n.i18nFormat.init&&n.i18nFormat.init(this)),this.translator=new mo(this.services,this.options),this.translator.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||(t=Lo),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(e=>{this[e]=(...t)=>this.store[e](...t)});["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});const s=Ut(),i=()=>{const e=(e,o)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),s.resolve(o),t(e,o)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?i():setTimeout(i,0),s}loadResources(e,t=Lo){let o=t;const n=zt(e)?e:this.language;if("function"==typeof e&&(o=e),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===Vt([n,"optionalAccess",e=>e.toLowerCase,"call",e=>e()])&&(!this.options.preload||0===this.options.preload.length))return o();const e=[],t=t=>{if(!t)return;if("cimode"===t)return;this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)})};if(n)t(n);else{this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e))}Vt([this,"access",e=>e.options,"access",e=>e.preload,"optionalAccess",e=>e.forEach,"optionalCall",e=>e(e=>t(e))]),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),o(e)})}else o(null)}reloadResources(e,t,o){const n=Ut();return"function"==typeof e&&(o=e,e=void 0),"function"==typeof t&&(o=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),o||(o=Lo),this.services.backendConnector.reload(e,t,e=>{n.resolve(),o(e)}),n}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&uo.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1)){for(let e=0;e<this.languages.length;e++){const t=this.languages[e];if(!(["cimode","dev"].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const o=Ut();this.emit("languageChanging",e);const n=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},r=(r,s)=>{s?this.isLanguageChangingTo===e&&(n(s),this.translator.changeLanguage(s),this.isLanguageChangingTo=void 0,this.emit("languageChanged",s),this.logger.log("languageChanged",s)):this.isLanguageChangingTo=void 0,o.resolve((...e)=>this.t(...e)),t&&t(r,(...e)=>this.t(...e))},s=t=>{e||t||!this.services.languageDetector||(t=[]);const o=zt(t)?t:t&&t[0],s=this.store.hasLanguageSomeTranslations(o)?o:this.services.languageUtils.getBestMatchFromCodes(zt(t)?[t]:t);s&&(this.language||n(s),this.translator.language||this.translator.changeLanguage(s),Vt([this,"access",e=>e.services,"access",e=>e.languageDetector,"optionalAccess",e=>e.cacheUserLanguage,"optionalCall",e=>e(s)])),this.loadResources(s,e=>{r(e,s)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(e):s(this.services.languageDetector.detect()),o}getFixedT(e,t,o){const n=(e,t,...r)=>{let s;s="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(r)):{...t},s.lng=s.lng||n.lng,s.lngs=s.lngs||n.lngs,s.ns=s.ns||n.ns,""!==s.keyPrefix&&(s.keyPrefix=s.keyPrefix||o||n.keyPrefix);const i=this.options.keySeparator||".";let a;return s.keyPrefix&&Array.isArray(e)?a=e.map(e=>("function"==typeof e&&(e=ho(e,{...this.options,...t})),`${s.keyPrefix}${i}${e}`)):("function"==typeof e&&(e=ho(e,{...this.options,...t})),a=s.keyPrefix?`${s.keyPrefix}${i}${e}`:e),this.t(a,s)};return zt(e)?n.lng=e:n.lngs=e,n.ns=t,n.keyPrefix=o,n}t(...e){return Vt([this,"access",e=>e.translator,"optionalAccess",e=>e.translate,"call",t=>t(...e)])}exists(...e){return Vt([this,"access",e=>e.translator,"optionalAccess",e=>e.exists,"call",t=>t(...e)])}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const o=t.lng||this.resolvedLanguage||this.languages[0],n=!!this.options&&this.options.fallbackLng,r=this.languages[this.languages.length-1];if("cimode"===o.toLowerCase())return!0;const s=(e,t)=>{const o=this.services.backendConnector.state[`${e}|${t}`];return-1===o||0===o||2===o};if(t.precheck){const e=t.precheck(this,s);if(void 0!==e)return e}return!!this.hasResourceBundle(o,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!s(o,e)||n&&!s(r,e)))}loadNamespaces(e,t){const o=Ut();return this.options.ns?(zt(e)&&(e=[e]),e.forEach(e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}),this.loadResources(e=>{o.resolve(),t&&t(e)}),o):(t&&t(),Promise.resolve())}loadLanguages(e,t){const o=Ut();zt(e)&&(e=[e]);const n=this.options.preload||[],r=e.filter(e=>n.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return r.length?(this.options.preload=n.concat(r),this.loadResources(e=>{o.resolve(),t&&t(e)}),o):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(Vt([this,"access",e=>e.languages,"optionalAccess",e=>e.length])>0?this.languages[0]:this.language)),!e)return"rtl";try{const t=new Intl.Locale(e);if(t&&t.getTextInfo){const e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch(e){}const t=Vt([this,"access",e=>e.services,"optionalAccess",e=>e.languageUtils])||new bo(_o());return e.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){const o=new No(e,t);return o.createInstance=No.createInstance,o}cloneInstance(e={},t=Lo){const o=e.forkResourceStore;o&&delete e.forkResourceStore;const n={...this.options,...e,isClone:!0},r=new No(n);void 0===e.debug&&void 0===e.prefix||(r.logger=r.logger.clone(e));if(["store","services","language"].forEach(e=>{r[e]=this[e]}),r.services={...this.services},r.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},o){const e=Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((o,n)=>(o[n]={...e[t][n]},o),e[t]),e),{});r.store=new lo(e,n),r.services.resourceStore=r.store}if(e.interpolation){const t={..._o().interpolation,...this.options.interpolation,...e.interpolation},o={...n,interpolation:t};r.services.interpolator=new ko(o)}return r.translator=new mo(r.services,n),r.translator.on("*",(e,...t)=>{r.emit(e,...t)}),r.init(n,t),r.translator.options=n,r.translator.backendConnector.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},r}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Ro=No.createInstance();Ro.createInstance,Ro.dir,Ro.init,Ro.loadResources,Ro.reloadResources,Ro.use,Ro.changeLanguage,Ro.getFixedT,Ro.t,Ro.exists,Ro.setDefaultNamespace,Ro.hasLoadedNamespace,Ro.loadNamespaces,Ro.loadLanguages;Ro.init({fallbackLng:"en",lng:"en",debug:!0,resources:{en:{translation:{categorize:{limitMaxChoicesPerCategory:"You've reached the limit of {{maxChoicesPerCategory}} responses per area. To add another response, one must first be removed.",maxChoicesPerCategoryRestriction:"To change this value to {{maxChoicesPerCategory}}, each category must have {{maxChoicesPerCategory}} or fewer answer choice[s]."},ebsr:{part:"Part {{index}}"},numberLine:{addElementLimit_one:"You can only add {{count}} element",addElementLimit_other:"You can only add {{count}} elements",clearAll:"Clear all"},imageClozeAssociation:{reachedLimit_one:"You’ve reached the limit of {{count}} response per area. To add another response, one must first be removed.",reachedLimit_other:"Full"},drawingResponse:{fillColor:"Fill color",outlineColor:"Outline color",noFill:"No fill",lightblue:"Light blue",lightyellow:"Light yellow",red:"Red",orange:"Orange",yellow:"Yellow",violet:"Violet",blue:"Blue",green:"Green",white:"White",black:"Black",onDoubleClick:"Double click to edit this text. Press Enter to submit."},charting:{addCategory:"Add category",actions:"Actions",add:"Add",delete:"Delete",newLabel:"New label",reachedLimit_other:"There can't be more than {{count}} categories.",keyLegend:{incorrectAnswer:"Student incorrect answer",correctAnswer:"Student correct answer",correctKeyAnswer:"Answer key correct"}},graphing:{point:"Point",circle:"Circle",line:"Line",parabola:"Parabola",absolute:"Absolute Value",exponential:"Exponential",polygon:"Polygon",ray:"Ray",segment:"Segment",sine:"Sine",vector:"Vector",label:"Label",redo:"Redo",reset:"Reset"},mathInline:{primaryCorrectWithAlternates:"Note: The answer shown above is the primary correct answer specified by the author for this item, but other answers may also be recognized as correct."},multipleChoice:{minSelections:"Select at least {{minSelections}}.",maxSelections_one:"Only {{maxSelections}} answer is allowed.",maxSelections_other:"Only {{maxSelections}} answers are allowed.",minmaxSelections_equal:"Select {{minSelections}}.",minmaxSelections_range:"Select between {{minSelections}} and {{maxSelections}}."},selectText:{correctAnswerSelected:"Correct",correctAnswerNotSelected:"Correct Answer Not Selected",incorrectSelection:"Incorrect Selection",key:"Key"}},common:{undo:"Undo",clearAll:"Clear all",correct:"Correct",incorrect:"Incorrect",showCorrectAnswer:"Show correct answer",hideCorrectAnswer:"Hide correct answer",commonCorrectAnswerWithAlternates:"Note: The answer shown above is the most common correct answer for this item. One or more additional correct answers are also defined, and will also be recognized as correct.",warning:"Warning",showNote:"Show Note",hideNote:"Hide Note",cancel:"Cancel"}},es:{translation:{categorize:{limitMaxChoicesPerCategory:"Has alcanzado el límite de {{maxChoicesPerCategory}} respuestas por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.",maxChoicesPerCategoryRestriction:"Para cambiar este valor a {{maxChoicesPerCategory}}, cada categoría debe tener {{maxChoicesPerCategory}} o menos opciones de respuesta"},ebsr:{part:"Parte {{index}}"},numberLine:{addElementLimit_one:"Solo puedes agregar {{count}} elemento",addElementLimit_other:"Solo puedes agregar {{count}} elementos",clearAll:"Borrar todo"},imageClozeAssociation:{reachedLimit_one:"Has alcanzado el límite de {{count}} respuesta por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.",reachedLimit_other:"Lleno"},drawingResponse:{fillColor:"Color de relleno",outlineColor:"Color del contorno",noFill:"Sin relleno",lightblue:"Azul claro",lightyellow:"Amarillo claro",red:"Rojo",orange:"Naranja",yellow:"Amarillo",violet:"Violeta",blue:"Azul",green:"Verde",white:"Blanco",black:"Negro",onDoubleClick:"Haz doble clic para revisar este texto. Presiona el botón de ingreso para enviar"},charting:{addCategory:"Añadir categoría",actions:"Acciones",add:"Añadir",delete:"Eliminar",newLabel:"Nueva etiqueta",reachedLimit_other:"No puede haber más de {{count}} categorías.",keyLegend:{incorrectAnswer:"Respuesta incorrecta del estudiante",correctAnswer:"Respuesta correcta del estudiante",correctKeyAnswer:"Clave de respuesta correcta"}},graphing:{point:"Punto",circle:"Circulo",line:"Línea",parabola:"Parábola",absolute:"Valor absoluto",exponential:"Exponencial",polygon:"Polígono",ray:"Semirrecta",segment:"Segmento ",sine:"Seno",vector:"Vector",label:"Etiqueta",redo:"Rehacer",reset:"Reiniciar"},mathInline:{primaryCorrectWithAlternates:"Nota: La respuesta que se muestra arriba es la respuesta correcta principal especificada por el autor para esta pregunta, pero también se pueden reconocer otras respuestas como correctas."},multipleChoice:{minSelections:"Seleccione al menos {{minSelections}}.",maxSelections_one:"Sólo se permite {{maxSelections}} respuesta.",maxSelections_other:"Sólo se permiten {{maxSelections}} respuestas.",minmaxSelections_equal:"Seleccione {{minSelections}}.",minmaxSelections_range:"Seleccione entre {{minSelections}} y {{maxSelections}}."},selectText:{correctAnswerSelected:"Respuesta Correcta",correctAnswerNotSelected:"Respuesta Correcta No Seleccionada",incorrectSelection:"Selección Incorrecta",key:"Clave"}},common:{undo:"Deshacer",clearAll:"Borrar todo",correct:"Correct",incorrect:"Incorrect",showCorrectAnswer:"Mostrar respuesta correcta",hideCorrectAnswer:"Ocultar respuesta correcta",commonCorrectAnswerWithAlternates:"Nota: La respuesta que se muestra arriba es la respuesta correcta más común para esta pregunta. También se definen una o más respuestas correctas adicionales, y también se reconocerán como correctas.",warning:"Advertencia",showNote:"Mostrar Nota",hideNote:"Ocultar Nota",cancel:"Cancelar"}}}});var Po={translator:{...Ro,t:(e,t)=>{const{lng:o}=t;switch(o){case"en_US":case"en-US":t.lng="en";break;case"es_ES":case"es-ES":case"es_MX":case"es-MX":t.lng="es"}return Ro.t(e,{lng:o,...t})}},languageOptions:[{value:"en_US",label:"English (US)"},{value:"es_ES",label:"Spanish"}]};function $o(){return $o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)({}).hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},$o.apply(null,arguments)}function To(e,t){if(null==e)return{};var o={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;o[n]=e[n]}return o}function Io(e,t){return Io=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Io(e,t)}function Mo(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Io(e,t)}function Fo(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var Bo=!1;var Do=e.createContext(null),Vo=function(e){return e.scrollTop};const zo=e,Uo=t;var Ko="unmounted",Ho="exited",Wo="entering",qo="entered",Jo="exiting",Yo=function(e){function t(t,o){var n;n=e.call(this,t,o)||this;var r,s=o&&!o.isMounting?t.enter:t.appear;return n.appearStatus=null,t.in?s?(r=Ho,n.appearStatus=Wo):r=qo:r=t.unmountOnExit||t.mountOnEnter?Ko:Ho,n.state={status:r},n.nextCallback=null,n}Mo(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===Ko?{status:Ho}:null};var o=t.prototype;return o.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},o.componentDidUpdate=function(e){var t=null;if(e!==this.props){var o=this.state.status;this.props.in?o!==Wo&&o!==qo&&(t=Wo):o!==Wo&&o!==qo||(t=Jo)}this.updateStatus(!1,t)},o.componentWillUnmount=function(){this.cancelNextCallback()},o.getTimeouts=function(){var e,t,o,n=this.props.timeout;return e=t=o=n,null!=n&&"number"!=typeof n&&(e=n.exit,t=n.enter,o=void 0!==n.appear?n.appear:t),{exit:e,enter:t,appear:o}},o.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===Wo){if(this.props.unmountOnExit||this.props.mountOnEnter){var o=this.props.nodeRef?this.props.nodeRef.current:Uo.findDOMNode(this);o&&Vo(o)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Ho&&this.setState({status:Ko})},o.performEnter=function(e){var t=this,o=this.props.enter,n=this.context?this.context.isMounting:e,r=this.props.nodeRef?[n]:[Uo.findDOMNode(this),n],s=r[0],i=r[1],a=this.getTimeouts(),c=n?a.appear:a.enter;!e&&!o||Bo?this.safeSetState({status:qo},function(){t.props.onEntered(s)}):(this.props.onEnter(s,i),this.safeSetState({status:Wo},function(){t.props.onEntering(s,i),t.onTransitionEnd(c,function(){t.safeSetState({status:qo},function(){t.props.onEntered(s,i)})})}))},o.performExit=function(){var e=this,t=this.props.exit,o=this.getTimeouts(),n=this.props.nodeRef?void 0:Uo.findDOMNode(this);t&&!Bo?(this.props.onExit(n),this.safeSetState({status:Jo},function(){e.props.onExiting(n),e.onTransitionEnd(o.exit,function(){e.safeSetState({status:Ho},function(){e.props.onExited(n)})})})):this.safeSetState({status:Ho},function(){e.props.onExited(n)})},o.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},o.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},o.setNextCallback=function(e){var t=this,o=!0;return this.nextCallback=function(n){o&&(o=!1,t.nextCallback=null,e(n))},this.nextCallback.cancel=function(){o=!1},this.nextCallback},o.onTransitionEnd=function(e,t){this.setNextCallback(t);var o=this.props.nodeRef?this.props.nodeRef.current:Uo.findDOMNode(this),n=null==e&&!this.props.addEndListener;if(o&&!n){if(this.props.addEndListener){var r=this.props.nodeRef?[this.nextCallback]:[o,this.nextCallback],s=r[0],i=r[1];this.props.addEndListener(s,i)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},o.render=function(){var e=this.state.status;if(e===Ko)return null;var t=this.props,o=t.children;t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef;var n=To(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return zo.createElement(Do.Provider,{value:null},"function"==typeof o?o(e,n):zo.cloneElement(zo.Children.only(o),n))},t}(zo.Component);function Go(){}Yo.contextType=Do,Yo.propTypes={},Yo.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Go,onEntering:Go,onEntered:Go,onExit:Go,onExiting:Go,onExited:Go},Yo.UNMOUNTED=Ko,Yo.EXITED=Ho,Yo.ENTERING=Wo,Yo.ENTERED=qo,Yo.EXITING=Jo;var Qo=Yo;const Xo=e;var Zo=function(e,t){return e&&t&&t.split(" ").forEach(function(t){return n=t,void((o=e).classList?o.classList.add(n):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(o,n)||("string"==typeof o.className?o.className=o.className+" "+n:o.setAttribute("class",(o.className&&o.className.baseVal||"")+" "+n)));var o,n})},en=function(e,t){return e&&t&&t.split(" ").forEach(function(t){return n=t,void((o=e).classList?o.classList.remove(n):"string"==typeof o.className?o.className=Fo(o.className,n):o.setAttribute("class",Fo(o.className&&o.className.baseVal||"",n)));var o,n})},tn=function(e){function t(){for(var t,o=arguments.length,n=new Array(o),r=0;r<o;r++)n[r]=arguments[r];return(t=e.call.apply(e,[this].concat(n))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,o){var n=t.resolveArguments(e,o),r=n[0],s=n[1];t.removeClasses(r,"exit"),t.addClass(r,s?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,o)},t.onEntering=function(e,o){var n=t.resolveArguments(e,o),r=n[0],s=n[1]?"appear":"enter";t.addClass(r,s,"active"),t.props.onEntering&&t.props.onEntering(e,o)},t.onEntered=function(e,o){var n=t.resolveArguments(e,o),r=n[0],s=n[1]?"appear":"enter";t.removeClasses(r,s),t.addClass(r,s,"done"),t.props.onEntered&&t.props.onEntered(e,o)},t.onExit=function(e){var o=t.resolveArguments(e)[0];t.removeClasses(o,"appear"),t.removeClasses(o,"enter"),t.addClass(o,"exit","base"),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var o=t.resolveArguments(e)[0];t.addClass(o,"exit","active"),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var o=t.resolveArguments(e)[0];t.removeClasses(o,"exit"),t.addClass(o,"exit","done"),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,o){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,o]},t.getClassNames=function(e){var o=t.props.classNames,n="string"==typeof o,r=n?""+(n&&o?o+"-":"")+e:o[e];return{baseClassName:r,activeClassName:n?r+"-active":o[e+"Active"],doneClassName:n?r+"-done":o[e+"Done"]}},t}Mo(t,e);var o=t.prototype;return o.addClass=function(e,t,o){var n=this.getClassNames(t)[o+"ClassName"],r=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===o&&r&&(n+=" "+r),"active"===o&&e&&Vo(e),n&&(this.appliedClasses[t][o]=n,Zo(e,n))},o.removeClasses=function(e,t){var o=this.appliedClasses[t],n=o.base,r=o.active,s=o.done;this.appliedClasses[t]={},n&&en(e,n),r&&en(e,r),s&&en(e,s)},o.render=function(){var e=this.props;e.classNames;var t=To(e,["classNames"]);return Xo.createElement(Qo,$o({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(Xo.Component);tn.defaultProps={classNames:""},tn.propTypes={};var on=tn;const{Children:nn}=e,{cloneElement:rn}=e,{isValidElement:sn}=e;function an(e,t){var o=Object.create(null);return e&&nn.map(e,function(e){return e}).forEach(function(e){o[e.key]=function(e){return t&&sn(e)?t(e):e}(e)}),o}function cn(e,t,o){return null!=o[t]?o[t]:e.props[t]}function ln(e,t,o){var n=an(e.children),r=function(e,t){function o(o){return o in t?t[o]:e[o]}e=e||{},t=t||{};var n,r=Object.create(null),s=[];for(var i in e)i in t?s.length&&(r[i]=s,s=[]):s.push(i);var a={};for(var c in t){if(r[c])for(n=0;n<r[c].length;n++){var l=r[c][n];a[r[c][n]]=o(l)}a[c]=o(c)}for(n=0;n<s.length;n++)a[s[n]]=o(s[n]);return a}(t,n);return Object.keys(r).forEach(function(s){var i=r[s];if(sn(i)){var a=s in t,c=s in n,l=t[s],u=sn(l)&&!l.props.in;!c||a&&!u?c||!a||u?c&&a&&sn(l)&&(r[s]=rn(i,{onExited:o.bind(null,i),in:l.props.in,exit:cn(i,"exit",e),enter:cn(i,"enter",e)})):r[s]=rn(i,{in:!1}):r[s]=rn(i,{onExited:o.bind(null,i),in:!0,exit:cn(i,"exit",e),enter:cn(i,"enter",e)})}}),r}const un=e;var pn=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},hn=function(e){function t(t,o){var n,r=(n=e.call(this,t,o)||this).handleExited.bind(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(n));return n.state={contextValue:{isMounting:!0},handleExited:r,firstRender:!0},n}Mo(t,e);var o=t.prototype;return o.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},o.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(e,t){var o,n,r=t.children,s=t.handleExited;return{children:t.firstRender?(o=e,n=s,an(o.children,function(e){return rn(e,{onExited:n.bind(null,e),in:!0,appear:cn(e,"appear",o),enter:cn(e,"enter",o),exit:cn(e,"exit",o)})})):ln(e,r,s),firstRender:!1}},o.handleExited=function(e,t){var o=an(this.props.children);e.key in o||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState(function(t){var o=$o({},t.children);return delete o[e.key],{children:o}}))},o.render=function(){var e=this.props,t=e.component,o=e.childFactory,n=To(e,["component","childFactory"]),r=this.state.contextValue,s=pn(this.state.children).map(o);return delete n.appear,delete n.enter,delete n.exit,null===t?un.createElement(Do.Provider,{value:r},s):un.createElement(Do.Provider,{value:r},un.createElement(t,n,s))},t}(un.Component);hn.propTypes={},hn.defaultProps={component:"div",childFactory:function(e){return e}};var dn=hn;const gn=e,{styled:fn}=o,{Box:mn}=n,bn=r,{color:yn}=s,vn=fn(mn)({width:"33px",height:"33px","& svg":{position:"absolute",display:"inline-block",width:"33px",height:"33px",verticalAlign:"middle","& hide":{display:"none"}}}),xn=fn("svg")({"& .incorrect-fill":{fill:`var(--feedback-incorrect-bg-color, ${yn.incorrect()})`},"& .correct-fill":{fill:`var(--feedback-correct-bg-color, ${yn.correct()})`}}),Sn=fn("div")({position:"relative","&.feedback-tick-enter":{opacity:"0",left:"-50px"},"&.feedback-tick-enter-active":{opacity:"1",left:"0px",transition:"left 500ms ease-in 200ms, opacity 500ms linear 200ms"},"&.feedback-tick-exit":{opacity:"1",left:"0px"},"&.feedback-tick-exit-active":{opacity:"0",left:"-50px",transition:"left 300ms ease-in, opacity 300ms"}});class Cn extends gn.Component{static __initStatic(){this.propTypes={correctness:bn.string}}constructor(e){super(e),Cn.prototype.__init.call(this),Cn.prototype.__init2.call(this),this.nodeRef=gn.createRef()}__init(){this.getIncorrectIcon=()=>gn.createElement(xn,{key:"1",preserveAspectRatio:"xMinYMin meet",x:"0px",y:"0px",viewBox:"0 0 44 40",style:{enableBackground:"new 0 0 44 40"}},gn.createElement("g",null,gn.createElement("rect",{x:"11",y:"17.3",transform:"matrix(0.7071 -0.7071 0.7071 0.7071 -7.852 19.2507)",className:"incorrect-fill",width:"16.6",height:"3.7"}),gn.createElement("rect",{x:"17.4",y:"10.7",transform:"matrix(0.7071 -0.7071 0.7071 0.7071 -7.8175 19.209)",className:"incorrect-fill",width:"3.7",height:"16.6"})))}__init2(){this.getCorrectIcon=()=>gn.createElement(xn,{key:"2",preserveAspectRatio:"xMinYMin meet",version:"1.1",x:"0px",y:"0px",viewBox:"0 0 44 40",style:{enableBackground:"new 0 0 44 40"}},gn.createElement("polygon",{className:"correct-fill",points:"19.1,28.6 11.8,22.3 14.4,19.2 17.9,22.1 23.9,11.4 27.5,13.4"}))}render(){const{correctness:e}=this.props,t=(()=>"incorrect"===e?this.getIncorrectIcon():"correct"===e?this.getCorrectIcon():null)();return gn.createElement(vn,null,gn.createElement(dn,null,e&&gn.createElement(on,{nodeRef:this.nodeRef,classNames:{enter:"feedback-tick-enter",enterActive:"feedback-tick-enter-active",exit:"feedback-tick-exit",exitActive:"feedback-tick-exit-active"},timeout:{enter:700,exit:300}},gn.createElement(Sn,{ref:this.nodeRef},t))))}}Cn.__initStatic();const{FormControlLabel:kn}=n,{Box:wn}=n,{Checkbox:En}=n,{Radio:On}=n,An=e,_n=r,{styled:jn}=o,{Feedback:Ln}=s,{color:Nn}=s,{PreviewPrompt:Rn}=s,Pn=i,$n="multiple-choice-component",Tn=jn(wn)({display:"flex",alignItems:"center",backgroundColor:Nn.background()}),In=jn(wn)({display:"flex",alignItems:"center",backgroundColor:Nn.background(),flex:1,"& .MuiFormControlLabel-root":{marginLeft:"-14px"},"& label":{color:Nn.text(),"& > span":{fontSize:"inherit"},"& > .MuiButtonBase-root":{padding:"12px"}}}),Mn=jn("span")(({theme:e})=>({display:"flex",alignItems:"center","& > span":{marginLeft:`-${e.spacing(1)}`}})),Fn=jn("span")({position:"absolute",left:"-10000px",top:"auto",width:"1px",height:"1px",overflow:"hidden"}),Bn=jn(kn)({"& .MuiFormControlLabel-label":{color:`${Nn.text()} !important`,backgroundColor:Nn.background(),letterSpacing:"normal"},"&.Mui-disabled *":{cursor:"not-allowed !important"}}),Dn=(e,t)=>({[`&.${$n}`]:{color:`var(--choice-input-${e}, ${t}) !important`}}),Vn=e=>{const t=t=>e?`${e}-${t}`:t;return{[t("root")]:{...Dn("color",Nn.text()),...e?{}:{"&:hover":{color:`${Nn.primaryLight()} !important`}},..."correct"===e?Dn("correct-color",Nn.text()):{},..."incorrect"===e?Dn("incorrect-color",Nn.incorrect()):{}},[t("checked")]:{..."correct"===e?Dn("correct-selected-color",Nn.correct()):{},..."incorrect"===e?Dn("incorrect-checked",Nn.incorrect()):{},...e?{}:Dn("selected-color",Nn.primary())},[t("disabled")]:{...Dn("disabled-color",Nn.text()),..."correct"===e?Dn("correct-disabled-color",Nn.disabled()):{},..."incorrect"===e?Dn("incorrect-disabled-color",Nn.disabled()):{},opacity:.6,cursor:"not-allowed !important",pointerEvents:"initial !important"},focusVisibleUnchecked:{outline:`2px solid ${Nn.focusUncheckedBorder()}`,backgroundColor:Nn.focusUnchecked()},focusVisibleChecked:{outline:`2px solid ${Nn.focusCheckedBorder()}`,backgroundColor:Nn.focusChecked()}}},zn=jn(En,{shouldForwardProp:e=>"correctness"!==e})(({correctness:e})=>{const t=Vn(e),o=t=>e?`${e}-${t}`:t;return{[`&.${$n}`]:{...t[o("root")],"&.Mui-checked":t[o("checked")],"&.Mui-disabled":e?{}:t[o("disabled")]},"&.Mui-focusVisible":{"&:not(.Mui-checked)":t.focusVisibleUnchecked,"&.Mui-checked":t.focusVisibleChecked}}}),Un=e=>{const{correctness:t,checked:o,onChange:n,disabled:r,value:s,id:i,onKeyDown:a,inputRef:c}=e,l={checked:o,onChange:n,disabled:r,value:s};return An.createElement(zn,{id:i,slotProps:{input:{ref:c}},onKeyDown:a,disableRipple:!0,...l,correctness:t,className:$n})},Kn=jn(On,{shouldForwardProp:e=>"correctness"!==e})(({correctness:e})=>{const t=Vn(e),o=t=>e?`${e}-${t}`:t;return{[`&.${$n}`]:{...t[o("root")],"&.Mui-checked":t[o("checked")],"&.Mui-disabled":e?{}:t[o("disabled")]},"&.Mui-focusVisible":{"&:not(.Mui-checked)":t.focusVisibleUnchecked,"&.Mui-checked":t.focusVisibleChecked}}}),Hn=e=>{const{correctness:t,checked:o,onChange:n,disabled:r,value:s,id:i,tagName:a,inputRef:c}=e,l={checked:o,onChange:n,disabled:r,value:s};return An.createElement(Kn,{id:i,slotProps:{input:{ref:c}},disableRipple:!0,...l,correctness:t,className:$n,name:a})};class Wn extends An.Component{static __initStatic(){this.propTypes={choiceMode:_n.oneOf(["radio","checkbox"]),displayKey:_n.string,checked:_n.bool.isRequired,correctness:_n.string,disabled:_n.bool.isRequired,feedback:_n.string,label:_n.string.isRequired,rationale:_n.string,onChange:_n.func.isRequired,value:_n.string.isRequired,className:_n.string,tagName:_n.string,hideTick:_n.bool,isEvaluateMode:_n.bool,choicesLayout:_n.oneOf(["vertical","grid","horizontal"]),isSelectionButtonBelow:_n.bool}}static __initStatic2(){this.defaultProps={rationale:null,checked:!1,isEvaluateMode:!1}}constructor(e){super(e),Wn.prototype.__init.call(this),this.onToggleChoice=this.onToggleChoice.bind(this),this.choiceId=this.generateChoiceId(),this.descId=`${this.choiceId}-desc`}onToggleChoice(e){this.props.onChange(e)}generateChoiceId(){return"choice-"+(1e4*Math.random()).toFixed()}__init(){this.handleKeyDown=e=>{const{choiceMode:t}=this.props;if("checkbox"!==t)return;const o="ArrowDown"===e.key,n="ArrowUp"===e.key;if(!o&&!n)return;e.preventDefault();const r=document.getElementById(this.choiceId);if(!r)return;const s=r.closest("fieldset");if(!s)return;const i=Array.from(s.querySelectorAll('input[type="checkbox"]')),a=i.findIndex(e=>e===r);if(-1===a)return;const c=i[o?a+1:a-1];c&&c.focus()}}render(){const{choiceMode:e,disabled:t,displayKey:o,feedback:n,label:r,correctness:s,className:i,rationale:a,hideTick:c,isEvaluateMode:l,choicesLayout:u,value:p,checked:h,tagName:d,isSelectionButtonBelow:g}=this.props,f="checkbox"===e?Un:Hn,m="checkbox"===e?"checkbox":"radio-button",b={..."horizontal"===u&&{[`& .${$n}`]:{padding:"8px",margin:"4px 0 4px 4px"}},...g&&"grid"!==u&&{"& > label":{alignItems:"flex-start"}},...g&&"grid"===u&&{justifyContent:"center","& > label":{alignItems:"center"}}},y="string"==typeof r&&(r.includes("<math")||r.includes("\\(")||r.includes("\\[")||r.includes("<img")||r.includes("data-latex")||r.includes("data-raw")||r.includes("<mjx-container")),v=o?An.createElement(Fn,{id:this.descId},y?`Pick the answer below, ${o}`:o):null,x=An.createElement(An.Fragment,null,o&&!g?An.createElement(Tn,{component:"span"},An.createElement("span",{"aria-hidden":"true"},o,"."," "),An.createElement(Rn,{className:"prompt-label",prompt:r,tagName:"span"})):An.createElement(Rn,{className:"prompt-label",prompt:r,tagName:"span"})),S={disabled:t,checked:h,correctness:s,tagName:d,value:p,id:this.choiceId,onChange:this.onToggleChoice,onKeyDown:this.handleKeyDown,...v?{"aria-describedby":this.descId}:{}},C=g?An.createElement(Mn,null,v,An.createElement(f,{...S,style:{padding:0}}),An.createElement("span",{"aria-hidden":"true"},o?`${o}.`:"")):An.createElement(An.Fragment,null,v,An.createElement(f,{...S,slotProps:{input:{ref:this.props.autoFocusRef}}}));return An.createElement("div",{className:Pn(i,"corespring-"+m,"choice-input")},An.createElement(Tn,null,!c&&l&&An.createElement(Cn,{correctness:s}),An.createElement(In,{className:"checkbox-holder",sx:b},An.createElement(Bn,{label:x,value:p,htmlFor:this.choiceId,labelPlacement:g?"top":void 0,control:C}))),a&&An.createElement(Rn,{className:"rationale",defaultClassName:"rationale",prompt:a}),An.createElement(Ln,{feedback:n,correctness:s}))}}Wn.__initStatic(),Wn.__initStatic2();const qn=e,Jn=r,{styled:Yn}=o,{Box:Gn}=n,Qn=Yn(Gn,{shouldForwardProp:e=>"noBorder"!==e&&"horizontalLayout"!==e})(({theme:e,noBorder:t,horizontalLayout:o})=>({paddingTop:e.spacing(2.5),paddingBottom:`calc(${e.spacing(1)} + 2px)`,paddingLeft:`calc(${e.spacing(1)} + 2px)`,paddingRight:`calc(${e.spacing(1)} + 2px)`,borderBottom:t?"none":`1px solid ${e.palette.grey[300]}`,...o&&{paddingRight:e.spacing(2.5),"& label":{marginRight:e.spacing(1)}}}));class Xn extends qn.Component{constructor(...e){super(...e),Xn.prototype.__init.call(this),Xn.prototype.__init2.call(this),Xn.prototype.__init3.call(this),Xn.prototype.__init4.call(this)}static __initStatic(){this.propTypes={}}__init(){this.state={isHovered:!1}}__init2(){this.handleMouseEnter=()=>{const{disabled:e,checked:t}=this.props;e||t||this.setState({isHovered:!0})}}__init3(){this.handleMouseLeave=()=>{this.setState({isHovered:!1})}}__init4(){this.onChange=e=>{const{disabled:t,onChoiceChanged:o}=this.props;t||o(e)}}render(){const{choice:e,index:t,choicesLength:o,showCorrect:n,isEvaluateMode:r,choiceMode:s,disabled:i,checked:a,correctness:c,displayKey:l,choicesLayout:u,gridColumns:p,isSelectionButtonBelow:h,selectedAnswerBackgroundColor:d,selectedAnswerStrokeColor:g,selectedAnswerStrokeWidth:f,hoverAnswerBackgroundColor:m,hoverAnswerStrokeColor:b,hoverAnswerStrokeWidth:y,autoFocusRef:v,tagName:x}=this.props,{isHovered:S}=this.state,C="choice"+(t===o-1?" last":""),k=!r||n?"":e.feedback,w={...e,checked:a,choiceMode:s,disabled:i,feedback:k,correctness:c,displayKey:l,index:t,choicesLayout:u,gridColumns:p,onChange:this.onChange,isEvaluateMode:r,isSelectionButtonBelow:h,selectedAnswerStrokeColor:g,selectedAnswerStrokeWidth:f,tagName:x},E=g&&"initial"!==g,O=b&&"initial"!==b;let A="transparent",_="2px",j="initial";(E||O)&&(a&&E?(A=g,_=f):S&&!i&&O&&(A=b,_=y)),a&&d&&"initial"!==d?j=d:S&&!i&&m&&"initial"!==m&&(j=m);const L=E||O,N=L?{border:`${(e=>{if(!e)return"2px";const t=String(e).trim();return/^\d+(\.\d+)?$/.test(t)?`${t}px`:t})(_)} solid ${A}`,borderRadius:"8px"}:{},R=t===o-1||"vertical"!==u||L,P="horizontal"===u,$="initial"!==j?j:"initial";return qn.createElement("div",{className:C,key:t,style:{backgroundColor:$,...N},onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave},qn.createElement(Qn,{component:"div",noBorder:R,horizontalLayout:P},qn.createElement(Wn,{...w,autoFocusRef:v})))}}Xn.__initStatic(),Xn.propTypes={choiceMode:Jn.oneOf(["radio","checkbox"]),choice:Jn.object,disabled:Jn.bool.isRequired,onChoiceChanged:Jn.func,index:Jn.number,choicesLength:Jn.number,showCorrect:Jn.bool,isEvaluateMode:Jn.bool,checked:Jn.bool,correctness:Jn.string,displayKey:Jn.string,choicesLayout:Jn.oneOf(["vertical","grid","horizontal"]),gridColumns:Jn.string,selectedAnswerBackgroundColor:Jn.string,selectedAnswerStrokeColor:Jn.string,selectedAnswerStrokeWidth:Jn.string,hoverAnswerBackgroundColor:Jn.string,hoverAnswerStrokeColor:Jn.string,hoverAnswerStrokeWidth:Jn.string,tagName:Jn.string,isSelectionButtonBelow:Jn.bool,autoFocusRef:Jn.object};const Zn=e,er=r,tr=a,or=i,{styled:nr}=o,{Box:rr}=n,{color:sr}=s,{Collapsible:ir}=s,{PreviewPrompt:ar}=s;const{translator:cr}=Po,lr=nr(rr)({color:sr.text(),backgroundColor:sr.background(),"& *":{"-webkit-font-smoothing":"antialiased"},position:"relative","& legend":{border:"none !important"}}),ur=nr("h2")(({theme:e})=>({display:"block",fontSize:"inherit",margin:"0",fontWeight:"normal",paddingBottom:e.spacing(2)})),pr=nr(rr)(({theme:e})=>({marginBottom:e.spacing(2)})),hr=nr(rr)({display:"flex",flexDirection:"row",flexWrap:"wrap"}),dr=nr(rr)({display:"grid"}),gr=nr("fieldset")({border:"0px",padding:"0.01em 0 0 0",margin:"0px",minWidth:"0px","&:focus":{outline:"none"}}),fr=nr("h3")({position:"absolute",left:"-10000px",top:"auto",width:"1px",height:"1px",overflow:"hidden"}),mr=nr("div")(({theme:e})=>({fontSize:e.typography.fontSize-2,color:e.palette.error.main,paddingTop:e.spacing(1)}));class br extends Zn.Component{static __initStatic(){this.propTypes={className:er.string,mode:er.oneOf(["gather","view","evaluate"]),choiceMode:er.oneOf(["radio","checkbox"]),keyMode:er.oneOf(["numbers","letters","none"]),choices:er.array,partLabel:er.string,prompt:er.string,teacherInstructions:er.string,session:er.object,disabled:er.bool,onChoiceChanged:er.func,responseCorrect:er.bool,correctResponse:er.array,choicesLayout:er.oneOf(["vertical","grid","horizontal"]),gridColumns:er.string,alwaysShowCorrect:er.bool,animationsDisabled:er.bool,language:er.string,selectedAnswerBackgroundColor:er.string,selectedAnswerStrokeColor:er.string,selectedAnswerStrokeWidth:er.string,hoverAnswerBackgroundColor:er.string,hoverAnswerStrokeColor:er.string,hoverAnswerStrokeWidth:er.string,onShowCorrectToggle:er.func,isSelectionButtonBelow:er.bool,minSelections:er.number,maxSelections:er.number,autoplayAudioEnabled:er.bool,customAudioButton:{playImage:er.string,pauseImage:er.string},options:er.object}}constructor(e){super(e),br.prototype.__init.call(this),br.prototype.__init2.call(this),br.prototype.__init3.call(this),br.prototype.__init4.call(this),this.state={showCorrect:this.props.options&&this.props.alwaysShowCorrect||!1,maxSelectionsErrorState:!1},this.onToggle=this.onToggle.bind(this),this.firstInputRef=Zn.createRef()}isSelected(e){const t=this.props.session&&this.props.session.value;return t&&t.indexOf&&t.indexOf(e)>=0}__init(){this.handleChange=e=>{const{value:t,checked:o}=e.target,{maxSelections:n,onChoiceChanged:r,session:s}=this.props;s.value&&s.value.length>=n&&(this.setState({maxSelectionsErrorState:o}),o)||r({value:t,selected:o,selector:"Mouse"})}}__init2(){this.onToggle=()=>{"evaluate"===this.props.mode&&this.setState({showCorrect:!this.state.showCorrect},()=>{this.props.onShowCorrectToggle&&this.props.onShowCorrectToggle()})}}UNSAFE_componentWillReceiveProps(e){e.correctResponse||!1===this.state.showCorrect||this.setState({showCorrect:!1},()=>{this.props.onShowCorrectToggle&&this.props.onShowCorrectToggle()}),e.options&&e.alwaysShowCorrect&&!0!==this.state.showCorrect&&this.setState({showCorrect:!0},()=>{this.props.onShowCorrectToggle&&this.props.onShowCorrectToggle()})}indexToSymbol(e){return"numbers"===this.props.keyMode?`${e+1}`:"letters"===this.props.keyMode?String.fromCharCode(97+e).toUpperCase():""}__init3(){this.getCorrectness=(e={})=>{const t=e.correct,o=this.isSelected(e.value);return this.state.showCorrect?t?"correct":void 0:t?o?"correct":"incorrect":o?"incorrect":void 0}}getChecked(e){if(this.props.options&&this.props.alwaysShowCorrect)return e.correct||!1;return this.state.showCorrect&&"evaluate"===this.props.mode?e.correct||!1:this.isSelected(e.value)}renderHeading(){const{mode:e,choiceMode:t}=this.props;return"gather"!==e?null:"radio"===t?Zn.createElement(fr,null,"Multiple Choice Question"):Zn.createElement(fr,null,"Multiple Select Question")}__init4(){this.handleGroupFocus=e=>{const t=e.currentTarget,o=document.activeElement;t.contains(o)&&o!==t||(!e.relatedTarget||t.compareDocumentPosition(e.relatedTarget)&Node.DOCUMENT_POSITION_PRECEDING)&&function(e){let t,o=e[0],n=1;for(;n<e.length;){const r=e[n],s=e[n+1];if(n+=2,("optionalAccess"===r||"optionalCall"===r)&&null==o)return;"access"===r||"optionalAccess"===r?(t=o,o=s(o)):"call"!==r&&"optionalCall"!==r||(o=s((...e)=>o.call(t,...e)),t=void 0)}return o}([this,"access",e=>e.firstInputRef,"optionalAccess",e=>e.current])&&this.firstInputRef.current.focus()}}render(){const{mode:e,disabled:t,className:o,choices:n=[],choiceMode:r,gridColumns:s,partLabel:i,prompt:a,responseCorrect:c,teacherInstructions:l,alwaysShowCorrect:u,animationsDisabled:p,language:h,isSelectionButtonBelow:d,minSelections:g,maxSelections:f,autoplayAudioEnabled:m,session:b,customAudioButton:y,options:v}=this.props,{showCorrect:x,maxSelectionsErrorState:S}=this.state,C="evaluate"===e,k=C&&!c,w=s>1?{gridTemplateColumns:`repeat(${s}, 1fr)`}:void 0,E=b.value&&b.value.length||0,O=Zn.createElement(ar,{tagName:"div",className:"prompt",defaultClassName:"teacher-instructions",prompt:l}),A="grid"===this.props.choicesLayout?dr:"horizontal"===this.props.choicesLayout?hr:rr;return Zn.createElement(lr,{id:"main-container",className:or(o,"multiple-choice")},i&&Zn.createElement(ur,null,i),this.renderHeading(),l&&Zn.createElement(pr,null,p?O:Zn.createElement(ir,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},O)),Zn.createElement(gr,{tabIndex:0,onFocus:this.handleGroupFocus,role:"radio"===r?"radiogroup":"group"},Zn.createElement(ar,{className:"prompt",defaultClassName:"prompt",prompt:a,tagName:"legend",autoplayAudioEnabled:m,customAudioButton:y}),!(v&&u)&&Zn.createElement(tr,{show:k,toggled:x,onToggle:this.onToggle.bind(this),language:h}),Zn.createElement(A,{style:w},n.map((e,o)=>Zn.createElement(Xn,{autoFocusRef:0===o?this.firstInputRef:null,choicesLayout:this.props.choicesLayout,selectedAnswerBackgroundColor:this.props.selectedAnswerBackgroundColor,selectedAnswerStrokeColor:this.props.selectedAnswerStrokeColor,selectedAnswerStrokeWidth:this.props.selectedAnswerStrokeWidth,hoverAnswerBackgroundColor:this.props.hoverAnswerBackgroundColor,hoverAnswerStrokeColor:this.props.hoverAnswerStrokeColor,hoverAnswerStrokeWidth:this.props.hoverAnswerStrokeWidth,gridColumns:s,key:`choice-${o}`,choice:e,index:o,choicesLength:n.length,showCorrect:x,isEvaluateMode:C,choiceMode:r,disabled:t,tagName:i?`group-${i}`:"group",onChoiceChanged:this.handleChange,hideTick:e.hideTick,checked:this.getChecked(e),correctness:C?this.getCorrectness(e):void 0,displayKey:this.indexToSymbol(o),isSelectionButtonBelow:d})))),"checkbox"===r&&E<g&&Zn.createElement(mr,null,g&&f?g===f?cr.t("translation:multipleChoice:minmaxSelections_equal",{lng:h,minSelections:g}):cr.t("translation:multipleChoice:minmaxSelections_range",{lng:h,minSelections:g,maxSelections:f}):g?cr.t("translation:multipleChoice:minSelections",{lng:h,minSelections:g}):""),"checkbox"===r&&S&&Zn.createElement(mr,null,cr.t("translation:multipleChoice:maxSelections_"+(1===f?"one":"other"),{lng:h,maxSelections:f})))}}br.__initStatic(),br.defaultProps={session:{value:[]}};const yr=e,vr=r,{PreviewLayout:xr}=s;class Sr extends yr.Component{static __initStatic(){this.propTypes={model:vr.object,session:vr.object,options:vr.object,onChoiceChanged:vr.func,onShowCorrectToggle:vr.func,extraCSSRules:vr.shape({names:vr.arrayOf(vr.string),rules:vr.string})}}static __initStatic2(){this.defaultProps={model:{},session:{}}}render(){const{model:e,onChoiceChanged:t,session:o,onShowCorrectToggle:n,options:r}=this.props,{extraCSSRules:s,fontSizeFactor:i}=e;return yr.createElement(xr,{extraCSSRules:s,fontSizeFactor:i,classes:{}},yr.createElement(br,{...e,options:r,session:o,onChoiceChanged:t,onShowCorrectToggle:n}))}}Sr.__initStatic(),Sr.__initStatic2();const Cr=e,{createRoot:kr}=l,wr=c,{renderMath:Er}=u,Or=wr("pie-element:multiple-choice:print"),Ar=(e,t)=>{const o="instructor"===t.role;e.prompt=!1!==e.promptEnabled?e.prompt:void 0,e.teacherInstructions=o&&!1!==e.teacherInstructionsEnabled?e.teacherInstructions:void 0,e.showTeacherInstructions=o,e.alwaysShowCorrect=o,e.mode=o?"evaluate":e.mode,e.disabled=!0,e.animationsDisabled=!0,e.lockChoiceOrder=!0,e.choicesLayout=e.choicesLayout||"vertical";const n=Tt(e.choices,5);return e.choices=n.map(t=>(t.rationale=o&&!1!==e.rationaleEnabled?t.rationale:void 0,t.hideTick=o,t.feedback=void 0,t)),e.keyMode=e.choicePrefix||"letters",e};class _r extends HTMLElement{constructor(){super(),this._options=null,this._model=null,this._session=[],this._root=null,this._rerender=Bt(()=>{if(this._model&&this._session){const e=Ar(this._model,this._options),t=this._options&&Cr.createElement(Sr,{model:e,session:{},options:this._options});this._root||(this._root=kr(this)),this._root.render(t),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Or("render complete - render math"),Er(this)})})}else Or("skip")},50,{leading:!1,trailing:!0})}set options(e){this._options=e}set model(e){this._model=e,this._rerender()}connectedCallback(){}disconnectedCallback(){this._root&&this._root.unmount()}}export{_r as default};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pie-element/multiple-choice",
3
3
  "repository": "pie-framework/pie-elements",
4
- "version": "12.2.0-next.1",
4
+ "version": "12.2.0-next.11",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -11,9 +11,9 @@
11
11
  "@mui/icons-material": "^7.3.4",
12
12
  "@mui/material": "^7.3.4",
13
13
  "@pie-framework/pie-player-events": "^0.1.0",
14
- "@pie-lib/correct-answer-toggle": "3.2.0-next.4",
15
- "@pie-lib/math-rendering": "4.2.0-next.3",
16
- "@pie-lib/render-ui": "5.2.0-next.4",
14
+ "@pie-lib/correct-answer-toggle": "3.2.0-next.9",
15
+ "@pie-lib/math-rendering": "4.2.0-next.4",
16
+ "@pie-lib/render-ui": "5.2.0-next.9",
17
17
  "@pie-lib/translator": "3.2.0-next.3",
18
18
  "classnames": "^2.2.5",
19
19
  "debug": "^4.1.1",
@@ -23,7 +23,7 @@
23
23
  "react-dom": "18.3.1",
24
24
  "react-transition-group": "^4.4.5"
25
25
  },
26
- "gitHead": "5052ddbf1c97a5a414330a25b453455ae56977e9",
26
+ "gitHead": "f5114ccf4572d5dbf15c5175000fd06116878af8",
27
27
  "scripts": {
28
28
  "postpublish": "../../scripts/postpublish"
29
29
  },
@@ -35,11 +35,7 @@
35
35
  "require": "./lib/index.js",
36
36
  "default": "./lib/index.js"
37
37
  },
38
- "./print": {
39
- "import": "./lib/print.js",
40
- "require": "./lib/print.js",
41
- "default": "./lib/print.js"
42
- },
38
+ "./print": "./src/print.js",
43
39
  "./configure/lib": {
44
40
  "import": "./configure/lib/index.js",
45
41
  "require": "./configure/lib/index.js",