@pie-element/ebsr 13.1.0-next.0 → 13.1.2-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/module/print.js DELETED
@@ -1 +0,0 @@
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 s,_dll_pie_lib__render_ui as r,_dll_classnames as i,_dll_pie_lib__correct_answer_toggle as a,_dll_debug as c}from"../../../@pie-lib/shared-module@^4.0.1/module/index.js";import{_dll_pie_lib__math_rendering as l}from"../../../@pie-lib/math-rendering-module@^4.0.7/module/index.js";var u="object"==typeof global&&global&&global.Object===Object&&global,p="object"==typeof self&&self&&self.Object===Object&&self,h=u||p||Function("return this")(),d=h.Symbol,g=Object.prototype,f=g.hasOwnProperty,m=g.toString,b=d?d.toStringTag:void 0;var v=Object.prototype.toString;var y=d?d.toStringTag:void 0;function x(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":y&&y in Object(e)?function(e){var t=f.call(e,b),o=e[b];try{e[b]=void 0;var n=!0}catch(e){}var s=m.call(e);return n&&(t?e[b]=o:delete e[b]),s}(e):function(e){return v.call(e)}(e)}function S(e){return null!=e&&"object"==typeof e}function C(e){return"symbol"==typeof e||S(e)&&"[object Symbol]"==x(e)}var w=Array.isArray,k=d?d.prototype:void 0,E=k?k.toString:void 0;function _(e){if("string"==typeof e)return e;if(w(e))return function(e,t){for(var o=-1,n=null==e?0:e.length,s=Array(n);++o<n;)s[o]=t(e[o],o,e);return s}(e,_)+"";if(C(e))return E?E.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}var A=/\s/;var O=/^\s+/;function j(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&A.test(e.charAt(t)););return t}(e)+1).replace(O,""):e}function L(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var N=/^[-+]0x[0-9a-f]+$/i,R=/^0b[01]+$/i,P=/^0o[0-7]+$/i,T=parseInt;function $(e){if("number"==typeof e)return e;if(C(e))return NaN;if(L(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=L(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=j(e);var o=R.test(e);return o||P.test(e)?T(e.slice(2),o?2:8):N.test(e)?NaN:+e}function M(e){if(!L(e))return!1;var t=x(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var I,F=h["__core-js_shared__"],D=(I=/[^.]+$/.exec(F&&F.keys&&F.keys.IE_PROTO||""))?"Symbol(src)_1."+I:"";var B=Function.prototype.toString;function z(e){if(null!=e){try{return B.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var V=/^\[object .+?Constructor\]$/,U=Function.prototype,K=Object.prototype,H=U.toString,q=K.hasOwnProperty,W=RegExp("^"+H.call(q).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Y(e){return!(!L(e)||(t=e,D&&D in t))&&(M(e)?W:V).test(z(e));var t}function J(e,t){var o=function(e,t){return null==e?void 0:e[t]}(e,t);return Y(o)?o:void 0}var G=J(h,"WeakMap"),Q=Object.create,X=function(){function e(){}return function(t){if(!L(t))return{};if(Q)return Q(t);e.prototype=t;var o=new e;return e.prototype=void 0,o}}(),Z=X;var ee=function(){try{var e=J(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),te=ee;var oe=/^(?:0|[1-9]\d*)$/;function ne(e,t){var o=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==o||"symbol"!=o&&oe.test(e))&&e>-1&&e%1==0&&e<t}function se(e,t,o){"__proto__"==t&&te?te(e,t,{configurable:!0,enumerable:!0,value:o,writable:!0}):e[t]=o}function re(e,t){return e===t||e!=e&&t!=t}var ie=Object.prototype.hasOwnProperty;function ae(e,t,o){var n=e[t];ie.call(e,t)&&re(n,o)&&(void 0!==o||t in e)||se(e,t,o)}function ce(e,t,o,n){var s=!o;o||(o={});for(var r=-1,i=t.length;++r<i;){var a=t[r],c=n?n(o[a],e[a],a,o,e):void 0;void 0===c&&(c=e[a]),s?se(o,a,c):ae(o,a,c)}return o}function le(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function ue(e){return null!=e&&le(e.length)&&!M(e)}var pe=Object.prototype;function he(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||pe)}function de(e){return S(e)&&"[object Arguments]"==x(e)}var ge=Object.prototype,fe=ge.hasOwnProperty,me=ge.propertyIsEnumerable,be=de(function(){return arguments}())?de:function(e){return S(e)&&fe.call(e,"callee")&&!me.call(e,"callee")};var ve="object"==typeof exports&&exports&&!exports.nodeType&&exports,ye=ve&&"object"==typeof module&&module&&!module.nodeType&&module,xe=ye&&ye.exports===ve?h.Buffer:void 0,Se=(xe?xe.isBuffer:void 0)||function(){return!1},Ce={};function we(e){return function(t){return e(t)}}Ce["[object Float32Array]"]=Ce["[object Float64Array]"]=Ce["[object Int8Array]"]=Ce["[object Int16Array]"]=Ce["[object Int32Array]"]=Ce["[object Uint8Array]"]=Ce["[object Uint8ClampedArray]"]=Ce["[object Uint16Array]"]=Ce["[object Uint32Array]"]=!0,Ce["[object Arguments]"]=Ce["[object Array]"]=Ce["[object ArrayBuffer]"]=Ce["[object Boolean]"]=Ce["[object DataView]"]=Ce["[object Date]"]=Ce["[object Error]"]=Ce["[object Function]"]=Ce["[object Map]"]=Ce["[object Number]"]=Ce["[object Object]"]=Ce["[object RegExp]"]=Ce["[object Set]"]=Ce["[object String]"]=Ce["[object WeakMap]"]=!1;var ke="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ee=ke&&"object"==typeof module&&module&&!module.nodeType&&module,_e=Ee&&Ee.exports===ke&&u.process,Ae=function(){try{var e=Ee&&Ee.require&&Ee.require("util").types;return e||_e&&_e.binding&&_e.binding("util")}catch(e){}}(),Oe=Ae&&Ae.isTypedArray,je=Oe?we(Oe):function(e){return S(e)&&le(e.length)&&!!Ce[x(e)]},Le=Object.prototype.hasOwnProperty;function Ne(e,t){var o=w(e),n=!o&&be(e),s=!o&&!n&&Se(e),r=!o&&!n&&!s&&je(e),i=o||n||s||r,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&&!Le.call(e,l)||i&&("length"==l||s&&("offset"==l||"parent"==l)||r&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||ne(l,c))||a.push(l);return a}function Re(e,t){return function(o){return e(t(o))}}var Pe=Re(Object.keys,Object),Te=Object.prototype.hasOwnProperty;function $e(e){return ue(e)?Ne(e):function(e){if(!he(e))return Pe(e);var t=[];for(var o in Object(e))Te.call(e,o)&&"constructor"!=o&&t.push(o);return t}(e)}var Me=Object.prototype.hasOwnProperty;function Ie(e){if(!L(e))return function(e){var t=[];if(null!=e)for(var o in Object(e))t.push(o);return t}(e);var t=he(e),o=[];for(var n in e)("constructor"!=n||!t&&Me.call(e,n))&&o.push(n);return o}function Fe(e){return ue(e)?Ne(e,!0):Ie(e)}var De=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Be=/^\w*$/;var ze=J(Object,"create");var Ve=Object.prototype.hasOwnProperty;var Ue=Object.prototype.hasOwnProperty;function Ke(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 He(e,t){for(var o=e.length;o--;)if(re(e[o][0],t))return o;return-1}Ke.prototype.clear=function(){this.__data__=ze?ze(null):{},this.size=0},Ke.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ke.prototype.get=function(e){var t=this.__data__;if(ze){var o=t[e];return"__lodash_hash_undefined__"===o?void 0:o}return Ve.call(t,e)?t[e]:void 0},Ke.prototype.has=function(e){var t=this.__data__;return ze?void 0!==t[e]:Ue.call(t,e)},Ke.prototype.set=function(e,t){var o=this.__data__;return this.size+=this.has(e)?0:1,o[e]=ze&&void 0===t?"__lodash_hash_undefined__":t,this};var qe=Array.prototype.splice;function We(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])}}We.prototype.clear=function(){this.__data__=[],this.size=0},We.prototype.delete=function(e){var t=this.__data__,o=He(t,e);return!(o<0)&&(o==t.length-1?t.pop():qe.call(t,o,1),--this.size,!0)},We.prototype.get=function(e){var t=this.__data__,o=He(t,e);return o<0?void 0:t[o][1]},We.prototype.has=function(e){return He(this.__data__,e)>-1},We.prototype.set=function(e,t){var o=this.__data__,n=He(o,e);return n<0?(++this.size,o.push([e,t])):o[n][1]=t,this};var Ye=J(h,"Map");function Je(e,t){var o,n,s=e.__data__;return("string"==(n=typeof(o=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==o:null===o)?s["string"==typeof t?"string":"hash"]:s.map}function Ge(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])}}Ge.prototype.clear=function(){this.size=0,this.__data__={hash:new Ke,map:new(Ye||We),string:new Ke}},Ge.prototype.delete=function(e){var t=Je(this,e).delete(e);return this.size-=t?1:0,t},Ge.prototype.get=function(e){return Je(this,e).get(e)},Ge.prototype.has=function(e){return Je(this,e).has(e)},Ge.prototype.set=function(e,t){var o=Je(this,e),n=o.size;return o.set(e,t),this.size+=o.size==n?0:1,this};function Qe(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var o=function(){var n=arguments,s=t?t.apply(this,n):n[0],r=o.cache;if(r.has(s))return r.get(s);var i=e.apply(this,n);return o.cache=r.set(s,i)||r,i};return o.cache=new(Qe.Cache||Ge),o}Qe.Cache=Ge;var Xe,Ze,et,tt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ot=/\\(\\)?/g,nt=(Xe=function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(tt,function(e,o,n,s){t.push(n?s.replace(ot,"$1"):o||e)}),t},Ze=Qe(Xe,function(e){return 500===et.size&&et.clear(),e}),et=Ze.cache,Ze),st=nt;function rt(e,t){return w(e)?e:function(e,t){if(w(e))return!1;var o=typeof e;return!("number"!=o&&"symbol"!=o&&"boolean"!=o&&null!=e&&!C(e))||Be.test(e)||!De.test(e)||null!=t&&e in Object(t)}(e,t)?[e]:st(function(e){return null==e?"":_(e)}(e))}function it(e){if("string"==typeof e||C(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function at(e,t,o){var n=null==e?void 0:function(e,t){for(var o=0,n=(t=rt(t,e)).length;null!=e&&o<n;)e=e[it(t[o++])];return o&&o==n?e:void 0}(e,t);return void 0===n?o:n}function ct(e,t){for(var o=-1,n=t.length,s=e.length;++o<n;)e[s+o]=t[o];return e}var lt=Re(Object.getPrototypeOf,Object);function ut(e){var t=this.__data__=new We(e);this.size=t.size}ut.prototype.clear=function(){this.__data__=new We,this.size=0},ut.prototype.delete=function(e){var t=this.__data__,o=t.delete(e);return this.size=t.size,o},ut.prototype.get=function(e){return this.__data__.get(e)},ut.prototype.has=function(e){return this.__data__.has(e)},ut.prototype.set=function(e,t){var o=this.__data__;if(o instanceof We){var n=o.__data__;if(!Ye||n.length<199)return n.push([e,t]),this.size=++o.size,this;o=this.__data__=new Ge(n)}return o.set(e,t),this.size=o.size,this};var pt="object"==typeof exports&&exports&&!exports.nodeType&&exports,ht=pt&&"object"==typeof module&&module&&!module.nodeType&&module,dt=ht&&ht.exports===pt?h.Buffer:void 0,gt=dt?dt.allocUnsafe:void 0;function ft(){return[]}var mt=Object.prototype.propertyIsEnumerable,bt=Object.getOwnPropertySymbols,vt=bt?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var o=-1,n=null==e?0:e.length,s=0,r=[];++o<n;){var i=e[o];t(i,o,e)&&(r[s++]=i)}return r}(bt(e),function(t){return mt.call(e,t)}))}:ft,yt=vt;var xt=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)ct(t,yt(e)),e=lt(e);return t}:ft,St=xt;function Ct(e,t,o){var n=t(e);return w(e)?n:ct(n,o(e))}function wt(e){return Ct(e,$e,yt)}function kt(e){return Ct(e,Fe,St)}var Et=J(h,"DataView"),_t=J(h,"Promise"),At=J(h,"Set"),Ot="[object Map]",jt="[object Promise]",Lt="[object Set]",Nt="[object WeakMap]",Rt="[object DataView]",Pt=z(Et),Tt=z(Ye),$t=z(_t),Mt=z(At),It=z(G),Ft=x;(Et&&Ft(new Et(new ArrayBuffer(1)))!=Rt||Ye&&Ft(new Ye)!=Ot||_t&&Ft(_t.resolve())!=jt||At&&Ft(new At)!=Lt||G&&Ft(new G)!=Nt)&&(Ft=function(e){var t=x(e),o="[object Object]"==t?e.constructor:void 0,n=o?z(o):"";if(n)switch(n){case Pt:return Rt;case Tt:return Ot;case $t:return jt;case Mt:return Lt;case It:return Nt}return t});var Dt=Ft,Bt=Object.prototype.hasOwnProperty;var zt=h.Uint8Array;function Vt(e){var t=new e.constructor(e.byteLength);return new zt(t).set(new zt(e)),t}var Ut=/\w*$/;var Kt=d?d.prototype:void 0,Ht=Kt?Kt.valueOf:void 0;function qt(e,t,o){var n,s=e.constructor;switch(t){case"[object ArrayBuffer]":return Vt(e);case"[object Boolean]":case"[object Date]":return new s(+e);case"[object DataView]":return function(e,t){var o=t?Vt(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?Vt(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.length)}(e,o);case"[object Map]":case"[object Set]":return new s;case"[object Number]":case"[object String]":return new s(e);case"[object RegExp]":return function(e){var t=new e.constructor(e.source,Ut.exec(e));return t.lastIndex=e.lastIndex,t}(e);case"[object Symbol]":return n=e,Ht?Object(Ht.call(n)):{}}}var Wt=Ae&&Ae.isMap,Yt=Wt?we(Wt):function(e){return S(e)&&"[object Map]"==Dt(e)};var Jt=Ae&&Ae.isSet,Gt=Jt?we(Jt):function(e){return S(e)&&"[object Set]"==Dt(e)},Qt="[object Arguments]",Xt="[object Function]",Zt="[object Object]",eo={};function to(e,t,o,n,s,r){var i,a=1&t,c=2&t,l=4&t;if(o&&(i=s?o(e,n,s,r):o(e)),void 0!==i)return i;if(!L(e))return e;var u=w(e);if(u){if(i=function(e){var t=e.length,o=new e.constructor(t);return t&&"string"==typeof e[0]&&Bt.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=Dt(e),h=p==Xt||"[object GeneratorFunction]"==p;if(Se(e))return function(e,t){if(t)return e.slice();var o=e.length,n=gt?gt(o):new e.constructor(o);return e.copy(n),n}(e,a);if(p==Zt||p==Qt||h&&!s){if(i=c||h?{}:function(e){return"function"!=typeof e.constructor||he(e)?{}:Z(lt(e))}(e),!a)return c?function(e,t){return ce(e,St(e),t)}(e,function(e,t){return e&&ce(t,Fe(t),e)}(i,e)):function(e,t){return ce(e,yt(e),t)}(e,function(e,t){return e&&ce(t,$e(t),e)}(i,e))}else{if(!eo[p])return s?e:{};i=qt(e,p,a)}}r||(r=new ut);var d=r.get(e);if(d)return d;r.set(e,i),Gt(e)?e.forEach(function(n){i.add(to(n,t,o,n,e,r))}):Yt(e)&&e.forEach(function(n,s){i.set(s,to(n,t,o,s,e,r))});var g=u?void 0:(l?c?kt:wt:c?Fe:$e)(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,s){g&&(n=e[s=n]),ae(i,s,to(n,t,o,s,e,r))}),i}eo[Qt]=eo["[object Array]"]=eo["[object ArrayBuffer]"]=eo["[object DataView]"]=eo["[object Boolean]"]=eo["[object Date]"]=eo["[object Float32Array]"]=eo["[object Float64Array]"]=eo["[object Int8Array]"]=eo["[object Int16Array]"]=eo["[object Int32Array]"]=eo["[object Map]"]=eo["[object Number]"]=eo[Zt]=eo["[object RegExp]"]=eo["[object Set]"]=eo["[object String]"]=eo["[object Symbol]"]=eo["[object Uint8Array]"]=eo["[object Uint8ClampedArray]"]=eo["[object Uint16Array]"]=eo["[object Uint32Array]"]=!0,eo["[object Error]"]=eo[Xt]=eo["[object WeakMap]"]=!1;var oo=function(){return h.Date.now()},no=Math.max,so=Math.min;function ro(e,t,o){var n,s,r,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,r=s;return n=s=void 0,l=t,i=e.apply(r,o)}function g(e){var o=e-c;return void 0===c||o>=t||o<0||p&&e-l>=r}function f(){var e=oo();if(g(e))return m(e);a=setTimeout(f,function(e){var o=t-(e-c);return p?so(o,r-(e-l)):o}(e))}function m(e){return a=void 0,h&&n?d(e):(n=s=void 0,i)}function b(){var e=oo(),o=g(e);if(n=arguments,s=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=$(t)||0,L(o)&&(u=!!o.leading,r=(p="maxWait"in o)?no($(o.maxWait)||0,t):r,h="trailing"in o?!!o.trailing:h),b.cancel=function(){void 0!==a&&clearTimeout(a),l=0,n=c=s=a=void 0},b.flush=function(){return void 0===a?i:m(oo())},b}function io(e,t){return null!=e?e:t()}function ao(e){let t,o=e[0],n=1;for(;n<e.length;){const s=e[n],r=e[n+1];if(n+=2,("optionalAccess"===s||"optionalCall"===s)&&null==o)return;"access"===s||"optionalAccess"===s?(t=o,o=r(o)):"call"!==s&&"optionalCall"!==s||(o=r((...e)=>o.call(t,...e)),t=void 0)}return o}const co=e=>"string"==typeof e,lo=()=>{let e,t;const o=new Promise((o,n)=>{e=o,t=n});return o.resolve=e,o.reject=t,o},uo=e=>null==e?"":""+e,po=/###/g,ho=e=>e&&e.indexOf("###")>-1?e.replace(po,"."):e,go=e=>!e||co(e),fo=(e,t,o)=>{const n=co(t)?t.split("."):t;let s=0;for(;s<n.length-1;){if(go(e))return{};const t=ho(n[s]);!e[t]&&o&&(e[t]=new o),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++s}return go(e)?{}:{obj:e,k:ho(n[s])}},mo=(e,t,o)=>{const{obj:n,k:s}=fo(e,t,Object);if(void 0!==n||1===t.length)return void(n[s]=o);let r=t[t.length-1],i=t.slice(0,t.length-1),a=fo(e,i,Object);for(;void 0===a.obj&&i.length;)r=`${i[i.length-1]}.${r}`,i=i.slice(0,i.length-1),a=fo(e,i,Object),ao([a,"optionalAccess",e=>e.obj])&&void 0!==a.obj[`${a.k}.${r}`]&&(a.obj=void 0);a.obj[`${a.k}.${r}`]=o},bo=(e,t)=>{const{obj:o,k:n}=fo(e,t);if(o&&Object.prototype.hasOwnProperty.call(o,n))return o[n]},vo=(e,t,o)=>{for(const n in t)"__proto__"!==n&&"constructor"!==n&&(n in e?co(e[n])||e[n]instanceof String||co(t[n])||t[n]instanceof String?o&&(e[n]=t[n]):vo(e[n],t[n],o):e[n]=t[n]);return e},yo=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var xo={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const So=e=>co(e)?e.replace(/[&<>"'\/]/g,e=>xo[e]):e;const Co=[" ",",","?","!",";"],wo=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),ko=(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 s=e;for(let e=0;e<n.length;){if(!s||"object"!=typeof s)return;let t,r="";for(let i=e;i<n.length;++i)if(i!==e&&(r+=o),r+=n[i],t=s[r],void 0!==t){if(["string","number","boolean"].indexOf(typeof t)>-1&&i<n.length-1)continue;e+=i-e+1;break}s=t}return s},Eo=e=>ao([e,"optionalAccess",e=>e.replace,"call",e=>e("_","-")]),_o={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){ao([console,"optionalAccess",t=>t[e],"optionalAccess",e=>e.apply,"optionalCall",e=>e(console,t)])}};class Ao{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||_o,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:(co(e[0])&&(e[0]=`${o}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new Ao(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new Ao(this.logger,e)}}var Oo=new Ao;class jo{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 s=0;s<n;s++)o.apply(o,[e,...t])})}}}class Lo extends jo{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 s=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,r=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):co(o)&&s?i.push(...o.split(s)):i.push(o)));const a=bo(this.data,i);return!a&&!t&&!o&&e.indexOf(".")>-1&&(e=i[0],t=i[1],o=i.slice(2).join(".")),!a&&r&&co(o)?ko(ao([this,"access",e=>e.data,"optionalAccess",t=>t[e],"optionalAccess",e=>e[t]]),o,s):a}addResource(e,t,o,n,s={silent:!1}){const r=void 0!==s.keySeparator?s.keySeparator:this.options.keySeparator;let i=[e,t];o&&(i=i.concat(r?o.split(r):o)),e.indexOf(".")>-1&&(i=e.split("."),n=t,t=i[1]),this.addNamespaces(t),mo(this.data,i,n),s.silent||this.emit("added",e,t,o,n)}addResources(e,t,o,n={silent:!1}){for(const n in o)(co(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,s,r={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=bo(this.data,i)||{};r.skipCopy||(o=JSON.parse(JSON.stringify(o))),n?vo(a,o,s):a={...a,...o},mo(this.data,i,a),r.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 No={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,o,n,s){return e.forEach(e=>{t=io(ao([this,"access",e=>e.processors,"access",t=>t[e],"optionalAccess",e=>e.process,"call",e=>e(t,o,n,s)]),()=>t)}),t}};const Ro=Symbol("i18next/PATH_KEY");function Po(e,t){const{[Ro]:o}=e(function(){const e=[],t=Object.create(null);let o;return t.get=(n,s)=>(ao([o,"optionalAccess",e=>e.revoke,"optionalCall",e=>e()]),s===Ro?e:(e.push(s),o=Proxy.revocable(n,t),o.proxy)),Proxy.revocable(Object.create(null),t).proxy}());return o.join(io(ao([t,"optionalAccess",e=>e.keySeparator]),()=>"."))}const To={},$o=e=>!co(e)&&"boolean"!=typeof e&&"number"!=typeof e;class Mo extends jo{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=Oo.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===ao([n,"optionalAccess",e=>e.res]))return!1;const s=$o(n.res);return!1!==o.returnObjects||!s}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 s=t.ns||this.options.defaultNS||[];const r=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=Co.filter(e=>t.indexOf(e)<0&&o.indexOf(e)<0);if(0===n.length)return!0;const s=wo.getRegExp(`(${n.map(e=>"?"===e?"\\?":e).join("|")})`);let r=!s.test(e);if(!r){const t=e.indexOf(o);t>0&&!s.test(e.substring(0,t))&&(r=!0)}return r})(e,o,n));if(r&&!i){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:co(s)?[s]:s};const r=e.split(o);(o!==n||o===n&&this.options.ns.indexOf(r[0])>-1)&&(s=r.shift()),e=r.join(n)}return{key:e,namespaces:co(s)?[s]:s}}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=Po(e,{...this.options,...n})),Array.isArray(e)||(e=[String(e)]);const s=void 0!==n.returnDetails?n.returnDetails:this.options.returnDetails,r=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"===ao([u,"optionalAccess",e=>e.toLowerCase,"call",e=>e()]))return p?s?{res:`${c}${l}${i}`,usedKey:i,exactUsedKey:i,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:`${c}${l}${i}`:s?{res:i,usedKey:i,exactUsedKey:i,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:i;const h=this.resolve(e,n);let d=ao([h,"optionalAccess",e=>e.res]);const g=ao([h,"optionalAccess",e=>e.usedKey])||i,f=ao([h,"optionalAccess",e=>e.exactUsedKey])||i,m=void 0!==n.joinArrays?n.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,v=void 0!==n.count&&!co(n.count),y=Mo.hasDefaultValue(n),x=v?this.pluralResolver.getSuffix(u,n.count,n):"",S=n.ordinal&&v?this.pluralResolver.getSuffix(u,n.count,{ordinal:!1}):"",C=v&&!n.ordinal&&0===n.count,w=C&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${x}`]||n[`defaultValue${S}`]||n.defaultValue;let k=d;b&&!d&&y&&(k=w);const E=$o(k),_=Object.prototype.toString.apply(k);if(!(b&&k&&E&&["[object Number]","[object Function]","[object RegExp]"].indexOf(_)<0)||co(m)&&Array.isArray(k))if(b&&co(m)&&Array.isArray(d))d=d.join(m),d&&(d=this.extendTranslation(d,e,n,o));else{let t=!1,s=!1;!this.isValidLookup(d)&&y&&(t=!0,d=w),this.isValidLookup(d)||(s=!0,d=i);const a=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&s?void 0:d,p=y&&w!==d&&this.options.updateMissing;if(s||t||p){if(this.logger.log(p?"updateKey":"missingKey",u,c,i,p?w:d),r){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 s=y&&o!==d?o:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,c,t,s,p,n):ao([this,"access",e=>e.backendConnector,"optionalAccess",e=>e.saveMissing])&&this.backendConnector.saveMissing(e,c,t,s,p,n),this.emit("missingKey",e,c,t,d)};this.options.saveMissing&&(this.options.saveMissingPlurals&&v?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}`]||w)})}):o(e,i,w))}d=this.extendTranslation(d,e,n,h,o),s&&d===i&&this.options.appendNamespaceToMissingKey&&(d=`${c}${l}${i}`),(s||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,k,{...n,ns:a}):`key '${i} (${this.language})' returned an object instead of string.`;return s?(h.res=e,h.usedParams=this.getUsedParamsDetails(n),h):e}if(r){const e=Array.isArray(k),t=e?[]:{},o=e?f:g;for(const e in k)if(Object.prototype.hasOwnProperty.call(k,e)){const s=`${o}${r}${e}`;t[e]=y&&!d?this.translate(s,{...n,defaultValue:$o(w)?w[e]:void 0,joinArrays:!1,ns:a}):this.translate(s,{...n,joinArrays:!1,ns:a}),t[e]===s&&(t[e]=k[e])}d=t}}return s?(h.res=d,h.usedParams=this.getUsedParamsDetails(n),h):d}extendTranslation(e,t,o,n,s){if(ao([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 r=co(e)&&(void 0!==ao([o,"optionalAccess",e=>e.interpolation,"optionalAccess",e=>e.skipOnVariables])?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let i;if(r){const t=e.match(this.interpolator.nestingRegexp);i=t&&t.length}let a=o.replace&&!co(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),r){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)=>ao([s,"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 r=o.postProcess||this.options.postProcess,i=co(r)?[r]:r;return null!=e&&ao([i,"optionalAccess",e=>e.length])&&!1!==o.applyPostProcessor&&(e=No.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,s,r,i;return co(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&&!co(t.count),p=u&&!t.ordinal&&0===t.count,h=void 0!==t.context&&(co(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,To[`${d[0]}-${e}`]||!ao([this,"access",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace])||ao([this,"access",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace,"call",e=>e(i)])||(To[`${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;r=n;const i=[c];if(ao([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`,s=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(t.ordinal&&0===e.indexOf(s)&&i.push(c+e.replace(s,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(s)&&i.push(n+e.replace(s,this.options.pluralSeparator)),i.push(n+e),p&&i.push(n+o))}}let a;for(;a=i.pop();)this.isValidLookup(o)||(s=a,o=this.getResource(n,e,a,t))}))})}),{res:o,usedKey:n,exactUsedKey:s,usedLng:r,usedNS:i}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,o,n={}){return ao([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&&!co(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 Io{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Oo.create("languageUtils")}getScriptPartFromCode(e){if(!(e=Eo(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=Eo(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(co(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)),co(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=[],s=e=>{e&&(this.isSupportedCode(e)?n.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return co(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&s(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&s(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&s(this.getLanguagePartFromCode(e))):co(e)&&s(this.formatLanguageCode(e)),o.forEach(e=>{n.indexOf(e)<0&&s(this.formatLanguageCode(e))}),n}}const Fo={zero:0,one:1,two:2,few:3,many:4,other:5},Do={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Bo{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=Oo.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const o=Eo("dev"===e?"en":e),n=t.ordinal?"ordinal":"cardinal",s=JSON.stringify({cleanedCode:o,type:n});if(s in this.pluralRulesCache)return this.pluralRulesCache[s];let r;try{r=new Intl.PluralRules(o,{type:n})}catch(o){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),Do;if(!e.match(/-|_/))return Do;const n=this.languageUtils.getLanguagePartFromCode(e);r=this.getRule(n,t)}return this.pluralRulesCache[s]=r,r}needsPlural(e,t={}){let o=this.getRule(e,t);return o||(o=this.getRule("dev",t)),ao([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)=>Fo[e]-Fo[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 zo=(e,t,o,n=".",s=!0)=>{let r=((e,t,o)=>{const n=bo(e,o);return void 0!==n?n:bo(t,o)})(e,t,o);return!r&&s&&co(o)&&(r=ko(e,o,n),void 0===r&&(r=ko(t,o,n))),r},Vo=e=>e.replace(/\$/g,"$$$$");class Uo{constructor(e={}){this.logger=Oo.create("interpolator"),this.options=e,this.format=ao([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:s,prefixEscaped:r,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:So,this.escapeValue=void 0===o||o,this.useRawValueToEscape=void 0!==n&&n,this.prefix=s?yo(s):r||"{{",this.suffix=i?yo(i):a||"}}",this.formatSeparator=c||",",this.unescapePrefix=l?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":l||"",this.nestingPrefix=p?yo(p):h||yo("$t("),this.nestingSuffix=d?yo(d):g||yo(")"),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)=>ao([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 s,r,i;const a=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(e.indexOf(this.formatSeparator)<0){const s=zo(t,a,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(s,void 0,o,{...n,...t,interpolationkey:e}):s}const s=e.split(this.formatSeparator),r=s.shift().trim(),i=s.join(this.formatSeparator).trim();return this.format(zo(t,a,r,this.options.keySeparator,this.options.ignoreJSONStructure),i,o,{...n,...t,interpolationkey:r})};this.resetRegExp();const l=ao([n,"optionalAccess",e=>e.missingInterpolationHandler])||this.options.missingInterpolationHandler,u=void 0!==ao([n,"optionalAccess",e=>e.interpolation,"optionalAccess",e=>e.skipOnVariables])?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>Vo(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?Vo(this.escape(e)):Vo(e)}].forEach(t=>{for(i=0;s=t.regex.exec(e);){const o=s[1].trim();if(r=c(o),void 0===r)if("function"==typeof l){const t=l(e,s,n);r=co(t)?t:""}else if(n&&Object.prototype.hasOwnProperty.call(n,o))r="";else{if(u){r=s[0];continue}this.logger.warn(`missed to pass in variable ${o} for interpolating ${e}`),r=""}else co(r)||this.useRawValueToEscape||(r=uo(r));const a=t.safeValue(r);if(e=e.replace(s[0],a),u?(t.regex.lastIndex+=r.length,t.regex.lastIndex-=s[0].length):t.regex.lastIndex=0,i++,i>=this.maxReplaces)break}}),e}nest(e,t,o={}){let n,s,r;const i=(e,t)=>{const o=this.nestingOptionsSeparator;if(e.indexOf(o)<0)return e;const n=e.split(new RegExp(`${o}[ ]*{`));let s=`{${n[1]}`;e=n[0],s=this.interpolate(s,r);const i=s.match(/'/g),a=s.match(/"/g);(io(ao([i,"optionalAccess",e=>e.length]),()=>0)%2==0&&!a||a.length%2!=0)&&(s=s.replace(/'/g,'"'));try{r=JSON.parse(s),t&&(r={...t,...r})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${o}${s}`}return r.defaultValue&&r.defaultValue.indexOf(this.prefix)>-1&&delete r.defaultValue,e};for(;n=this.nestingRegexp.exec(e);){let a=[];r={...o},r=r.replace&&!co(r.replace)?r.replace:r,r.applyPostProcessor=!1,delete r.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)),s=t(i.call(this,n[1].trim(),r),r),s&&n[0]===e&&!co(s))return s;co(s)||(s=uo(s)),s||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),s=""),a.length&&(s=a.reduce((e,t)=>this.format(e,t,o.lng,{...o,interpolationkey:n[1].trim()}),s.trim())),e=e.replace(n[0],s),this.regexp.lastIndex=0}return e}}const Ko=e=>{const t={};return(o,n,s)=>{let r=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(r={...r,[s.interpolationkey]:void 0});const i=n+JSON.stringify(r);let a=t[i];return a||(a=e(Eo(n),s),t[i]=a),a(o)}},Ho=e=>(t,o,n)=>e(Eo(o),n)(t);class qo{constructor(e={}){this.logger=Oo.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const o=t.cacheInBuiltFormats?Ko:Ho;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()]=Ko(t)}format(e,t,o,n={}){const s=t.split(this.formatSeparator);if(s.length>1&&s[0].indexOf("(")>1&&s[0].indexOf(")")<0&&s.find(e=>e.indexOf(")")>-1)){const e=s.findIndex(e=>e.indexOf(")")>-1);s[0]=[s[0],...s.splice(1,e)].join(this.formatSeparator)}return s.reduce((e,t)=>{const{formatName:s,formatOptions:r}=(e=>{let t=e.toLowerCase().trim();const o={};if(e.indexOf("(")>-1){const n=e.split("(");t=n[0].toLowerCase().trim();const s=n[1].substring(0,n[1].length-1);"currency"===t&&s.indexOf(":")<0?o.currency||(o.currency=s.trim()):"relativetime"===t&&s.indexOf(":")<0?o.range||(o.range=s.trim()):s.split(";").forEach(e=>{if(e){const[t,...n]=e.split(":"),s=n.join(":").trim().replace(/^'+|'+$/g,""),r=t.trim();o[r]||(o[r]=s),"false"===s&&(o[r]=!1),"true"===s&&(o[r]=!0),isNaN(s)||(o[r]=parseInt(s,10))}})}return{formatName:t,formatOptions:o}})(t);if(this.formats[s]){let t=e;try{const i=ao([n,"optionalAccess",e=>e.formatParams,"optionalAccess",e=>e[n.interpolationkey]])||{},a=i.locale||i.lng||n.locale||n.lng||o;t=this.formats[s](e,a,{...r,...n,...i})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${s}`),e},e)}}class Wo extends jo{constructor(e,t,o,n={}){super(),this.backend=e,this.store=t,this.services=o,this.languageUtils=o.languageUtils,this.options=n,this.logger=Oo.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=[],ao([this,"access",e=>e.backend,"optionalAccess",e=>e.init,"optionalCall",e=>e(o,n.backend,n)])}queueLoad(e,t,o,n){const s={},r={},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===r[i]&&(r[i]=!0):(this.state[i]=1,n=!1,void 0===r[i]&&(r[i]=!0),void 0===s[i]&&(s[i]=!0),void 0===a[t]&&(a[t]=!0)))}),n||(i[e]=!0)}),(Object.keys(s).length||Object.keys(r).length)&&this.queue.push({pending:r,pendingCount:Object.keys(r).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(s),pending:Object.keys(r),toLoadLanguages:Object.keys(i),toLoadNamespaces:Object.keys(a)}}loaded(e,t,o){const n=e.split("|"),s=n[0],r=n[1];t&&this.emit("failedLoading",s,r,t),!t&&o&&this.store.addResourceBundle(s,r,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:s}=fo(e,t,Object);n[s]=n[s]||[],n[s].push(o)})(o.loaded,[s],r),((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,s=this.retryTimeout,r){if(!e.length)return r(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:o,tried:n,wait:s,callback:r});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*s,r)},s):r(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();co(e)&&(e=this.languageUtils.toResolveHierarchy(e)),co(t)&&(t=[t]);const s=this.queueLoad(e,t,o,n);if(!s.toLoad.length)return s.pending.length||n(),null;s.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],s=o[1];this.read(n,s,"read",void 0,void 0,(o,r)=>{o&&this.logger.warn(`${t}loading namespace ${s} for language ${n} failed`,o),!o&&r&&this.logger.log(`${t}loaded namespace ${s} for language ${n}`,r),this.loaded(e,o,r)})}saveMissing(e,t,o,n,s,r={},i=()=>{}){if(!ao([this,"access",e=>e.services,"optionalAccess",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace])||ao([this,"access",e=>e.services,"optionalAccess",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace,"call",e=>e(t)])){if(null!=o&&""!==o){if(ao([this,"access",e=>e.backend,"optionalAccess",e=>e.create])){const a={...r,isUpdate:s},c=this.backend.create.bind(this.backend);if(c.length<6)try{let s;s=5===c.length?c(e,t,o,n,a):c(e,t,o,n),s&&"function"==typeof s.then?s.then(e=>i(null,e)).catch(i):i(null,s)}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 Yo=()=>({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]),co(e[1])&&(t.defaultValue=e[1]),co(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=>(co(e.ns)&&(e.ns=[e.ns]),co(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),co(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),ao([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),Go=()=>{};class Qo extends jo{constructor(e={},t){var o;if(super(),this.options=Jo(e),this.services={},this.logger=Oo,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&&(co(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const o=Yo();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||(ao([n=this,"optionalAccess",e=>e.modules,"optionalAccess",e=>e.backend,"optionalAccess",e=>e.name,"optionalAccess",e=>e.indexOf,"call",e=>e("Locize")])>0||ao([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||ao([n,"optionalAccess",e=>e.options,"optionalAccess",e=>e.backend,"optionalAccess",e=>e.backends])&&n.options.backend.backends.some(e=>ao([e,"optionalAccess",e=>e.name,"access",e=>e.indexOf,"call",e=>e("Locize")])>0||ao([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 s=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?Oo.init(s(this.modules.logger),this.options):Oo.init(null,this.options),e=this.modules.formatter?this.modules.formatter:qo;const t=new Io(this.options);this.store=new Lo(this.options.resources,this.options);const n=this.services;n.logger=Oo,n.resourceStore=this.store,n.languageUtils=t,n.pluralResolver=new Bo(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=s(e),n.formatter.init&&n.formatter.init(n,this.options),this.options.interpolation.format=n.formatter.format.bind(n.formatter)),n.interpolator=new Uo(this.options),n.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},n.backendConnector=new Wo(s(this.modules.backend),n.resourceStore,n,this.options),n.backendConnector.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(n.languageDetector=s(this.modules.languageDetector),n.languageDetector.init&&n.languageDetector.init(n,this.options.detection,this.options)),this.modules.i18nFormat&&(n.i18nFormat=s(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=Go),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 r=lo(),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),r.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),r}loadResources(e,t=Go){let o=t;const n=co(e)?e:this.language;if("function"==typeof e&&(o=e),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===ao([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))}ao([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=lo();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=Go),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&&No.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=lo();this.emit("languageChanging",e);const n=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},s=(s,r)=>{r?this.isLanguageChangingTo===e&&(n(r),this.translator.changeLanguage(r),this.isLanguageChangingTo=void 0,this.emit("languageChanged",r),this.logger.log("languageChanged",r)):this.isLanguageChangingTo=void 0,o.resolve((...e)=>this.t(...e)),t&&t(s,(...e)=>this.t(...e))},r=t=>{e||t||!this.services.languageDetector||(t=[]);const o=co(t)?t:t&&t[0],r=this.store.hasLanguageSomeTranslations(o)?o:this.services.languageUtils.getBestMatchFromCodes(co(t)?[t]:t);r&&(this.language||n(r),this.translator.language||this.translator.changeLanguage(r),ao([this,"access",e=>e.services,"access",e=>e.languageDetector,"optionalAccess",e=>e.cacheUserLanguage,"optionalCall",e=>e(r)])),this.loadResources(r,e=>{s(e,r)})};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(r):this.services.languageDetector.detect(r):r(e):r(this.services.languageDetector.detect()),o}getFixedT(e,t,o){const n=(e,t,...s)=>{let r;r="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(s)):{...t},r.lng=r.lng||n.lng,r.lngs=r.lngs||n.lngs,r.ns=r.ns||n.ns,""!==r.keyPrefix&&(r.keyPrefix=r.keyPrefix||o||n.keyPrefix);const i=this.options.keySeparator||".";let a;return r.keyPrefix&&Array.isArray(e)?a=e.map(e=>("function"==typeof e&&(e=Po(e,{...this.options,...t})),`${r.keyPrefix}${i}${e}`)):("function"==typeof e&&(e=Po(e,{...this.options,...t})),a=r.keyPrefix?`${r.keyPrefix}${i}${e}`:e),this.t(a,r)};return co(e)?n.lng=e:n.lngs=e,n.ns=t,n.keyPrefix=o,n}t(...e){return ao([this,"access",e=>e.translator,"optionalAccess",e=>e.translate,"call",t=>t(...e)])}exists(...e){return ao([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,s=this.languages[this.languages.length-1];if("cimode"===o.toLowerCase())return!0;const r=(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,r);if(void 0!==e)return e}return!!this.hasResourceBundle(o,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!r(o,e)||n&&!r(s,e)))}loadNamespaces(e,t){const o=lo();return this.options.ns?(co(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=lo();co(e)&&(e=[e]);const n=this.options.preload||[],s=e.filter(e=>n.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return s.length?(this.options.preload=n.concat(s),this.loadResources(e=>{o.resolve(),t&&t(e)}),o):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(ao([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=ao([this,"access",e=>e.services,"optionalAccess",e=>e.languageUtils])||new Io(Yo());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 Qo(e,t);return o.createInstance=Qo.createInstance,o}cloneInstance(e={},t=Go){const o=e.forkResourceStore;o&&delete e.forkResourceStore;const n={...this.options,...e,isClone:!0},s=new Qo(n);void 0===e.debug&&void 0===e.prefix||(s.logger=s.logger.clone(e));if(["store","services","language"].forEach(e=>{s[e]=this[e]}),s.services={...this.services},s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},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),{});s.store=new Lo(e,n),s.services.resourceStore=s.store}if(e.interpolation){const t={...Yo().interpolation,...this.options.interpolation,...e.interpolation},o={...n,interpolation:t};s.services.interpolator=new Uo(o)}return s.translator=new Mo(s.services,n),s.translator.on("*",(e,...t)=>{s.emit(e,...t)}),s.init(n,t),s.translator.options=n,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Xo=Qo.createInstance();Xo.createInstance,Xo.dir,Xo.init,Xo.loadResources,Xo.reloadResources,Xo.use,Xo.changeLanguage,Xo.getFixedT,Xo.t,Xo.exists,Xo.setDefaultNamespace,Xo.hasLoadedNamespace,Xo.loadNamespaces,Xo.loadLanguages;Xo.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 Zo={translator:{...Xo,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 Xo.t(e,{lng:o,...t})}},languageOptions:[{value:"en_US",label:"English (US)"},{value:"es_ES",label:"Spanish"}]};function en(){return en=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},en.apply(null,arguments)}function tn(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 on(e,t){return on=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},on(e,t)}function nn(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,on(e,t)}function sn(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var rn=!1;var an=e.createContext(null),cn=function(e){return e.scrollTop};const ln=e,un=t;var pn="unmounted",hn="exited",dn="entering",gn="entered",fn="exiting",mn=function(e){function t(t,o){var n;n=e.call(this,t,o)||this;var s,r=o&&!o.isMounting?t.enter:t.appear;return n.appearStatus=null,t.in?r?(s=hn,n.appearStatus=dn):s=gn:s=t.unmountOnExit||t.mountOnEnter?pn:hn,n.state={status:s},n.nextCallback=null,n}nn(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===pn?{status:hn}: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!==dn&&o!==gn&&(t=dn):o!==dn&&o!==gn||(t=fn)}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===dn){if(this.props.unmountOnExit||this.props.mountOnEnter){var o=this.props.nodeRef?this.props.nodeRef.current:un.findDOMNode(this);o&&cn(o)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===hn&&this.setState({status:pn})},o.performEnter=function(e){var t=this,o=this.props.enter,n=this.context?this.context.isMounting:e,s=this.props.nodeRef?[n]:[un.findDOMNode(this),n],r=s[0],i=s[1],a=this.getTimeouts(),c=n?a.appear:a.enter;!e&&!o||rn?this.safeSetState({status:gn},function(){t.props.onEntered(r)}):(this.props.onEnter(r,i),this.safeSetState({status:dn},function(){t.props.onEntering(r,i),t.onTransitionEnd(c,function(){t.safeSetState({status:gn},function(){t.props.onEntered(r,i)})})}))},o.performExit=function(){var e=this,t=this.props.exit,o=this.getTimeouts(),n=this.props.nodeRef?void 0:un.findDOMNode(this);t&&!rn?(this.props.onExit(n),this.safeSetState({status:fn},function(){e.props.onExiting(n),e.onTransitionEnd(o.exit,function(){e.safeSetState({status:hn},function(){e.props.onExited(n)})})})):this.safeSetState({status:hn},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:un.findDOMNode(this),n=null==e&&!this.props.addEndListener;if(o&&!n){if(this.props.addEndListener){var s=this.props.nodeRef?[this.nextCallback]:[o,this.nextCallback],r=s[0],i=s[1];this.props.addEndListener(r,i)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},o.render=function(){var e=this.state.status;if(e===pn)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=tn(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return ln.createElement(an.Provider,{value:null},"function"==typeof o?o(e,n):ln.cloneElement(ln.Children.only(o),n))},t}(ln.Component);function bn(){}mn.contextType=an,mn.propTypes={},mn.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:bn,onEntering:bn,onEntered:bn,onExit:bn,onExiting:bn,onExited:bn},mn.UNMOUNTED=pn,mn.EXITED=hn,mn.ENTERING=dn,mn.ENTERED=gn,mn.EXITING=fn;var vn=mn;const yn=e;var xn=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})},Sn=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=sn(o.className,n):o.setAttribute("class",sn(o.className&&o.className.baseVal||"",n)));var o,n})},Cn=function(e){function t(){for(var t,o=arguments.length,n=new Array(o),s=0;s<o;s++)n[s]=arguments[s];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),s=n[0],r=n[1];t.removeClasses(s,"exit"),t.addClass(s,r?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,o)},t.onEntering=function(e,o){var n=t.resolveArguments(e,o),s=n[0],r=n[1]?"appear":"enter";t.addClass(s,r,"active"),t.props.onEntering&&t.props.onEntering(e,o)},t.onEntered=function(e,o){var n=t.resolveArguments(e,o),s=n[0],r=n[1]?"appear":"enter";t.removeClasses(s,r),t.addClass(s,r,"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,s=n?""+(n&&o?o+"-":"")+e:o[e];return{baseClassName:s,activeClassName:n?s+"-active":o[e+"Active"],doneClassName:n?s+"-done":o[e+"Done"]}},t}nn(t,e);var o=t.prototype;return o.addClass=function(e,t,o){var n=this.getClassNames(t)[o+"ClassName"],s=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===o&&s&&(n+=" "+s),"active"===o&&e&&cn(e),n&&(this.appliedClasses[t][o]=n,xn(e,n))},o.removeClasses=function(e,t){var o=this.appliedClasses[t],n=o.base,s=o.active,r=o.done;this.appliedClasses[t]={},n&&Sn(e,n),s&&Sn(e,s),r&&Sn(e,r)},o.render=function(){var e=this.props;e.classNames;var t=tn(e,["classNames"]);return yn.createElement(vn,en({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(yn.Component);Cn.defaultProps={classNames:""},Cn.propTypes={};var wn=Cn;const{Children:kn}=e,{cloneElement:En}=e,{isValidElement:_n}=e;function An(e,t){var o=Object.create(null);return e&&kn.map(e,function(e){return e}).forEach(function(e){o[e.key]=function(e){return t&&_n(e)?t(e):e}(e)}),o}function On(e,t,o){return null!=o[t]?o[t]:e.props[t]}function jn(e,t,o){var n=An(e.children),s=function(e,t){function o(o){return o in t?t[o]:e[o]}e=e||{},t=t||{};var n,s=Object.create(null),r=[];for(var i in e)i in t?r.length&&(s[i]=r,r=[]):r.push(i);var a={};for(var c in t){if(s[c])for(n=0;n<s[c].length;n++){var l=s[c][n];a[s[c][n]]=o(l)}a[c]=o(c)}for(n=0;n<r.length;n++)a[r[n]]=o(r[n]);return a}(t,n);return Object.keys(s).forEach(function(r){var i=s[r];if(_n(i)){var a=r in t,c=r in n,l=t[r],u=_n(l)&&!l.props.in;!c||a&&!u?c||!a||u?c&&a&&_n(l)&&(s[r]=En(i,{onExited:o.bind(null,i),in:l.props.in,exit:On(i,"exit",e),enter:On(i,"enter",e)})):s[r]=En(i,{in:!1}):s[r]=En(i,{onExited:o.bind(null,i),in:!0,exit:On(i,"exit",e),enter:On(i,"enter",e)})}}),s}const Ln=e;var Nn=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},Rn=function(e){function t(t,o){var n,s=(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:s,firstRender:!0},n}nn(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,s=t.children,r=t.handleExited;return{children:t.firstRender?(o=e,n=r,An(o.children,function(e){return En(e,{onExited:n.bind(null,e),in:!0,appear:On(e,"appear",o),enter:On(e,"enter",o),exit:On(e,"exit",o)})})):jn(e,s,r),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=en({},t.children);return delete o[e.key],{children:o}}))},o.render=function(){var e=this.props,t=e.component,o=e.childFactory,n=tn(e,["component","childFactory"]),s=this.state.contextValue,r=Nn(this.state.children).map(o);return delete n.appear,delete n.enter,delete n.exit,null===t?Ln.createElement(an.Provider,{value:s},r):Ln.createElement(an.Provider,{value:s},Ln.createElement(t,n,r))},t}(Ln.Component);Rn.propTypes={},Rn.defaultProps={component:"div",childFactory:function(e){return e}};var Pn=Rn;const Tn=e,{styled:$n}=o,{Box:Mn}=n,In=s,{color:Fn}=r,Dn=$n(Mn)({width:"33px",height:"33px","& svg":{position:"absolute",display:"inline-block",width:"33px",height:"33px",verticalAlign:"middle","& hide":{display:"none"}}}),Bn=$n("svg")({"& .incorrect-fill":{fill:`var(--feedback-incorrect-bg-color, ${Fn.incorrect()})`},"& .correct-fill":{fill:`var(--feedback-correct-bg-color, ${Fn.correct()})`}}),zn=$n("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 Vn extends Tn.Component{static __initStatic(){this.propTypes={correctness:In.string}}constructor(e){super(e),Vn.prototype.__init.call(this),Vn.prototype.__init2.call(this),this.nodeRef=Tn.createRef()}__init(){this.getIncorrectIcon=()=>Tn.createElement(Bn,{key:"1",preserveAspectRatio:"xMinYMin meet",x:"0px",y:"0px",viewBox:"0 0 44 40",style:{enableBackground:"new 0 0 44 40"}},Tn.createElement("g",null,Tn.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"}),Tn.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=()=>Tn.createElement(Bn,{key:"2",preserveAspectRatio:"xMinYMin meet",version:"1.1",x:"0px",y:"0px",viewBox:"0 0 44 40",style:{enableBackground:"new 0 0 44 40"}},Tn.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 Tn.createElement(Dn,null,Tn.createElement(Pn,null,e&&Tn.createElement(wn,{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}},Tn.createElement(zn,{ref:this.nodeRef},t))))}}Vn.__initStatic();const{FormControlLabel:Un}=n,{Box:Kn}=n,{Checkbox:Hn}=n,{Radio:qn}=n,Wn=e,Yn=s,{styled:Jn}=o,{Feedback:Gn}=r,{color:Qn}=r,{PreviewPrompt:Xn}=r,Zn=i,es="multiple-choice-component",ts=Jn(Kn)({display:"flex",alignItems:"center",backgroundColor:Qn.background()}),os=Jn(Kn)({display:"flex",alignItems:"center",backgroundColor:Qn.background(),flex:1,"& label":{color:Qn.text(),"& > span":{fontSize:"inherit"}}}),ns=Jn("span")(({theme:e})=>({display:"flex",alignItems:"center","& > span":{marginLeft:`-${e.spacing(1)}px`}})),ss=Jn("span")({position:"absolute",left:"-10000px",top:"auto",width:"1px",height:"1px",overflow:"hidden"}),rs=Jn(Un)({"& .MuiFormControlLabel-label":{color:`${Qn.text()} !important`,backgroundColor:Qn.background(),letterSpacing:"normal"},"&.Mui-disabled *":{cursor:"not-allowed !important"}}),is=(e,t)=>({[`&.${es}`]:{color:`var(--choice-input-${e}, ${t}) !important`}}),as=e=>{const t=t=>e?`${e}-${t}`:t;return{[t("root")]:{...is("color",Qn.text()),...e?{}:{"&:hover":{color:`${Qn.primaryLight()} !important`}},..."correct"===e?is("correct-color",Qn.text()):{},..."incorrect"===e?is("incorrect-color",Qn.incorrect()):{}},[t("checked")]:{..."correct"===e?is("correct-selected-color",Qn.correct()):{},..."incorrect"===e?is("incorrect-checked",Qn.incorrect()):{},...e?{}:is("selected-color",Qn.primary())},[t("disabled")]:{...is("disabled-color",Qn.text()),..."correct"===e?is("correct-disabled-color",Qn.disabled()):{},..."incorrect"===e?is("incorrect-disabled-color",Qn.disabled()):{},opacity:.6,cursor:"not-allowed !important",pointerEvents:"initial !important"},focusVisibleUnchecked:{outline:`2px solid ${Qn.focusUncheckedBorder()}`,backgroundColor:Qn.focusUnchecked()},focusVisibleChecked:{outline:`2px solid ${Qn.focusCheckedBorder()}`,backgroundColor:Qn.focusChecked()}}},cs=Jn(Hn,{shouldForwardProp:e=>"correctness"!==e})(({correctness:e})=>{const t=as(e),o=t=>e?`${e}-${t}`:t;return{[`&.${es}`]:{...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}}}),ls=e=>{const{correctness:t,checked:o,onChange:n,disabled:s,value:r,id:i,onKeyDown:a,inputRef:c}=e,l={checked:o,onChange:n,disabled:s,value:r};return Wn.createElement(cs,{id:i,slotProps:{input:{ref:c}},"aria-checked":o,onKeyDown:a,disableRipple:!0,...l,correctness:t,className:es})},us=Jn(qn,{shouldForwardProp:e=>"correctness"!==e})(({correctness:e})=>{const t=as(e),o=t=>e?`${e}-${t}`:t;return{[`&.${es}`]:{...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}}}),ps=e=>{const{correctness:t,checked:o,onChange:n,disabled:s,value:r,id:i,tagName:a,inputRef:c}=e,l={checked:o,onChange:n,disabled:s,value:r};return Wn.createElement(us,{id:i,slotProps:{input:{ref:c}},"aria-checked":o,disableRipple:!0,...l,correctness:t,className:es,name:a})};class hs extends Wn.Component{static __initStatic(){this.propTypes={choiceMode:Yn.oneOf(["radio","checkbox"]),displayKey:Yn.string,checked:Yn.bool.isRequired,correctness:Yn.string,disabled:Yn.bool.isRequired,feedback:Yn.string,label:Yn.string.isRequired,rationale:Yn.string,onChange:Yn.func.isRequired,value:Yn.string.isRequired,className:Yn.string,tagName:Yn.string,hideTick:Yn.bool,isEvaluateMode:Yn.bool,choicesLayout:Yn.oneOf(["vertical","grid","horizontal"]),isSelectionButtonBelow:Yn.bool}}static __initStatic2(){this.defaultProps={rationale:null,checked:!1,isEvaluateMode:!1}}constructor(e){super(e),hs.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 s=document.getElementById(this.choiceId);if(!s)return;const r=s.closest("fieldset");if(!r)return;const i=Array.from(r.querySelectorAll('input[type="checkbox"]')),a=i.findIndex(e=>e===s);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:s,correctness:r,className:i,rationale:a,hideTick:c,isEvaluateMode:l,choicesLayout:u,value:p,checked:h,tagName:d,isSelectionButtonBelow:g}=this.props,f="checkbox"===e?ls:ps,m="checkbox"===e?"checkbox":"radio-button",b={..."horizontal"===u&&{[`& .${es}`]:{padding:"8px",margin:"4px 0 4px 4px"}},...g&&"grid"!==u&&{"& > label":{alignItems:"flex-start"}},...g&&"grid"===u&&{justifyContent:"center","& > label":{alignItems:"center"}}},v=Wn.createElement(Wn.Fragment,null,o&&!g?Wn.createElement(ts,{component:"span"},o,"."," ",Wn.createElement(Xn,{className:"prompt-label",prompt:s,tagName:"span"})):Wn.createElement(Xn,{className:"prompt-label",prompt:s,tagName:"span"})),y=Wn.createElement(ss,{id:this.descId},"checkbox"===e?"Checkbox to select the answer below":"Radio button to select the answer below"),x={disabled:t,checked:h,correctness:r,tagName:d,value:p,id:this.choiceId,onChange:this.onToggleChoice,onKeyDown:this.handleKeyDown,"aria-describedby":this.descId},S="string"==typeof s&&(s.includes("<math")||s.includes("\\(")||s.includes("\\[")||s.includes("<img")||s.includes("data-latex")||s.includes("data-raw")||s.includes("<mjx-container")),C=g?Wn.createElement(ns,null,S&&y,Wn.createElement(f,{...x,style:{padding:0}}),o?`${o}.`:""):Wn.createElement(Wn.Fragment,null,S&&y,Wn.createElement(f,{...x,slotProps:{input:{ref:this.props.autoFocusRef}}}));return Wn.createElement("div",{className:Zn(i,"corespring-"+m,"choice-input")},Wn.createElement(ts,null,!c&&l&&Wn.createElement(Vn,{correctness:r}),Wn.createElement(os,{className:"checkbox-holder",sx:b},Wn.createElement(rs,{label:v,value:p,htmlFor:this.choiceId,labelPlacement:g?"top":void 0,control:C}))),a&&Wn.createElement(Xn,{className:"rationale",defaultClassName:"rationale",prompt:a}),Wn.createElement(Gn,{feedback:n,correctness:r}))}}hs.__initStatic(),hs.__initStatic2();const ds=e,gs=s,{styled:fs}=o,{Box:ms}=n,bs=fs(ms,{shouldForwardProp:e=>"noBorder"!==e&&"horizontalLayout"!==e})(({theme:e,noBorder:t,horizontalLayout:o})=>({paddingTop:e.spacing(2.5),paddingBottom:e.spacing(1)+2,paddingLeft:e.spacing(1)+2,paddingRight:e.spacing(1)+2,borderBottom:t?"none":`1px solid ${e.palette.grey[300]}`,...o&&{paddingRight:e.spacing(2.5),"& label":{marginRight:e.spacing(1)}}}));class vs extends ds.Component{constructor(...e){super(...e),vs.prototype.__init.call(this),vs.prototype.__init2.call(this),vs.prototype.__init3.call(this),vs.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:s,choiceMode:r,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:v,autoFocusRef:y,tagName:x}=this.props,{isHovered:S}=this.state,C="choice"+(t===o-1?" last":""),w=!s||n?"":e.feedback,k={...e,checked:a,choiceMode:r,disabled:i,feedback:w,correctness:c,displayKey:l,index:t,choicesLayout:u,gridColumns:p,onChange:this.onChange,isEvaluateMode:s,isSelectionButtonBelow:h,selectedAnswerStrokeColor:g,selectedAnswerStrokeWidth:f,tagName:x},E=g&&"initial"!==g,_=b&&"initial"!==b;let A="transparent",O="2px",j="initial";(E||_)&&(a&&E?(A=g,O=f):S&&!i&&_&&(A=b,O=v)),a&&d&&"initial"!==d?j=d:S&&!i&&m&&"initial"!==m&&(j=m);const L=E||_,N=L?{border:`${(e=>{if(!e)return"2px";const t=String(e).trim();return/^\d+(\.\d+)?$/.test(t)?`${t}px`:t})(O)} solid ${A}`,borderRadius:"8px"}:{},R=t===o-1||"vertical"!==u||L,P="horizontal"===u,T="initial"!==j?j:"initial";return ds.createElement("div",{className:C,key:t,style:{backgroundColor:T,...N},onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave},ds.createElement(bs,{component:"div",noBorder:R,horizontalLayout:P},ds.createElement(hs,{...k,autoFocusRef:y})))}}vs.__initStatic(),vs.propTypes={choiceMode:gs.oneOf(["radio","checkbox"]),choice:gs.object,disabled:gs.bool.isRequired,onChoiceChanged:gs.func,index:gs.number,choicesLength:gs.number,showCorrect:gs.bool,isEvaluateMode:gs.bool,checked:gs.bool,correctness:gs.string,displayKey:gs.string,choicesLayout:gs.oneOf(["vertical","grid","horizontal"]),gridColumns:gs.string,selectedAnswerBackgroundColor:gs.string,selectedAnswerStrokeColor:gs.string,selectedAnswerStrokeWidth:gs.string,hoverAnswerBackgroundColor:gs.string,hoverAnswerStrokeColor:gs.string,hoverAnswerStrokeWidth:gs.string,tagName:gs.string,isSelectionButtonBelow:gs.bool,autoFocusRef:gs.object};const ys=e,xs=s,Ss=a,Cs=i,{styled:ws}=o,{Box:ks}=n,{color:Es}=r,{Collapsible:_s}=r,{PreviewPrompt:As}=r;const{translator:Os}=Zo,js=ws(ks)({color:Es.text(),backgroundColor:Es.background(),"& *":{"-webkit-font-smoothing":"antialiased"},position:"relative","& legend":{border:"none !important"}}),Ls=ws("h2")(({theme:e})=>({display:"block",fontSize:"inherit",margin:"0",fontWeight:"normal",paddingBottom:e.spacing(2)})),Ns=ws(ks)(({theme:e})=>({marginBottom:e.spacing(2)})),Rs=ws(ks)({display:"flex",flexDirection:"row",flexWrap:"wrap"}),Ps=ws(ks)({display:"grid"}),Ts=ws("fieldset")({border:"0px",padding:"0.01em 0 0 0",margin:"0px",minWidth:"0px","&:focus":{outline:"none"}}),$s=ws("h3")({position:"absolute",left:"-10000px",top:"auto",width:"1px",height:"1px",overflow:"hidden"}),Ms=ws("div")(({theme:e})=>({fontSize:e.typography.fontSize-2,color:e.palette.error.main,paddingTop:e.spacing(1)}));class Is extends ys.Component{static __initStatic(){this.propTypes={className:xs.string,mode:xs.oneOf(["gather","view","evaluate"]),choiceMode:xs.oneOf(["radio","checkbox"]),keyMode:xs.oneOf(["numbers","letters","none"]),choices:xs.array,partLabel:xs.string,prompt:xs.string,teacherInstructions:xs.string,session:xs.object,disabled:xs.bool,onChoiceChanged:xs.func,responseCorrect:xs.bool,correctResponse:xs.array,choicesLayout:xs.oneOf(["vertical","grid","horizontal"]),gridColumns:xs.string,alwaysShowCorrect:xs.bool,animationsDisabled:xs.bool,language:xs.string,selectedAnswerBackgroundColor:xs.string,selectedAnswerStrokeColor:xs.string,selectedAnswerStrokeWidth:xs.string,hoverAnswerBackgroundColor:xs.string,hoverAnswerStrokeColor:xs.string,hoverAnswerStrokeWidth:xs.string,onShowCorrectToggle:xs.func,isSelectionButtonBelow:xs.bool,minSelections:xs.number,maxSelections:xs.number,autoplayAudioEnabled:xs.bool,customAudioButton:{playImage:xs.string,pauseImage:xs.string},options:xs.object}}constructor(e){super(e),Is.prototype.__init.call(this),Is.prototype.__init2.call(this),Is.prototype.__init3.call(this),Is.prototype.__init4.call(this),this.state={showCorrect:this.props.options&&this.props.alwaysShowCorrect||!1,maxSelectionsErrorState:!1},this.onToggle=this.onToggle.bind(this),this.firstInputRef=ys.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:s,session:r}=this.props;r.value&&r.value.length>=n&&(this.setState({maxSelectionsErrorState:o}),o)||s({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?ys.createElement($s,null,"Multiple Choice Question"):ys.createElement($s,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 s=e[n],r=e[n+1];if(n+=2,("optionalAccess"===s||"optionalCall"===s)&&null==o)return;"access"===s||"optionalAccess"===s?(t=o,o=r(o)):"call"!==s&&"optionalCall"!==s||(o=r((...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:s,gridColumns:r,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:v,options:y}=this.props,{showCorrect:x,maxSelectionsErrorState:S}=this.state,C="evaluate"===e,w=C&&!c,k=r>1?{gridTemplateColumns:`repeat(${r}, 1fr)`}:void 0,E=b.value&&b.value.length||0,_=ys.createElement(As,{tagName:"div",className:"prompt",defaultClassName:"teacher-instructions",prompt:l}),A="grid"===this.props.choicesLayout?Ps:"horizontal"===this.props.choicesLayout?Rs:ks;return ys.createElement(js,{id:"main-container",className:Cs(o,"multiple-choice")},i&&ys.createElement(Ls,null,i),this.renderHeading(),l&&ys.createElement(Ns,null,p?_:ys.createElement(_s,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},_)),ys.createElement(Ts,{tabIndex:0,onFocus:this.handleGroupFocus,role:"radio"===s?"radiogroup":"group"},ys.createElement(As,{className:"prompt",defaultClassName:"prompt",prompt:a,tagName:"legend",autoplayAudioEnabled:m,customAudioButton:v}),!(y&&u)&&ys.createElement(Ss,{show:w,toggled:x,onToggle:this.onToggle.bind(this),language:h}),ys.createElement(A,{style:k},n.map((e,o)=>ys.createElement(vs,{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:r,key:`choice-${o}`,choice:e,index:o,choicesLength:n.length,showCorrect:x,isEvaluateMode:C,choiceMode:s,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"===s&&E<g&&ys.createElement(Ms,null,g&&f?g===f?Os.t("translation:multipleChoice:minmaxSelections_equal",{lng:h,minSelections:g}):Os.t("translation:multipleChoice:minmaxSelections_range",{lng:h,minSelections:g,maxSelections:f}):g?Os.t("translation:multipleChoice:minSelections",{lng:h,minSelections:g}):""),"checkbox"===s&&S&&ys.createElement(Ms,null,Os.t("translation:multipleChoice:maxSelections_"+(1===f?"one":"other"),{lng:h,maxSelections:f})))}}Is.__initStatic(),Is.defaultProps={session:{value:[]}};const Fs=e,Ds=s,{PreviewLayout:Bs}=r;class zs extends Fs.Component{static __initStatic(){this.propTypes={model:Ds.object,session:Ds.object,options:Ds.object,onChoiceChanged:Ds.func,onShowCorrectToggle:Ds.func,extraCSSRules:Ds.shape({names:Ds.arrayOf(Ds.string),rules:Ds.string})}}static __initStatic2(){this.defaultProps={model:{},session:{}}}render(){const{model:e,onChoiceChanged:t,session:o,onShowCorrectToggle:n,options:s}=this.props,{extraCSSRules:r,fontSizeFactor:i}=e;return Fs.createElement(Bs,{extraCSSRules:r,fontSizeFactor:i,classes:{}},Fs.createElement(Is,{...e,options:s,session:o,onChoiceChanged:t,onShowCorrectToggle:n}))}}zs.__initStatic(),zs.__initStatic2();var Vs,Us=t;Vs=Us.createRoot,Us.hydrateRoot;var Ks={};Object.defineProperty(Ks,"__esModule",{value:!0});class Hs extends CustomEvent{constructor(e,t,o){super(Hs.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e,hasModel:o}}),this.component=e,this.complete=t}}Hs.TYPE="model-set";var qs=Ks.ModelSetEvent=Hs;class Ws extends CustomEvent{constructor(e,t){super(Ws.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e}}),this.component=e,this.complete=t}}Ws.TYPE="session-changed";var Ys=Ks.SessionChangedEvent=Ws;function Js(e,t){e.audioStartTime=e.audioStartTime||t.audioStartTime,e.audioEndTime=e.audioEndTime||t.audioEndTime,!e.waitTime&&e.audioStartTime&&e.audioEndTime&&(e.waitTime=e.audioEndTime-e.audioStartTime)}const Gs=e,Qs=c,{EnableAudioAutoplayImage:Xs}=r,{renderMath:Zs}=l;const er=Qs("pie-ui:multiple-choice"),tr=(e,t,o,n)=>{const{autoplayAudioEnabled:s,completeAudioEnabled:r}=t||{};if(s&&r&&!o&&n){const e=n.querySelector("audio"),t=e&&e.closest("#preview-prompt");if(e&&t)return!1}if(!e||!e.value)return!1;const{choiceMode:i,minSelections:a=1,maxSelections:c}=t||{},l=e.value.length||0;return"radio"===i?!!l:!(l<a||l>c)};class or extends HTMLElement{constructor(){super(),this._model=null,this._session=null,this._options=null,this.audioComplete=!1,this._boundHandleKeyDown=this.handleKeyDown.bind(this),this._keyboardEventsEnabled=!1,this._audioInitialized=!1,this._root=null,this._rerender=ro(()=>{if(this._model&&this._session){var e=Gs.createElement(zs,{model:this._model,session:this._session,options:this._options,onChoiceChanged:this._onChange.bind(this),onShowCorrectToggle:this.onShowCorrectToggle.bind(this)});this.setAttribute("aria-label","radio"===this._model.choiceMode?"Multiple Choice Question":"Multiple Correct Answer Question"),this.setAttribute("role","region"),this.setLangAttribute(),this._root||(this._root=Vs(this)),this._root.render(e),queueMicrotask(()=>{er("render complete - render math"),Zs(this)}),!0!==this._model.keyboardEventsEnabled||this._keyboardEventsEnabled||this.enableKeyboardEvents()}else er("skip")},50,{leading:!1,trailing:!0}),this._dispatchResponseChanged=ro(()=>{this.dispatchEvent(new Ys(this.tagName.toLowerCase(),tr(this._session,this._model,this.audioComplete,this)))}),this._dispatchModelSet=ro(()=>{this.dispatchEvent(new qs(this.tagName.toLowerCase(),tr(this._session,this._model,this.audioComplete,this),void 0!==this._model))},50,{leading:!1,trailing:!0})}onShowCorrectToggle(){Zs(this)}setLangAttribute(){const e=this._model&&(this._model.language,1)?this._model.language:"",t=e?e.slice(0,2):"en";this.setAttribute("lang",t)}set model(e){this._model=e,this._rerender(),this._audioInitialized=!1,this._dispatchModelSet()}get session(){return this._session}get options(){return this._options}set options(e){this._options=e,this._rerender()}set session(e){this._session=e,this._rerender(),this._dispatchResponseChanged()}_onChange(e){!function(e,t,o){e.value=e.value||[],"checkbox"===t&&(o.selected?e.value=Array.from(new Set([...e.value,o.value])):e.value=e.value.filter(e=>e!==o.value)),"radio"===t&&(o.selected?e.value=[o.value]:e.value=[]),e.selector=o.selector}(this._session,this._model.choiceMode,e),this._dispatchResponseChanged(),this._rerender()}_createAudioInfoToast(){const e=document.createElement("div");e.id="play-audio-info",Object.assign(e.style,{position:"absolute",top:0,width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",background:"white",zIndex:"1000",cursor:"pointer"});const t=document.createElement("img");return t.src=Xs,t.alt="Click anywhere to enable audio autoplay",t.width=500,t.height=300,e.appendChild(t),e}connectedCallback(){this._rerender();new MutationObserver((e,t)=>{e.forEach(e=>{if("childList"===e.type){if(this._audioInitialized)return;const e=this.querySelector("audio"),o=e&&e.closest("#preview-prompt");if(!this._model)return;if(!this._model.autoplayAudioEnabled)return;if(e&&!o)return;if(!e)return;const n=this._createAudioInfoToast(),s=this.querySelector("#main-container"),r=()=>{this.querySelector("#play-audio-info")&&(e.play(),s.removeChild(n)),document.removeEventListener("click",r)};setTimeout(()=>{e.paused&&!this.querySelector("#play-audio-info")?(s.appendChild(n),document.addEventListener("click",r)):document.removeEventListener("click",r)},500);const i=()=>{Js(this._session,{audioStartTime:(new Date).getTime()});const t=this.querySelector("#play-audio-info");t&&s.removeChild(t),e.removeEventListener("playing",i)};e.addEventListener("playing",i);const a=()=>{Js(this._session,{audioEndTime:(new Date).getTime()}),this.audioComplete=!0,this._dispatchResponseChanged(),e.removeEventListener("ended",a)};e.addEventListener("ended",a),this._audio=e,this._handlePlaying=i,this._handleEnded=a,this._enableAudio=r,this._audioInitialized=!0,t.disconnect()}})}).observe(this,{childList:!0,subtree:!0})}enableKeyboardEvents(){this._keyboardEventsEnabled||(window.addEventListener("keydown",this._boundHandleKeyDown),this._keyboardEventsEnabled=!0)}disconnectedCallback(){this._keyboardEventsEnabled&&(window.removeEventListener("keydown",this._boundHandleKeyDown),this._keyboardEventsEnabled=!1),document.removeEventListener("click",this._enableAudio),this._audio&&(this._audio.removeEventListener("playing",this._handlePlaying),this._audio.removeEventListener("ended",this._handleEnded),this._audio=null),this._root&&this._root.unmount()}handleKeyDown(e){if(!this._model||!this._session)return;const{mode:t}=this._model;if("gather"!==t)return;const o=(e=>{const t=e>="1"&&e<="9"?e-"1":"0"===e?9:-1,o=/^[a-jA-J]$/.test(e)?e.toLowerCase().charCodeAt(0)-"a".charCodeAt(0):-1;return t>=0?t:o})(e.key);if(void 0===o||o<=-1||o>=function(e){let t,o=e[0],n=1;for(;n<e.length;){const s=e[n],r=e[n+1];if(n+=2,("optionalAccess"===s||"optionalCall"===s)&&null==o)return;"access"===s||"optionalAccess"===s?(t=o,o=r(o)):"call"!==s&&"optionalCall"!==s||(o=r((...e)=>o.call(t,...e)),t=void 0)}return o}([this,"access",e=>e._model,"access",e=>e.choices,"optionalAccess",e=>e.length]))return;const n=this._session.value||[],s=this._model.choices[o].value,r={value:s,selected:!n.includes(s),selector:"Keyboard"};this._onChange(r)}}const nr=c,sr="ebsr-multiple-choice",rr=Ys.TYPE,{translator:ir}=Zo,ar=nr("pie-element:ebsr:print"),cr=(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":"gather",e.disabled=!0,e.animationsDisabled=!0,e.lockChoiceOrder=!0,e.choicesLayout=e.choicesLayout||"vertical";const n=to(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 lr extends or{}customElements.get(sr)||customElements.define(sr,lr);const ur=e=>Array.isArray(e)&&e.length>0,pr=e=>{const t=at(e,"value.partA.value"),o=at(e,"value.partB.value");return ur(t)&&ur(o)};class hr extends HTMLElement{constructor(){super(),hr.prototype.__init.call(this),this._model={},this._session={},this._options=null}__init(){this.onSessionUpdated=e=>{if(e.target===this)return;e.preventDefault(),e.stopImmediatePropagation();const t=e.target.getAttribute("id");if(t){const o=`part${t.toUpperCase()}`;e.update&&(this._model[o]=e.update),this.dispatchSessionChanged(e.srcElement._session,o)}}}set model(e){this._model=e,customElements.whenDefined(sr).then(()=>{this.setPartModel(this.partA,"partA"),this.setPartModel(this.partB,"partB")})}set session(e){this._session=e,customElements.whenDefined(sr).then(()=>{this.setPartSession(this.partA,"partA"),this.setPartSession(this.partB,"partB")})}setPartModel(e,t){if(this._model&&this._model[t]&&e){let o={partA:void 0,partB:void 0};if(this._model.partLabels){const e=this._model.language;o={partA:ir.t("ebsr.part",{lng:e,index:"Letters"===this._model.partLabelType?"A":"1"}),partB:ir.t("ebsr.part",{lng:e,index:"Letters"===this._model.partLabelType?"B":"2"})}}e.model={...cr(this._model[t],this._options),keyMode:this._model[t].choicePrefix,partLabel:o[t]},e.options=this._options,e._session||(e.session={})}}set options(e){this._options=e}setPartSession(e,t){if(this._session&&this._model&&e){const{value:o}=this._session;e.session=o&&o[t]?o[t]:{id:t}}}dispatchSessionChanged(e,t){this._session.value={...this._session.value,[t]:e},ar("[onSessionChanged] session: ",this._session);const o=pr(this._session);this.dispatchEvent(new Ys(this.tagName.toLowerCase(),o))}get partA(){return this.querySelector(`${sr}#a`)}get partB(){return this.querySelector(`${sr}#b`)}connectedCallback(){this._render(),this.addEventListener(rr,this.onSessionUpdated)}disconnectedCallback(){this.removeEventListener(rr,this.onSessionUpdated)}_render(){this.innerHTML=`\n <div>\n <${sr} id="a"></${sr}>\n <${sr} id="b"></${sr}>\n </div>\n `}}export{hr as default,pr as isSessionComplete};