@pie-element/math-templated 6.2.0-next.9 → 7.0.0
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/CHANGELOG.md +18 -0
- package/configure/CHANGELOG.md +12 -0
- package/configure/package.json +5 -5
- package/controller/CHANGELOG.md +6 -0
- package/controller/package.json +3 -3
- package/lib/main.js +131 -12
- package/lib/main.js.map +1 -1
- package/module/configure.js +1 -1
- package/module/element.js +1 -1
- package/module/index.html +1 -1
- package/module/manifest.json +5 -5
- package/module/print.html +1 -1
- package/module/print.js +1 -1
- package/package.json +7 -7
package/module/print.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_dll_react_dom as e,_dll_prop_types as t,_dll_react as n,_dll_mui__material_styles as r,_dll_mui__material as o,_dll_debug as i,_dll_mui__material_collapse as a,_dll_classnames as s,_dll_mui__icons_material as l}from"../../../@pie-lib/shared-module@^4.1.0/module/index.js";import{_dll_pie_lib__math_rendering as c}from"../../../@pie-lib/math-rendering-module@^4.1.0/module/index.js";import{_dll_pie_framework__mathquill as d}from"../../../@pie-lib/math-edit-module@^3.2.0/module/index.js";import{green as u,orange as p,red as h,indigo as m,pink as g,grey as f}from"@mui/material/colors";import{_dll_pie_lib__drag as v}from"../../../@pie-lib/drag-module@^3.2.0/module/index.js";var b,y=e;b=y.createRoot,y.hydrateRoot;var x="object"==typeof global&&global&&global.Object===Object&&global,w="object"==typeof self&&self&&self.Object===Object&&self,E=x||w||Function("return this")(),C=E.Symbol,k=Object.prototype,_=k.hasOwnProperty,S=k.toString,R=C?C.toStringTag:void 0;var A=Object.prototype.toString;var O=C?C.toStringTag:void 0;function T(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":O&&O in Object(e)?function(e){var t=_.call(e,R),n=e[R];try{e[R]=void 0;var r=!0}catch(e){}var o=S.call(e);return r&&(t?e[R]=n:delete e[R]),o}(e):function(e){return A.call(e)}(e)}function L(e){return null!=e&&"object"==typeof e}function N(e){return"symbol"==typeof e||L(e)&&"[object Symbol]"==T(e)}function D(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}var j=Array.isArray,M=C?C.prototype:void 0,P=M?M.toString:void 0;function F(e){if("string"==typeof e)return e;if(j(e))return D(e,F)+"";if(N(e))return P?P.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}var I=/\s/;var $=/^\s+/;function z(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&I.test(e.charAt(t)););return t}(e)+1).replace($,""):e}function B(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var q=/^[-+]0x[0-9a-f]+$/i,K=/^0b[01]+$/i,U=/^0o[0-7]+$/i,H=parseInt;function W(e){if("number"==typeof e)return e;if(N(e))return NaN;if(B(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=B(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=z(e);var n=K.test(e);return n||U.test(e)?H(e.slice(2),n?2:8):q.test(e)?NaN:+e}var V=1/0;function Y(e){var t=function(e){return e?(e=W(e))===V||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}(e),n=t%1;return t==t?n?t-n:t:0}function X(e){return e}function J(e){if(!B(e))return!1;var t=T(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var G,Q=E["__core-js_shared__"],Z=(G=/[^.]+$/.exec(Q&&Q.keys&&Q.keys.IE_PROTO||""))?"Symbol(src)_1."+G:"";var ee=Function.prototype.toString;function te(e){if(null!=e){try{return ee.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var ne=/^\[object .+?Constructor\]$/,re=Function.prototype,oe=Object.prototype,ie=re.toString,ae=oe.hasOwnProperty,se=RegExp("^"+ie.call(ae).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function le(e){return!(!B(e)||(t=e,Z&&Z in t))&&(J(e)?se:ne).test(te(e));var t}function ce(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return le(n)?n:void 0}var de=ce(E,"WeakMap");var ue=Date.now;var pe,he,me,ge=function(){try{var e=ce(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),fe=ge,ve=fe?function(e,t){return fe(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:X,be=(pe=ve,he=0,me=0,function(){var e=ue(),t=16-(e-me);if(me=e,t>0){if(++he>=800)return arguments[0]}else he=0;return pe.apply(void 0,arguments)}),ye=/^(?:0|[1-9]\d*)$/;function xe(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&ye.test(e))&&e>-1&&e%1==0&&e<t}function we(e,t){return e===t||e!=e&&t!=t}var Ee=Math.max;function Ce(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function ke(e){return null!=e&&Ce(e.length)&&!J(e)}var _e=Object.prototype;function Se(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||_e)}function Re(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Ae(e){return L(e)&&"[object Arguments]"==T(e)}var Oe=Object.prototype,Te=Oe.hasOwnProperty,Le=Oe.propertyIsEnumerable,Ne=Ae(function(){return arguments}())?Ae:function(e){return L(e)&&Te.call(e,"callee")&&!Le.call(e,"callee")};var De="object"==typeof exports&&exports&&!exports.nodeType&&exports,je=De&&"object"==typeof module&&module&&!module.nodeType&&module,Me=je&&je.exports===De?E.Buffer:void 0,Pe=(Me?Me.isBuffer:void 0)||function(){return!1},Fe={};Fe["[object Float32Array]"]=Fe["[object Float64Array]"]=Fe["[object Int8Array]"]=Fe["[object Int16Array]"]=Fe["[object Int32Array]"]=Fe["[object Uint8Array]"]=Fe["[object Uint8ClampedArray]"]=Fe["[object Uint16Array]"]=Fe["[object Uint32Array]"]=!0,Fe["[object Arguments]"]=Fe["[object Array]"]=Fe["[object ArrayBuffer]"]=Fe["[object Boolean]"]=Fe["[object DataView]"]=Fe["[object Date]"]=Fe["[object Error]"]=Fe["[object Function]"]=Fe["[object Map]"]=Fe["[object Number]"]=Fe["[object Object]"]=Fe["[object RegExp]"]=Fe["[object Set]"]=Fe["[object String]"]=Fe["[object WeakMap]"]=!1;var Ie="object"==typeof exports&&exports&&!exports.nodeType&&exports,$e=Ie&&"object"==typeof module&&module&&!module.nodeType&&module,ze=$e&&$e.exports===Ie&&x.process,Be=function(){try{var e=$e&&$e.require&&$e.require("util").types;return e||ze&&ze.binding&&ze.binding("util")}catch(e){}}(),qe=Be&&Be.isTypedArray,Ke=qe?function(e){return function(t){return e(t)}}(qe):function(e){return L(e)&&Ce(e.length)&&!!Fe[T(e)]},Ue=Ke,He=Object.prototype.hasOwnProperty;var We=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object),Ve=We,Ye=Object.prototype.hasOwnProperty;function Xe(e){if(!Se(e))return Ve(e);var t=[];for(var n in Object(e))Ye.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Je(e){return ke(e)?function(e,t){var n=j(e),r=!n&&Ne(e),o=!n&&!r&&Pe(e),i=!n&&!r&&!o&&Ue(e),a=n||r||o||i,s=a?Re(e.length,String):[],l=s.length;for(var c in e)!t&&!He.call(e,c)||a&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||xe(c,l))||s.push(c);return s}(e):Xe(e)}var Ge=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Qe=/^\w*$/;function Ze(e,t){if(j(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!N(e))||(Qe.test(e)||!Ge.test(e)||null!=t&&e in Object(t))}var et=ce(Object,"create");var tt=Object.prototype.hasOwnProperty;var nt=Object.prototype.hasOwnProperty;function rt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ot(e,t){for(var n=e.length;n--;)if(we(e[n][0],t))return n;return-1}rt.prototype.clear=function(){this.__data__=et?et(null):{},this.size=0},rt.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},rt.prototype.get=function(e){var t=this.__data__;if(et){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return tt.call(t,e)?t[e]:void 0},rt.prototype.has=function(e){var t=this.__data__;return et?void 0!==t[e]:nt.call(t,e)},rt.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=et&&void 0===t?"__lodash_hash_undefined__":t,this};var it=Array.prototype.splice;function at(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}at.prototype.clear=function(){this.__data__=[],this.size=0},at.prototype.delete=function(e){var t=this.__data__,n=ot(t,e);return!(n<0)&&(n==t.length-1?t.pop():it.call(t,n,1),--this.size,!0)},at.prototype.get=function(e){var t=this.__data__,n=ot(t,e);return n<0?void 0:t[n][1]},at.prototype.has=function(e){return ot(this.__data__,e)>-1},at.prototype.set=function(e,t){var n=this.__data__,r=ot(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var st=ce(E,"Map");function lt(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function ct(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ct.prototype.clear=function(){this.size=0,this.__data__={hash:new rt,map:new(st||at),string:new rt}},ct.prototype.delete=function(e){var t=lt(this,e).delete(e);return this.size-=t?1:0,t},ct.prototype.get=function(e){return lt(this,e).get(e)},ct.prototype.has=function(e){return lt(this,e).has(e)},ct.prototype.set=function(e,t){var n=lt(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function dt(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(dt.Cache||ct),n}dt.Cache=ct;var ut=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,pt=/\\(\\)?/g,ht=function(e){var t=dt(e,function(e){return 500===n.size&&n.clear(),e}),n=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(ut,function(e,n,r,o){t.push(r?o.replace(pt,"$1"):n||e)}),t}),mt=ht;function gt(e,t){return j(e)?e:Ze(e,t)?[e]:mt(function(e){return null==e?"":F(e)}(e))}function ft(e){if("string"==typeof e||N(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function vt(e,t){for(var n=0,r=(t=gt(t,e)).length;null!=e&&n<r;)e=e[ft(t[n++])];return n&&n==r?e:void 0}function bt(e,t,n){var r=null==e?void 0:vt(e,t);return void 0===r?n:r}function yt(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}var xt=C?C.isConcatSpreadable:void 0;function wt(e){return j(e)||Ne(e)||!!(xt&&e&&e[xt])}function Et(e,t,n,r,o){var i=-1,a=e.length;for(n||(n=wt),o||(o=[]);++i<a;){var s=e[i];t>0&&n(s)?t>1?Et(s,t-1,n,r,o):yt(o,s):r||(o[o.length]=s)}return o}function Ct(e){return(null==e?0:e.length)?Et(e,1):[]}function kt(e){var t=this.__data__=new at(e);this.size=t.size}function _t(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}kt.prototype.clear=function(){this.__data__=new at,this.size=0},kt.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},kt.prototype.get=function(e){return this.__data__.get(e)},kt.prototype.has=function(e){return this.__data__.has(e)},kt.prototype.set=function(e,t){var n=this.__data__;if(n instanceof at){var r=n.__data__;if(!st||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new ct(r)}return n.set(e,t),this.size=n.size,this};var St=Object.prototype.propertyIsEnumerable,Rt=Object.getOwnPropertySymbols,At=Rt?function(e){return null==e?[]:(e=Object(e),_t(Rt(e),function(t){return St.call(e,t)}))}:function(){return[]};function Ot(e){return function(e,t,n){var r=t(e);return j(e)?r:yt(r,n(e))}(e,Je,At)}var Tt=ce(E,"DataView"),Lt=ce(E,"Promise"),Nt=ce(E,"Set"),Dt="[object Map]",jt="[object Promise]",Mt="[object Set]",Pt="[object WeakMap]",Ft="[object DataView]",It=te(Tt),$t=te(st),zt=te(Lt),Bt=te(Nt),qt=te(de),Kt=T;(Tt&&Kt(new Tt(new ArrayBuffer(1)))!=Ft||st&&Kt(new st)!=Dt||Lt&&Kt(Lt.resolve())!=jt||Nt&&Kt(new Nt)!=Mt||de&&Kt(new de)!=Pt)&&(Kt=function(e){var t=T(e),n="[object Object]"==t?e.constructor:void 0,r=n?te(n):"";if(r)switch(r){case It:return Ft;case $t:return Dt;case zt:return jt;case Bt:return Mt;case qt:return Pt}return t});var Ut=Kt,Ht=E.Uint8Array;function Wt(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new ct;++t<n;)this.add(e[t])}function Vt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function Yt(e,t){return e.has(t)}Wt.prototype.add=Wt.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Wt.prototype.has=function(e){return this.__data__.has(e)};function Xt(e,t,n,r,o,i){var a=1&n,s=e.length,l=t.length;if(s!=l&&!(a&&l>s))return!1;var c=i.get(e),d=i.get(t);if(c&&d)return c==t&&d==e;var u=-1,p=!0,h=2&n?new Wt:void 0;for(i.set(e,t),i.set(t,e);++u<s;){var m=e[u],g=t[u];if(r)var f=a?r(g,m,u,t,e,i):r(m,g,u,e,t,i);if(void 0!==f){if(f)continue;p=!1;break}if(h){if(!Vt(t,function(e,t){if(!Yt(h,t)&&(m===e||o(m,e,n,r,i)))return h.push(t)})){p=!1;break}}else if(m!==g&&!o(m,g,n,r,i)){p=!1;break}}return i.delete(e),i.delete(t),p}function Jt(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function Gt(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var Qt=C?C.prototype:void 0,Zt=Qt?Qt.valueOf:void 0;var en=Object.prototype.hasOwnProperty;var tn="[object Arguments]",nn="[object Array]",rn="[object Object]",on=Object.prototype.hasOwnProperty;function an(e,t,n,r,o,i){var a=j(e),s=j(t),l=a?nn:Ut(e),c=s?nn:Ut(t),d=(l=l==tn?rn:l)==rn,u=(c=c==tn?rn:c)==rn,p=l==c;if(p&&Pe(e)){if(!Pe(t))return!1;a=!0,d=!1}if(p&&!d)return i||(i=new kt),a||Ue(e)?Xt(e,t,n,r,o,i):function(e,t,n,r,o,i,a){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!i(new Ht(e),new Ht(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return we(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=Jt;case"[object Set]":var l=1&r;if(s||(s=Gt),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=2,a.set(e,t);var d=Xt(s(e),s(t),r,o,i,a);return a.delete(e),d;case"[object Symbol]":if(Zt)return Zt.call(e)==Zt.call(t)}return!1}(e,t,l,n,r,o,i);if(!(1&n)){var h=d&&on.call(e,"__wrapped__"),m=u&&on.call(t,"__wrapped__");if(h||m){var g=h?e.value():e,f=m?t.value():t;return i||(i=new kt),o(g,f,n,r,i)}}return!!p&&(i||(i=new kt),function(e,t,n,r,o,i){var a=1&n,s=Ot(e),l=s.length;if(l!=Ot(t).length&&!a)return!1;for(var c=l;c--;){var d=s[c];if(!(a?d in t:en.call(t,d)))return!1}var u=i.get(e),p=i.get(t);if(u&&p)return u==t&&p==e;var h=!0;i.set(e,t),i.set(t,e);for(var m=a;++c<l;){var g=e[d=s[c]],f=t[d];if(r)var v=a?r(f,g,d,t,e,i):r(g,f,d,e,t,i);if(!(void 0===v?g===f||o(g,f,n,r,i):v)){h=!1;break}m||(m="constructor"==d)}if(h&&!m){var b=e.constructor,y=t.constructor;b==y||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof y&&y instanceof y||(h=!1)}return i.delete(e),i.delete(t),h}(e,t,n,r,o,i))}function sn(e,t,n,r,o){return e===t||(null==e||null==t||!L(e)&&!L(t)?e!=e&&t!=t:an(e,t,n,r,sn,o))}function ln(e){return e==e&&!B(e)}function cn(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}function dn(e){var t=function(e){for(var t=Je(e),n=t.length;n--;){var r=t[n],o=e[r];t[n]=[r,o,ln(o)]}return t}(e);return 1==t.length&&t[0][2]?cn(t[0][0],t[0][1]):function(n){return n===e||function(e,t,n,r){var o=n.length,i=o,a=!r;if(null==e)return!i;for(e=Object(e);o--;){var s=n[o];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++o<i;){var l=(s=n[o])[0],c=e[l],d=s[1];if(a&&s[2]){if(void 0===c&&!(l in e))return!1}else{var u=new kt;if(r)var p=r(c,d,l,e,t,u);if(!(void 0===p?sn(d,c,3,r,u):p))return!1}}return!0}(n,e,t)}}function un(e,t){return null!=e&&t in Object(e)}function pn(e,t){return null!=e&&function(e,t,n){for(var r=-1,o=(t=gt(t,e)).length,i=!1;++r<o;){var a=ft(t[r]);if(!(i=null!=e&&n(e,a)))break;e=e[a]}return i||++r!=o?i:!!(o=null==e?0:e.length)&&Ce(o)&&xe(a,o)&&(j(e)||Ne(e))}(e,t,un)}function hn(e){return function(t){return null==t?void 0:t[e]}}function mn(e){return Ze(e)?hn(ft(e)):function(e){return function(t){return vt(t,e)}}(e)}function gn(e){return"function"==typeof e?e:null==e?X:"object"==typeof e?j(e)?(t=e[0],n=e[1],Ze(t)&&ln(n)?cn(ft(t),n):function(e){var r=bt(e,t);return void 0===r&&r===n?pn(e,t):sn(n,r,3)}):dn(e):mn(e);var t,n}var fn,vn=function(e,t,n){for(var r=-1,o=Object(e),i=n(e),a=i.length;a--;){var s=i[fn?a:++r];if(!1===t(o[s],s,o))break}return e},bn=vn;function yn(e,t){return e&&bn(e,t,Je)}var xn=function(){return E.Date.now()},wn=Math.max,En=Math.min;function Cn(e,t,n){var r,o,i,a,s,l,c=0,d=!1,u=!1,p=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function h(t){var n=r,i=o;return r=o=void 0,c=t,a=e.apply(i,n)}function m(e){var n=e-l;return void 0===l||n>=t||n<0||u&&e-c>=i}function g(){var e=xn();if(m(e))return f(e);s=setTimeout(g,function(e){var n=t-(e-l);return u?En(n,i-(e-c)):n}(e))}function f(e){return s=void 0,p&&r?h(e):(r=o=void 0,a)}function v(){var e=xn(),n=m(e);if(r=arguments,o=this,l=e,n){if(void 0===s)return function(e){return c=e,s=setTimeout(g,t),d?h(e):a}(l);if(u)return clearTimeout(s),s=setTimeout(g,t),h(l)}return void 0===s&&(s=setTimeout(g,t)),a}return t=W(t)||0,B(n)&&(d=!!n.leading,i=(u="maxWait"in n)?wn(W(n.maxWait)||0,t):i,p="trailing"in n?!!n.trailing:p),v.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=l=o=s=void 0},v.flush=function(){return void 0===s?a:f(xn())},v}var kn=Object.prototype.hasOwnProperty;function _n(e){if(null==e)return!0;if(ke(e)&&(j(e)||"string"==typeof e||"function"==typeof e.splice||Pe(e)||Ue(e)||Ne(e)))return!e.length;var t=Ut(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(Se(e))return!Xe(e).length;for(var n in e)if(kn.call(e,n))return!1;return!0}function Sn(e,t){return sn(e,t)}var Rn=4294967295,An=Math.min;function On(e,t){if((e=Y(e))<1||e>9007199254740991)return[];var n,r=Rn,o=An(e,Rn);e-=Rn;for(var i=Re(o,t="function"==typeof(n=t)?n:X);++r<e;)t(r);return i}var Tn=Math.max;var Ln=function(e,t){return be(function(e,t,n){return t=Ee(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=Ee(r.length-t,0),a=Array(i);++o<i;)a[o]=r[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=r[o];return s[t]=n(a),function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}(e,this,s)}}(e,t,X),e+"")}(function(e){if(!e||!e.length)return[];var t=0;return e=_t(e,function(e){if(L(n=e)&&ke(n))return t=Tn(e.length,t),!0;var n}),Re(t,function(t){return D(e,hn(t))})}),Nn=Ln;const Dn=e=>({...e,category:"comparison"}),jn=Dn({name:"Less than",latex:"<",command:"\\lt"}),Mn=Dn({name:"Greater than",latex:">",command:"\\gt"}),Pn=Dn({name:"Less than or equal",latex:"\\le",symbol:"<=",command:"\\le",ariaLabel:"less than or equal to"}),Fn=Dn({name:"Greater than or equal",symbol:">=",command:"\\ge",latex:"\\ge"});var In=Object.freeze({__proto__:null,lessThan:jn,greaterThan:Mn,lessThanEqual:Pn,greaterThanEqual:Fn});const $n=e=>t=>({...t,category:e}),zn=(e=[],t=[])=>{t=t.filter((e=>t=>{const n=Ct(e),r=n.some(e=>e.latex===t.latex),o=n.some(e=>e.name===t.name);return!r&&!o})(e));const n=[];On(5-e.length,()=>e.push([])),On(5,()=>n.push([]));const r=((e=[])=>{const t=[];On(5,()=>t.push([]));let n=e.length,r=0,o=0;for(;o<n;)t[r++].push(e[o++]),5===r&&(r=0);return t})(t);for(let t=0;t<5;t++)n[t]=[...e[t],...r[t]];return n},Bn=$n("vars"),qn=Bn({name:"X",latex:"x",write:"x"}),Kn=Bn({name:"Y",latex:"y",write:"y"}),Un=Bn({name:"Theta",latex:"\\theta",write:"\\theta"});var Hn=Object.freeze({__proto__:null,x:qn,y:Kn,theta:Un});const Wn=$n("fractions"),Vn=Wn({name:"blank/blank",latex:"\\frac{}{}",command:"\\frac",ariaLabel:"fraction"}),Yn=Wn({latex:"\\frac{x}{ }",name:"X/blank",label:"x/[]",command:"/",ariaLabel:"x over blank fraction"}),Xn=Wn({name:"X (blank/blank)",latex:"x\\frac{}{}",label:"x([]/[])",command:"\\frac",ariaLabel:"mixed number"});var Jn=Object.freeze({__proto__:null,blankOverBlank:Vn,xOverBlank:Yn,xBlankBlank:Xn});const Gn=$n("exponent"),Qn=Gn({name:"Squared",latex:"x^2",write:"^2"}),Zn=Gn({name:"X to the power of n",latex:"x^{}",command:"^",ariaLabel:"exponent"}),er=Gn({name:"Square root",latex:"\\sqrt{}",command:"\\sqrt"}),tr=Gn({name:"Nth root",latex:"\\sqrt[{}]{}",command:"\\nthroot"});var nr=Object.freeze({__proto__:null,squared:Qn,xToPowerOfN:Zn,squareRoot:er,nthRoot:tr});const rr=$n("misc"),or=rr({name:"Plus or Minus",latex:"\\pm",write:"\\pm"}),ir=rr({name:"Absolute Value",latex:"\\abs{}",symbol:"| |",command:"|"}),ar=rr({name:"Parenthesis",latex:"\\left(\\right)",symbol:"( )",command:"("}),sr=rr({name:"Brackets",latex:"\\left[\\right]",symbol:"[ ]",command:"["}),lr=rr({name:"Percent",latex:"%",command:"%"}),cr=rr({latex:"\\approx",command:"\\approx",ariaLabel:"Approximately equal to"}),dr=rr({latex:"\\napprox",command:"\\napprox",ariaLabel:"Not pproximately equal to"}),ur=rr({latex:"\\neq",command:"\\neq",ariaLabel:"Not equals"}),pr=rr({latex:"\\sim",command:"\\sim",ariaLabel:"Similar"}),hr=rr({latex:"\\nsim",command:"\\nsim",ariaLabel:"Not similar"});var mr=Object.freeze({__proto__:null,plusMinus:or,absValue:ir,parenthesis:ar,brackets:sr,percentage:lr,approx:cr,nApprox:dr,notEqual:ur,similar:pr,notSimilar:hr});const gr=$n("constants"),fr=gr({name:"Pi",label:"π",latex:"\\pi",command:"\\pi",category:"constants"}),vr=gr({name:"Eulers",label:"e",latex:"e",command:"e",category:"constants"}),br=gr({name:"Infinity",label:"\\infty",latex:"\\infty",command:"\\infty",category:"constants"}),yr=gr({name:"Half Infinity",label:"\\propto",latex:"\\propto",command:"\\propto",category:"constants"});var xr=Object.freeze({__proto__:null,pi:fr,eulers:vr,infinity:br,halfInfinity:yr});const wr=$n("trigonometry"),Er=wr({name:"sine",label:"sin",command:"\\sin",latex:"\\sin"}),Cr=wr({name:"cosine",label:"cos",command:"\\cos",latex:"\\cos"}),kr=wr({name:"tanget",label:"tan",command:"\\tan",latex:"\\tan"}),_r=wr({name:"secant",label:"sec",command:"\\sec",latex:"\\sec"}),Sr=wr({name:"cosecant",label:"csc",command:"\\csc",latex:"\\csc"}),Rr=wr({name:"cotangent",label:"cot",command:"\\cot",latex:"\\cot"});var Ar=Object.freeze({__proto__:null,sin:Er,cos:Cr,tan:kr,sec:_r,csc:Sr,cot:Rr});const Or=e=>({...e,category:"geometry"}),Tr=Or({name:"Line",latex:"\\overline{}",command:"\\overline"}),Lr=Or({name:"Ray",latex:"\\overrightarrow{}",command:"\\overrightarrow"}),Nr=Or({name:"Segment",latex:"\\overleftrightarrow{\\overline{}}",symbol:"AB",command:"\\overleftrightarrow"}),Dr=Or({name:"Segment",latex:"\\overleftrightarrow{AB}",write:"\\overleftrightarrow{AB}",label:"AB"}),jr=Or({name:"Parallel",latex:"\\parallel",command:"\\parallel"}),Mr=Or({name:"Not Parallel",latex:"\\nparallel",command:"\\nparallel"}),Pr=Or({name:"Perpendicular",latex:"\\perp",command:"\\perpendicular"}),Fr=Or({name:"Angle",latex:"\\angle",command:"\\angle"}),Ir=Or({name:"Over arc",latex:"\\overarc{\\overline{}}",command:"\\overarc"}),$r=Or({name:"Measured Angle",latex:"\\measuredangle",command:["m","\\angle"]}),zr=Or({name:"Triangle",latex:"\\triangle",command:"\\triangle"}),Br=Or({name:"Square",latex:"\\square",command:"\\square"}),qr=Or({name:"Parallelogram",latex:"\\parallelogram",command:"\\parallelogram"}),Kr=Or({name:"Circled Dot",latex:"\\odot",command:"\\odot"}),Ur=Or({name:"Degree",latex:"\\degree",command:"\\degree"}),Hr=Or({name:"Similar",command:"\\sim",latex:"\\sim"}),Wr=Or({name:"Congruent To",command:"\\cong",latex:"\\cong"}),Vr=Or({name:"Not Congruent To",command:"\\ncong",latex:"\\ncong"}),Yr=Or({name:"Prime",label:"pam",latex:"'",write:"'"}),Xr=Or({name:"Double Prime",latex:"''",write:"''"}),Jr=Or({name:"Left Arrow",latex:"\\leftarrow",command:"\\leftarrow"}),Gr=Or({name:"Right Arrow",latex:"\\rightarrow",command:"\\rightarrow"}),Qr=Or({name:"Left and Right Arrow",latex:"\\leftrightarrow",command:"\\leftrightarrow"});var Zr=Object.freeze({__proto__:null,overline:Tr,overRightArrow:Lr,overLeftRightArrow:Nr,segment:Dr,parallel:jr,notParallel:Mr,perpindicular:Pr,angle:Fr,overArc:Ir,measureOfAngle:$r,triangle:zr,square:Br,parallelogram:qr,circledDot:Kr,degree:Ur,similarTo:Hr,congruentTo:Wr,notCongruentTo:Vr,primeArcminute:Yr,doublePrimeArcSecond:Xr,leftArrow:Jr,rightArrow:Gr,leftrightArrow:Qr});const eo=$n("operators")({name:"CircleDot",label:"⋅",write:"\\cdot",ariaLabel:"Dot multiplier"});var to=Object.freeze({__proto__:null,circleDot:eo});const no=$n("log"),ro=no({name:"Log",label:"log",command:"\\log",latex:"\\log"}),oo=no({name:"log base n",label:"log s",latex:"\\log_{}",command:["\\log","_"]}),io=no({name:"natural log",label:"ln",command:"\\ln",latex:"\\ln"});var ao=Object.freeze({__proto__:null,log:ro,logSubscript:oo,ln:io});const so=$n("sub-sup"),lo=so({name:"Superscript",latex:"x^{}",command:"^"}),co=so({name:"Subscript",latex:"x_{}",command:"_"});var uo=Object.freeze({__proto__:null,superscript:lo,subscript:co});const po=$n("statistics"),ho=po({name:"X Bar",label:"x̄",latex:"\\overline{x}",write:"\\overline{x}"}),mo=po({name:"Y Bar",latex:"\\overline{y}",write:"\\overline{y}"}),go=po({name:"mu",label:"mu",latex:"\\mu",write:"\\mu"}),fo=po({name:"Sigma",ariaLabel:"Uppercase Sigma",label:"\\Sigma",latex:"\\Sigma",write:"\\Sigma"}),vo=po({name:"sigma",ariaLabel:"Lowercase Sigma",label:"\\sigma",latex:"\\sigma",write:"\\sigma"});var bo=Object.freeze({__proto__:null,xBar:ho,yBar:mo,mu:go,sigma:fo,smallSigma:vo});const yo=$n("operators"),xo=yo({write:"=",label:"="}),wo=yo({write:"+",label:"+"}),Eo=yo({write:"−",label:"−"}),Co=yo({name:"divide",label:"÷",command:"\\divide",otherNotation:"\\div"}),ko=yo({name:"multiply",label:"×",command:"\\times"});var _o=Object.freeze({__proto__:null,equals:xo,plus:wo,minus:Eo,divide:Co,multiply:ko});const So=$n("matrices"),Ro=So({name:"Single Cell Matrix",label:"[ ]",write:"\\begin{pmatrix}\\end{pmatrix}"}),Ao=So({name:"Double Cell Matrix",label:"[ ] [ ] \\\\newline [ ] [ ]",write:"\\begin{bmatrix}&\\\\&\\end{bmatrix}"});var Oo=Object.freeze({__proto__:null,singleCellMatrix:Ro,doubleCellMatrix:Ao});const To={0:"zero",1:"one",2:"two",3:"three",4:"four",5:"five",6:"six",7:"seven",8:"eight",9:"nine"};var Lo=On(10,String).map(e=>({name:To[e],write:e,label:e,category:"digit"})).reduce((e,t)=>(e[t.name]=t,e),{comma:{name:"comma",label:",",write:",",category:"digit"},decimalPoint:{name:"decimal-point",label:".",write:".",category:"digit"}});const No=$n("logic"),Do=No({name:"Therefore",label:"∴",write:"∴"}),jo=No({name:"Long division",latex:"\\longdiv{}",command:"\\longdiv"}),Mo=$n("navigation"),Po=Mo({label:"◀",keystroke:"Left",ariaLabel:"Move cursor left"}),Fo=Mo({label:"▶",keystroke:"Right",ariaLabel:"Move cursor right"}),Io={label:"⌫",category:"edit",keystroke:"Backspace",ariaLabel:"Delete"},$o=[[Vn,lr,qn,Qn,er],[eo,Kn,co,Zn,tr],[or,jn,Mn,Pn,Fn],[fr,Un,ar,sr,ir],[ur,Er,Cr,kr,Ur]],zo=(()=>{const e=[...$o.map(e=>[...e])];return e[0].push({name:"i",latex:"i",write:"i"}),e[1].push(ro),e[2].push(oo),e[3].push(io),e[4].push(vr),e})(),Bo=(()=>{const e=[...$o.map(e=>[...e])];return e[0].push(go),e[1].push(ho),e[2].push(mo),e[3].push(fo),e[4].push(vo),e})(),qo=[{predicate:e=>e>=3&&e<=5,set:[[jn,Mn],[Yn,Xn],[qn,jo],[Qn,Zn]]},{predicate:e=>e>=6&&e<=7,set:[[Ur,jn,Mn],[eo,Pn,Fn],[qn,Kn,Qn,Zn],[or,Yn,Xn,er],[fr,ar,ir,tr]]},{predicate:e=>e>=8||"HS"===e,set:$o},{predicate:"non-negative-integers",set:[[Lo.seven,Lo.eight,Lo.nine],[Lo.four,Lo.five,Lo.six],[Lo.one,Lo.two,Lo.three],[Lo.zero,{name:"",latex:"",write:""},{name:"",latex:"",write:""}],[Po,Fo,Io]]},{predicate:"integers",set:[[Lo.seven,Lo.eight,Lo.nine],[Lo.four,Lo.five,Lo.six],[Lo.one,Lo.two,Lo.three],[Lo.zero,{name:"",latex:"",write:""},Eo],[Po,Fo,Io]]},{predicate:"decimals",set:[[Lo.seven,Lo.eight,Lo.nine],[Lo.four,Lo.five,Lo.six],[Lo.one,Lo.two,Lo.three],[Lo.zero,Lo.decimalPoint,Eo],[Po,Fo,Io]]},{predicate:"fractions",set:[[Lo.seven,Lo.eight,Lo.nine],[Lo.four,Lo.five,Lo.six],[Lo.one,Lo.two,Lo.three],[Lo.zero,Vn,Eo],[Po,Fo,Io]]},{predicate:"geometry",set:[[Vn,Ur,Yr,Xr,Wr,Hr],[eo,Fr,$r,zr,Vr,hr],[Er,Cr,kr,fr,er,tr],[Sr,_r,Rr,Un,co,Zn],[Tr,Lr,Nr,Ir,Pr,jr]]},{predicate:"advanced-algebra",set:zo},{predicate:"statistics",set:Bo},{predicate:"item-authoring",set:[[Co,Vn,jo,yr,Qn,er,Tr,Lr,Nr,ro],[ko,eo,{name:"",latex:"",write:""},co,Zn,tr,Pr,jr,Ir,oo],[or,fr,Un,Ur,Fr,Jr,Gr,zr,Br,io],[ur,ir,vo,go,Do,fo,Qr,Er,Cr,kr],[Pn,Fn,{name:"",latex:"",write:""},{name:"",latex:"",write:""},br,{name:"",latex:"",write:""},{name:"",latex:"",write:""},Sr,_r,Rr]]},{predicate:e=>e>=1&&e<=2,set:[]}],Ko=e=>{const t=parseInt(e,10);if(!(e=isNaN(t)?e:t))return[];const n=qo.find(t=>"string"==typeof t.predicate?t.predicate===e:t.predicate(e));return n?n.set||[]:"language"!==e?qo[2].set:void 0},Uo=[...Object.values(_o),...Object.values(In),...Object.values(xr),...Object.values(Lo),...Object.values(nr),...Object.values(Jn),...Object.values(Zr),...Object.values(ao),...Object.values(Oo),...Object.values(mr),...Object.values(to),...Object.values(bo),...Object.values(uo),...Object.values(Ar),...Object.values(Hn)],Ho=()=>{(Array.from(document.querySelectorAll("span[mathquill-command-id]"))||[]).forEach(e=>{e&&"∥"===e.innerText&&"mq-editable-field"!==e.className&&(e.style.fontSize="32px"),"′"!==e.innerText&&"′′"!==e.innerText||e.hasAttribute("data-prime")||e.setAttribute("data-prime","true")})},{one:Wo,two:Vo,three:Yo,four:Xo,five:Jo,six:Go,seven:Qo,eight:Zo,nine:ei,zero:ti,comma:ni,decimalPoint:ri}=Lo,oi=[[Qo,Zo,ei,Co],[Xo,Jo,Go,ko],[Wo,Vo,Yo,Eo],[ti,ri,ni,wo],[Po,Fo,Io,xo]],ii=n,ai=t,si=e=>"string"==typeof e?e:"number"==typeof e?`${e}px`:"30px",li=({size:e,children:t})=>{const n={height:e=si(e),width:e,display:"inline-block",position:"relative"};return ii.createElement("div",{style:n},t)};li.propTypes={size:ai.number,children:ai.oneOfType([ai.arrayOf(ai.node),ai.node]).isRequired};const ci=n,di=t,ui=({size:e,children:t,sx:n})=>ci.createElement(li,{size:e},ci.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"0 0 44 40",style:{enableBackground:"new 0 0 44 40",...n}},t));ui.propTypes={size:di.oneOfType([di.string,di.number]),children:di.oneOfType([di.arrayOf(di.node),di.node]).isRequired,sx:di.object},di.string.isRequired;const pi=({fill:e})=>ci.createElement("polygon",{transform:"translate(2, 0)",points:"34.1,28.6 34.1,2.2 2,2.2 2,34.3 40.1,34.3",fill:e});pi.propTypes={fill:di.string.isRequired};const hi=({fill:e})=>ci.createElement("path",{transform:"translate(1, 0)",d:"M31.2,29.1v-0.3c2.2-2.8,3.6-6.3,3.6-10.1c0-8.9-7.2-16.1-16.1-16.1c-8.8,0.1-16,7.3-16,16.2 s7.2,16.1,16.1,16.1h18.5L31.2,29.1z",fill:e});hi.propTypes={fill:di.string.isRequired};const mi=({fill:e})=>ci.createElement("circle",{transform:"translate(-3,0)",cx:"23",cy:"20.4",r:"16",fill:e});mi.propTypes={fill:di.string.isRequired};const gi=({fill:e})=>ci.createElement("rect",{x:"3.6",y:"4.1",width:"32",height:"32",fill:e});gi.propTypes={fill:di.string.isRequired};const fi=t,vi=n;var bi=(e,t)=>{class n extends vi.Component{static __initStatic(){this.propTypes={iconSet:fi.oneOf(["emoji","check"]),shape:fi.oneOf(["round","square"]),category:fi.oneOf(["feedback",void 0]),open:fi.bool,size:fi.oneOfType([fi.number,fi.string]),fg:fi.string,bg:fi.string}}static __initStatic2(){this.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,size:30,fg:"#4aaf46",bg:"#f8ffe2"}}render(){const{iconSet:n,shape:r,category:o,open:i,size:a,fg:s,bg:l}=this.props,c="check"===n?vi.createElement(e,{fill:s}):vi.createElement(t,{fill:s}),d="check"===n?vi.createElement(e,{fill:l}):vi.createElement(t,{fill:l});return i?vi.createElement(ui,{size:a},d):vi.createElement(ui,{size:a},"feedback"===o?"round"===r?vi.createElement(hi,{fill:l}):vi.createElement(pi,{fill:l}):"round"===r?vi.createElement(mi,{fill:l}):vi.createElement(gi,{fill:l}),c)}}return n.__initStatic(),n.__initStatic2(),n};const yi=t,xi=n,wi=({fill:e})=>xi.createElement("g",{transform:"translate(1, 0)"},xi.createElement("path",{d:"M24.7,22.1c-1.5,1.7-3.6,2.7-5.8,2.7s-4.5-1.1-5.8-2.7l-2.8,1.6c2,2.7,5.2,4.2,8.7,4.2 c3.4,0,6.6-1.6,8.7-4.2L24.7,22.1z",fill:e}),xi.createElement("rect",{x:"21.1",y:"13.1",width:"3.7",height:"4.7",fill:e}),xi.createElement("rect",{x:"12.7",y:"13.1",width:"3.7",height:"4.7",fill:e}));wi.propTypes={fill:yi.string.isRequired};const Ei=({fill:e,x:t=0,y:n=0})=>xi.createElement("polygon",{transform:`translate(${t}, ${n})`,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",fill:e});Ei.propTypes={fill:yi.string.isRequired,x:yi.number,y:yi.number};const Ci=bi(Ei,wi);Ci.propTypes={iconSet:yi.oneOf(["emoji","check"]),shape:yi.oneOf(["round","square"]),category:yi.oneOf(["feedback",void 0]),open:yi.bool,fg:yi.string,bg:yi.string,size:yi.oneOfType([yi.string,yi.number])},Ci.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,fg:"#4aaf46",bg:"#f8ffe2",size:30};const ki=t,_i=n,{styled:Si}=r,Ri=({bgFill:e,fgFill:t})=>_i.createElement("svg",{preserveAspectRatio:"xMinYMin meet",version:"1.1",viewBox:"-283 359 34 35",style:{enableBackground:"new -283 359 34 35"}},_i.createElement("circle",{cx:"-266",cy:"375.9",r:"14",fill:e}),_i.createElement("path",{d:"M-280.5,375.9c0-8,6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5s-6.5,14.5-14.5,14.5S-280.5,383.9-280.5,375.9z M-279.5,375.9c0,7.4,6.1,13.5,13.5,13.5c7.4,0,13.5-6.1,13.5-13.5s-6.1-13.5-13.5-13.5C-273.4,362.4-279.5,368.5-279.5,375.9z",fill:e}),_i.createElement("polygon",{points:"-265.4,383.1 -258.6,377.2 -261.2,374.2 -264.3,376.9 -268.9,368.7 -272.4,370.6",fill:t}));Ri.propTypes={bgFill:ki.string.isRequired,fgFill:ki.string.isRequired};const Ai=({bgFill:e,fgFill:t,borderFill:n})=>_i.createElement("svg",{preserveAspectRatio:"xMinYMin meet",version:"1.1",viewBox:"-129.5 127 34 35",style:{enableBackground:"new -129.5 127 34 35"}},_i.createElement("path",{style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeMiterlimit:10},d:"M-112.9,160.4c-8.5,0-15.5-6.9-15.5-15.5c0-8.5,6.9-15.5,15.5-15.5s15.5,6.9,15.5,15.5 C-97.4,153.5-104.3,160.4-112.9,160.4z"}),_i.createElement("path",{style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeMiterlimit:10},d:"M-113.2,159c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-105.2,159-113.2,159z"}),_i.createElement("circle",{cx:"-114.2",cy:"143.5",r:"14",fill:e}),_i.createElement("path",{d:"M-114.2,158c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-106.2,158-114.2,158z M-114.2,130c-7.4,0-13.5,6.1-13.5,13.5s6.1,13.5,13.5,13.5s13.5-6.1,13.5-13.5S-106.8,130-114.2,130z",fill:n}),_i.createElement("polygon",{points:"-114.8,150.7 -121.6,144.8 -119,141.8 -115.9,144.5 -111.3,136.3 -107.8,138.2",fill:t}));Ai.propTypes={bgFill:ki.string.isRequired,fgFill:ki.string.isRequired,borderFill:ki.string.isRequired};const Oi=Si("div")(({size:e})=>({width:e||"25px",height:e||"25px"})),Ti=({open:e,size:t})=>_i.createElement(Oi,{size:t},e?_i.createElement(Ri,{bgFill:"#bce2ff",fgFill:"#1a9cff"}):_i.createElement(Ai,{bgFill:"white",fgFill:"#1a9cff",borderFill:"#bce2ff"}));Ti.propTypes={open:ki.bool,size:ki.string},Ti.defaultProps={open:!1};const Li=t,Ni=n,Di=({fill:e})=>Ni.createElement("g",{transform:"translate(0.5, 0.5)"},Ni.createElement("rect",{x:"11",y:"17.3",transform:"matrix(0.7071 -0.7071 0.7071 0.7071 -7.852 19.2507)",width:"16.6",height:"3.7",fill:e}),Ni.createElement("rect",{x:"17.4",y:"10.7",transform:"matrix(0.7071 -0.7071 0.7071 0.7071 -7.8175 19.209)",width:"3.7",height:"16.6",fill:e}));Di.propTypes={fill:Li.string.isRequired};const ji=({fill:e})=>Ni.createElement("g",{transform:"translate(1,0)"},Ni.createElement("rect",{x:"21",y:"12.9",width:"3.7",height:"4.7",fill:e}),Ni.createElement("rect",{x:"12.7",y:"12.9",width:"3.7",height:"4.7",fill:e}),Ni.createElement("rect",{x:"12.2",y:"22.5",width:"13",height:"3.3",fill:e}));ji.propTypes={fill:Li.string.isRequired};const Mi=bi(Di,ji);Mi.propTypes={iconSet:Li.oneOf(["emoji","check"]),shape:Li.oneOf(["round","square"]),category:Li.oneOf(["feedback",void 0]),open:Li.bool,fg:Li.string,bg:Li.string,size:Li.oneOfType([Li.string,Li.number])},Mi.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,fg:"#fcb733",bg:"#fbf2e3",size:30};const Pi=t,Fi=n,Ii=()=>{const e={fill:"none",stroke:"#BCE2FF",strokeWidth:2,strokeMiterlimit:10};return Fi.createElement("g",null,Fi.createElement("line",{style:e,x1:"-98",y1:"142",x2:"-114.6",y2:"142"}),Fi.createElement("line",{style:e,x1:"-98",y1:"146.3",x2:"-114.6",y2:"146.3"}),Fi.createElement("line",{style:e,x1:"-104",y1:"150.7",x2:"-114.6",y2:"150.7"}))},$i=({children:e,size:t})=>Fi.createElement(li,{size:t},Fi.createElement("svg",{version:"1.1",viewBox:"-128 129 31 31",style:{enableBackground:"new -128 129 31 31"}},e));$i.propTypes={children:Pi.oneOfType([Pi.arrayOf(Pi.node),Pi.node]).isRequired,size:Pi.number};const zi=()=>Fi.createElement("g",null,Fi.createElement("rect",{x:"-123.9",y:"135.3",style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeLinejoin:"round",strokeMiterlimit:10},width:"4.1",height:"4.1"}),Fi.createElement("polygon",{style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeLinejoin:"round",strokeMiterlimit:10},points:"-119.8,150.4 -119.8,142.2 -125,142.2 -125,144.9 -122.6,144.9 -122.6,150.4 -125.6,150.4 -125.6,153.2 -116.8,153.2 -116.8,150.4 "}),Fi.createElement("rect",{x:"-124.7",y:"134.7",style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},width:"4.1",height:"4.1"}),Fi.createElement("polygon",{style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},points:"-120.6,149.8 -120.6,141.5 -125.8,141.5 -125.8,144.3 -123.3,144.3 -123.3,149.8 -126.4,149.8 -126.4,152.5 -117.6,152.5 -117.6,149.8 "}),Fi.createElement("rect",{x:"-125.5",y:"134",style:{fill:"#7FABC6"},width:"4.1",height:"4.1"}),Fi.createElement("polygon",{style:{fill:"#7FABC6"},points:"-121.4,149.1 -121.4,140.9 -126.5,140.9 -126.5,143.6 -124.1,143.6 -124.1,149.1 -127.1,149.1 -127.1,151.9 -118.4,151.9 -118.4,149.1 "})),Bi=()=>Fi.createElement("g",null,Fi.createElement("rect",{x:"-123.9",y:"135.3",style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeLinejoin:"round",strokeMiterlimit:10},width:"4.1",height:"4.1"}),Fi.createElement("polygon",{style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeLinejoin:"round",strokeMiterlimit:10},points:"-119.8,150.4 -119.8,142.2 -125,142.2 -125,144.9 -122.6,144.9 -122.6,150.4 -125.6,150.4 -125.6,153.2 -116.8,153.2 -116.8,150.4 "}),Fi.createElement("rect",{x:"-124.7",y:"134.7",style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},width:"4.1",height:"4.1"}),Fi.createElement("polygon",{style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},points:"-120.6,149.8 -120.6,141.5 -125.8,141.5 -125.8,144.3 -123.3,144.3 -123.3,149.8 -126.4,149.8 -126.4,152.5 -117.6,152.5 -117.6,149.8 "}),Fi.createElement("rect",{x:"-125.5",y:"134",style:{fill:"#1A9CFF"},width:"4.1",height:"4.1"}),Fi.createElement("polygon",{style:{fill:"#1A9CFF"},points:"-121.4,149.1 -121.4,140.9 -126.5,140.9 -126.5,143.6 -124.1,143.6 -124.1,149.1 -127.1,149.1 -127.1,151.9 -118.4,151.9 -118.4,149.1 "}));class qi extends Fi.Component{constructor(e){super(e)}render(){return!0===this.props.open?Fi.createElement($i,null,Fi.createElement(zi,null),Fi.createElement(Ii,null)):Fi.createElement($i,null,Fi.createElement(Bi,null),Fi.createElement(Ii,null))}}qi.propTypes={open:Pi.bool},qi.defaultProps={open:!1};const Ki=t,Ui=n,Hi=({fill:e})=>Ui.createElement("path",{fill:e,d:"M-130.4,142.1c0-2.1,1.7-3.9,3.9-3.9c0.3,0,0.5,0,0.8,0.1c-0.6-0.8-1.5-1.3-2.6-1.3c-1.8,0-3.3,1.5-3.3,3.3c0,1.1,0.5,2,1.3,2.6C-130.4,142.6-130.4,142.4-130.4,142.1z"});Hi.propTypes={fill:Ki.string};class Wi extends Ui.Component{static __initStatic(){this.propTypes={classes:Ki.object.isRequired,size:Ki.number}}render(){const{size:e}=this.props;return!0===this.props.open?Ui.createElement(li,{size:e},Ui.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"-135 129 16 32"},Ui.createElement("path",{fill:"#BCE2FF",d:"M-122,141.1c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-122.8,144.7-122,143-122,141.1z"}),Ui.createElement("path",{fill:"#BCE2FF",d:"M-125.7,153h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-124.9,152.7-125.2,153-125.7,153z"}),Ui.createElement(Hi,{fill:"#1A9CFF"}))):Ui.createElement(li,{size:e},Ui.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"-135 129 16 31"},Ui.createElement("path",{fill:"#D0CAC5",stroke:"#E6E3E0",className:"st0",d:"M-120.7,142.4c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-121.6,146-120.7,144.3-120.7,142.4z"}),Ui.createElement("path",{fill:"#D0CAC5",stroke:"#E6E3E0",className:"st0",d:"M-124.4,154.3h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-123.6,153.9-123.9,154.3-124.4,154.3z"}),Ui.createElement("path",{fill:"#B3ABA4",stroke:"#CDC7C2",className:"st1",d:"M-121.3,141.8c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-122.2,145.3-121.3,143.7-121.3,141.8z"}),",",Ui.createElement("path",{fill:"#B3ABA4",stroke:"#CDC7C2",className:"st1",d:"M-125,153.7h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-124.2,153.3-124.6,153.7-125,153.7z"}),Ui.createElement("path",{fill:"#1A9CFF",d:"M-122,141.1c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-122.8,144.7-122,143-122,141.1z"}),Ui.createElement("path",{fill:"#1A9CFF",d:"M-125.7,153h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-124.9,152.7-125.2,153-125.7,153z"}),Ui.createElement(Hi,{fill:"1A9CFF"})))}}Wi.__initStatic(),Wi.propTypes={open:Ki.bool},Wi.defaultProps={open:!1};const Vi=t,Yi=n,Xi=({fill:e})=>Yi.createElement("g",null,Yi.createElement("rect",{x:"19.3",y:"10.3",width:"4.5",height:"12.7",fill:e}),Yi.createElement("rect",{x:"19.3",y:"26.2",width:"4.5",height:"4.5",fill:e}));Xi.propTypes={fill:Vi.string.isRequired};const Ji=({fill:e})=>Yi.createElement("polygon",{points:"14.8,4.5 5.6,13.8 5.6,27 14.8,36.5 28.1,36.5 37.6,27 37.6,13.8 28.1,4.5",fill:e});Ji.propTypes={fill:Vi.string.isRequired};const Gi=({fill:e})=>Yi.createElement("g",null,Yi.createElement("rect",{x:"23.8",y:"15",width:"3.5",height:"4.4",fill:e}),Yi.createElement("rect",{x:"16",y:"15",width:"3.5",height:"4.4",fill:e}),Yi.createElement("path",{d:"M24.2,27.1h-5.1c-0.8,0-1.5-0.7-1.5-1.5v0c0-0.8,0.7-1.5,1.5-1.5h5.1c0.8,0,1.5,0.7,1.5,1.5v0 C25.7,26.4,25,27.1,24.2,27.1z",fill:e}));Gi.propTypes={fill:Vi.string.isRequired};class Qi extends Yi.Component{constructor(e){super(e);const{fg:t="#464146",bg:n="white"}=this.props;this.icons={check:Yi.createElement(ui,null,Yi.createElement(Ji,{fill:n}),Yi.createElement(Xi,{fill:t})),emoji:Yi.createElement(ui,null,Yi.createElement(Ji,{fill:n}),Yi.createElement(Gi,{fill:t})),feedback:{check:Yi.createElement(ui,null,Yi.createElement(Ji,{fill:n}),Yi.createElement(Gi,{fill:t})),emoji:Yi.createElement(ui,null,Yi.createElement(Ji,{fill:n}),Yi.createElement(Gi,{fill:t})),square:{check:Yi.createElement(ui,null,Yi.createElement(Ji,{fill:n}),Yi.createElement(Xi,{fill:t})),emoji:Yi.createElement(ui,null,Yi.createElement(Ji,{fill:n}),Yi.createElement(Gi,{fill:t})),open:{check:Yi.createElement(ui,null,Yi.createElement(Xi,{fill:n})),emoji:Yi.createElement(ui,null,Yi.createElement(Gi,{fill:n}))}}}}}render(){const{iconSet:e,category:t,shape:n,open:r}=this.props;return void 0===t?this.icons[e]:void 0===n?this.icons.feedback[e]:!0===r?this.icons.feedback.square.open[e]:this.icons.feedback.square[e]}}Qi.propTypes={iconSet:Vi.oneOf(["emoji","check",void 0]),shape:Vi.oneOf(["square",void 0]),category:Vi.oneOf(["feedback",void 0]),open:Vi.bool,fg:Vi.string,bg:Vi.string},Qi.defaultProps={iconSet:"check",shape:void 0,category:void 0,open:!1,fg:"#464146",bg:"white"};const Zi=t,ea=n,ta=({fill:e})=>ea.createElement("g",{transform:"translate(0, 0)"},ea.createElement("polygon",{points:"27.5,13.4 23.9,11.4 15.9,25.8 19.1,28.6",fill:e}),ea.createElement("polygon",{points:"16.2,20.6 14.4,19.2 11.8,22.3 14.1,24.3",fill:e}));ta.propTypes={fill:Zi.string.isRequired};const na=({fill:e})=>ea.createElement("g",{transform:"translate(2, 0)"},ea.createElement("rect",{x:"20.6",y:"11.8",width:"4",height:"5",fill:e}),ea.createElement("rect",{x:"11.5",y:"11.8",width:"4",height:"5",fill:e}),ea.createElement("rect",{x:"10.9",y:"22.9",transform:"matrix(0.9794 -0.2019 0.2019 0.9794 -4.6237 4.1559)",width:"14.3",height:"3.7",fill:e}));na.propTypes={fill:Zi.string.isRequired};const ra=bi(ta,na);ra.propTypes={iconSet:Zi.oneOf(["emoji","check"]),shape:Zi.oneOf(["round","square"]),category:Zi.oneOf(["feedback",void 0]),open:Zi.bool,fg:Zi.string,bg:Zi.string,size:Zi.oneOfType([Zi.string,Zi.number])},ra.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,fg:"#4aaf46",bg:"#c1e1ac",size:30};const oa=t,ia=n,aa=({fill:e})=>ia.createElement("g",null,ia.createElement("rect",{x:"-115",y:"136.7",width:"3",height:"3",fill:e}),ia.createElement("polygon",{points:"-112,147.7 -112,141.7 -115.8,141.7 -115.8,143.7 -114,143.7 -114,147.7 -116.2,147.7 -116.2,149.7 -109.8,149.7 -109.8,147.7",fill:e}));aa.propTypes={fill:oa.string.isRequired};const sa=({fill:e})=>ia.createElement("path",{d:"M-113,158.5c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-105,158.5-113,158.5z M-113,130.5c-7.4,0-13.5,6.1-13.5,13.5s6.1,13.5,13.5,13.5s13.5-6.1,13.5-13.5S-105.6,130.5-113,130.5z",fill:e});sa.propTypes={fill:oa.string.isRequired};const la=({fill:e="#FFFFFF"})=>ia.createElement("g",null,ia.createElement("path",{style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeMiterlimit:10},d:"M-111.7,160.9c-8.5,0-15.5-6.9-15.5-15.5c0-8.5,6.9-15.5,15.5-15.5s15.5,6.9,15.5,15.5C-96.2,154-103.1,160.9-111.7,160.9z"}),ia.createElement("path",{style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeMiterlimit:10},d:"M-112,159.5c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-104,159.5-112,159.5z"}),ia.createElement("circle",{cx:"-113",cy:"144",r:"14",fill:e}));la.propTypes={fill:oa.string};const ca=({children:e,size:t})=>{const n=si(t),r={height:n,width:n,display:"inline-block",position:"relative"};return ia.createElement("div",{style:r},ia.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"-129 128 34 34"},e))};ca.propTypes={children:oa.oneOfType([oa.arrayOf(oa.node),oa.node]).isRequired,size:oa.oneOfType([oa.string,oa.number])};class da extends ia.Component{render(){const{iconSet:e,open:t,fg:n="#1a9cff",bg:r="#bce2ff",border:o="#bbe3fd"}=this.props,i=ia.createElement(aa,{fill:n}),a={check:ia.createElement(ca,{size:this.props.size},ia.createElement(la,null),i,ia.createElement(sa,{fill:o})),emoji:ia.createElement(ca,{size:this.props.size},ia.createElement(la,null),i,ia.createElement(sa,{fill:o})),open:{check:ia.createElement(ca,{size:this.props.size},ia.createElement("circle",{cx:"-113",cy:"144",r:"14",fill:"#FFFFFF"}),ia.createElement(aa,{fill:r}),ia.createElement(sa,{fill:"#FFFFFF"})),emoji:ia.createElement(ca,{size:this.props.size},ia.createElement("circle",{cx:"-113",cy:"144",r:"14",fill:"#FFFFFF"}),ia.createElement(aa,{fill:r}),ia.createElement(sa,{fill:o}))}};return!0===t?a.open[e]:a[e]}}function ua(){return ua=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ua.apply(null,arguments)}function pa(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}function ha(e,t){return ha=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ha(e,t)}function ma(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,ha(e,t)}function ga(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}da.propTypes={iconSet:oa.oneOf(["emoji","check"]),open:oa.bool,fg:oa.string,bg:oa.string,border:oa.string,size:oa.oneOfType([oa.string,oa.number])},da.defaultProps={iconSet:"check",open:!1,fg:"#1a9cff",bg:"#bce2ff",border:"#bbe3fd",size:30};var fa=!1;var va=n.createContext(null),ba=function(e){return e.scrollTop};const ya=n,xa=e;var wa="unmounted",Ea="exited",Ca="entering",ka="entered",_a="exiting",Sa=function(e){function t(t,n){var r;r=e.call(this,t,n)||this;var o,i=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?i?(o=Ea,r.appearStatus=Ca):o=ka:o=t.unmountOnExit||t.mountOnEnter?wa:Ea,r.state={status:o},r.nextCallback=null,r}ma(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===wa?{status:Ea}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==Ca&&n!==ka&&(t=Ca):n!==Ca&&n!==ka||(t=_a)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===Ca){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:xa.findDOMNode(this);n&&ba(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Ea&&this.setState({status:wa})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,o=this.props.nodeRef?[r]:[xa.findDOMNode(this),r],i=o[0],a=o[1],s=this.getTimeouts(),l=r?s.appear:s.enter;!e&&!n||fa?this.safeSetState({status:ka},function(){t.props.onEntered(i)}):(this.props.onEnter(i,a),this.safeSetState({status:Ca},function(){t.props.onEntering(i,a),t.onTransitionEnd(l,function(){t.safeSetState({status:ka},function(){t.props.onEntered(i,a)})})}))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:xa.findDOMNode(this);t&&!fa?(this.props.onExit(r),this.safeSetState({status:_a},function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:Ea},function(){e.props.onExited(r)})})})):this.safeSetState({status:Ea},function(){e.props.onExited(r)})},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:xa.findDOMNode(this),r=null==e&&!this.props.addEndListener;if(n&&!r){if(this.props.addEndListener){var o=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],i=o[0],a=o[1];this.props.addEndListener(i,a)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if(e===wa)return null;var t=this.props,n=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 r=pa(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return ya.createElement(va.Provider,{value:null},"function"==typeof n?n(e,r):ya.cloneElement(ya.Children.only(n),r))},t}(ya.Component);function Ra(){}Sa.contextType=va,Sa.propTypes={},Sa.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Ra,onEntering:Ra,onEntered:Ra,onExit:Ra,onExiting:Ra,onExited:Ra},Sa.UNMOUNTED=wa,Sa.EXITED=Ea,Sa.ENTERING=Ca,Sa.ENTERED=ka,Sa.EXITING=_a;var Aa=Sa;const Oa=n;var Ta=function(e,t){return e&&t&&t.split(" ").forEach(function(t){return r=t,void((n=e).classList?n.classList.add(r):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(n,r)||("string"==typeof n.className?n.className=n.className+" "+r:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+r)));var n,r})},La=function(e,t){return e&&t&&t.split(" ").forEach(function(t){return r=t,void((n=e).classList?n.classList.remove(r):"string"==typeof n.className?n.className=ga(n.className,r):n.setAttribute("class",ga(n.className&&n.className.baseVal||"",r)));var n,r})},Na=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,n){var r=t.resolveArguments(e,n),o=r[0],i=r[1];t.removeClasses(o,"exit"),t.addClass(o,i?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,n)},t.onEntering=function(e,n){var r=t.resolveArguments(e,n),o=r[0],i=r[1]?"appear":"enter";t.addClass(o,i,"active"),t.props.onEntering&&t.props.onEntering(e,n)},t.onEntered=function(e,n){var r=t.resolveArguments(e,n),o=r[0],i=r[1]?"appear":"enter";t.removeClasses(o,i),t.addClass(o,i,"done"),t.props.onEntered&&t.props.onEntered(e,n)},t.onExit=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"appear"),t.removeClasses(n,"enter"),t.addClass(n,"exit","base"),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var n=t.resolveArguments(e)[0];t.addClass(n,"exit","active"),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"exit"),t.addClass(n,"exit","done"),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,n){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,n]},t.getClassNames=function(e){var n=t.props.classNames,r="string"==typeof n,o=r?""+(r&&n?n+"-":"")+e:n[e];return{baseClassName:o,activeClassName:r?o+"-active":n[e+"Active"],doneClassName:r?o+"-done":n[e+"Done"]}},t}ma(t,e);var n=t.prototype;return n.addClass=function(e,t,n){var r=this.getClassNames(t)[n+"ClassName"],o=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===n&&o&&(r+=" "+o),"active"===n&&e&&ba(e),r&&(this.appliedClasses[t][n]=r,Ta(e,r))},n.removeClasses=function(e,t){var n=this.appliedClasses[t],r=n.base,o=n.active,i=n.done;this.appliedClasses[t]={},r&&La(e,r),o&&La(e,o),i&&La(e,i)},n.render=function(){var e=this.props;e.classNames;var t=pa(e,["classNames"]);return Oa.createElement(Aa,ua({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(Oa.Component);Na.defaultProps={classNames:""},Na.propTypes={};var Da=Na;const{Children:ja}=n,{cloneElement:Ma}=n,{isValidElement:Pa}=n;function Fa(e,t){var n=Object.create(null);return e&&ja.map(e,function(e){return e}).forEach(function(e){n[e.key]=function(e){return t&&Pa(e)?t(e):e}(e)}),n}function Ia(e,t,n){return null!=n[t]?n[t]:e.props[t]}function $a(e,t,n){var r=Fa(e.children),o=function(e,t){function n(n){return n in t?t[n]:e[n]}e=e||{},t=t||{};var r,o=Object.create(null),i=[];for(var a in e)a in t?i.length&&(o[a]=i,i=[]):i.push(a);var s={};for(var l in t){if(o[l])for(r=0;r<o[l].length;r++){var c=o[l][r];s[o[l][r]]=n(c)}s[l]=n(l)}for(r=0;r<i.length;r++)s[i[r]]=n(i[r]);return s}(t,r);return Object.keys(o).forEach(function(i){var a=o[i];if(Pa(a)){var s=i in t,l=i in r,c=t[i],d=Pa(c)&&!c.props.in;!l||s&&!d?l||!s||d?l&&s&&Pa(c)&&(o[i]=Ma(a,{onExited:n.bind(null,a),in:c.props.in,exit:Ia(a,"exit",e),enter:Ia(a,"enter",e)})):o[i]=Ma(a,{in:!1}):o[i]=Ma(a,{onExited:n.bind(null,a),in:!0,exit:Ia(a,"exit",e),enter:Ia(a,"enter",e)})}}),o}const za=n;var Ba=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},qa=function(e){function t(t,n){var r,o=(r=e.call(this,t,n)||this).handleExited.bind(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(r));return r.state={contextValue:{isMounting:!0},handleExited:o,firstRender:!0},r}ma(t,e);var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(e,t){var n,r,o=t.children,i=t.handleExited;return{children:t.firstRender?(n=e,r=i,Fa(n.children,function(e){return Ma(e,{onExited:r.bind(null,e),in:!0,appear:Ia(e,"appear",n),enter:Ia(e,"enter",n),exit:Ia(e,"exit",n)})})):$a(e,o,i),firstRender:!1}},n.handleExited=function(e,t){var n=Fa(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState(function(t){var n=ua({},t.children);return delete n[e.key],{children:n}}))},n.render=function(){var e=this.props,t=e.component,n=e.childFactory,r=pa(e,["component","childFactory"]),o=this.state.contextValue,i=Ba(this.state.children).map(n);return delete r.appear,delete r.enter,delete r.exit,null===t?za.createElement(va.Provider,{value:o},i):za.createElement(va.Provider,{value:o},za.createElement(t,r,i))},t}(za.Component);qa.propTypes={},qa.defaultProps={component:"div",childFactory:function(e){return e}};var Ka=qa;const Ua={TEXT:"black",DISABLED:"grey",DISABLED_SECONDARY:"#ABABAB",CORRECT:u[500],CORRECT_SECONDARY:u[50],CORRECT_TERTIARY:"#0EA449",CORRECT_WITH_ICON:"#087D38",INCORRECT:p[500],INCORRECT_SECONDARY:h[50],INCORRECT_WITH_ICON:"#BF0D00",MISSING:h[700],MISSING_WITH_ICON:"#6A78A1",PRIMARY:m[500],PRIMARY_LIGHT:m[200],PRIMARY_DARK:m[800],SECONDARY:g.A400,SECONDARY_LIGHT:g[200],SECONDARY_DARK:g[900],TERTIARY:"#146EB3",TERTIARY_LIGHT:"#D0E2F0",BACKGROUND:"rgba(255,255,255,0)",BACKGROUND_DARK:"#ECEDF1",DROPDOWN_BACKGROUND:"#E0E1E6",SECONDARY_BACKGROUND:"rgba(241,241,241,1)",BORDER:"#9A9A9A",BORDER_LIGHT:"#D1D1D1",BORDER_DARK:"#646464",BORDER_GRAY:"#7E8494",BLACK:"#000000",WHITE:"#ffffff",TRANSPARENT:"transparent",FOCUS_CHECKED:"#BBDEFB",FOCUS_CHECKED_BORDER:"#1565C0",FOCUS_UNCHECKED:"#E0E0E0",FOCUS_UNCHECKED_BORDER:"#757575",BLUE_GREY100:"#F3F5F7",BLUE_GREY300:"#C0C3CF",BLUE_GREY600:"#7E8494",BLUE_GREY900:"#152452",FADED_PRIMARY:"#DCDAFB",KEYPAD_BUTTON:"rgb(188, 194, 229)",KEYPAD_BUTTON_OPERATOR:"rgb(255, 159, 192)",KEYPAD_EMPTY_PLACEHOLDER:"rgba(245, 0, 87, 0.4)",KEYPAD_BUTTON_HOVER:"rgb(214, 218, 239)",KEYPAD_BUTTON_OPERATOR_HOVER:"rgb(255, 197, 217)",BUTTON_BORDER:"rgba(0, 0, 0, 0.23)",BUTTON_HOVER_BG:"rgba(0, 0, 0, 0.08)"};Object.freeze(Ua);const Ha=(Wa="pie",(...e)=>{const t=e.pop();return e.reduceRight((e,t)=>`var(--${Wa}-${t}, ${e})`,t)});var Wa;const Va=()=>Ha("text",Ua.TEXT),Ya=()=>Ha("correct",Ua.CORRECT),Xa=()=>Ha("incorrect",Ua.INCORRECT),Ja=()=>Ha("incorrect-icon",Ua.INCORRECT_WITH_ICON),Ga=()=>Ha("background",Ua.BACKGROUND),Qa=()=>Ha("dropdown-background",Ua.DROPDOWN_BACKGROUND),Za=()=>Ha("tertiary",Ua.TERTIARY),es=()=>Ha("white",Ua.WHITE),ts=()=>Ha("keypad-button",Ua.KEYPAD_BUTTON),ns=()=>Ha("keypad-button-operator",Ua.KEYPAD_BUTTON_OPERATOR),rs=()=>Ha("keypad-button-hover",Ua.KEYPAD_BUTTON_HOVER),os=()=>Ha("keypad-button-operator-hover",Ua.KEYPAD_BUTTON_OPERATOR_HOVER),is=n,as=t,{styled:ss}=r,ls=ss("div")({transformOrigin:"0% 0px 0px",width:"100%",display:"block",overflow:"hidden","&.incorrect":{color:"#946202"}}),cs=ss("div")({WebkitFontSmoothing:"antialiased",backgroundColor:`var(--feedback-bg-color, ${Ha("disabled",Ua.DISABLED)})`,borderRadius:"4px",lineHeight:"25px",margin:"0px",padding:"10px",verticalAlign:"middle",color:"var(--feedback-color, white)","&.correct":{backgroundColor:`var(--feedback-correct-bg-color, ${Ya()})`},"&.incorrect":{backgroundColor:`var(--feedback-incorrect-bg-color, ${Xa()})`}}),ds=ss("div")({"&.feedback-enter":{height:"1px"},"&.feedback-enter-active":{height:"45px",transition:"height 500ms"},"&.feedback-exit":{height:"45px"},"&.feedback-exit-active":{height:"1px",transition:"height 200ms"}});class us extends is.Component{constructor(...e){super(...e),us.prototype.__init.call(this)}static __initStatic(){this.propTypes={correctness:as.string,feedback:as.string}}__init(){this.nodeRef=is.createRef()}renderFeedback(){const{correctness:e,feedback:t}=this.props;return e&&t?is.createElement(Da,{key:"hasFeedback",nodeRef:this.nodeRef,timeout:{enter:500,exit:200},classNames:"feedback"},is.createElement(ds,{ref:this.nodeRef},is.createElement(ls,null,is.createElement(cs,{className:e,dangerouslySetInnerHTML:{__html:t}})))):null}render(){return is.createElement("div",null,is.createElement(Ka,null,this.renderFeedback()))}}us.__initStatic();const ps=n,hs=t,{Popover:ms}=o,{styled:gs}=r,fs=i("pie-libs:render-ui:response-indicators"),vs=gs("div")(({hasFeedback:e})=>({cursor:e?"pointer":"default"})),bs=gs(ms)({cursor:"pointer"}),ys=gs("div")({padding:"0",borderRadius:"4px"}),xs=(e,t)=>{class n extends ps.Component{constructor(e){super(e),n.prototype.__init.call(this),n.prototype.__init2.call(this),this.state={}}__init(){this.handlePopoverOpen=e=>{fs("[handlePopoverOpen]",e.target),this.setState({anchorEl:e.target})}}__init2(){this.handlePopoverClose=()=>{this.setState({anchorEl:null})}}render(){const{feedback:n}=this.props,{anchorEl:r}=this.state;return ps.createElement(vs,{hasFeedback:!!n},ps.createElement("span",{ref:e=>this.icon=e,onClick:this.handlePopoverOpen},ps.createElement(e,null)),n&&ps.createElement(bs,{PaperComponent:ys,open:!!r,anchorEl:r,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:this.handlePopoverClose},ps.createElement(us,{feedback:n,correctness:t})))}}return n.propTypes={feedback:hs.string},n};xs(Ci,"correct"),xs(Mi,"incorrect"),xs(ra,"partially-correct"),xs(Qi,"nothing-submitted");const ws=n,{styled:Es}=r,Cs=a,ks=t,{renderMath:_s}=c,Ss=Es("span")(({theme:e})=>({color:e.palette.primary.light,borderBottom:`1px dotted ${e.palette.primary.light}`,cursor:"pointer"})),Rs=Es(Cs)(({theme:e})=>({paddingTop:e.spacing(2)}));class As extends ws.Component{constructor(...e){super(...e),As.prototype.__init.call(this),As.prototype.__init2.call(this)}static __initStatic(){this.propTypes={className:ks.string,children:ks.object,labels:ks.shape({visible:ks.string,hidden:ks.string})}}static __initStatic2(){this.defaultProps={labels:{}}}__init(){this.state={expanded:!1}}__init2(){this.toggleExpanded=()=>{this.setState(e=>({expanded:!e.expanded}))}}componentDidMount(){_s(this.root)}componentDidUpdate(){_s(this.root)}render(){const{labels:e,children:t,className:n}=this.props,r=this.state.expanded?e.visible||"Hide":e.hidden||"Show";return ws.createElement("div",{className:n,ref:e=>this.root=e},ws.createElement("div",{onClick:this.toggleExpanded},ws.createElement(Ss,null,r)),ws.createElement(Rs,{in:this.state.expanded,timeout:{enter:225,exit:195},unmountOnExit:!0},t))}}As.__initStatic(),As.__initStatic2();const{Button:Os}=o,{styled:Ts}=r;Ts("div")({display:"flex",flexDirection:"column"}),Ts("div")({display:"flex",alignItems:"center",justifyContent:"center"}),Ts("div")(({theme:e})=>({width:"24px",height:"24px",color:"gray",marginRight:e.spacing(1),display:"flex",alignItems:"center"})),Ts(Os)(({theme:e})=>({display:"flex",alignItems:"center",marginLeft:e.spacing(3),marginRight:e.spacing(3)}));const Ls=n,{createTheme:Ns}=r,{styled:Ds}=r,{StyledEngineProvider:js}=r,{ThemeProvider:Ms}=r,Ps=t;const Fs=Ns({typography:{fontFamily:"inherit"},palette:{action:{disabled:"rgba(0, 0, 0, 0.54);"}},components:{MuiTypography:{styleOverrides:{root:{fontFamily:"inherit"}}},MuiButton:{styleOverrides:{contained:{backgroundColor:"#e0e0e0",color:"#000000","&:hover":{backgroundColor:"#bdbdbd"}}}}}}),Is=Ds("div")({"& table, th, td":{fontSize:"inherit"}});class $s extends Ls.Component{static __initStatic(){this.propTypes={className:Ps.string,children:Ps.array,extraCSSRules:Ps.shape({names:Ps.arrayOf(Ps.string),rules:Ps.string}),fontSizeFactor:Ps.number}}static __initStatic2(){this.defaultProps={extraCSSRules:{},fontSizeFactor:1}}constructor(e){super(e),this.classesSheet=document.createElement("style")}computeStyle(e){const t=e=>parseFloat(getComputedStyle(e).fontSize),n=t(document.documentElement),r=t(document.body),o=Math.max(n,r),i=null!=e&&"number"==typeof e?e:1;return 1!==i?{fontSize:o*i+"px"}:null}render(){const{children:e,className:t,fontSizeFactor:n,...r}=this.props,{extraCSSRules:o,...i}=r,a=this.computeStyle(n);return Ls.createElement(js,{injectFirst:!0},Ls.createElement(Ms,{theme:Fs},function(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],i=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=i(n)):"call"!==o&&"optionalCall"!==o||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}([o,"optionalAccess",e=>e.rules])?Ls.createElement("style",{dangerouslySetInnerHTML:{__html:`.extraCSSRules { ${o.rules} }`}}):null,Ls.createElement(Is,{className:`${t} extraCSSRules`,...i,...a&&{style:a}},e)))}}$s.__initStatic(),$s.__initStatic2();const zs=n,{styled:Bs}=r,qs=t,Ks=Bs($s)({display:"flex",flexDirection:"column",position:"relative"});class Us extends zs.Component{static __initStatic(){this.propTypes={ariaLabel:qs.string,children:qs.oneOfType([qs.arrayOf(qs.node),qs.node]).isRequired,role:qs.string,extraCSSRules:qs.shape({names:qs.arrayOf(qs.string),rules:qs.string}),fontSizeFactor:qs.number}}render(){const{children:e,ariaLabel:t,role:n,extraCSSRules:r,fontSizeFactor:o,classes:i}=this.props,a=t?{"aria-label":t,role:n}:{};return zs.createElement(Ks,{...a,extraCSSRules:r,fontSizeFactor:o,classes:i},e)}}Us.__initStatic();const Hs=n,Ws=t;class Vs extends Hs.Component{static __initStatic(){this.propTypes={tag:Ws.string,className:Ws.string,html:Ws.string}}static __initStatic2(){this.defaultProps={tag:"div",html:""}}render(){const{tag:e,className:t,html:n}=this.props,r=e||"div";return Hs.createElement(r,{ref:e=>this.node=e,className:t,dangerouslySetInnerHTML:{__html:n}})}}Vs.__initStatic(),Vs.__initStatic2();const{InputLabel:Ys}=o,{FormControl:Xs}=o,Js=t,{styled:Gs}=r;Gs(Xs)(({theme:e})=>({margin:0,padding:0,flex:"1 0 auto",minWidth:e.spacing(4)})),Gs(Ys)(()=>({fontSize:"inherit",whiteSpace:"nowrap",margin:0,padding:0,alignSelf:"flex-start",position:"absolute",top:0,left:0,transformOrigin:"top left",pointerEvents:"none","&.MuiInputLabel-shrink":{transform:"scale(0.75) translate(0, -0.75em)"},"&:not(.MuiInputLabel-shrink)":{transform:"translate(0, 0)"}})),Js.oneOfType([Js.string,Js.object]).isRequired,Js.string,Js.oneOfType([Js.arrayOf(Js.node),Js.node]).isRequired;const Qs=n,{Component:Zs}=n,{styled:el}=r,tl=t,{renderMath:nl}=c,rl=el("div")(({theme:e,tagName:t})=>({"&:not(.MathJax) > table":{borderCollapse:"collapse"},"&:not(.MathJax) > table:has(tbody tr > th:first-child):not(:has(tbody tr > td:first-child)) tbody td:nth-child(even)":{backgroundColor:"#f6f8fa",color:e.palette.common.black},"&:not(.MathJax) > table:has(tbody tr > td:first-child) tbody tr:nth-child(even) td":{backgroundColor:"#f6f8fa",color:e.palette.common.black},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:".6em 1em",textAlign:"left"},"&:not(.MathJax) > table td > p.kds-indent":{textAlign:"initial"},"&.prompt":{verticalAlign:"middle",color:Va()},"&.legend":{width:"100%",fontSize:"inherit !important"},"&.rationale":{paddingLeft:e.spacing(4),paddingBottom:e.spacing(1)},"&.prompt-label":{color:`${Va()} !important`,display:"flex",flexDirection:"column",verticalAlign:"middle",cursor:"pointer","& > p":{margin:"0 0 0 0 !important"}}})),ol=/\\embed\{newLine\}\[\]/g;class il extends Zs{constructor(...e){super(...e),il.prototype.__init.call(this)}static __initStatic(){this.propTypes={prompt:tl.string,tagName:tl.string,className:tl.string,onClick:tl.func,defaultClassName:tl.string,autoplayAudioEnabled:tl.bool,customAudioButton:{playImage:tl.string,pauseImage:tl.string}}}static __initStatic2(){this.defaultProps={onClick:()=>{}}}__init(){this.parsedText=e=>{const{customAudioButton:t}=this.props,n=document.createElement("div");n.innerHTML=e;const r=n.querySelector("audio");if(r){const e=document.createElement("source");if(e.setAttribute("type","audio/mp3"),e.setAttribute("src",r.getAttribute("src")),r.removeAttribute("src"),r.setAttribute("id","pie-prompt-audio-player"),r.appendChild(e),t){r.style.display="none";const e=document.createElement("div");e.id="play-audio-button",Object.assign(e.style,{cursor:"pointer",display:"block",width:"128px",height:"128px",backgroundImage:`url(${t.pauseImage})`,backgroundSize:"cover",borderRadius:"50%",border:"1px solid #326295"}),r.parentNode.insertBefore(e,r)}}return n.innerHTML}}addCustomAudioButtonControls(){const{autoplayAudioEnabled:e,customAudioButton:t}=this.props,n=document.getElementById("play-audio-button"),r=document.getElementById("pie-prompt-audio-player");if(e&&r&&r.play().then(()=>{n&&t&&r.addEventListener("ended",i)}).catch(e=>{console.error("Error playing audio",e)}),!n||!r||!t)return;const o=()=>{r.paused&&(n.style.backgroundImage.includes(t.pauseImage)||r.play())},i=()=>{n.style.backgroundImage=`url(${t.playImage})`},a=()=>{Object.assign(n.style,{backgroundImage:`url(${t.pauseImage})`,border:"1px solid #ccc"})},s=()=>{Object.assign(n.style,{backgroundImage:`url(${t.playImage})`,border:"1px solid #326295"})};n.addEventListener("click",o),r.addEventListener("play",a),r.addEventListener("pause",s),r.addEventListener("ended",i),this._handlePlayClick=o,this._handleAudioPlay=a,this._handleAudioPause=s,this._handleAudioEnded=i}removeCustomAudioButtonListeners(){const e=document.getElementById("play-audio-button"),t=document.querySelector("audio");e&&t&&(e.removeEventListener("click",this._handlePlayClick),t.removeEventListener("play",this._handleAudioPlay),t.removeEventListener("pause",this._handleAudioPause),t.removeEventListener("ended",this._handleAudioEnded))}componentDidMount(){this.alignImages(),this.addCustomAudioButtonControls(),this.setupMathRendering()}componentDidUpdate(e){this.alignImages(),e.prompt!==this.props.prompt&&this.renderMathContent()}componentWillUnmount(){this.removeCustomAudioButtonListeners()}setupMathRendering(){this.renderMathContent()}renderMathContent(){const e=document.getElementById("preview-prompt");e&&"function"==typeof nl&&nl(e)}alignImages(){document.querySelectorAll("#preview-prompt").forEach(e=>{const t=e.getElementsByTagName("img");if(t&&t.length)for(let e of t)if(e.attributes&&e.attributes.alignment&&e.attributes.alignment.value){const t=e.attributes.alignment.value,n="center"===t?"center":"right"===t?"flex-end":"flex-start",r=e.parentElement;if("DIV"===r.tagName&&"flex"===r.style.display&&"100%"===r.style.width)r.style.justifyContent=n;else{const t=document.createElement("div");t.style.display="flex",t.style.width="100%",t.style.justifyContent=n;const o=e.cloneNode(!0);t.appendChild(o),r.replaceChild(t,e)}}})}render(){const{prompt:e,tagName:t,className:n,onClick:r,defaultClassName:o}=this.props,i=`${n||""} ${o||""} ${"legend"===t?"legend":""}`.trim();return Qs.createElement(rl,{as:t||"div",id:"preview-prompt",onClick:r,className:i,tagName:t,dangerouslySetInnerHTML:{__html:this.parsedText(e||"").replace(ol,"\\newline ")}})}}il.__initStatic(),il.__initStatic2();const al=t,sl=n,ll=e=>sl.createElement(sl.Fragment,null,sl.Children.map(e.children,t=>sl.cloneElement(t,{"data-pie-readable":void 0===e.false})));ll.propTypes={children:al.node,false:al.bool};const cl=t;let dl;cl.node,cl.string,"undefined"!=typeof window&&(dl=new DOMParser);const ul=e=>{if(!e)return!1;const t=(e=>dl.parseFromString(e,"text/html").body.textContent)(e);return!(!t||!t.trim())};let pl;"undefined"!=typeof window&&(pl=new DOMParser);const hl=e=>{if(!e)return!1;const t=pl.parseFromString(e,"text/html");return!!t.body.querySelector("img")||!!t.body.querySelector("video")||!!t.body.querySelector("audio")};let ml;"undefined"!=typeof window&&(ml=d.getInterface(3),ml&&ml.registerEmbed&&function(e){e.registerEmbed("newLine",()=>({htmlString:'<div class="newLine"></div>',text:()=>"testText",latex:()=>"\\embed{newLine}[]"}))}(ml));const gl=n,fl=t,{styled:vl}=r,bl=i("math-input:mq:input"),yl=vl("span")({});class xl extends gl.Component{constructor(...e){super(...e),xl.prototype.__init.call(this),xl.prototype.__init2.call(this),xl.prototype.__init3.call(this),xl.prototype.__init4.call(this)}static __initStatic(){this.propTypes={className:fl.string,onClick:fl.func,onChange:fl.func,latex:fl.string,onFocus:fl.func,onBlur:fl.func}}componentDidMount(){if(!ml)throw new Error("MQ is not defined - but component has mounted?");this.mathField=ml.MathField(this.input,{handlers:{edit:this.onInputEdit.bind(this)}}),this.updateLatex()}componentDidUpdate(){this.updateLatex()}updateLatex(){if(!this.mathField)return;const{latex:e}=this.props;null!=e&&this.mathField.latex(e)}clear(){return this.mathField.latex(""),""}blur(){bl("blur mathfield"),this.mathField.blur()}focus(){bl("focus mathfield..."),this.mathField.focus()}command(e){return bl("command: ",e),Array.isArray(e)?e.forEach(e=>{this.mathField.cmd(e)}):this.mathField.cmd(e),this.mathField.focus(),this.mathField.latex()}keystroke(e){return this.mathField.keystroke(e),this.mathField.focus(),this.mathField.latex()}write(e){return bl("write: ",e),this.mathField.write(e),this.mathField.focus(),this.mathField.latex()}__init(){this.onInputEdit=()=>{bl("[onInputEdit] ...");const{onChange:e}=this.props;this.mathField&&e&&e(this.mathField.latex())}}__init2(){this.refresh=()=>{this.blur(),this.focus()}}__init3(){this.onKeyPress=e=>{Object.keys(this.mathField.__controller.options).indexOf("ignoreNextMousedown")<0&&this.refresh(),13!==e.charCode||e.preventDefault()}}__init4(){this.onClick=e=>{const{onClick:t}=this.props;this.refresh(),t&&t(e)}}shouldComponentUpdate(e){return bl("next: ",e.latex),bl("current: ",this.mathField.latex()),e.latex!==this.mathField.latex()}render(){const{onFocus:e,onBlur:t,className:n}=this.props;return gl.createElement(yl,{className:n,onKeyDown:this.onKeyPress,onClick:this.onClick,onFocus:e,onBlur:t,ref:e=>this.input=e})}}xl.__initStatic();const wl=t,El=n;function Cl(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],i=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=i(n)):"call"!==o&&"optionalCall"!==o||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}const kl=i("pie-lib:math-input:mq:static"),_l=/\\MathQuillMathField\[r\d*\]\{(.*?)\}/g,Sl=/ /g;function Rl(e=""){return e.replace(Sl,"")}function Al(e){let t=0;for(let n=0;n<(e||"").length;n++)"{"===e[n]&&t++;return t}class Ol extends El.Component{static __initStatic(){this.propTypes={latex:wl.string.isRequired,onFocus:wl.func,onBlur:wl.func,className:wl.string,getFieldName:wl.func,onSubFieldChange:wl.func,onSubFieldFocus:wl.func,setInput:wl.func}}static __initStatic2(){this.defaultProps={getFieldName:()=>{}}}constructor(e){super(e),Ol.prototype.__init.call(this),Ol.prototype.__init2.call(this),Ol.prototype.__init3.call(this),Ol.prototype.__init4.call(this),Ol.prototype.__init5.call(this),Ol.prototype.__init6.call(this),Ol.prototype.__init7.call(this),Ol.prototype.__init8.call(this),Ol.prototype.__init9.call(this),Ol.prototype.__init10.call(this),Ol.prototype.__init11.call(this),Ol.prototype.__init12.call(this),Ol.prototype.__init13.call(this),this.state={announcement:"",previousLatex:"",inputSource:null,isDeleteKeyPressed:!1},this.inputRef=El.createRef()}componentDidMount(){this.update(),Ho(),this.createLiveRegion(),this.addEventListeners()}componentDidUpdate(){this.update(),Ho()}componentWillUnmount(){this.removeLiveRegion(),this.removeEventListeners()}__init(){this.createLiveRegion=()=>{this.liveRegion=document.createElement("div"),this.liveRegion.style.position="absolute",this.liveRegion.style.width="1px",this.liveRegion.style.height="1px",this.liveRegion.style.marginTop="-1px",this.liveRegion.style.clip="rect(1px, 1px, 1px, 1px)",this.liveRegion.style.overflow="hidden",this.liveRegion.setAttribute("aria-live","polite"),this.liveRegion.setAttribute("aria-atomic","true"),document.body.appendChild(this.liveRegion)}}__init2(){this.addEventListeners=()=>{const e=this.inputRef.current;e&&(e.addEventListener("keydown",this.handleKeyDown),e.addEventListener("click",this.handleMathKeyboardClick))}}__init3(){this.removeEventListeners=()=>{const e=this.inputRef.current;e&&(e.removeEventListener("keydown",this.handleKeyDown),e.removeEventListener("click",this.handleMathKeyboardClick))}}__init4(){this.removeLiveRegion=()=>{this.liveRegion&&(document.body.removeChild(this.liveRegion),this.liveRegion=null)}}__init5(){this.handleKeyDown=e=>{"Backspace"!==Cl([e,"optionalAccess",e=>e.key])&&"Delete"!==Cl([e,"optionalAccess",e=>e.key])||this.setState({isDeleteKeyPressed:!0}),this.setState({inputSource:"keyboard"})}}__init6(){this.handleMathKeyboardClick=()=>{this.setState({inputSource:"mathKeyboard"})}}__init7(){this.onInputEdit=e=>{if(!this.mathField||this._isProgrammaticUpdate)return;const t=this.props.getFieldName(e,this.mathField.innerFields);if(this.props.onSubFieldChange){const n=e.latex().match(/[0-9]\\ \\frac\{[^\{]*\}\{ \}/);if(Cl([this,"access",e=>e.inputRef,"optionalAccess",e=>e.current])&&n&&Cl([n,"optionalAccess",e=>e.length]))try{e.__controller.cursor.insLeftOf(e.__controller.cursor.parent[-1].parent),e.el().dispatchEvent(new KeyboardEvent("keydown",{keyCode:8}))}catch(e){console.error(e.toString())}else this.props.onSubFieldChange(t,e.latex())}this.announceLatexConversion(e.latex())}}__init8(){this.announceLatexConversion=e=>{if(!this.state)return void console.error("State is not initialized");const{previousLatex:t,inputSource:n,isDeleteKeyPressed:r}=this.state,o="Converted to math symbol";if("keyboard"===n&&!r){if(Al(e)>Al(t))this.announceMessage(o);else try{this.mathField.parseLatex(t),this.mathField.parseLatex(e),e==t&&this.announceMessage(o)}catch(e){console.warn("Error parsing latex:",e.message),console.warn(e)}}(this.state.previousLatex!==e||this.state.isDeleteKeyPressed)&&this.setState({previousLatex:e,isDeleteKeyPressed:!1})}}__init9(){this.announceMessage=e=>{this.setState({previousLatex:""}),this.liveRegion&&(this.liveRegion.textContent=e,setTimeout(()=>{this.liveRegion.textContent=""},500))}}__init10(){this.update=()=>{if(!ml)throw new Error("MQ is not defined - but component has mounted?");this.mathField||(this.mathField=ml.StaticMath(Cl([this,"access",e=>e.inputRef,"optionalAccess",e=>e.current]),{handlers:{edit:this.onInputEdit.bind(this)}}));try{this._isProgrammaticUpdate=!0,this.mathField.parseLatex(this.props.latex),this.mathField.latex(this.props.latex)}catch(e){this.mathField.latex("\\MathQuillMathField[r1]{}")}finally{this._isProgrammaticUpdate=!1}}}__init11(){this.blur=()=>{kl("blur mathfield"),this.mathField.blur()}}__init12(){this.focus=()=>{kl("focus mathfield..."),this.mathField.focus()}}shouldComponentUpdate(e){try{const t=Rl(this.mathField.parseLatex(e.latex)),n=(e.latex.match(_l)||[]).length,r=t!==Rl(this.mathField.latex().trim())||n!==Object.keys(this.mathField.innerFields).length/2;return kl("[shouldComponentUpdate] ",r),r}catch(e){return console.warn("Error parsing latex:",e.message,"skip update"),console.warn(e),!1}}__init13(){this.onFocus=e=>{try{let t=e.target.parentElement.nextSibling,n=parseInt(t.getAttribute("mathquill-block-id"),10);n||(t=t.parentElement,n=parseInt(t.getAttribute("mathquill-block-id"),10));const r=this.mathField.innerFields.find(e=>e.id===n);if(r){const e=this.props.getFieldName(r,this.mathField.innerFields);this.props.setInput&&this.props.setInput(r),this.props.onSubFieldFocus(e,r)}}catch(e){console.error("error finding root block",e.message)}}}render(){const{onBlur:e,className:t}=this.props;return El.createElement("span",{className:t,onFocus:this.onFocus,onBlur:e,ref:this.inputRef})}}Ol.__initStatic(),Ol.__initStatic2();const Tl={"& *":{fontFamily:"MJXZERO, MJXTEX !important","-webkit-font-smoothing":"antialiased !important","& .mq-math-mode > span > var":{fontFamily:"MJXZERO, MJXTEX-I !important"},"& .mq-math-mode span var":{fontFamily:"MJXZERO, MJXTEX-I !important"},"& .mq-math-mode .mq-nonSymbola":{fontFamily:"MJXZERO, MJXTEX-I !important"},"& .mq-math-mode > span > var.mq-operator-name":{fontFamily:"MJXZERO, MJXTEX !important"},"& .mq-longdiv-inner":{marginTop:"-1px",marginLeft:"5px !important;","& > .mq-empty":{padding:"0 !important",marginLeft:"0px !important",marginTop:"2px"}},"& .mq-math-mode .mq-longdiv":{display:"inline-flex !important"},"& .mq-math-mode .mq-sqrt-prefix":{top:"0 !important"},"& .mq-math-mode .mq-empty":{padding:"9px 1px !important"},"& .mq-math-mode .mq-longdiv-inner .mq-empty":{padding:"0 !important"},"& .mq-math-mode .mq-supsub":{fontSize:"70.7% !important"},"& .mq-math-mode .mq-sqrt-stem":{marginTop:"-5px",paddingTop:"4px"},"& .mq-math-mode .mq-paren":{verticalAlign:"middle !important"},"& .mq-math-mode .mq-overarrow .mq-overarrow-inner .mq-empty":{padding:"0 !important"},"& .mq-math-mode .mq-overline .mq-overline-inner .mq-empty ":{padding:"0 !important"}}},Ll=e=>{On(5-e.length,()=>e.push([]));return Nn.apply(null,e)},Nl=n,Dl=t,{Button:jl}=o,{IconButton:Ml}=o,{styled:Pl}=r;function Fl(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],i=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=i(n)):"call"!==o&&"optionalCall"!==o||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}const Il=i("pie-lib:math-inline:keypad"),$l=Pl(Ol)(({latex:e})=>{const t={pointerEvents:"none",textTransform:"none !important",color:Va(),"& .mq-scaled.mq-sqrt-prefix":{transform:"scale(1, 0.9) !important"},"& .mq-sup-only .mq-sup":{marginBottom:"0.9px !important"},"& .mq-empty":{backgroundColor:`${Ha("keypad-empty-placeholder",Ua.KEYPAD_EMPTY_PLACEHOLDER)} !important`},"& .mq-overline .mq-overline-inner":{borderTop:"2px solid black"},"& .mq-non-leaf.mq-overline":{borderTop:"none !important"},"& .mq-overarrow":{width:"30px",marginTop:"0 !important",borderTop:"2px solid black",fontFamily:"Roboto, Helvetica, Arial, sans-serif !important","&.mq-arrow-both":{top:"0px !important","& *":{lineHeight:"1 !important",borderTop:"none !important"},"&:before":{fontSize:"80%",left:"calc(-13%) !important",top:"-0.31em !important"},"&:after":{fontSize:"80% !important",right:"calc(-13%) !important",top:"-1.5em"},"&.mq-empty:before":{fontSize:"80%",left:"calc(-13%)",top:"-0.26em"},"&.mq-empty:after":{fontSize:"80%",right:"calc(-13%)",top:"-0.26em"},"&.mq-empty":{minHeight:"1.4em"}},"&.mq-arrow-right:before":{fontSize:"80%",right:"calc(-13%) !important",top:"-0.26em !important"},"& .mq-overarrow-inner":{border:"none !important"},"& .mq-overarrow-inner .mq-overarrow-inner-right":{display:"none !important"}},"& .mq-root-block":{padding:"5px !important"},"& .mq-overarrow.mq-arrow-both.mq-empty:after":{right:"-6px",fontSize:"80% !important",top:"-3px"},"& .mq-overarrow.mq-arrow-right.mq-empty:before":{right:"-5px",fontSize:"80% !important",top:"-3px"},"& .mq-overarrow.mq-arrow-both.mq-empty:before":{left:"-6px",fontSize:"80% !important",top:"-3px"},"& .mq-longdiv-inner":{borderTop:"1px solid !important",paddingTop:"1.5px !important"},"& .mq-parallelogram":{lineHeight:.85},"& .mq-overarc":{borderTop:"2px solid black !important","& .mq-overline":{borderTop:"none !important"},"& .mq-overline-inner":{borderTop:"none !important",paddingTop:"0 !important"}}};return"\\parallel"===e?{...t,fontStyle:"italic !important"}:"\\overleftrightarrow{\\overline{}}"===e?{...t,"& .mq-overarrow.mq-arrow-both":{"& .mq-overline-inner":{borderTop:"none !important",paddingTop:"0 !important"},"&:after":{position:"absolute !important",top:"0px !important"}}}:t});$l.propTypes={latex:Dl.string.isRequired};const zl=Pl("div")(()=>({...Tl,width:"100%",display:"grid",gridTemplateRows:"repeat(5, minmax(40px, 60px))",gridRowGap:"0px",gridColumnGap:"0px",gridAutoFlow:"column","&.character":{textTransform:"initial !important",gridTemplateRows:"repeat(5, minmax(40px, 50px)) !important"},"&.language":{gridTemplateRows:"repeat(4, minmax(40px, 50px)) !important","& *":{fontFamily:"Roboto, Helvetica, Arial, sans-serif !important"}}})),Bl=Pl(jl)(({category:e,isDelete:t,isComma:n,isDot:r})=>({minWidth:"auto",textTransform:"none",fontSize:n||r?"200% !important":"140% !important",lineHeight:n||r?"100%":"normal",color:Va(),backgroundColor:"operators"===e?ns():ts(),"&:hover":{backgroundColor:"operators"===e?os():rs()},borderRadius:0,...t&&{fontFamily:"Roboto, Helvetica, Arial, sans-serif !important"}})),ql=Pl(jl)(({category:e})=>({textTransform:"none",padding:0,margin:0,fontSize:"110% !important",minWidth:"auto",borderRadius:0,backgroundColor:"operators"===e?ns():ts(),"&:hover":{backgroundColor:"operators"===e?os():rs()}})),Kl=Pl(Ml)(({category:e})=>({minWidth:"auto",backgroundColor:"operators"===e?ns():ts(),"&:hover":{backgroundColor:"operators"===e?os():rs()},borderRadius:0,"& .icon":{height:"30px"}}));class Ul extends Nl.Component{static __initStatic(){this.propTypes={className:Dl.string,controlledKeypadMode:Dl.bool,baseSet:Dl.array,additionalKeys:Dl.array,layoutForKeyPad:Dl.object,onPress:Dl.func.isRequired,onFocus:Dl.func,noDecimal:Dl.bool,setKeypadInteraction:Dl.func,mode:Dl.oneOfType([Dl.string,Dl.number])}}static __initStatic2(){this.defaultProps={baseSet:oi,noDecimal:!1}}constructor(e){super(e),Ul.prototype.__init.call(this),Ul.prototype.__init2.call(this),Ul.prototype.__init3.call(this),Ul.prototype.__init4.call(this),this.keypadRef=Nl.createRef()}componentDidMount(){const e=Fl([this,"access",e=>e.keypadRef,"optionalAccess",e=>e.current]),t=Fl([e,"optionalAccess",e=>e.closest,"call",e=>e(".main-container")]),n=Fl([e,"optionalAccess",e=>e.closest,"call",e=>e(".pie-toolbar")]);if(this.props.controlledKeypadMode&&t&&n){const e=t.getBoundingClientRect(),r=n.getBoundingClientRect(),o=e.top+e.height-(r.top+r.height);if(o<0){const n=e.height+e.top-o;t&&(t.style.height=`${n}px`)}}e&&(e.addEventListener("touchstart",this.handleKeypadInteraction,!0),e.addEventListener("mousedown",this.handleKeypadInteraction,!0))}componentWillUnmount(){const e=Fl([this,"access",e=>e.keypadRef,"optionalAccess",e=>e.current]);if(this.props.controlledKeypadMode&&e){const t=e.closest(".main-container");t&&(t.style.height="unset")}e&&(e.removeEventListener("touchstart",this.handleKeypadInteraction,!0),e.removeEventListener("mousedown",this.handleKeypadInteraction,!0))}__init(){this.handleKeypadInteraction=()=>{this.props.setKeypadInteraction&&this.props.setKeypadInteraction(!0)}}__init2(){this.buttonClick=e=>{Il("[buttonClick]",e);const{onPress:t}=this.props;t(e)}}__init3(){this.flowKeys=(e,t)=>Ct([...Ll(e),...Ll(t)])}__init4(){this.keyIsNotAllowed=e=>{const{noDecimal:t}=this.props;return!(!("."===e.write&&"."===e.label||","===e.write&&","===e.label)||!t)}}render(){const{className:e,baseSet:t,additionalKeys:n,layoutForKeyPad:r,onFocus:o,mode:i}=this.props,a=["non-negative-integers","integers","decimals","fractions","item-authoring","language"].includes(i),s=a?this.flowKeys([],n||[]):this.flowKeys(t,n||[]),l=s.length%5?1:0,c={gridTemplateColumns:`repeat(${Math.floor(s.length/5)+l}, minmax(min-content, 150px))`,...(d=r,d?{gridTemplateColumns:`repeat(${d.columns}, minmax(min-content, 150px))`,gridTemplateRows:`repeat(${d.rows}, minmax(40px, 60px))`,gridAutoFlow:"initial"}:{})};var d;return Nl.createElement(zl,{ref:this.keypadRef,className:[e,i].filter(Boolean).join(" "),style:c,onFocus:o},s.map((e,t)=>{const n=this.buttonClick.bind(this,e);if(!e)return Nl.createElement("span",{key:`empty-${t}`});const r={onClick:n,disabled:this.keyIsNotAllowed(e),key:`${e.label||e.latex||e.command}-${t}`,...e.actions||{},...e.extraProps||{}};if(e.latex)return Nl.createElement(ql,{key:r.key,onClick:r.onClick,disabled:r.disabled,category:a?void 0:e.category,"aria-label":e.ariaLabel?e.ariaLabel:e.name||e.label,...e.actions||{},...e.extraProps||{}},Nl.createElement($l,{latex:e.latex}));if(e.label)return Nl.createElement(Bl,{key:r.key,onClick:r.onClick,disabled:r.disabled,category:a?void 0:e.category,isDelete:"⌫"===e.label,isComma:","===e.label,isDot:"."===e.label,"aria-label":e.ariaLabel?e.ariaLabel:e.name||e.label,...e.actions||{},...e.extraProps||{}},e.label);{const t=e.icon?e.icon:"div";return Nl.createElement(Kl,{key:r.key,tabIndex:"-1",onClick:r.onClick,disabled:r.disabled,category:a?void 0:e.category,size:"large",...e.actions||{},...e.extraProps||{}},Nl.createElement(t,{className:"icon"}))}}))}}Ul.__initStatic(),Ul.__initStatic2();const Hl=n,Wl=t;class Vl extends Hl.Component{constructor(...e){super(...e),Vl.prototype.__init.call(this)}static __initStatic(){this.propTypes={className:Wl.string,controlledKeypadMode:Wl.bool,mode:Wl.oneOfType([Wl.string,Wl.number]),layoutForKeyPad:Wl.object,onClick:Wl.func.isRequired,onFocus:Wl.func,noDecimal:Wl.bool,additionalKeys:Wl.array,setKeypadInteraction:Wl.func}}static __initStatic2(){this.defaultProps={mode:"scientific",noDecimal:!1,additionalKeys:[]}}__init(){this.keypadPress=e=>{const{onClick:t}=this.props;var n;t((n=e).command?{value:n.command,type:"command"}:n.write?{value:n.write}:n.keystroke?{type:"cursor",value:n.keystroke}:void 0)}}render(){const{mode:e,onFocus:t,controlledKeypadMode:n,noDecimal:r,className:o,additionalKeys:i,layoutForKeyPad:a,setKeypadInteraction:s}=this.props,l=(e=>(e||[]).map(e=>{const{latex:t}=e,n=(Uo||[]).find(e=>t===e.latex||t===e.write||t===e.command||t===e.otherNotation);return t&&n||e}))(i);return Hl.createElement(Ul,{className:o,controlledKeypadMode:n,onFocus:t,noDecimal:r,layoutForKeyPad:a,additionalKeys:zn(Ko(e),l),onPress:this.keypadPress,mode:e,setKeypadInteraction:s})}}Vl.__initStatic(),Vl.__initStatic2();var Yl,Xl={"border-radius":1,"border-top-left-radius":1,"border-top-right-radius":1,"border-bottom-left-radius":1,"border-bottom-right-radius":1,"box-shadow":1,order:1,flex:function(e,t){return[t+"box-flex"]},"box-flex":1,"box-align":1,animation:1,"animation-duration":1,"animation-name":1,transition:1,"transition-duration":1,transform:1,"transform-style":1,"transform-origin":1,"backface-visibility":1,perspective:1,"box-pack":1},Jl={animation:1,"column-count":1,columns:1,"font-weight":1,opacity:1,"order ":1,"z-index":1,zoom:1,flex:1,"box-flex":1,transform:1,perspective:1,"box-pack":1,"box-align":1,colspan:1,rowspan:1},Gl=function(e){return e.length?e.charAt(0).toUpperCase()+e.substring(1):e},Ql=Gl,Zl=/^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/,ec="undefined"==typeof document?{}:document.documentElement.style,tc=function(){var e=function(){for(var e in ec)if(Zl.test(e))return e.match(Zl)[0];return"WebkitOpacity"in ec?"Webkit":"KhtmlOpacity"in ec?"Khtml":""}(),t=e.toLowerCase();return{style:e,css:"-"+t+"-",dom:{Webkit:"WebKit",ms:"MS",o:"WebKit"}[e]||Ql(e)}}(),nc=function(e,t){return t?t.toUpperCase():""},rc=/[-\s]+(.)?/g,oc=function(e){return e?e.replace(rc,nc):""},ic=/::/g,ac=/([A-Z]+)([A-Z][a-z])/g,sc=/([a-z\d])([A-Z])/g,lc=/_/g,cc=function(e,t){return e?e.replace(ic,"/").replace(ac,"$1_$2").replace(sc,"$1_$2").replace(lc,t||"-"):""},dc=function(e){return cc(e).toLowerCase()},uc=oc,pc=dc,hc=function(e){return e.length?e.charAt(0).toLowerCase()+e.substring(1):e},mc=Gl,gc=tc,fc=Xl,vc="undefined"==typeof document?{}:document.documentElement.style,bc=function(e,t){t=t||{};var n=hc(uc(e)),r=pc(e),o=Yl?n:r,i=gc.style?Yl?gc.style:gc.css:"";if(n in vc)return t.asString?o:[o];var a=o,s=fc[r],l=[];if(Yl&&(a=mc(o)),"function"==typeof s){var c=s(o,i)||[];c&&!Array.isArray(c)&&(c=[c]),c.length&&(c=c.map(function(e){return Yl?hc(uc(e)):pc(e)})),l=l.concat(c)}return i&&l.push(i+a),l.push(o),t.asString||1==l.length?l[0]:l},yc=Object.prototype.hasOwnProperty,xc=function(e,t){return yc.call(e,t)},wc=Object.prototype.toString,Ec=Object.prototype.toString,Cc=bc,kc=dc,_c=oc,Sc=xc,Rc=function(e){return!!e&&"[object Object]"===wc.call(e)},Ac=function(e){return"[object Function]"===Ec.apply(e)},Oc=function(e,t,n,r){Cc(t).forEach(function(t){e[r?r(t):t]=n})},Tc={cssUnitless:Jl},Lc=function(e,t,n,r){"string"==typeof e&&(e=function(e){e=(e||"").split(";");var t={};return e.forEach(function(e){var n=e.split(":");2==n.length&&(t[n[0].trim()]=n[1].trim())}),t}(e)),(t=t||Tc).cssUnitless=t.cssUnitless||Tc.cssUnitless,r=r||{};var o,i,a,s,l,c,d,u,p=t.scope||{},h=null!=t.addUnits?t.addUnits:!p||null==p.addUnits||p.addUnits,m=(null!=t.cssUnitless?t.cssUnitless:p?p.cssUnitless:null)||{},g=(t.cssUnit||p?p.cssUnit:null)||"px",f=t.prefixProperties||(p?p.prefixProperties:null)||{},v=t.camelize?_c:kc;for(a in e)if(Sc(e,a)){if(s=e[a],i=kc(n?n+a:a),o=!1,u=!1,Ac(s)&&(d=s.call(p||e,s,a,i,e),Rc(d)&&null!=d.value?(s=d.value,u=d.prefix,i=d.name?kc(d.name):i):s=d),c="number"==(l=typeof s)||"string"==l&&""!=s&&1*s==s,null==s||null==i||""===i)continue;if((c||"string"==l)&&(o=!0),!o&&null!=s.value&&s.prefix&&(o=!0,u=s.prefix,s=s.value),o){if(u=u||!!f[i],c&&(s=h&&!(i in m)?s+g:s+""),"border"!=i&&(i.indexOf("border")||~i.indexOf("radius")||~i.indexOf("width"))||!c||(i+="-width"),!i.indexOf("border-radius-")&&(i.replace(/border(-radius)(-(.*))/,function(e,t,n){var r={"-top":["-top-left","-top-right"],"-left":["-top-left","-bottom-left"],"-right":["-top-right","-bottom-right"],"-bottom":["-bottom-left","-bottom-right"]};n in r?(i=[],r[n].forEach(function(e){i.push("border"+e+t)})):i="border"+n+t}),Array.isArray(i))){i.forEach(function(e){u?Oc(r,e,s,v):r[v(e)]=s});continue}u?Oc(r,i,s,v):r[v(i)]=s}else Lc(s,t,i+"-",r)}return r},Nc=Lc,Dc=xc,jc={prefixProperties:Xl,cssUnitless:Jl,object:Lc,string:function(e,t){e=Nc(e,t);var n,r=[];for(n in e)Dc(e,n)&&r.push(n+": "+e[n]);return r.join("; ")}};const Mc=i("@pie-lib:mask-markup:serialization"),Pc=["span"],Fc=["em","strong","u"],Ic=(e,t)=>{const n=e.getAttribute(t);return r=(e=>{const t=/([\w-]*)\s*:\s*([^;]*)/g;let n;const r={};for(;n=t.exec(e);)r[n[1]]=n[2].trim();return r})(n),jc.object(r,{camelize:!0,addUnits:!1});var r},$c=["border","class","style"],zc={b:"bold",em:"italic",u:"underline",s:"strikethrough",code:"code",strong:"strong"},Bc=(e,t=[])=>{if(8===e.nodeType)return null;if(3===e.nodeType){const n={text:e.textContent};return t.length>0&&(n.marks=t.map(e=>({type:e,data:void 0}))),{object:"text",leaves:[n]}}if(1===e.nodeType){const r=e.tagName.toLowerCase(),o=zc[r];if(o){Mc("[deserialize] mark: ",o);return{_flatten:!0,nodes:qc(e.childNodes,[...t,o])}}if("math"===r)return{isMath:!0,nodes:[e]};const i=(e=>{if(!e.attributes||e.attributes.length<=0)return;const t={};let n;for(n=0;n<e.attributes.length;n++){const r=e.attributes[n];t[r.name]=r.value}return t})(e)||{};"audio"===r&&""===i.controls&&(i.controls=!0);const a=$c.reduce((n=e,(e,t)=>{if(!n.getAttribute)return e;if(n.getAttribute(t))switch(t){case"style":e.style=Ic(n,t);break;case"class":e.className=((e,t,n)=>{const r=e.getAttribute(n);return delete t.class,r})(n,e,t);break;default:e[t]=n.getAttribute(t)}return e}),{...i}),s=(e=>Pc.includes(e)?"inline":Fc.includes(e)?"mark":"block")(r),l=qc(e.childNodes,t);return{object:s,type:r,data:{dataset:{...e.dataset},attributes:{...a}},nodes:l}}var n;return null},qc=(e,t=[])=>{const n=[];for(let r=0;r<e.length;r++){const o=Bc(e[r],t);null!==o&&(o._flatten&&o.nodes?n.push(...o.nodes):n.push(o))}return n},Kc=n,Uc=t,{styled:Hc}=r,{renderMath:Wc}=c;function Vc(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],i=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=i(n)):"call"!==o&&"optionalCall"!==o||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}const Yc=Hc("div")(({theme:e})=>({paddingTop:e.spacing(.5),paddingBottom:e.spacing(.5)})),Xc=Hc("span")(()=>({display:"inline-block",width:".75em"})),Jc=["tbody","tr"],Gc=(e,t,n,r,o,i)=>{if(!t)return null;const a=[];return(e.nodes||[]).forEach((e,s)=>{const l=e.type?`${e.type}-${s}`:`${s}`;if(e.isMath)return a.push(Kc.createElement("span",{dangerouslySetInnerHTML:{__html:`<math displaystyle="true">${e.nodes[0].innerHTML}</math>`}})),a;if(r){const l=r(e,t,n);if(l)return a.push(l),void("td"!==Vc([o,"optionalAccess",e=>e.type])&&"drag-in-the-blank"===i&&a.push(Kc.createElement(Xc,{key:`spacer-${s}`})))}if("text"===e.object){const t=e.leaves.reduce((e,t)=>{const n=t.text,r=((e,t)=>{const n=""===t.trim(),r=e&&e.type;return n&&Jc.includes(r)?void 0:t})(o,n);return r?e+r:e},""),n=(e=>{const t=e.leaves.find(e=>bt(e,"marks",[]).length);return t?t.marks[0]:null})(e);if(n){let e;for(e in zc)if(zc[e]===n.type){const n=e;a.push(Kc.createElement(n,{key:l},t));break}}else t.length>0&&(a.push(t),"td"!==Vc([o,"optionalAccess",e=>e.type])&&"drag-in-the-blank"===i&&a.push(Kc.createElement(Xc,{key:`spacer-${s}`})))}else{const o=Gc(e,t,n,r,e,i);if("p"===e.type||"paragraph"===e.type)a.push(Kc.createElement(Yc,{key:l},o));else{const t=e.type;e.nodes&&e.nodes.length>0?a.push(Kc.createElement(t,{key:l,...e.data.attributes},o)):a.push(Kc.createElement(t,{key:l,...e.data.attributes}))}}}),a},Qc=Hc("div")(()=>({display:"initial","&:not(.MathJax) table":{borderCollapse:"collapse"},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:"8px 12px",textAlign:"left"}}));class Zc extends Kc.Component{constructor(e){super(e),Zc.prototype.__init.call(this),this.internalContainerRef=Kc.createRef()}static __initStatic(){this.propTypes={renderChildren:Uc.func,layout:Uc.object,value:Uc.object,onChange:Uc.func,elementType:Uc.string,containerRef:Uc.oneOfType([Uc.func,Uc.shape({current:Uc.instanceOf(Element)})])}}componentDidMount(){const e=this.props.containerRef||this.internalContainerRef;e.current&&"function"==typeof Wc&&Wc(e.current)}__init(){this.handleChange=(e,t)=>{const n={...this.props.value,[e]:t};this.props.onChange(n)}}render(){const{value:e,layout:t,elementType:n,containerRef:r}=this.props,o=Gc(t,e,this.handleChange,this.props.renderChildren,null,n),i=r||this.internalContainerRef;return Kc.createElement(Qc,{ref:i},o)}}Zc.__initStatic();const ed=/\{\{(\d+)\}\}/g;const td=n,nd=t;var rd;const od=(e,t)=>{const{markup:n}=(o=t,(r=e)?{markup:r.replace(ed,(e,t)=>`<span data-component="${o}" data-id="${t}"></span>`)}:{markup:""});var r,o;return(e=>{if(!e||!e.trim())return{object:"value",document:{object:"document",data:{},nodes:[{object:"block",type:"span",data:{},isVoid:!1,nodes:[]}]}};const t=(new DOMParser).parseFromString(e,"text/html");let n=qc(t.body.childNodes);return!n.some(e=>"block"===e.object||"inline"===e.object)&&n.length>0&&(n=[{object:"block",type:"span",data:{},isVoid:!1,nodes:n}]),0===n.length&&(n=[{object:"block",type:"span",data:{},isVoid:!1,nodes:[]}]),{object:"value",document:{object:"document",data:{},nodes:n}}})(n).document},id=(e,t)=>((rd=class extends td.Component{static __initStatic(){this.propTypes={markup:nd.string,layout:nd.object,value:nd.object,onChange:nd.func,customMarkMarkupComponent:nd.func,elementType:nd.string}}constructor(e){super(e),this.containerRef=td.createRef()}componentDidUpdate(e){if(this.props.markup!==e.markup){const e=this.containerRef.current;(e&&e.querySelectorAll('[data-latex][data-math-handled="true"]')||[]).forEach(e=>{const t=e.querySelector("mjx-container");t&&e.removeChild(t);const n=e.getAttribute("data-raw");e.innerHTML=n,e.removeAttribute("data-math-handled")})}}render(){const{markup:n,layout:r,value:o,onChange:i,elementType:a}=this.props,s=r||od(n,e);return td.createElement(Zc,{containerRef:this.containerRef,elementType:a,layout:s,value:o,onChange:i,renderChildren:t(this.props)})}}).__initStatic(),rd),{useMemo:ad}=n,{useLayoutEffect:sd}=n,{useEffect:ld}=n,{useRef:cd}=n,{useCallback:dd}=n,ud="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function pd(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function hd(e){return"nodeType"in e}function md(e){var t,n;return e?pd(e)?e:hd(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function gd(e){const{Document:t}=md(e);return e instanceof t}function fd(e){return!pd(e)&&e instanceof md(e).HTMLElement}function vd(e){return e instanceof md(e).SVGElement}function bd(e){return e?pd(e)?e.document:hd(e)?gd(e)?e:fd(e)||vd(e)?e.ownerDocument:document:document:document}const yd=ud?sd:ld;function xd(e){const t=cd(e);return yd(()=>{t.current=e}),dd(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)},[])}function wd(e,t){void 0===t&&(t=[e]);const n=cd(e);return yd(()=>{n.current!==e&&(n.current=e)},t),n}function Ed(e,t){const n=cd();return ad(()=>{const t=e(n.current);return n.current=t,t},[...t])}function Cd(e){const t=xd(e),n=cd(null),r=dd(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,r]}function kd(e){const t=cd();return ld(()=>{t.current=e},[e]),t.current}let _d={};function Sd(e,t){return ad(()=>{if(t)return t;const n=null==_d[e]?0:_d[e]+1;return _d[e]=n,e+"-"+n},[e,t])}function Rd(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((t,n)=>{const r=Object.entries(n);for(const[n,o]of r){const r=t[n];null!=r&&(t[n]=r+e*o)}return t},{...t})}}const Ad=Rd(1),Od=Rd(-1);function Td(e){if(!e)return!1;const{KeyboardEvent:t}=md(e.target);return t&&e instanceof t}function Ld(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=md(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const Nd=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Nd.Translate.toString(e),Nd.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Dd="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function jd(e){return e.matches(Dd)?e:e.querySelector(Dd)}const Md=n,{useState:Pd}=n,{useCallback:Fd}=n,Id={display:"none"};function $d(e){let{id:t,value:n}=e;return Md.createElement("div",{id:t,style:Id},n)}function zd(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;return Md.createElement("div",{id:t,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":r,"aria-atomic":!0},n)}const Bd=n,{createContext:qd}=n,{useContext:Kd}=n,{useEffect:Ud}=n,{useState:Hd}=n,{useCallback:Wd}=n,{useMemo:Vd}=n,{useRef:Yd}=n,{memo:Xd}=n,{useReducer:Jd}=n,{cloneElement:Gd}=n,{forwardRef:Qd}=n,{createPortal:Zd}=e,{unstable_batchedUpdates:eu}=e,tu=qd(null);const nu={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},ru={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function ou(e){let{announcements:t=ru,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=nu}=e;const{announce:i,announcement:a}=function(){const[e,t]=Pd("");return{announce:Fd(e=>{null!=e&&t(e)},[]),announcement:e}}(),s=Sd("DndLiveRegion"),[l,c]=Hd(!1);if(Ud(()=>{c(!0)},[]),function(e){const t=Kd(tu);Ud(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}(Vd(()=>({onDragStart(e){let{active:n}=e;i(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&i(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;i(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;i(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;i(t.onDragCancel({active:n,over:r}))}}),[i,t])),!l)return null;const d=Bd.createElement(Bd.Fragment,null,Bd.createElement($d,{id:r,value:o.draggable}),Bd.createElement(zd,{id:s,announcement:a}));return n?Zd(d,n):d}var iu;function au(){}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(iu||(iu={}));const su=Object.freeze({x:0,y:0});function lu(e,t){const n=Ld(e);if(!n)return"0 0";return(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%"}function cu(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function du(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),a=o-r,s=i-n;if(r<o&&n<i){const n=t.width*t.height,r=e.width*e.height,o=a*s;return Number((o/(n+r-o)).toFixed(4))}return 0}const uu=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const e of r){const{id:r}=e,i=n.get(r);if(i){const n=du(i,t);n>0&&o.push({id:r,data:{droppableContainer:e,value:n}})}}return o.sort(cu)};function pu(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:su}const hu=(mu=1,function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.reduce((e,t)=>({...e,top:e.top+mu*t.y,bottom:e.bottom+mu*t.y,left:e.left+mu*t.x,right:e.right+mu*t.x}),{...e})});var mu;function gu(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}const fu={ignoreTransform:!1};function vu(e,t){void 0===t&&(t=fu);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=md(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=gu(t);if(!r)return e;const{scaleX:o,scaleY:i,x:a,y:s}=r,l=e.left-a-(1-o)*parseFloat(n),c=e.top-s-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),d=o?e.width/o:e.width,u=i?e.height/i:e.height;return{width:d,height:u,top:c,right:l+d,bottom:c+u,left:l}}(n,t,r))}const{top:r,left:o,width:i,height:a,bottom:s,right:l}=n;return{top:r,left:o,width:i,height:a,bottom:s,right:l}}function bu(e){return vu(e,{ignoreTransform:!0})}function yu(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if(gd(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!fd(o)||vd(o))return n;if(n.includes(o))return n;const i=md(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=md(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(e=>{const r=t[e];return"string"==typeof r&&n.test(r)})}(o,i)&&n.push(o),function(e,t){return void 0===t&&(t=md(e).getComputedStyle(e)),"fixed"===t.position}(o,i)?n:r(o.parentNode)}(e):n}function xu(e){const[t]=yu(e,1);return null!=t?t:null}function wu(e){return ud&&e?pd(e)?e:hd(e)?gd(e)||e===bd(e).scrollingElement?window:fd(e)?e:null:null:null}function Eu(e){return pd(e)?e.scrollX:e.scrollLeft}function Cu(e){return pd(e)?e.scrollY:e.scrollTop}function ku(e){return{x:Eu(e),y:Cu(e)}}var _u;function Su(e){return!(!ud||!e)&&e===document.scrollingElement}function Ru(e){const t={x:0,y:0},n=Su(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(_u||(_u={}));const Au={x:.2,y:.2};function Ou(e,t,n,r,o){let{top:i,left:a,right:s,bottom:l}=n;void 0===r&&(r=10),void 0===o&&(o=Au);const{isTop:c,isBottom:d,isLeft:u,isRight:p}=Ru(e),h={x:0,y:0},m={x:0,y:0},g=t.height*o.y,f=t.width*o.x;return!c&&i<=t.top+g?(h.y=_u.Backward,m.y=r*Math.abs((t.top+g-i)/g)):!d&&l>=t.bottom-g&&(h.y=_u.Forward,m.y=r*Math.abs((t.bottom-g-l)/g)),!p&&s>=t.right-f?(h.x=_u.Forward,m.x=r*Math.abs((t.right-f-s)/f)):!u&&a<=t.left+f&&(h.x=_u.Backward,m.x=r*Math.abs((t.left+f-a)/f)),{direction:h,speed:m}}function Tu(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function Lu(e){return e.reduce((e,t)=>Ad(e,ku(t)),su)}function Nu(e,t){if(void 0===t&&(t=vu),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);xu(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Du=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+Eu(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+Cu(t),0)}]];class ju{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=yu(t),r=Lu(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of Du)for(const i of t)Object.defineProperty(this,i,{get:()=>{const t=o(n),a=r[e]-t;return this.rect[i]+a},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Mu{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)})},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function Pu(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t&&r>t.y}var Fu,Iu;function $u(e){e.preventDefault()}function zu(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(Fu||(Fu={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"}(Iu||(Iu={}));const Bu={start:[Iu.Space,Iu.Enter],cancel:[Iu.Esc],end:[Iu.Space,Iu.Enter,Iu.Tab]},qu=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Iu.Right:return{...n,x:n.x+25};case Iu.Left:return{...n,x:n.x-25};case Iu.Down:return{...n,y:n.y+25};case Iu.Up:return{...n,y:n.y-25}}};class Ku{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new Mu(bd(t)),this.windowListeners=new Mu(md(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Fu.Resize,this.handleCancel),this.windowListeners.add(Fu.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Fu.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&Nu(n),t(su)}handleKeyDown(e){if(Td(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=Bu,coordinateGetter:i=qu,scrollBehavior:a="smooth"}=r,{code:s}=e;if(o.end.includes(s))return void this.handleEnd(e);if(o.cancel.includes(s))return void this.handleCancel(e);const{collisionRect:l}=n.current,c=l?{x:l.left,y:l.top}:su;this.referenceCoordinates||(this.referenceCoordinates=c);const d=i(e,{active:t,context:n.current,currentCoordinates:c});if(d){const t=Od(d,c),r={x:0,y:0},{scrollableAncestors:o}=n.current;for(const n of o){const o=e.code,{isTop:i,isRight:s,isLeft:l,isBottom:c,maxScroll:u,minScroll:p}=Ru(n),h=Tu(n),m={x:Math.min(o===Iu.Right?h.right-h.width/2:h.right,Math.max(o===Iu.Right?h.left:h.left+h.width/2,d.x)),y:Math.min(o===Iu.Down?h.bottom-h.height/2:h.bottom,Math.max(o===Iu.Down?h.top:h.top+h.height/2,d.y))},g=o===Iu.Right&&!s||o===Iu.Left&&!l,f=o===Iu.Down&&!c||o===Iu.Up&&!i;if(g&&m.x!==d.x){const e=n.scrollLeft+t.x,i=o===Iu.Right&&e<=u.x||o===Iu.Left&&e>=p.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:a});r.x=i?n.scrollLeft-e:o===Iu.Right?n.scrollLeft-u.x:n.scrollLeft-p.x,r.x&&n.scrollBy({left:-r.x,behavior:a});break}if(f&&m.y!==d.y){const e=n.scrollTop+t.y,i=o===Iu.Down&&e<=u.y||o===Iu.Up&&e>=p.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:a});r.y=i?n.scrollTop-e:o===Iu.Down?n.scrollTop-u.y:n.scrollTop-p.y,r.y&&n.scrollBy({top:-r.y,behavior:a});break}}this.handleMove(e,Ad(Od(d,this.referenceCoordinates),r))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function Uu(e){return Boolean(e&&"distance"in e)}function Hu(e){return Boolean(e&&"delay"in e)}Ku.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Bu,onActivation:o}=t,{active:i}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const t=i.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==o||o({event:e.nativeEvent}),!0)}return!1}}];class Wu{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=md(e);return e instanceof t?e:bd(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:o}=e,{target:i}=o;this.props=e,this.events=t,this.document=bd(i),this.documentListeners=new Mu(this.document),this.listeners=new Mu(n),this.windowListeners=new Mu(md(i)),this.initialCoordinates=null!=(r=Ld(o))?r:su,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(Fu.Resize,this.handleCancel),this.windowListeners.add(Fu.DragStart,$u),this.windowListeners.add(Fu.VisibilityChange,this.handleCancel),this.windowListeners.add(Fu.ContextMenu,$u),this.documentListeners.add(Fu.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Hu(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(Uu(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){const{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(Fu.Click,zu,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Fu.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:o}=this,{onMove:i,options:{activationConstraint:a}}=o;if(!r)return;const s=null!=(t=Ld(e))?t:su,l=Od(r,s);if(!n&&a){if(Uu(a)){if(null!=a.tolerance&&Pu(l,a.tolerance))return this.handleCancel();if(Pu(l,a.distance))return this.handleStart()}return Hu(a)&&Pu(l,a.tolerance)?this.handleCancel():void this.handlePending(a,l)}e.cancelable&&e.preventDefault(),i(s)}handleEnd(){const{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){const{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===Iu.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const Vu={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Yu extends Wu{constructor(e){const{event:t}=e,n=bd(t.target);super(e,Vu,n)}}Yu.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!(!n.isPrimary||0!==n.button)&&(null==r||r({event:n}),!0)}}];const Xu={move:{name:"mousemove"},end:{name:"mouseup"}};var Ju;!function(e){e[e.RightClick=2]="RightClick"}(Ju||(Ju={}));(class extends Wu{constructor(e){super(e,Xu,bd(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==Ju.RightClick&&(null==r||r({event:n}),!0)}}];const Gu={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var Qu,Zu;function ep(e){let{acceleration:t,activator:n=Qu.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:a=5,order:s=Zu.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:d,delta:u,threshold:p}=e;const h=function(e){let{delta:t,disabled:n}=e;const r=kd(t);return Ed(e=>{if(n||!r||!e)return tp;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[_u.Backward]:e.x[_u.Backward]||-1===o.x,[_u.Forward]:e.x[_u.Forward]||1===o.x},y:{[_u.Backward]:e.y[_u.Backward]||-1===o.y,[_u.Forward]:e.y[_u.Forward]||1===o.y}}},[n,t,r])}({delta:u,disabled:!i}),[m,g]=function(){const e=cd(null);return[dd((t,n)=>{e.current=setInterval(t,n)},[]),dd(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}(),f=Yd({x:0,y:0}),v=Yd({x:0,y:0}),b=Vd(()=>{switch(n){case Qu.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case Qu.DraggableRect:return o}},[n,o,l]),y=Yd(null),x=Wd(()=>{const e=y.current;if(!e)return;const t=f.current.x*v.current.x,n=f.current.y*v.current.y;e.scrollBy(t,n)},[]),w=Vd(()=>s===Zu.TreeOrder?[...c].reverse():c,[s,c]);Ud(()=>{if(i&&c.length&&b){for(const e of w){if(!1===(null==r?void 0:r(e)))continue;const n=c.indexOf(e),o=d[n];if(!o)continue;const{direction:i,speed:s}=Ou(e,o,b,t,p);for(const e of["x","y"])h[e][i[e]]||(s[e]=0,i[e]=0);if(s.x>0||s.y>0)return g(),y.current=e,m(x,a),f.current=s,void(v.current=i)}f.current={x:0,y:0},v.current={x:0,y:0},g()}else g()},[t,x,r,g,i,a,JSON.stringify(b),JSON.stringify(h),m,c,w,d,JSON.stringify(p)])}(class extends Wu{constructor(e){super(e,Gu)}static setup(){return window.addEventListener(Gu.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Gu.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return!(o.length>1)&&(null==r||r({event:n}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(Qu||(Qu={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(Zu||(Zu={}));const tp={x:{[_u.Backward]:!1,[_u.Forward]:!1},y:{[_u.Backward]:!1,[_u.Forward]:!1}};var np,rp;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(np||(np={})),function(e){e.Optimized="optimized"}(rp||(rp={}));const op=new Map;function ip(e,t){return Ed(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function ap(e){let{callback:t,disabled:n}=e;const r=xd(t),o=Vd(()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(r)},[n]);return Ud(()=>()=>null==o?void 0:o.disconnect(),[o]),o}function sp(e){return new ju(vu(e),e)}function lp(e,t,n){void 0===t&&(t=sp);const[r,o]=Hd(null);function i(){o(r=>{if(!e)return null;var o;if(!1===e.isConnected)return null!=(o=null!=r?r:n)?o:null;const i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}const a=function(e){let{callback:t,disabled:n}=e;const r=xd(t),o=Vd(()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(r)},[r,n]);return Ud(()=>()=>null==o?void 0:o.disconnect(),[o]),o}({callback(t){if(e)for(const n of t){const{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){i();break}}}}),s=ap({callback:i});return yd(()=>{i(),e?(null==s||s.observe(e),null==a||a.observe(document.body,{childList:!0,subtree:!0})):(null==s||s.disconnect(),null==a||a.disconnect())},[e]),r}const cp=[];function dp(e,t){void 0===t&&(t=[]);const n=Yd(null);return Ud(()=>{n.current=null},t),Ud(()=>{const t=e!==su;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?Od(e,n.current):su}function up(e){return Vd(()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null,[e])}const pp=[];function hp(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return fd(t)?t:e}const mp=[{sensor:Yu,options:{}},{sensor:Ku,options:{}}],gp={current:{}},fp={draggable:{measure:bu},droppable:{measure:bu,strategy:np.WhileDragging,frequency:rp.Optimized},dragOverlay:{measure:vu}};class vp extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const bp={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new vp,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:au},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:fp,measureDroppableContainers:au,windowRect:null,measuringScheduled:!1},yp={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:au,draggableNodes:new Map,over:null,measureDroppableContainers:au},xp=qd(yp),wp=qd(bp);function Ep(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new vp}}}function Cp(e,t){switch(t.type){case iu.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case iu.DragMove:return null==e.draggable.active?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case iu.DragEnd:case iu.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case iu.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new vp(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case iu.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const a=new vp(e.droppable.containers);return a.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case iu.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new vp(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function kp(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=Kd(xp),i=kd(r),a=kd(null==n?void 0:n.id);return Ud(()=>{if(!t&&!r&&i&&null!=a){if(!Td(i))return;if(document.activeElement===i.target)return;const e=o.get(a);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=jd(e);if(t){t.focus();break}}})}},[r,t,o,a,i]),null}function _p(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}const Sp=qd({...su,scaleX:1,scaleY:1});var Rp;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(Rp||(Rp={})),Xd(function(e){var t,n,r,o;let{id:i,accessibility:a,autoScroll:s=!0,children:l,sensors:c=mp,collisionDetection:d=uu,measuring:u,modifiers:p,...h}=e;const m=Jd(Cp,void 0,Ep),[g,f]=m,[v,b]=function(){const[e]=Hd(()=>new Set),t=Wd(t=>(e.add(t),()=>e.delete(t)),[e]);return[Wd(t=>{let{type:n,event:r}=t;e.forEach(e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)})},[e]),t]}(),[y,x]=Hd(Rp.Uninitialized),w=y===Rp.Initialized,{draggable:{active:E,nodes:C,translate:k},droppable:{containers:_}}=g,S=null!=E?C.get(E):null,R=Yd({initial:null,translated:null}),A=Vd(()=>{var e;return null!=E?{id:E,data:null!=(e=null==S?void 0:S.data)?e:gp,rect:R}:null},[E,S]),O=Yd(null),[T,L]=Hd(null),[N,D]=Hd(null),j=wd(h,Object.values(h)),M=Sd("DndDescribedBy",i),P=Vd(()=>_.getEnabled(),[_]),F=function(e){return Vd(()=>({draggable:{...fp.draggable,...null==e?void 0:e.draggable},droppable:{...fp.droppable,...null==e?void 0:e.droppable},dragOverlay:{...fp.dragOverlay,...null==e?void 0:e.dragOverlay}}),[null==e?void 0:e.draggable,null==e?void 0:e.droppable,null==e?void 0:e.dragOverlay])}(u),{droppableRects:I,measureDroppableContainers:$,measuringScheduled:z}=function(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,a]=Hd(null),{frequency:s,measure:l,strategy:c}=o,d=Yd(e),u=function(){switch(c){case np.Always:return!1;case np.BeforeDragging:return n;default:return!n}}(),p=wd(u),h=Wd(function(e){void 0===e&&(e=[]),p.current||a(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[p]),m=Yd(null),g=Ed(t=>{if(u&&!n)return op;if(!t||t===op||d.current!==e||null!=i){const t=new Map;for(let n of e){if(!n)continue;if(i&&i.length>0&&!i.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,r=e?new ju(l(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,i,n,u,l]);return Ud(()=>{d.current=e},[e]),Ud(()=>{u||h()},[n,u]),Ud(()=>{i&&i.length>0&&a(null)},[JSON.stringify(i)]),Ud(()=>{u||"number"!=typeof s||null!==m.current||(m.current=setTimeout(()=>{h(),m.current=null},s))},[s,u,h,...r]),{droppableRects:g,measureDroppableContainers:h,measuringScheduled:null!=i}}(P,{dragging:w,dependencies:[k.x,k.y],config:F.droppable}),B=function(e,t){const n=null!=t?e.get(t):void 0,r=n?n.node.current:null;return Ed(e=>{var n;return null==t?null:null!=(n=null!=r?r:e)?n:null},[r,t])}(C,E),q=Vd(()=>N?Ld(N):null,[N]),K=function(){const e=!1===(null==T?void 0:T.autoScrollEnabled),t="object"==typeof s?!1===s.enabled:!1===s,n=w&&!e&&!t;if("object"==typeof s)return{...s,enabled:n};return{enabled:n}}(),U=function(e,t){return ip(e,t)}(B,F.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=Yd(!1),{x:a,y:s}="boolean"==typeof o?{x:o,y:o}:o;yd(()=>{if(!a&&!s||!t)return void(i.current=!1);if(i.current||!r)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const o=pu(n(e),r);if(a||(o.x=0),s||(o.y=0),i.current=!0,Math.abs(o.x)>0||Math.abs(o.y)>0){const t=xu(e);t&&t.scrollBy({top:o.y,left:o.x})}},[t,a,s,r,n])}({activeNode:null!=E?C.get(E):null,config:K.layoutShiftCompensation,initialRect:U,measure:F.draggable.measure});const H=lp(B,F.draggable.measure,U),W=lp(B?B.parentElement:null),V=Yd({activatorEvent:null,active:null,activeNode:B,collisionRect:null,collisions:null,droppableRects:I,draggableNodes:C,draggingNode:null,draggingNodeRect:null,droppableContainers:_,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Y=_.getNodeFor(null==(t=V.current.over)?void 0:t.id),X=function(e){let{measure:t}=e;const[n,r]=Hd(null),o=ap({callback:Wd(e=>{for(const{target:n}of e)if(fd(n)){r(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),i=Wd(e=>{const n=hp(e);null==o||o.disconnect(),n&&(null==o||o.observe(n)),r(n?t(n):null)},[t,o]),[a,s]=Cd(i);return Vd(()=>({nodeRef:a,rect:n,setRef:s}),[n,a,s])}({measure:F.dragOverlay.measure}),J=null!=(n=X.nodeRef.current)?n:B,G=w?null!=(r=X.rect)?r:H:null,Q=Boolean(X.nodeRef.current&&X.rect),Z=pu(ee=Q?null:H,ip(ee));var ee;const te=up(J?md(J):null),ne=function(e){const t=Yd(e),n=Ed(n=>e?n&&n!==cp&&e&&t.current&&e.parentNode===t.current.parentNode?n:yu(e):cp,[e]);return Ud(()=>{t.current=e},[e]),n}(w?null!=Y?Y:B:null),re=function(e,t){void 0===t&&(t=vu);const[n]=e,r=up(n?md(n):null),[o,i]=Hd(pp);function a(){i(()=>e.length?e.map(e=>Su(e)?r:new ju(t(e),e)):pp)}const s=ap({callback:a});return yd(()=>{null==s||s.disconnect(),a(),e.forEach(e=>null==s?void 0:s.observe(e))},[e]),o}(ne),oe=_p(p,{transform:{x:k.x-Z.x,y:k.y-Z.y,scaleX:1,scaleY:1},activatorEvent:N,active:A,activeNodeRect:H,containerNodeRect:W,draggingNodeRect:G,over:V.current.over,overlayNodeRect:X.rect,scrollableAncestors:ne,scrollableAncestorRects:re,windowRect:te}),ie=q?Ad(q,k):null,ae=function(e){const[t,n]=Hd(null),r=Yd(e),o=Wd(e=>{const t=wu(e.target);t&&n(e=>e?(e.set(t,ku(t)),new Map(e)):null)},[]);return Ud(()=>{const t=r.current;if(e!==t){i(t);const a=e.map(e=>{const t=wu(e);return t?(t.addEventListener("scroll",o,{passive:!0}),[t,ku(t)]):null}).filter(e=>null!=e);n(a.length?new Map(a):null),r.current=e}return()=>{i(e),i(t)};function i(e){e.forEach(e=>{const t=wu(e);null==t||t.removeEventListener("scroll",o)})}},[o,e]),Vd(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>Ad(e,t),su):Lu(e):su,[e,t])}(ne),se=dp(ae),le=dp(ae,[H]),ce=Ad(oe,se),de=G?hu(G,oe):null,ue=A&&de?d({active:A,collisionRect:de,droppableRects:I,droppableContainers:P,pointerCoordinates:ie}):null,pe=function(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}(ue,"id"),[he,me]=Hd(null),ge=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(Q?oe:Ad(oe,le),null!=(o=null==he?void 0:he.rect)?o:null,H),fe=Yd(null),ve=Wd((e,t)=>{let{sensor:n,options:r}=t;if(null==O.current)return;const o=C.get(O.current);if(!o)return;const i=e.nativeEvent,a=new n({active:O.current,activeNode:o,event:i,options:r,context:V,onAbort(e){if(!C.get(e))return;const{onDragAbort:t}=j.current,n={id:e};null==t||t(n),v({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!C.get(e))return;const{onDragPending:o}=j.current,i={id:e,constraint:t,initialCoordinates:n,offset:r};null==o||o(i),v({type:"onDragPending",event:i})},onStart(e){const t=O.current;if(null==t)return;const n=C.get(t);if(!n)return;const{onDragStart:r}=j.current,o={activatorEvent:i,active:{id:t,data:n.data,rect:R}};eu(()=>{null==r||r(o),x(Rp.Initializing),f({type:iu.DragStart,initialCoordinates:e,active:t}),v({type:"onDragStart",event:o}),L(fe.current),D(i)})},onMove(e){f({type:iu.DragMove,coordinates:e})},onEnd:s(iu.DragEnd),onCancel:s(iu.DragCancel)});function s(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:o}=V.current;let a=null;if(t&&o){const{cancelDrop:s}=j.current;if(a={activatorEvent:i,active:t,collisions:n,delta:o,over:r},e===iu.DragEnd&&"function"==typeof s){await Promise.resolve(s(a))&&(e=iu.DragCancel)}}O.current=null,eu(()=>{f({type:e}),x(Rp.Uninitialized),me(null),L(null),D(null),fe.current=null;const t=e===iu.DragEnd?"onDragEnd":"onDragCancel";if(a){const e=j.current[t];null==e||e(a),v({type:t,event:a})}})}}fe.current=a},[C]),be=Wd((e,t)=>(n,r)=>{const o=n.nativeEvent,i=C.get(r);if(null!==O.current||!i||o.dndKit||o.defaultPrevented)return;const a={active:i};!0===e(n,t.options,a)&&(o.dndKit={capturedBy:t.sensor},O.current=r,ve(n,t))},[C,ve]),ye=function(e,t){return Vd(()=>e.reduce((e,n)=>{const{sensor:r}=n;return[...e,...r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}))]},[]),[e,t])}(c,be);!function(e){Ud(()=>{if(!ud)return;const t=e.map(e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()});return()=>{for(const e of t)null==e||e()}},e.map(e=>{let{sensor:t}=e;return t}))}(c),yd(()=>{H&&y===Rp.Initializing&&x(Rp.Initialized)},[H,y]),Ud(()=>{const{onDragMove:e}=j.current,{active:t,activatorEvent:n,collisions:r,over:o}=V.current;if(!t||!n)return;const i={active:t,activatorEvent:n,collisions:r,delta:{x:ce.x,y:ce.y},over:o};eu(()=>{null==e||e(i),v({type:"onDragMove",event:i})})},[ce.x,ce.y]),Ud(()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:o}=V.current;if(!e||null==O.current||!t||!o)return;const{onDragOver:i}=j.current,a=r.get(pe),s=a&&a.rect.current?{id:a.id,rect:a.rect.current,data:a.data,disabled:a.disabled}:null,l={active:e,activatorEvent:t,collisions:n,delta:{x:o.x,y:o.y},over:s};eu(()=>{me(s),null==i||i(l),v({type:"onDragOver",event:l})})},[pe]),yd(()=>{V.current={activatorEvent:N,active:A,activeNode:B,collisionRect:de,collisions:ue,droppableRects:I,draggableNodes:C,draggingNode:J,draggingNodeRect:G,droppableContainers:_,over:he,scrollableAncestors:ne,scrollAdjustedTranslate:ce},R.current={initial:G,translated:de}},[A,B,ue,de,C,J,G,I,_,he,ne,ce]),ep({...K,delta:k,draggingRect:de,pointerCoordinates:ie,scrollableAncestors:ne,scrollableAncestorRects:re});const xe=Vd(()=>({active:A,activeNode:B,activeNodeRect:H,activatorEvent:N,collisions:ue,containerNodeRect:W,dragOverlay:X,draggableNodes:C,droppableContainers:_,droppableRects:I,over:he,measureDroppableContainers:$,scrollableAncestors:ne,scrollableAncestorRects:re,measuringConfiguration:F,measuringScheduled:z,windowRect:te}),[A,B,H,N,ue,W,X,C,_,I,he,$,ne,re,F,z,te]),we=Vd(()=>({activatorEvent:N,activators:ye,active:A,activeNodeRect:H,ariaDescribedById:{draggable:M},dispatch:f,draggableNodes:C,over:he,measureDroppableContainers:$}),[N,ye,A,H,f,M,C,he,$]);return Bd.createElement(tu.Provider,{value:b},Bd.createElement(xp.Provider,{value:we},Bd.createElement(wp.Provider,{value:xe},Bd.createElement(Sp.Provider,{value:ge},l)),Bd.createElement(kp,{disabled:!1===(null==a?void 0:a.restoreFocus)})),Bd.createElement(ou,{...a,hiddenTextDescribedById:M}))});const Ap=qd(null),Op="button";function Tp(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=Sd("Draggable"),{activators:a,activatorEvent:s,active:l,activeNodeRect:c,ariaDescribedById:d,draggableNodes:u,over:p}=Kd(xp),{role:h=Op,roleDescription:m="draggable",tabIndex:g=0}=null!=o?o:{},f=(null==l?void 0:l.id)===t,v=Kd(f?Sp:Ap),[b,y]=Cd(),[x,w]=Cd(),E=function(e,t){return Vd(()=>e.reduce((e,n)=>{let{eventName:r,handler:o}=n;return e[r]=e=>{o(e,t)},e},{}),[e,t])}(a,t),C=wd(n);yd(()=>(u.set(t,{id:t,key:i,node:b,activatorNode:x,data:C}),()=>{const e=u.get(t);e&&e.key===i&&u.delete(t)}),[u,t]);return{active:l,activatorEvent:s,activeNodeRect:c,attributes:Vd(()=>({role:h,tabIndex:g,"aria-disabled":r,"aria-pressed":!(!f||h!==Op)||void 0,"aria-roledescription":m,"aria-describedby":d.draggable}),[r,h,g,f,m,d.draggable]),isDragging:f,listeners:r?void 0:E,node:b,over:p,setNodeRef:y,setActivatorNodeRef:w,transform:v}}const Lp={timeout:25};function Np(e){let{animation:t,children:n}=e;const[r,o]=Hd(null),[i,a]=Hd(null),s=kd(n);return n||r||!s||o(s),yd(()=>{if(!i)return;const e=null==r?void 0:r.key,n=null==r?void 0:r.props.id;null!=e&&null!=n?Promise.resolve(t(n,i)).then(()=>{o(null)}):o(null)},[t,r,i]),Bd.createElement(Bd.Fragment,null,n,r?Gd(r,{ref:a}):null)}const Dp={x:0,y:0,scaleX:1,scaleY:1};function jp(e){let{children:t}=e;return Bd.createElement(xp.Provider,{value:yp},Bd.createElement(Sp.Provider,{value:Dp},t))}const Mp={position:"fixed",touchAction:"none"},Pp=e=>Td(e)?"transform 250ms ease":void 0,Fp=Qd((e,t)=>{let{as:n,activatorEvent:r,adjustScale:o,children:i,className:a,rect:s,style:l,transform:c,transition:d=Pp}=e;if(!s)return null;const u=o?c:{...c,scaleX:1,scaleY:1},p={...Mp,width:s.width,height:s.height,top:s.top,left:s.left,transform:Nd.Transform.toString(u),transformOrigin:o&&r?lu(r,s):void 0,transition:"function"==typeof d?d(r):d,...l};return Bd.createElement(n,{className:a,style:p,ref:t},i)}),Ip={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Nd.Transform.toString(t)},{transform:Nd.Transform.toString(n)}]},sideEffects:($p={styles:{active:{opacity:"0"}}},e=>{let{active:t,dragOverlay:n}=e;const r={},{styles:o,className:i}=$p;if(null!=o&&o.active)for(const[e,n]of Object.entries(o.active))void 0!==n&&(r[e]=t.node.style.getPropertyValue(e),t.node.style.setProperty(e,n));if(null!=o&&o.dragOverlay)for(const[e,t]of Object.entries(o.dragOverlay))void 0!==t&&n.node.style.setProperty(e,t);return null!=i&&i.active&&t.node.classList.add(i.active),null!=i&&i.dragOverlay&&n.node.classList.add(i.dragOverlay),function(){for(const[e,n]of Object.entries(r))t.node.style.setProperty(e,n);null!=i&&i.active&&t.node.classList.remove(i.active)}})};var $p;function zp(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return xd((e,i)=>{if(null===t)return;const a=n.get(e);if(!a)return;const s=a.node.current;if(!s)return;const l=hp(i);if(!l)return;const{transform:c}=md(i).getComputedStyle(i),d=gu(c);if(!d)return;const u="function"==typeof t?t:function(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...Ip,...e};return e=>{let{active:i,dragOverlay:a,transform:s,...l}=e;if(!t)return;const c={x:a.rect.left-i.rect.left,y:a.rect.top-i.rect.top},d={scaleX:1!==s.scaleX?i.rect.width*s.scaleX/a.rect.width:1,scaleY:1!==s.scaleY?i.rect.height*s.scaleY/a.rect.height:1},u={x:s.x-c.x,y:s.y-c.y,...d},p=o({...l,active:i,dragOverlay:a,transform:{initial:s,final:u}}),[h]=p,m=p[p.length-1];if(JSON.stringify(h)===JSON.stringify(m))return;const g=null==r?void 0:r({active:i,dragOverlay:a,...l}),f=a.node.animate(p,{duration:t,easing:n,fill:"forwards"});return new Promise(e=>{f.onfinish=()=>{null==g||g(),e()}})}}(t);return Nu(s,o.draggable.measure),u({active:{id:e,data:a.data,node:s,rect:o.draggable.measure(s)},draggableNodes:n,dragOverlay:{node:i,rect:o.dragOverlay.measure(l)},droppableContainers:r,measuringConfiguration:o,transform:d})})}let Bp=0;function qp(e){return Vd(()=>{if(null!=e)return Bp++,Bp},[e])}const Kp=Bd.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:o,transition:i,modifiers:a,wrapperElement:s="div",className:l,zIndex:c=999}=e;const{activatorEvent:d,active:u,activeNodeRect:p,containerNodeRect:h,draggableNodes:m,droppableContainers:g,dragOverlay:f,over:v,measuringConfiguration:b,scrollableAncestors:y,scrollableAncestorRects:x,windowRect:w}=Kd(wp),E=Kd(Sp),C=qp(null==u?void 0:u.id),k=_p(a,{activatorEvent:d,active:u,activeNodeRect:p,containerNodeRect:h,draggingNodeRect:f.rect,over:v,overlayNodeRect:f.rect,scrollableAncestors:y,scrollableAncestorRects:x,transform:E,windowRect:w}),_=ip(p),S=zp({config:r,draggableNodes:m,droppableContainers:g,measuringConfiguration:b}),R=_?f.setRef:void 0;return Bd.createElement(jp,null,Bd.createElement(Np,{animation:S},u&&C?Bd.createElement(Fp,{key:C,id:u.id,ref:R,as:s,activatorEvent:d,adjustScale:t,className:l,transition:i,rect:_,style:{zIndex:c,...o},transform:k},n):null))}),Up=n,{useEffect:Hp}=n,{useRef:Wp}=n,Vp=t,{styled:Yp}=r,{Chip:Xp}=o,{renderMath:Jp}=c;function Gp(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],i=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=i(n)):"call"!==o&&"optionalCall"!==o||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}const Qp=Yp("span")(({theme:e,disabled:t})=>({border:`solid 0px ${e.palette.primary.main}`,borderRadius:e.spacing(2),margin:e.spacing(.5),transform:"translate(0, 0)",display:"inline-flex",...t&&{}})),Zp=Yp(Xp)(()=>({backgroundColor:es(),border:`1px solid ${Va()}`,color:Va(),alignItems:"center",display:"inline-flex",height:"initial",minHeight:"32px",fontSize:"inherit",whiteSpace:"pre-wrap",maxWidth:"374px",pointerEvents:"none",borderRadius:"3px",paddingTop:"12px",paddingBottom:"12px","&.Mui-disabled":{opacity:1}})),eh=Yp("span")(()=>({whiteSpace:"normal","& img":{display:"block",padding:"2px 0"},"& mjx-frac":{fontSize:"120% !important"}}));function th({choice:e,disabled:t,instanceId:n}){const r=Wp(null),{attributes:o,listeners:i,setNodeRef:a,isDragging:s}=Tp({id:`choice-${e.id}`,data:{choice:e,instanceId:n,fromChoice:!0,type:"MaskBlank"},disabled:t});return Hp(()=>{Jp(r.current)},[e.value]),Up.createElement(Qp,{ref:a,style:s?{width:Gp([r,"access",e=>e.current,"optionalAccess",e=>e.offsetWidth]),height:Gp([r,"access",e=>e.current,"optionalAccess",e=>e.offsetHeight])}:{},disabled:t,...i,...o},Up.createElement(Zp,{clickable:!1,disabled:t,ref:r,label:Up.createElement(eh,{dangerouslySetInnerHTML:{__html:e.value}})}))}th.propTypes={choice:Vp.object.isRequired,disabled:Vp.bool,instanceId:Vp.oneOfType([Vp.string,Vp.number])};const nh=n,rh=t,{DragDroppablePlaceholder:oh}=v;class ih extends nh.Component{constructor(...e){super(...e),ih.prototype.__init.call(this)}static __initStatic(){this.propTypes={disabled:rh.bool,duplicates:rh.bool,choices:rh.arrayOf(rh.shape({label:rh.string,value:rh.string})),value:rh.object,choicePosition:rh.string.isRequired,instanceId:rh.string}}__init(){this.getStyleForWrapper=()=>{const{choicePosition:e}=this.props;switch(e){case"above":return{margin:"0 0 40px 0"};case"below":return{margin:"40px 0 0 0"};case"right":return{margin:"0 0 0 40px"};default:return{margin:"0 40px 0 0"}}}}render(){const{disabled:e,duplicates:t,choices:n,value:r,instanceId:o}=this.props,i=n.filter(e=>{if(!0===t)return!0;const n=(o=t=>t===e.id,function(e,t){var n;return yn(e,function(e,r,o){if(t(e,r,o))return n=r,!1}),n}(r,gn(o)));var o;return void 0===n}),a={...this.getStyleForWrapper(),minWidth:"100px"};return nh.createElement("div",{style:a},nh.createElement(oh,{disabled:e,instanceId:o},i.map((t,n)=>nh.createElement(th,{key:`${t.value}-${n}`,disabled:e,choice:t,instanceId:o}))))}}ih.__initStatic();const ah=n,{useEffect:sh}=n,{useRef:lh}=n,{useState:ch}=n,dh=t,uh=i,{styled:ph}=r,{Chip:hh}=o,mh=s,{renderMath:gh}=c;function fh(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],i=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=i(n)):"call"!==o&&"optionalCall"!==o||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}uh("pie-lib:mask-markup:blank");const vh=ph("span")(({dragged:e,over:t})=>({border:`solid 0px ${Ha("primary",Ua.PRIMARY)}`,minWidth:"200px",touchAction:"none",overflow:"hidden",whiteSpace:"nowrap",opacity:1,...t&&{whiteSpace:"nowrap",overflow:"hidden"},...e&&{opacity:.5}})),bh=ph(hh)(()=>({backgroundColor:Ga(),border:`2px dashed ${Va()}`,touchAction:"none",color:Va(),fontSize:"inherit",maxWidth:"374px",position:"relative",borderRadius:"3px","&.over":{whiteSpace:"nowrap",overflow:"hidden"},"&.parentOver":{border:`1px solid ${f[500]}`,backgroundColor:`${f[300]}`},"&.correct":{border:`solid 1px ${Ya()}`},"&.incorrect":{border:`solid 1px ${Xa()}`},"&.Mui-disabled":{opacity:1}})),yh=ph("span")(()=>({whiteSpace:"normal",pointerEvents:"none","& img":{display:"block",padding:"2px 0"},"& p":{marginTop:"0",marginBottom:"0"},"& mjx-frac":{fontSize:"120% !important"},"&.over":{whiteSpace:"nowrap",overflow:"hidden"},"&.hidden":{color:"transparent",opacity:0},"&.dragged":{position:"absolute",left:16,maxWidth:"60px",top:"50%",transform:"translateY(-50%)"}}));function xh({disabled:e,choice:t,isOver:n,isDragging:r,dragItem:o,correct:i,emptyResponseAreaWidth:a,emptyResponseAreaHeight:s}){const l=lh(null),c=lh(null),d=lh(null),[u,p]=ch({height:0,width:0}),h=()=>{g()},m=()=>{const e=fh([c,"access",e=>e.current,"optionalAccess",e=>e.querySelector,"call",e=>e("img")]);e?e.onload=h:setTimeout(()=>{g()},300)},g=()=>{if(c.current&&l.current){l.current.style.width="auto",l.current.style.height="auto",l.current.offsetHeight;const e=(()=>{if(!c.current)return null;if(c.current.querySelector("mjx-container")&&c.current.parentElement)return c.current.parentElement;return c.current.querySelector("img")||c.current})()||c.current,t=e.getBoundingClientRect(),n=(t.width||e.offsetWidth||0)+24,r=Math.max(t.height||0,e.offsetHeight||0,e.scrollHeight||0,c.current.scrollHeight||0)+24,o=parseFloat(a)||0,i=parseFloat(s)||0,d=n<=o?o:n,u=r<=i?i:r;p(e=>({width:d>o?d:e.width,height:u>i?u:e.height})),l.current.style.width=`${d}px`,l.current.style.height=`${u}px`}};sh(()=>{m()},[]),sh(()=>{l.current&&gh(l.current)},[n,fh([o,"optionalAccess",e=>e.choice,"optionalAccess",e=>e.value])]),sh(()=>{t?m():p({height:0,width:0})},[t]),sh(()=>{n||r||(d.current={width:l.current.offsetWidth,height:l.current.offsetHeight})},[t,n,r]);const f=o&&n&&o.choice&&o.choice.value,v=t&&t.value,b=n||r?{width:fh([d,"access",e=>e.current,"optionalAccess",e=>e.width]),height:fh([d,"access",e=>e.current,"optionalAccess",e=>e.height])}:(()=>{const e=isNaN(parseFloat(a))?0:parseFloat(a),t=isNaN(parseFloat(s))?0:parseFloat(s);return{...{height:u.height||t,width:u.width||e},...e?{}:{minWidth:90},...t?{}:{minHeight:32}}})();return ah.createElement(bh,{clickable:!1,disabled:e,ref:l,component:"span",label:ah.createElement(ah.Fragment,null,ah.createElement(yh,{ref:c,draggable:!0,className:mh({over:n,hidden:f}),dangerouslySetInnerHTML:{__html:v||""}}),f&&ah.createElement(yh,{draggable:!0,className:mh({over:n,dragged:!0}),dangerouslySetInnerHTML:{__html:f||""}})),className:mh({over:n,parentOver:n,correct:void 0!==i&&i,incorrect:void 0!==i&&!i}),variant:e?"outlined":void 0,style:b})}function wh({id:e,disabled:t,duplicates:n,choice:r,correct:o,onChange:i,emptyResponseAreaWidth:a,emptyResponseAreaHeight:s,instanceId:l}){const{attributes:c,listeners:d,setNodeRef:u,transform:p,isDragging:h}=Tp({id:`mask-blank-drag-${e}`,disabled:t||!r,data:{id:e,choice:r,instanceId:l,fromChoice:!1,type:"MaskBlank"}}),{setNodeRef:m,isOver:g,active:f}=function(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=Sd("Droppable"),{active:a,dispatch:s,over:l,measureDroppableContainers:c}=Kd(xp),d=Yd({disabled:n}),u=Yd(!1),p=Yd(null),h=Yd(null),{disabled:m,updateMeasurementsFor:g,timeout:f}={...Lp,...o},v=wd(null!=g?g:r),b=ap({callback:Wd(()=>{u.current?(null!=h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{c(Array.isArray(v.current)?v.current:[v.current]),h.current=null},f)):u.current=!0},[f]),disabled:m||!a}),y=Wd((e,t)=>{b&&(t&&(b.unobserve(t),u.current=!1),e&&b.observe(e))},[b]),[x,w]=Cd(y),E=wd(t);return Ud(()=>{b&&x.current&&(b.disconnect(),u.current=!1,b.observe(x.current))},[x,b]),Ud(()=>(s({type:iu.RegisterDroppable,element:{id:r,key:i,disabled:n,node:x,rect:p,data:E}}),()=>s({type:iu.UnregisterDroppable,key:i,id:r})),[r]),Ud(()=>{n!==d.current.disabled&&(s({type:iu.SetDroppableDisabled,id:r,key:i,disabled:n}),d.current.disabled=n)},[r,i,n,s]),{active:a,rect:p,isOver:(null==l?void 0:l.id)===r,node:x,over:l,setNodeRef:w}}({id:`mask-blank-drop-${e}`,data:{id:e,accepts:["MaskBlank"],instanceId:l}}),v={transform:Nd.Translate.toString(p)};return ah.createElement(vh,{ref:e=>{u(e),m(e)},style:v,dragged:h,over:g,...c,...d},ah.createElement(xh,{id:e,disabled:t,duplicates:n,choice:r,isOver:g,dragItem:fh([f,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current]),correct:o,onChange:i,emptyResponseAreaWidth:a,emptyResponseAreaHeight:s,instanceId:l}))}xh.defaultProps={emptyResponseAreaWidth:0,emptyResponseAreaHeight:0},xh.propTypes={id:dh.oneOfType([dh.string,dh.number]),disabled:dh.bool,duplicates:dh.bool,choice:dh.object,isOver:dh.bool,dragItem:dh.object,correct:dh.bool,onChange:dh.func,emptyResponseAreaWidth:dh.oneOfType([dh.string,dh.number]),emptyResponseAreaHeight:dh.oneOfType([dh.string,dh.number]),instanceId:dh.string},wh.defaultProps={emptyResponseAreaWidth:0,emptyResponseAreaHeight:0},wh.propTypes={id:dh.oneOfType([dh.string,dh.number]),disabled:dh.bool,duplicates:dh.bool,choice:dh.object,correct:dh.bool,onChange:dh.func,emptyResponseAreaWidth:dh.oneOfType([dh.string,dh.number]),emptyResponseAreaHeight:dh.oneOfType([dh.string,dh.number]),instanceId:dh.string};const Eh=n,Ch=t,{DragProvider:kh}=v;function _h(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],i=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=i(n)):"call"!==o&&"optionalCall"!==o||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}const Sh=id("blank",e=>(t,n,r)=>{const o=_h([t,"access",e=>e.data,"optionalAccess",e=>e.dataset])||{};if("blank"===o.component){const{disabled:i,duplicates:a,correctResponse:s,feedback:l,showCorrectAnswer:c,emptyResponseAreaWidth:d,emptyResponseAreaHeight:u,instanceId:p,isDragging:h}=e,m=c?s[o.id]:n[o.id],g=m&&e.choices.find(e=>e.id===m);return Eh.createElement(wh,{key:`${t.type}-${o.id}`,correct:c||l&&l[o.id],disabled:i,duplicates:a,choice:g,id:o.id,emptyResponseAreaWidth:d,emptyResponseAreaHeight:u,onChange:(e,t)=>{const o={...n};void 0===t?delete o[e]:o[e]=t,r(o)},instanceId:p,isDragging:h})}});class Rh extends Eh.Component{constructor(e){super(e),Rh.prototype.__init.call(this),Rh.prototype.__init2.call(this),Rh.prototype.__init3.call(this),Rh.prototype.__init4.call(this),this.state={activeDragItem:null,dropAnimation:void 0}}static __initStatic(){this.propTypes={markup:Ch.string,layout:Ch.object,choicesPosition:Ch.string,choices:Ch.array,value:Ch.object,onChange:Ch.func,duplicates:Ch.bool,disabled:Ch.bool,feedback:Ch.object,correctResponse:Ch.object,showCorrectAnswer:Ch.bool,emptyResponseAreaWidth:Ch.oneOfType([Ch.string,Ch.number]),emptyResponseAreaHeight:Ch.oneOfType([Ch.string,Ch.number]),instanceId:Ch.string}}static __initStatic2(){this.defaultProps={instanceId:"drag-in-the-blank"}}__init(){this.handleDragStart=e=>{const{active:t}=e;_h([t,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current])&&this.setState({activeDragItem:t.data.current,dropAnimation:void 0})}}__init2(){this.renderDragOverlay=()=>{const{activeDragItem:e}=this.state;return e&&"MaskBlank"===e.type?Eh.createElement(th,{disabled:e.disabled,choice:e.choice,instanceId:e.instanceId}):null}}__init3(){this.handleDragEnd=e=>{const{active:t,over:n}=e,{onChange:r,value:o}=this.props,i=_h([t,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current]),a=_h([n,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current]),s=!!t&&!!n&&"MaskBlank"===_h([i,"optionalAccess",e=>e.type])&&_h([a,"optionalAccess",e=>e.accepts,"optionalAccess",e=>e.includes,"call",e=>e("MaskBlank")]);if(this.setState({activeDragItem:null,dropAnimation:s?null:void 0}),!s||!r)return;const l=i,c=a.id;if(!0===a.toChoiceBoard){if(!l.fromChoice&&l.id){const e={...o};delete e[l.id],r(e)}}else if(!0===l.fromChoice){if(c&&"drag-in-the-blank-droppable"!==c){const e={...o};e[c]=l.choice.id,r(e)}}else if(l.id&&l.id!==c){const e={...o};e[c]=l.choice.id,delete e[l.id],r(e)}}}__init4(){this.getPositionDirection=e=>{let t,n,r;switch(e){case"left":t="row",r="center";break;case"right":t="row-reverse",n="flex-end",r="center";break;case"below":t="column-reverse";break;default:t="column"}return{flexDirection:t,justifyContent:n,alignItems:r}}}render(){const{markup:e,duplicates:t,value:n,onChange:r,choicesPosition:o,choices:i,correctResponse:a,disabled:s,feedback:l,showCorrectAnswer:c,emptyResponseAreaWidth:d,emptyResponseAreaHeight:u,layout:p,instanceId:h}=this.props,m=o||"below",g={display:"flex",minWidth:"100px",...this.getPositionDirection(m)};return Eh.createElement(kh,{onDragStart:this.handleDragStart,onDragEnd:this.handleDragEnd,collisionDetection:uu},Eh.createElement("div",{ref:e=>this.rootRef=e,style:g},Eh.createElement(ih,{choicePosition:m,choices:i,value:n,duplicates:t,disabled:s,instanceId:h}),Eh.createElement(Sh,{elementType:"drag-in-the-blank",markup:e,layout:p,value:n,choices:i,onChange:r,disabled:s,duplicates:t,feedback:l,correctResponse:a,showCorrectAnswer:c,emptyResponseAreaWidth:d,emptyResponseAreaHeight:u,instanceId:h,isDragging:!!this.state.activeDragItem}),Eh.createElement(Kp,{style:{pointerEvents:"none"},dropAnimation:this.state.dropAnimation},this.renderDragOverlay())))}}Rh.__initStatic(),Rh.__initStatic2();const Ah=n,{styled:Oh}=r,Th=s;function Lh(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],i=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=i(n)):"call"!==o&&"optionalCall"!==o||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}let Nh,Dh;"undefined"!=typeof window&&(Nh=require("@pie-lib/editable-html-tip-tap").default,Dh=Oh(Nh)(()=>({display:"inline-block",verticalAlign:"middle",margin:"4px",borderRadius:"4px",border:`1px solid ${Ha("black",Ua.BLACK)}`,"&.correct":{border:`1px solid ${Ya()}`},"&.incorrect":{border:`1px solid ${Xa()}`}})));id("input",e=>(t,n)=>{const{adjustedLimit:r,disabled:o,feedback:i,showCorrectAnswer:a,maxLength:s,spellCheck:l,pluginProps:c,onChange:d}=e,u=Lh([t,"access",e=>e.data,"optionalAccess",e=>e.dataset])||{};if("input"===u.component){const p=(e.choices&&u&&e.choices[u.id]||[])[0],h=a?p&&p.label:n[u.id]||"",m=s&&s[u.id],g=i&&i[u.id],f=a||"correct"===g,v=!a&&"incorrect"===g,b=e=>{const t={...n,[u.id]:e};d(t)},y=e=>{if("Enter"===e.key||13===e.keyCode)return!0};return Ah.createElement(Dh,{id:u.id,key:`${t.type}-input-${u.id}`,disabled:a||o,disableUnderline:!0,onChange:b,markup:h||"",charactersLimit:r?m:25,activePlugins:["languageCharacters"],pluginProps:c,languageCharactersProps:[{language:"spanish"}],spellCheck:l,adjustWidthForLimit:!0,onKeyDown:y,autoWidthToolbar:!0,toolbarOpts:{minWidth:"auto",noBorder:!0,isHidden:!!Lh([c,"optionalAccess",e=>e.characters,"optionalAccess",e=>e.disabled])},className:Th({correct:f,incorrect:v})})}});var jh=id("input",e=>(t,n,r)=>{const o=t.data&&t.data.dataset||{};if("input"===o.component)return e.customMarkMarkupComponent(o.id)});const Mh=n,Ph=t,{Button:Fh}=o,{InputLabel:Ih}=o,{Menu:$h}=o,{MenuItem:zh}=o,{ArrowDropDown:Bh}=l,{ArrowDropUp:qh}=l,{Close:Kh}=l,{Check:Uh}=l,{styled:Hh}=r,{renderMath:Wh}=c,Vh=Hh(Fh)(()=>({color:Va(),border:`1px solid ${Ha("border-gray",Ua.BORDER_GRAY)}`,borderRadius:"4px",justifyContent:"space-between",backgroundColor:Ga(),position:"relative",height:"45px",width:"fit-content",margin:"2px",textTransform:"none","& span":{paddingRight:"5px"},"& svg":{position:"absolute",right:0,top:"calc(50% - 12px)",pointerEvents:"none",color:Va(),marginLeft:"5px"},"&.Mui-focused":{outline:`3px solid ${Za()}`,outlineOffset:"2px",borderWidth:"3px"},"&.disabledCorrect":{borderWidth:"2px",borderColor:Ya(),color:`${Va()} !important`},"&.disabledIncorrect":{borderWidth:"2px",borderColor:Ja(),color:`${Va()} !important`}})),Yh=Hh($h)(()=>({backgroundColor:Ga(),border:`1px solid ${Ya()} !important`,"&:hover":{border:`1px solid ${Va()} `,borderColor:"initial"},"&:focus":{border:`1px solid ${Va()}`,borderColor:"initial"},"& .MuiList-root":{padding:0}})),Xh=Hh(zh)(()=>({height:24,overflow:"hidden",fontSize:"1rem",fontWeight:400,fontFamily:"inherit",lineHeight:"1.5em",whiteSpace:"nowrap",color:Va(),backgroundColor:Ga(),"&.Mui-focusVisible":{outline:`3px solid ${Za()}`,outlineOffset:"-1px",color:Va(),backgroundColor:Ga()},"&:hover":{color:Va(),backgroundColor:Qa()},boxSizing:"border-box",padding:"25px",borderRadius:"4px","&.selected":{color:`${Va()} !important`,backgroundColor:`${Ga()} !important`,"&:hover":{color:Va(),backgroundColor:`${Qa()} !important`}}})),Jh=Hh("span")(()=>({fontSize:"max(1rem, 14px)"})),Gh=Hh("span")(()=>({fontSize:"max(1rem, 14px)",position:"absolute",right:"10px"})),Qh=Hh(Ih)(()=>({position:"absolute",left:"-10000px",top:"auto",width:"1px",height:"1px",overflow:"hidden"})),Zh=Hh(Uh)(()=>({color:`${es()} !important`,position:"absolute",top:"-8px !important",left:"-8px",marginLeft:"0 !important",borderRadius:"50%",fontSize:"16px",padding:"2px","&.correct":{backgroundColor:Ya()},"&.incorrect":{backgroundColor:Ja()}})),em=Hh(Kh)(()=>({color:`${es()} !important`,position:"absolute",top:"-8px !important",left:"-8px",marginLeft:"0 !important",borderRadius:"50%",fontSize:"16px",padding:"2px","&.correct":{backgroundColor:Ya()},"&.incorrect":{backgroundColor:Ja()}}));class tm extends Mh.Component{static __initStatic(){this.propTypes={id:Ph.string,value:Ph.string,disabled:Ph.bool,onChange:Ph.func,correct:Ph.bool,choices:Ph.arrayOf(Ph.shape({value:Ph.string,label:Ph.string})),showCorrectAnswer:Ph.bool,singleQuery:Ph.bool,correctValue:Ph.string}}constructor(e){super(e),tm.prototype.__init.call(this),tm.prototype.__init2.call(this),tm.prototype.__init3.call(this),tm.prototype.__init4.call(this),tm.prototype.__init5.call(this),this.state={anchorEl:null,highlightedOptionId:null,menuWidth:null,previewValue:null},this.hiddenRef=Mh.createRef(),this.buttonRef=Mh.createRef(),this.previewRef=Mh.createRef(),this.elementRefs=[]}componentDidMount(){this.hiddenRef.current&&null===this.state.menuWidth&&this.setState({menuWidth:this.hiddenRef.current.clientWidth})}componentDidUpdate(e,t){const n=this.hiddenRef.current;if(!t.anchorEl&&this.state.anchorEl&&this.elementRefs.forEach(e=>{if(!e)return;const t=e.querySelector("[data-latex], [data-raw]"),n=e.querySelector("mjx-container"),r=e.querySelector('[data-math-handled="true"]');!t||r&&n||Wh(e)}),n){const e=n.clientWidth;e!==this.state.menuWidth&&(this.elementRefs.forEach(e=>{e&&Wh(e)}),Wh(n),this.setState({menuWidth:e}))}}__init(){this.handleClick=e=>this.setState({anchorEl:e.currentTarget})}__init2(){this.handleClose=()=>{const{value:e}=this.props;this.setState({anchorEl:null,previewValue:null,highlightedOptionId:null}),!e&&this.previewRef.current&&(this.previewRef.current.innerHTML="")}}__init3(){this.handleHighlight=e=>{const t={highlightedOptionId:`dropdown-option-${this.props.id}-${e}`};this.props.value||(t.previewValue=this.props.choices[e].value),this.setState(t)}}__init4(){this.handleSelect=(e,t)=>{this.props.onChange(this.props.id,e),this.handleHighlight(t),this.handleClose()}}__init5(){this.handleHover=e=>{if(this.props.value)return;const t=`dropdown-option-${this.props.id}-${e}`,n=this.state.previewValue;this.setState({highlightedOptionId:t,previewValue:n},()=>{const t=this.elementRefs[e],n=this.previewRef.current;t&&n&&(n.innerHTML=t.innerHTML)})}}getLabel(e,t){const n=(e||[]).find(e=>e.value===t);return n?n.label.trim():void 0}render(){const{id:e,correct:t,disabled:n,value:r,choices:o,showCorrectAnswer:i,singleQuery:a,correctValue:s}=this.props,{anchorEl:l}=this.state,c=Boolean(l),d=`dropdown-button-${e}`,u=`dropdown-menu-${e}`,p=`dropdown-value-${e}`;let h;this.elementRefs=[],n&&void 0!==t&&(h=t||i?"disabledCorrect":"disabledIncorrect");const m=parseInt(e,10)+1,g=a?"Query-label":`Query-label-${m}`,f=a?"Query":`Query ${m}`;let v=null;return n&&void 0!==t&&(v=t||i?Mh.createElement(Zh,{className:"correct"}):Mh.createElement(em,{className:"incorrect"})),Mh.createElement(Mh.Fragment,null,Mh.createElement("div",{ref:this.hiddenRef,style:{position:"absolute",visibility:"hidden",top:0,left:0},tabIndex:-1,"aria-hidden":"true"},(o||[]).map((e,t)=>Mh.createElement(Xh,{key:t,tabIndex:-1,"aria-hidden":"true"},Mh.createElement(Jh,{dangerouslySetInnerHTML:{__html:e.label}})))),Mh.createElement(Qh,{id:g,tabIndex:-1,"aria-hidden":"true"},f),Mh.createElement(Vh,{ref:this.buttonRef,style:{...this.state.menuWidth&&{minWidth:`calc(${this.state.menuWidth}px + 8px)`},borderWidth:c?"2px":"1px",transition:"border-width 0.2s ease-in-out"},"aria-controls":c?u:void 0,"aria-haspopup":"listbox","aria-expanded":c?"true":void 0,"aria-activedescendant":this.state.highlightedOptionId,onClick:this.handleClick,className:h,disabled:n,id:d,role:"combobox","aria-label":`Select an option for ${f}`,"aria-labelledby":p},v,Mh.createElement(Jh,{id:p,ref:this.previewRef,dangerouslySetInnerHTML:{__html:s||(c&&this.state.previewValue?this.getLabel(o,this.state.previewValue):this.getLabel(o,r)||"")}}),c?Mh.createElement(qh,null):Mh.createElement(Bh,null)),Mh.createElement(Yh,{id:u,anchorEl:l,keepMounted:!0,open:c,onClose:this.handleClose,getContentAnchorEl:null,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},transitionDuration:{enter:225,exit:195},slotProps:{paper:this.state.menuWidth?{style:{minWidth:this.state.menuWidth,padding:"4px"}}:void 0,list:{"aria-labelledby":d,role:"listbox",disablePadding:!0}}},(o||[]).map((t,n)=>{const o=`dropdown-option-${e}-${n}`;return Mh.createElement(Xh,{id:o,className:t.value===r?"selected":"",key:`${t.label}-${n}`,value:t.value,onClick:()=>this.handleSelect(t.value,n),role:"option","aria-selected":this.state.highlightedOptionId===o?"true":void 0,onMouseOver:()=>this.handleHover(n)},Mh.createElement(Jh,{ref:e=>this.elementRefs[n]=e,dangerouslySetInnerHTML:{__html:t.label}}),Mh.createElement(Gh,{dangerouslySetInnerHTML:{__html:t.value===r?" ✓":""}}))})))}}tm.__initStatic();const nm=n;id("dropdown",e=>(t,n,r)=>{const o=t.data&&t.data.dataset||{};if("dropdown"===o.component){const{choices:i,disabled:a,feedback:s,showCorrectAnswer:l}=e,c=i&&i[o.id]&&i[o.id].find(e=>e.correct),d=l?c&&c.value:n[o.id];return nm.createElement(tm,{key:`${t.type}-dropdown-${o.id}`,correct:s&&s[o.id]&&"correct"===s[o.id],disabled:a||l,value:d,correctValue:l?c&&c.label:void 0,id:o.id,onChange:r,choices:i[o.id],showCorrectAnswer:l,singleQuery:1==Object.keys(i).length})}});const rm=n,{useRef:om}=n,im=t,{styled:am}=r,sm="height ease-in 300ms, opacity ease-in 300ms",lm=am("div")(()=>({position:"relative",height:0,overflow:"hidden",display:"flex",visibility:"hidden",width:0,"&.enter":{transition:sm,opacity:1,height:"auto",width:"auto",visibility:"visible",minHeight:"25px"},"&.enter-done":{height:"auto",visibility:"visible",width:"auto",minHeight:"25px"},"&.exit":{transition:sm,opacity:0,height:0,visibility:"visible",width:0},"&.exit-done":{opacity:0,visibility:"hidden",height:0,width:0}})),cm=e=>{const{show:t,children:n,className:r}=e,o=om(null);return rm.createElement(Da,{nodeRef:o,in:t,appear:!0,mountOnEnter:!1,timeout:300,classNames:{enter:"enter",enterDone:"enter-done",exit:"exit",exitDone:"exit-done"}},rm.createElement(lm,{ref:o,className:r},n))};function dm(e,t){return null!=e?e:t()}function um(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],i=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=i(n)):"call"!==o&&"optionalCall"!==o||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}cm.propTypes={show:im.bool.isRequired,className:im.string,children:im.oneOfType([im.arrayOf(im.node),im.node]).isRequired};const pm=e=>"string"==typeof e,hm=()=>{let e,t;const n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},mm=e=>null==e?"":""+e,gm=/###/g,fm=e=>e&&e.indexOf("###")>-1?e.replace(gm,"."):e,vm=e=>!e||pm(e),bm=(e,t,n)=>{const r=pm(t)?t.split("."):t;let o=0;for(;o<r.length-1;){if(vm(e))return{};const t=fm(r[o]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++o}return vm(e)?{}:{obj:e,k:fm(r[o])}},ym=(e,t,n)=>{const{obj:r,k:o}=bm(e,t,Object);if(void 0!==r||1===t.length)return void(r[o]=n);let i=t[t.length-1],a=t.slice(0,t.length-1),s=bm(e,a,Object);for(;void 0===s.obj&&a.length;)i=`${a[a.length-1]}.${i}`,a=a.slice(0,a.length-1),s=bm(e,a,Object),um([s,"optionalAccess",e=>e.obj])&&void 0!==s.obj[`${s.k}.${i}`]&&(s.obj=void 0);s.obj[`${s.k}.${i}`]=n},xm=(e,t)=>{const{obj:n,k:r}=bm(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},wm=(e,t,n)=>{for(const r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?pm(e[r])||e[r]instanceof String||pm(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):wm(e[r],t[r],n):e[r]=t[r]);return e},Em=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Cm={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const km=e=>pm(e)?e.replace(/[&<>"'\/]/g,e=>Cm[e]):e;const _m=[" ",",","?","!",";"],Sm=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 n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}(20),Rm=(e,t,n=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}const r=t.split(n);let o=e;for(let e=0;e<r.length;){if(!o||"object"!=typeof o)return;let t,i="";for(let a=e;a<r.length;++a)if(a!==e&&(i+=n),i+=r[a],t=o[i],void 0!==t){if(["string","number","boolean"].indexOf(typeof t)>-1&&a<r.length-1)continue;e+=a-e+1;break}o=t}return o},Am=e=>um([e,"optionalAccess",e=>e.replace,"call",e=>e("_","-")]),Om={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){um([console,"optionalAccess",t=>t[e],"optionalAccess",e=>e.apply,"optionalCall",e=>e(console,t)])}};class Tm{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||Om,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,n,r){return r&&!this.debug?null:(pm(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new Tm(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new Tm(this.logger,e)}}var Lm=new Tm;class Nm{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);const n=this.observers[e].get(t)||0;this.observers[e].set(t,n+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,n])=>{for(let r=0;r<n;r++)e(...t)})}if(this.observers["*"]){Array.from(this.observers["*"].entries()).forEach(([n,r])=>{for(let o=0;o<r;o++)n.apply(n,[e,...t])})}}}class Dm extends Nm{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,n,r={}){const o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,i=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;e.indexOf(".")>-1?a=e.split("."):(a=[e,t],n&&(Array.isArray(n)?a.push(...n):pm(n)&&o?a.push(...n.split(o)):a.push(n)));const s=xm(this.data,a);return!s&&!t&&!n&&e.indexOf(".")>-1&&(e=a[0],t=a[1],n=a.slice(2).join(".")),!s&&i&&pm(n)?Rm(um([this,"access",e=>e.data,"optionalAccess",t=>t[e],"optionalAccess",e=>e[t]]),n,o):s}addResource(e,t,n,r,o={silent:!1}){const i=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator;let a=[e,t];n&&(a=a.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(a=e.split("."),r=t,t=a[1]),this.addNamespaces(t),ym(this.data,a,r),o.silent||this.emit("added",e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(const r in n)(pm(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,r,o,i={silent:!1,skipCopy:!1}){let a=[e,t];e.indexOf(".")>-1&&(a=e.split("."),r=n,n=t,t=a[1]),this.addNamespaces(t);let s=xm(this.data,a)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?wm(s,n,o):s={...s,...n},ym(this.data,a,s),i.silent||this.emit("added",e,t,n)}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 jm={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,o){return e.forEach(e=>{t=dm(um([this,"access",e=>e.processors,"access",t=>t[e],"optionalAccess",e=>e.process,"call",e=>e(t,n,r,o)]),()=>t)}),t}};const Mm=Symbol("i18next/PATH_KEY");function Pm(e,t){const{[Mm]:n}=e(function(){const e=[],t=Object.create(null);let n;return t.get=(r,o)=>(um([n,"optionalAccess",e=>e.revoke,"optionalCall",e=>e()]),o===Mm?e:(e.push(o),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}());return n.join(dm(um([t,"optionalAccess",e=>e.keySeparator]),()=>"."))}const Fm={},Im=e=>!pm(e)&&"boolean"!=typeof e&&"number"!=typeof e;class $m extends Nm{constructor(e,t={}){var n,r;super(),n=e,r=this,["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach(e=>{n[e]&&(r[e]=n[e])}),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=Lm.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const n={...t};if(null==e)return!1;const r=this.resolve(e,n);if(void 0===um([r,"optionalAccess",e=>e.res]))return!1;const o=Im(r.res);return!1!==n.returnObjects||!o}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let o=t.ns||this.options.defaultNS||[];const i=n&&e.indexOf(n)>-1,a=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,n)=>{t=t||"",n=n||"";const r=_m.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(0===r.length)return!0;const o=Sm.getRegExp(`(${r.map(e=>"?"===e?"\\?":e).join("|")})`);let i=!o.test(e);if(!i){const t=e.indexOf(n);t>0&&!o.test(e.substring(0,t))&&(i=!0)}return i})(e,n,r));if(i&&!a){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:pm(o)?[o]:o};const i=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(i[0])>-1)&&(o=i.shift()),e=i.join(r)}return{key:e,namespaces:pm(o)?[o]:o}}translate(e,t,n){let r="object"==typeof t?{...t}:t;if("object"!=typeof r&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof r&&(r={...r}),r||(r={}),null==e)return"";"function"==typeof e&&(e=Pm(e,{...this.options,...r})),Array.isArray(e)||(e=[String(e)]);const o=void 0!==r.returnDetails?r.returnDetails:this.options.returnDetails,i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,{key:a,namespaces:s}=this.extractFromKey(e[e.length-1],r),l=s[s.length-1];let c=void 0!==r.nsSeparator?r.nsSeparator:this.options.nsSeparator;void 0===c&&(c=":");const d=r.lng||this.language,u=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===um([d,"optionalAccess",e=>e.toLowerCase,"call",e=>e()]))return u?o?{res:`${l}${c}${a}`,usedKey:a,exactUsedKey:a,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:`${l}${c}${a}`:o?{res:a,usedKey:a,exactUsedKey:a,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:a;const p=this.resolve(e,r);let h=um([p,"optionalAccess",e=>e.res]);const m=um([p,"optionalAccess",e=>e.usedKey])||a,g=um([p,"optionalAccess",e=>e.exactUsedKey])||a,f=void 0!==r.joinArrays?r.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,b=void 0!==r.count&&!pm(r.count),y=$m.hasDefaultValue(r),x=b?this.pluralResolver.getSuffix(d,r.count,r):"",w=r.ordinal&&b?this.pluralResolver.getSuffix(d,r.count,{ordinal:!1}):"",E=b&&!r.ordinal&&0===r.count,C=E&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${x}`]||r[`defaultValue${w}`]||r.defaultValue;let k=h;v&&!h&&y&&(k=C);const _=Im(k),S=Object.prototype.toString.apply(k);if(!(v&&k&&_&&["[object Number]","[object Function]","[object RegExp]"].indexOf(S)<0)||pm(f)&&Array.isArray(k))if(v&&pm(f)&&Array.isArray(h))h=h.join(f),h&&(h=this.extendTranslation(h,e,r,n));else{let t=!1,o=!1;!this.isValidLookup(h)&&y&&(t=!0,h=C),this.isValidLookup(h)||(o=!0,h=a);const s=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&o?void 0:h,u=y&&C!==h&&this.options.updateMissing;if(o||t||u){if(this.logger.log(u?"updateKey":"missingKey",d,l,a,u?C:h),i){const e=this.resolve(a,{...r,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,r.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(r.lng||this.language):e.push(r.lng||this.language);const n=(e,t,n)=>{const o=y&&n!==h?n:s;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,o,u,r):um([this,"access",e=>e.backendConnector,"optionalAccess",e=>e.saveMissing])&&this.backendConnector.saveMissing(e,l,t,o,u,r),this.emit("missingKey",e,l,t,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{const t=this.pluralResolver.getSuffixes(e,r);E&&r[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],a+t,r[`defaultValue${t}`]||C)})}):n(e,a,C))}h=this.extendTranslation(h,e,r,p,n),o&&h===a&&this.options.appendNamespaceToMissingKey&&(h=`${l}${c}${a}`),(o||t)&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${c}${a}`:a,t?h:void 0,r))}else{if(!r.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(m,k,{...r,ns:s}):`key '${a} (${this.language})' returned an object instead of string.`;return o?(p.res=e,p.usedParams=this.getUsedParamsDetails(r),p):e}if(i){const e=Array.isArray(k),t=e?[]:{},n=e?g:m;for(const e in k)if(Object.prototype.hasOwnProperty.call(k,e)){const o=`${n}${i}${e}`;t[e]=y&&!h?this.translate(o,{...r,defaultValue:Im(C)?C[e]:void 0,joinArrays:!1,ns:s}):this.translate(o,{...r,joinArrays:!1,ns:s}),t[e]===o&&(t[e]=k[e])}h=t}}return o?(p.res=h,p.usedParams=this.getUsedParamsDetails(r),p):h}extendTranslation(e,t,n,r,o){if(um([this,"access",e=>e.i18nFormat,"optionalAccess",e=>e.parse]))e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const i=pm(e)&&(void 0!==um([n,"optionalAccess",e=>e.interpolation,"optionalAccess",e=>e.skipOnVariables])?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let a;if(i){const t=e.match(this.interpolator.nestingRegexp);a=t&&t.length}let s=n.replace&&!pm(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||r.usedLng,n),i){const t=e.match(this.interpolator.nestingRegexp);a<(t&&t.length)&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,(...e)=>um([o,"optionalAccess",e=>e[0]])!==e[0]||n.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null),n)),n.interpolation&&this.interpolator.reset()}const i=n.postProcess||this.options.postProcess,a=pm(i)?[i]:i;return null!=e&&um([a,"optionalAccess",e=>e.length])&&!1!==n.applyPostProcessor&&(e=jm.handle(a,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,o,i,a;return pm(e)&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(n))return;const s=this.extractFromKey(e,t),l=s.key;r=l;let c=s.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const d=void 0!==t.count&&!pm(t.count),u=d&&!t.ordinal&&0===t.count,p=void 0!==t.context&&(pm(t.context)||"number"==typeof t.context)&&""!==t.context,h=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);c.forEach(e=>{this.isValidLookup(n)||(a=e,Fm[`${h[0]}-${e}`]||!um([this,"access",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace])||um([this,"access",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace,"call",e=>e(a)])||(Fm[`${h[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${h.join(", ")}" won't get resolved as namespace "${a}" 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!!!")),h.forEach(r=>{if(this.isValidLookup(n))return;i=r;const a=[l];if(um([this,"access",e=>e.i18nFormat,"optionalAccess",e=>e.addLookupKeys]))this.i18nFormat.addLookupKeys(a,l,r,e,t);else{let e;d&&(e=this.pluralResolver.getSuffix(r,t.count,t));const n=`${this.options.pluralSeparator}zero`,o=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(t.ordinal&&0===e.indexOf(o)&&a.push(l+e.replace(o,this.options.pluralSeparator)),a.push(l+e),u&&a.push(l+n)),p){const r=`${l}${this.options.contextSeparator||"_"}${t.context}`;a.push(r),d&&(t.ordinal&&0===e.indexOf(o)&&a.push(r+e.replace(o,this.options.pluralSeparator)),a.push(r+e),u&&a.push(r+n))}}let s;for(;s=a.pop();)this.isValidLookup(n)||(o=s,n=this.getResource(r,e,s,t))}))})}),{res:n,usedKey:r,exactUsedKey:o,usedLng:i,usedNS:a}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,n,r={}){return um([this,"access",e=>e.i18nFormat,"optionalAccess",e=>e.getResource])?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!pm(e.replace);let r=n?e.replace:e;if(n&&void 0!==e.count&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(const e of t)delete r[e]}return r}static hasDefaultValue(e){const t="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,12)&&void 0!==e[n])return!0;return!1}}class zm{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Lm.create("languageUtils")}getScriptPartFromCode(e){if(!(e=Am(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=Am(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(pm(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 n=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(n)||(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;const n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;const r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>e===r?e:e.indexOf("-")<0&&r.indexOf("-")<0?void 0:e.indexOf("-")>0&&r.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===r||0===e.indexOf(r)&&r.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)),pm(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes((!1===t?[]:t)||this.options.fallbackLng||[],e),r=[],o=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return pm(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):pm(e)&&o(this.formatLanguageCode(e)),n.forEach(e=>{r.indexOf(e)<0&&o(this.formatLanguageCode(e))}),r}}const Bm={zero:0,one:1,two:2,few:3,many:4,other:5},qm={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Km{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=Lm.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const n=Am("dev"===e?"en":e),r=t.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:n,type:r});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let i;try{i=new Intl.PluralRules(n,{type:r})}catch(n){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),qm;if(!e.match(/-|_/))return qm;const r=this.languageUtils.getLanguagePartFromCode(e);i=this.getRule(r,t)}return this.pluralRulesCache[o]=i,i}needsPlural(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),um([n,"optionalAccess",e=>e.resolvedOptions,"call",e=>e(),"access",e=>e.pluralCategories,"access",e=>e.length])>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?n.resolvedOptions().pluralCategories.sort((e,t)=>Bm[e]-Bm[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):[]}getSuffix(e,t,n={}){const r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}const Um=(e,t,n,r=".",o=!0)=>{let i=((e,t,n)=>{const r=xm(e,n);return void 0!==r?r:xm(t,n)})(e,t,n);return!i&&o&&pm(n)&&(i=Rm(e,n,r),void 0===i&&(i=Rm(t,n,r))),i},Hm=e=>e.replace(/\$/g,"$$$$");class Wm{constructor(e={}){this.logger=Lm.create("interpolator"),this.options=e,this.format=um([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:n,useRawValueToEscape:r,prefix:o,prefixEscaped:i,suffix:a,suffixEscaped:s,formatSeparator:l,unescapeSuffix:c,unescapePrefix:d,nestingPrefix:u,nestingPrefixEscaped:p,nestingSuffix:h,nestingSuffixEscaped:m,nestingOptionsSeparator:g,maxReplaces:f,alwaysFormat:v}=e.interpolation;this.escape=void 0!==t?t:km,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==r&&r,this.prefix=o?Em(o):i||"{{",this.suffix=a?Em(a):s||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":d||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=u?Em(u):p||Em("$t("),this.nestingSuffix=h?Em(h):m||Em(")"),this.nestingOptionsSeparator=g||",",this.maxReplaces=f||1e3,this.alwaysFormat=void 0!==v&&v,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>um([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,n,r){let o,i,a;const s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=e=>{if(e.indexOf(this.formatSeparator)<0){const o=Um(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(o,void 0,n,{...r,...t,interpolationkey:e}):o}const o=e.split(this.formatSeparator),i=o.shift().trim(),a=o.join(this.formatSeparator).trim();return this.format(Um(t,s,i,this.options.keySeparator,this.options.ignoreJSONStructure),a,n,{...r,...t,interpolationkey:i})};this.resetRegExp();const c=um([r,"optionalAccess",e=>e.missingInterpolationHandler])||this.options.missingInterpolationHandler,d=void 0!==um([r,"optionalAccess",e=>e.interpolation,"optionalAccess",e=>e.skipOnVariables])?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>Hm(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?Hm(this.escape(e)):Hm(e)}].forEach(t=>{for(a=0;o=t.regex.exec(e);){const n=o[1].trim();if(i=l(n),void 0===i)if("function"==typeof c){const t=c(e,o,r);i=pm(t)?t:""}else if(r&&Object.prototype.hasOwnProperty.call(r,n))i="";else{if(d){i=o[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),i=""}else pm(i)||this.useRawValueToEscape||(i=mm(i));const s=t.safeValue(i);if(e=e.replace(o[0],s),d?(t.regex.lastIndex+=i.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,o,i;const a=(e,t)=>{const n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;const r=e.split(new RegExp(`${n}[ ]*{`));let o=`{${r[1]}`;e=r[0],o=this.interpolate(o,i);const a=o.match(/'/g),s=o.match(/"/g);(dm(um([a,"optionalAccess",e=>e.length]),()=>0)%2==0&&!s||s.length%2!=0)&&(o=o.replace(/'/g,'"'));try{i=JSON.parse(o),t&&(i={...t,...i})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${o}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];i={...n},i=i.replace&&!pm(i.replace)?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;const l=/{.*}/.test(r[1])?r[1].lastIndexOf("}")+1:r[1].indexOf(this.formatSeparator);if(-1!==l&&(s=r[1].slice(l).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,l)),o=t(a.call(this,r[1].trim(),i),i),o&&r[0]===e&&!pm(o))return o;pm(o)||(o=mm(o)),o||(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),o=""),s.length&&(o=s.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),o.trim())),e=e.replace(r[0],o),this.regexp.lastIndex=0}return e}}const Vm=e=>{const t={};return(n,r,o)=>{let i=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(i={...i,[o.interpolationkey]:void 0});const a=r+JSON.stringify(i);let s=t[a];return s||(s=e(Am(r),o),t[a]=s),s(n)}},Ym=e=>(t,n,r)=>e(Am(n),r)(t);class Xm{constructor(e={}){this.logger=Lm.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const n=t.cacheInBuiltFormats?Vm:Ym;this.formats={number:n((e,t)=>{const n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{const n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)}),datetime:n((e,t)=>{const n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{const n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")}),list:n((e,t)=>{const n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=Vm(t)}format(e,t,n,r={}){const o=t.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(e=>e.indexOf(")")>-1)){const e=o.findIndex(e=>e.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,e)].join(this.formatSeparator)}const i=o.reduce((e,t)=>{const{formatName:o,formatOptions:i}=(e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const o=r[1].substring(0,r[1].length-1);"currency"===t&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):"relativetime"===t&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach(e=>{if(e){const[t,...r]=e.split(":"),o=r.join(":").trim().replace(/^'+|'+$/g,""),i=t.trim();n[i]||(n[i]=o),"false"===o&&(n[i]=!1),"true"===o&&(n[i]=!0),isNaN(o)||(n[i]=parseInt(o,10))}})}return{formatName:t,formatOptions:n}})(t);if(this.formats[o]){let t=e;try{const a=um([r,"optionalAccess",e=>e.formatParams,"optionalAccess",e=>e[r.interpolationkey]])||{},s=a.locale||a.lng||r.locale||r.lng||n;t=this.formats[o](e,s,{...i,...r,...a})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${o}`),e},e);return i}}class Jm extends Nm{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=Lm.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],um([this,"access",e=>e.backend,"optionalAccess",e=>e.init,"optionalCall",e=>e(n,r.backend,r)])}queueLoad(e,t,n,r){const o={},i={},a={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{const a=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[a]=2:this.state[a]<0||(1===this.state[a]?void 0===i[a]&&(i[a]=!0):(this.state[a]=1,r=!1,void 0===i[a]&&(i[a]=!0),void 0===o[a]&&(o[a]=!0),void 0===s[t]&&(s[t]=!0)))}),r||(a[e]=!0)}),(Object.keys(o).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(o),pending:Object.keys(i),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){const r=e.split("|"),o=r[0],i=r[1];t&&this.emit("failedLoading",o,i,t),!t&&n&&this.store.addResourceBundle(o,i,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const a={};this.queue.forEach(n=>{((e,t,n)=>{const{obj:r,k:o}=bm(e,t,Object);r[o]=r[o]||[],r[o].push(n)})(n.loaded,[o],i),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach(e=>{a[e]||(a[e]={});const t=n.loaded[e];t.length&&t.forEach(t=>{void 0===a[e][t]&&(a[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,o=this.retryTimeout,i){if(!e.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:o,callback:i});this.readingCalls++;const a=(a,s)=>{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)}a&&s&&r<this.maxRetries?setTimeout(()=>{this.read.call(this,e,t,n,r+1,2*o,i)},o):i(a,s)},s=this.backend[n].bind(this.backend);if(2!==s.length)return s(e,t,a);try{const n=s(e,t);n&&"function"==typeof n.then?n.then(e=>a(null,e)).catch(a):a(null,n)}catch(e){a(e)}}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();pm(e)&&(e=this.languageUtils.toResolveHierarchy(e)),pm(t)&&(t=[t]);const o=this.queueLoad(e,t,n,r);if(!o.toLoad.length)return o.pending.length||r(),null;o.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=""){const n=e.split("|"),r=n[0],o=n[1];this.read(r,o,"read",void 0,void 0,(n,i)=>{n&&this.logger.warn(`${t}loading namespace ${o} for language ${r} failed`,n),!n&&i&&this.logger.log(`${t}loaded namespace ${o} for language ${r}`,i),this.loaded(e,n,i)})}saveMissing(e,t,n,r,o,i={},a=()=>{}){if(!um([this,"access",e=>e.services,"optionalAccess",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace])||um([this,"access",e=>e.services,"optionalAccess",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace,"call",e=>e(t)])){if(null!=n&&""!==n){if(um([this,"access",e=>e.backend,"optionalAccess",e=>e.create])){const s={...i,isUpdate:o},l=this.backend.create.bind(this.backend);if(l.length<6)try{let o;o=5===l.length?l(e,t,n,r,s):l(e,t,n,r),o&&"function"==typeof o.then?o.then(e=>a(null,e)).catch(a):a(null,o)}catch(e){a(e)}else l(e,t,n,r,a,s)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}else this.logger.warn(`did not save key "${n}" 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 Gm=()=>({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]),pm(e[1])&&(t.defaultValue=e[1]),pm(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Qm=e=>(pm(e.ns)&&(e.ns=[e.ns]),pm(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),pm(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),um([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),Zm=()=>{};class eg extends Nm{constructor(e={},t){var n;if(super(),this.options=Qm(e),this.services={},this.logger=Lm,this.modules={external:[]},n=this,Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(e=>{"function"==typeof n[e]&&(n[e]=n[e].bind(n))}),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&&(pm(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const n=Gm();var r;this.options={...n,...this.options,...Qm(e)},this.options.interpolation={...n.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=n.overloadTranslationOptionHandler),!1===this.options.showSupportNotice||(um([r=this,"optionalAccess",e=>e.modules,"optionalAccess",e=>e.backend,"optionalAccess",e=>e.name,"optionalAccess",e=>e.indexOf,"call",e=>e("Locize")])>0||um([r,"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||um([r,"optionalAccess",e=>e.options,"optionalAccess",e=>e.backend,"optionalAccess",e=>e.backends])&&r.options.backend.backends.some(e=>um([e,"optionalAccess",e=>e.name,"access",e=>e.indexOf,"call",e=>e("Locize")])>0||um([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 o=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?Lm.init(o(this.modules.logger),this.options):Lm.init(null,this.options),e=this.modules.formatter?this.modules.formatter:Xm;const t=new zm(this.options);this.store=new Dm(this.options.resources,this.options);const r=this.services;r.logger=Lm,r.resourceStore=this.store,r.languageUtils=t,r.pluralResolver=new Km(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix});this.options.interpolation.format&&this.options.interpolation.format!==n.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!==n.interpolation.format||(r.formatter=o(e),r.formatter.init&&r.formatter.init(r,this.options),this.options.interpolation.format=r.formatter.format.bind(r.formatter)),r.interpolator=new Wm(this.options),r.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},r.backendConnector=new Jm(o(this.modules.backend),r.resourceStore,r,this.options),r.backendConnector.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(r.languageDetector=o(this.modules.languageDetector),r.languageDetector.init&&r.languageDetector.init(r,this.options.detection,this.options)),this.modules.i18nFormat&&(r.i18nFormat=o(this.modules.i18nFormat),r.i18nFormat.init&&r.i18nFormat.init(this)),this.translator=new $m(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=Zm),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 i=hm(),a=()=>{const e=(e,n)=>{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),i.resolve(n),t(e,n)};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?a():setTimeout(a,0),i}loadResources(e,t=Zm){let n=t;const r=pm(e)?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===um([r,"optionalAccess",e=>e.toLowerCase,"call",e=>e()])&&(!this.options.preload||0===this.options.preload.length))return n();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(r)t(r);else{this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e))}um([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),n(e)})}else n(null)}reloadResources(e,t,n){const r=hm();return"function"==typeof e&&(n=e,e=void 0),"function"==typeof t&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=Zm),this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}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&&jm.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 n=hm();this.emit("languageChanging",e);const r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},o=(o,i)=>{i?this.isLanguageChangingTo===e&&(r(i),this.translator.changeLanguage(i),this.isLanguageChangingTo=void 0,this.emit("languageChanged",i),this.logger.log("languageChanged",i)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(o,(...e)=>this.t(...e))},i=t=>{e||t||!this.services.languageDetector||(t=[]);const n=pm(t)?t:t&&t[0],i=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(pm(t)?[t]:t);i&&(this.language||r(i),this.translator.language||this.translator.changeLanguage(i),um([this,"access",e=>e.services,"access",e=>e.languageDetector,"optionalAccess",e=>e.cacheUserLanguage,"optionalCall",e=>e(i)])),this.loadResources(i,e=>{o(e,i)})};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(i):this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),n}getFixedT(e,t,n){const r=(e,t,...o)=>{let i;i="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(o)):{...t},i.lng=i.lng||r.lng,i.lngs=i.lngs||r.lngs,i.ns=i.ns||r.ns,""!==i.keyPrefix&&(i.keyPrefix=i.keyPrefix||n||r.keyPrefix);const a=this.options.keySeparator||".";let s;return i.keyPrefix&&Array.isArray(e)?s=e.map(e=>("function"==typeof e&&(e=Pm(e,{...this.options,...t})),`${i.keyPrefix}${a}${e}`)):("function"==typeof e&&(e=Pm(e,{...this.options,...t})),s=i.keyPrefix?`${i.keyPrefix}${a}${e}`:e),this.t(s,i)};return pm(e)?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=n,r}t(...e){return um([this,"access",e=>e.translator,"optionalAccess",e=>e.translate,"call",t=>t(...e)])}exists(...e){return um([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 n=t.lng||this.resolvedLanguage||this.languages[0],r=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;const i=(e,t)=>{const n=this.services.backendConnector.state[`${e}|${t}`];return-1===n||0===n||2===n};if(t.precheck){const e=t.precheck(this,i);if(void 0!==e)return e}return!!this.hasResourceBundle(n,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!i(n,e)||r&&!i(o,e)))}loadNamespaces(e,t){const n=hm();return this.options.ns?(pm(e)&&(e=[e]),e.forEach(e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=hm();pm(e)&&(e=[e]);const r=this.options.preload||[],o=e.filter(e=>r.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return o.length?(this.options.preload=r.concat(o),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(um([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=um([this,"access",e=>e.services,"optionalAccess",e=>e.languageUtils])||new zm(Gm());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 n=new eg(e,t);return n.createInstance=eg.createInstance,n}cloneInstance(e={},t=Zm){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const r={...this.options,...e,isClone:!0},o=new eg(r);void 0===e.debug&&void 0===e.prefix||(o.logger=o.logger.clone(e));if(["store","services","language"].forEach(e=>{o[e]=this[e]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},n){const e=Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{});o.store=new Dm(e,r),o.services.resourceStore=o.store}if(e.interpolation){const t={...Gm().interpolation,...this.options.interpolation,...e.interpolation},n={...r,interpolation:t};o.services.interpolator=new Wm(n)}return o.translator=new $m(o.services,r),o.translator.on("*",(e,...t)=>{o.emit(e,...t)}),o.init(r,t),o.translator.options=r,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const tg=eg.createInstance();tg.createInstance,tg.dir,tg.init,tg.loadResources,tg.reloadResources,tg.use,tg.changeLanguage,tg.getFixedT,tg.t,tg.exists,tg.setDefaultNamespace,tg.hasLoadedNamespace,tg.loadNamespaces,tg.loadLanguages;tg.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 ng={translator:{...tg,t:(e,t)=>{const{lng:n}=t;switch(n){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 tg.t(e,{lng:n,...t})}},languageOptions:[{value:"en_US",label:"English (US)"},{value:"es_ES",label:"Spanish"}]};const{styled:rg}=r,og=n,ig=t;const{translator:ag}=ng,sg={"-webkit-touchCcallout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none"},lg=rg("div")(()=>({width:"100%",cursor:"pointer"})),cg=rg("div")(()=>({margin:"0 auto",textAlign:"center",display:"flex"})),dg=rg("div")(()=>({width:"fit-content",minWidth:"140px",alignSelf:"center",verticalAlign:"middle",color:`var(--correct-answer-toggle-label-color, ${Va()})`,fontWeight:"normal",...sg})),ug=rg("div")(()=>({position:"absolute",width:"25px","&.enter":{opacity:"0"},"&.enter-active":{opacity:"1",transition:"opacity 0.3s ease-in"},"&.exit":{opacity:"1"},"&.exit-active":{opacity:"0",transition:"opacity 0.3s ease-in"}})),pg=rg("div")(()=>({width:"25px",marginRight:"5px",display:"flex",alignItems:"center"}));class hg extends og.Component{static __initStatic(){this.propTypes={onToggle:ig.func,toggled:ig.bool,show:ig.bool,hideMessage:ig.string,showMessage:ig.string,className:ig.string,language:ig.string}}static __initStatic2(){this.defaultProps={showMessage:"Show correct answer",hideMessage:"Hide correct answer",show:!1,toggled:!1}}constructor(e){super(e),this.state={show:e.show},this.openIconRef=og.createRef(),this.closedIconRef=og.createRef(),hg.defaultProps={...hg.defaultProps,showMessage:ag.t("common:showCorrectAnswer",{lng:e.language}),hideMessage:ag.t("common:hideCorrectAnswer",{lng:e.language})}}onClick(){this.props.onToggle(!this.props.toggled)}onTouch(e){e.preventDefault(),this.props.onToggle(!this.props.toggled)}UNSAFE_componentWillReceiveProps(e){this.setState({show:e.show}),e.language!==function(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],i=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=i(n)):"call"!==o&&"optionalCall"!==o||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}([this,"access",e=>e.props,"optionalAccess",e=>e.language])&&(hg.defaultProps={...hg.defaultProps,showMessage:ag.t("common:showCorrectAnswer",{lng:e.language}),hideMessage:ag.t("common:hideCorrectAnswer",{lng:e.language})})}render(){const{className:e,toggled:t,hideMessage:n,showMessage:r}=this.props;return og.createElement(lg,{className:e},og.createElement(cm,{show:this.state.show},og.createElement(cg,{onClick:this.onClick.bind(this),onTouchEnd:this.onTouch.bind(this)},og.createElement(pg,null,og.createElement(Da,{nodeRef:this.openIconRef,timeout:400,in:t,exit:!t,classNames:{enter:"enter",enterActive:"enter-active",exit:"exit",exitActive:"exit-active"}},og.createElement(ug,{ref:this.openIconRef},og.createElement(Ti,{open:t,key:"correct-open"}))),og.createElement(Da,{nodeRef:this.closedIconRef,timeout:5e3,in:!t,exit:t,classNames:{enter:"enter",enterActive:"enter-active",exit:"exit",exitActive:"exit-active"}},og.createElement(ug,{ref:this.closedIconRef},og.createElement(Ti,{open:t,key:"correct-closed"})))),og.createElement(ll,{false:!0},og.createElement(dg,{"aria-hidden":!this.state.show},t?n:r)))))}}hg.__initStatic(),hg.__initStatic2();const mg=n,gg=t,{styled:fg}=r,{Tooltip:vg}=o,bg=e,{renderMath:yg}=c,xg=d;function wg(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],i=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=i(n)):"call"!==o&&"optionalCall"!==o||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}const Eg=fg($s)({color:Va(),backgroundColor:Ga(),display:"inline-block"}),Cg=fg("div")({width:"100%",position:"relative",backgroundColor:Ga(),color:Va()}),kg=fg("div")(({theme:e})=>({marginBottom:e.spacing(2)})),_g=fg("div")(({theme:e})=>({marginBottom:e.spacing(2)})),Sg=fg("div")({position:"relative","& > div > div":{display:"flex",alignItems:"baseline",flexWrap:"wrap"},"& .mq-overarrow-inner":{border:"none !important",padding:"0 !important"},"& .mq-overarrow-inner-right":{display:"none !important"},"& .mq-overarrow-inner-left":{display:"none !important"},"& .mq-overarrow.mq-arrow-both":{minWidth:"1.23em","& *":{lineHeight:"1 !important"},"&:before":{top:"-0.4em",left:"-1px"},"&:after":{top:"-2.4em",right:"-1px"},"&.mq-empty:after":{top:"-0.45em"}},"& .mq-overarrow.mq-arrow-right":{"&:before":{top:"-0.4em",right:"-1px"}},"& .mq-longdiv-inner":{borderTop:"1px solid !important",paddingTop:"1.5px !important"},"& .mq-parallelogram":{lineHeight:.85}}),Rg=fg("div")(({theme:e,$incorrect:t,$correct:n,$showCorrectness:r,$correctAnswerShown:o})=>({maxWidth:"fit-content",...t&&{borderColor:`${Xa()} !important`},...n&&{borderColor:`${Ya()} !important`},...r&&{border:"2px solid"},...o&&{padding:e.spacing(1),letterSpacing:"0.5px"},"& > .mq-math-mode":{"& > .mq-root-block":{"& > .mq-editable-field":{minWidth:"10px",padding:e.spacing(.25)}},"& sup":{top:0}}})),Ag=fg(Ol)({"& > .mq-root-block":{"& > .mq-editable-field":{borderColor:Va()}}}),Og=fg("div")(({theme:e})=>({zIndex:10,minWidth:"400px",marginTop:e.spacing(2)})),Tg=fg("div")(({theme:e})=>({marginBottom:e.spacing(1),pointerEvents:"none"})),Lg=fg("h2")({position:"absolute",left:"-10000px",top:"auto",width:"1px",height:"1px",overflow:"hidden"}),Ng=fg("div")(({theme:e})=>({marginBottom:e.spacing(2)})),Dg=fg(hg)(({theme:e})=>({color:Va(),marginBottom:e.spacing(2)}));if("undefined"!=typeof document){const e="math-templated-main-styles";if(!document.getElementById(e)){const t=document.createElement("style");t.id=e,t.textContent=`\n .block-container {\n margin: 8px !important;\n display: inline-flex;\n border: 2px solid grey !important;\n }\n .block-response {\n flex: 2;\n color: grey;\n background: rgba(0, 0, 0, 0.04);\n font-size: 0.8rem !important;\n padding: 4px !important;\n display: flex;\n align-items: center;\n justify-content: center;\n border-right: 2px solid #bdbdbd !important;\n }\n .block-math {\n color: ${Va()};\n background-color: ${Ga()};\n padding: 4px !important;\n display: flex;\n align-items: center;\n justify-content: center;\n flex: 8;\n }\n .block-math > .mq-math-mode > .mq-hasCursor > .mq-cursor {\n display: none;\n }\n .correct {\n border-color: ${Ya()} !important;\n }\n .incorrect {\n border-color: ${Xa()} !important;\n }\n `,document.head.appendChild(t)}}let jg=!1;const Mg=/(\{\{\d+\}\})/gm,Pg=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);function Fg(e=[],t){return 30*Math.floor(e.length/5)+("miscellaneous"===t?600:500)}function Ig(e,t){const{responses:n,disabled:r,markup:o,printMode:i,alwaysShowCorrect:a}=e||{};if(o){if(t.showCorrect)return Object.keys(n||{}).reduce((e,t)=>(e[t]=wg([n,"optionalAccess",e=>e[t],"optionalAccess",e=>e.answer]),e),{});const e=function(e){return e.split(Mg).filter(e=>e)}(o);return e.reduce((e,n)=>{if(n.match(Mg)){const o=$g.getResponseKey(n),s=t.session.answers[`r${o}`];if(i&&!a){const t="\\ \\ ".repeat(30)+"\\embed{newLine}[] ";return{...e,[o]:`\\MathQuillMathField[r${o}]{${t.repeat(3)}}`}}return r?{...e,[o]:`\\embed{answerBlock}[r${o}]`}:{...e,[o]:`\\MathQuillMathField[r${o}]{${s&&s.value||""}}`}}return e},{})}}class $g extends mg.Component{static __initStatic(){this.getResponseKey=e=>(e||"").replaceAll("{{","").replaceAll("}}","")}static __initStatic2(){this.propTypes={session:gg.object.isRequired,onSessionChange:gg.func,model:gg.object.isRequired}}constructor(e){super(e),$g.prototype.__init.call(this),$g.prototype.__init2.call(this),$g.prototype.__init3.call(this),$g.prototype.__init4.call(this),$g.prototype.__init5.call(this),$g.prototype.__init6.call(this),$g.prototype.__init7.call(this),$g.prototype.__init8.call(this),$g.prototype.__init9.call(this),$g.prototype.__init10.call(this),$g.prototype.__init11.call(this),$g.prototype.__init12.call(this),$g.prototype.__init13.call(this);const t={},{model:n,session:r}=e||{},{markup:o,alwaysShowCorrect:i}=n||{},{answers:a}=r||{};o&&(o||"").replace(Mg,e=>{const n=$g.getResponseKey(e),r=a&&a[`r${n}`];t[`r${n}`]={value:wg([r,"optionalAccess",e=>e.value])||""}}),this.state={session:{...e.session,answers:t},activeAnswerBlock:"",showCorrect:i||!1,tooltipContainerRef:mg.createRef()}}UNSAFE_componentWillMount(){if("undefined"!=typeof window){let e=xg.getInterface(3);jg||(e.registerEmbed("answerBlock",e=>({htmlString:`<div class="block-container">\n <div class="block-response" id="${e}Index">R</div>\n <div class="block-math">\n <span id="${e}"></span>\n </div>\n </div>`,text:()=>"text",latex:()=>`\\embed{answerBlock}[${e}]`})),jg=!0)}}__init(){this.handleAnswerBlockDomUpdate=()=>{const{model:e}=this.props,{session:t,showCorrect:n}=this.state,r=t.answers;this.root&&e.disabled&&!n&&Object.keys(r).forEach(t=>{const n=this.root.querySelector(`#${t}`),o=this.root.querySelector(`#${t}Index`);if(n){let i=xg.getInterface(3);const a=r[t];n.textContent=a&&a.value||"",e.view&&(n.parentElement.parentElement.classList.remove("correct"),n.parentElement.parentElement.classList.remove("incorrect")),i.StaticMath(n),o.textContent="R"}}),yg(this.root)}}UNSAFE_componentWillReceiveProps(e){const{model:t}=this.props,{model:n={}}=e||{},{markup:r="",env:o={}}=t||{},{markup:i="",env:a={},alwaysShowCorrect:s=!1}=n,l=e=>e&&"evaluate"===e.mode;l(o)&&l(a)||this.setState(e=>({...e.session,showCorrect:!1})),s&&this.setState({showCorrect:!0});const c=r.match(Mg),d=i.match(Mg);if(!Sn(c,d)){const e={},t=this.state.session.answers;(d||[]).forEach(n=>{const r=$g.getResponseKey(n),o=t&&t[`r${r}`];e[`r${r}`]={value:wg([o,"optionalAccess",e=>e.value])||""}}),this.setState(t=>({session:{...t.session,answers:e}}),()=>{this.props.onSessionChange(this.state.session),this.handleAnswerBlockDomUpdate()})}}shouldComponentUpdate(e,t){const n=Sn(this.props.model,e.model),r=Sn(this.state,t);return!n||!r}componentDidMount(){this.handleAnswerBlockDomUpdate(),setTimeout(()=>yg(this.root),100)}componentDidUpdate(){this.handleAnswerBlockDomUpdate()}__init2(){this.onSubFieldFocus=e=>{this.setState({activeAnswerBlock:e})}}__init3(){this.toNodeData=e=>{if(!e)return;const{type:t,value:n}=e;return"command"===t||"cursor"===t?e:"answer"===t?{type:"answer",...e}:"clear"===n?{type:"clear"}:{type:"write",value:n}}}__init4(){this.setInput=e=>{this.input=e}}__init5(){this.onClick=e=>{const t=this.toNodeData(e);"clear"===t.type?this.input.clear():"command"===t.type?Array.isArray(t.value)?t.value.forEach(e=>{this.input.cmd(e)}):this.input.cmd(t.value):"cursor"===t.type?this.input.keystroke(t.value):this.input.write(t.value),this.input.focus()}}__init6(){this.callOnSessionChange=()=>{const{onSessionChange:e}=this.props;e&&e(this.state.session)}}__init7(){this.toggleShowCorrect=e=>{this.setState({showCorrect:e},this.handleAnswerBlockDomUpdate)}}__init8(){this.subFieldChanged=(e,t)=>{Ho(),e&&this.setState(n=>({session:{...n.session,answers:{...n.session.answers,[e]:{value:t}}}}),this.callOnSessionChange)}}__init9(){this.getFieldName=(e,t)=>{const{answers:n}=this.state.session;if(Object.keys(n||{}).length){return Object.keys(n).find(n=>{const r=t[n];return r&&r.id==e.id})}}}__init10(){this.onBlur=e=>{const{relatedTarget:t,currentTarget:n}=e||{};const r=function e(t,n=0){if(!t||n>=16)return null;const r=t.offsetParent;return r?"tooltip"===r.getAttribute("role")?r:e(r,n+1):null}(t),o=r?function e(t,n=0){if(!t||n>=4)return null;const r=wg([t,"optionalAccess",e=>e.children,"optionalAccess",e=>e[0]]);return r?r.attributes&&r.attributes["data-keypad"]?r:e(r,n+1):null}(r):null;t&&n&&wg([o,"optionalAccess",e=>e.attributes,"access",e=>e["data-keypad"]])||this.setState({activeAnswerBlock:""})}}setTooltipRef(e){setTimeout(()=>{if(e&&Pg){const e=document.querySelector("[role='tooltip']");if(e){e.firstChild.setAttribute("tabindex","-1")}}},1)}__init11(){this.renderTeacherInstructions=()=>{const{model:e}=this.props,{teacherInstructions:t,animationsDisabled:n}=e||{},r=t&&(ul(t)||hl(t)),o=mg.createElement(il,{defaultClassName:"teacher-instructions",prompt:t});return r&&mg.createElement(_g,null,n?o:mg.createElement(As,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},o))}}__init12(){this.renderRationale=()=>{const{model:e}=this.props,{rationale:t,animationsDisabled:n}=e||{},r=mg.createElement(il,{prompt:t});return t&&(ul(t)||hl(t))&&mg.createElement(_g,null,n?r:mg.createElement(As,{labels:{hidden:"Show Rationale",visible:"Hide Rationale"}},r))}}__init13(){this.renderPlayerContent=()=>{const{model:e}=this.props,{activeAnswerBlock:t,showCorrect:n,session:r,tooltipContainerRef:o}=this.state,{correctness:i,disabled:a,view:s,responses:l,equationEditor:c,customKeys:d,feedback:u,env:{mode:p}={},printMode:h,alwaysShowCorrect:m}=e||{},g=_n(l),f=function(e=[]){return e.map(e=>({name:e,latex:e,write:e,label:e}))}(d),v=Ig(e,this.state)||"",b=h&&!m;return mg.createElement(Sg,null,mg.createElement(jh,{disabled:a,markup:e.markup,value:{},customMarkMarkupComponent:e=>{const l="evaluate"===p&&u&&u[e],d=mg.createElement(Ag,{ref:e=>{this.mqStatic=e||this.mqStatic},latex:v[e],onSubFieldChange:this.subFieldChanged,getFieldName:this.getFieldName,setInput:this.setInput,onSubFieldFocus:this.onSubFieldFocus,onBlur:this.onBlur});return mg.createElement(Rg,{ref:o,$incorrect:!g&&!l&&!n,$correct:!g&&(l||n),$showCorrectness:!g&&a&&i&&!s,$correctAnswerShown:n},mg.createElement(vg,{ref:e=>this.setTooltipRef(e),enterTouchDelay:0,interactive:!0,open:t===`r${e}`,slotProps:{popper:{container:wg([o,"optionalAccess",e=>e.current])||void 0,placement:"bottom-end",sx:{backgroundColor:"transparent",width:"650px",opacity:1,"& .MuiTooltip-arrow":{display:"none"}},modifiers:{preventOverflow:{enabled:!0,boundariesElement:"body"},flip:{enabled:!1}}},tooltip:{sx:{fontSize:"initial",backgroundColor:"transparent",width:"600px",marginTop:0,paddingTop:0,boxShadow:"none"}}},title:Object.keys(r.answers).map(e=>e===t&&!(n||a)&&mg.createElement(Og,{"data-keypad":!0,key:e,style:{width:Fg(f,c)}},mg.createElement(Vl,{additionalKeys:f,mode:c||6,onClick:this.onClick}))||null)},b?mg.createElement(Tg,null,d):mg.createElement("div",null,d)))}}))}}render(){const{model:e}=this.props,{showCorrect:t}=this.state,{prompt:n,env:{mode:r,role:o}={},extraCSSRules:i,correctness:a,responses:s,language:l,showNote:c,note:d}=e||{},u=!_n(s)&&a&&"correct"!==a.correctness,p=(t||"view"===r&&"instructor"===o)&&c&&d;return mg.createElement(Eg,{extraCSSRules:i,ref:e=>{const t=bg.findDOMNode(e);this.root=t||this.root}},mg.createElement(Cg,null,"gather"===r&&mg.createElement(Lg,null,"Math Equation Response Question"),mg.createElement(Cg,null,u&&mg.createElement(Dg,{language:l,show:!0,toggled:t,onToggle:this.toggleShowCorrect})),this.renderTeacherInstructions(),n&&mg.createElement(kg,null,mg.createElement(il,{prompt:n})),mg.createElement(ll,{false:!0},this.renderPlayerContent()),p&&mg.createElement(Ng,{className:"note",dangerouslySetInnerHTML:{__html:d}}),this.renderRationale()))}}$g.__initStatic(),$g.__initStatic2();const zg=n,Bg=i,{renderMath:qg}=c,Kg=Bg("pie-element:math-templated:print");class Ug extends HTMLElement{constructor(){super(),this._options=null,this._model=null,this._session=[],this._root=null,this._rerender=Cn(()=>{if(this._model&&this._session){const e=((e,t)=>{const n="instructor"===t.role;return e.prompt=!1!==e.promptEnabled?e.prompt:void 0,e.teacherInstructions=n&&!1!==e.teacherInstructionsEnabled?e.teacherInstructions:void 0,e.rationale=n&&!1!==e.rationaleEnabled?e.rationale:void 0,e.showTeacherInstructions=n,e.alwaysShowCorrect=n,e.printMode=!0,e.feedback=void 0,e.markup=e.markup||"{{0}}",{...e,disabled:!0,env:{mode:n?"evaluate":e.mode,role:t.role}}})(this._model,this._options),t=this._options&&zg.createElement($g,{model:e,session:{}});this._root||(this._root=b(this)),this._root.render(t),queueMicrotask(()=>{Kg("render complete - render math"),qg(this)})}else Kg("skip")},50,{leading:!1,trailing:!0})}set options(e){this._options=e}set model(e){this._model=e,this._rerender()}connectedCallback(){}disconnectedCallback(){this._root&&this._root.unmount()}}export{Ug as default};
|
|
1
|
+
import{_dll_debug as e,_dll_react as t,_dll_prop_types as n,_dll_mui__material_styles as r,_dll_react_dom as o,_dll_mui__material as i,_dll_pie_lib__render_ui as a,_dll_classnames as s,_dll_mui__icons_material as l,_dll_pie_lib__correct_answer_toggle as c,_dll_react_dom_client as u}from"../../../@pie-lib/shared-module@^5.0.0/module/index.js";import{_dll_pie_lib__math_rendering as d}from"../../../@pie-lib/math-rendering-module@^5.0.0/module/index.js";import{_dll_pie_lib__math_input as p,_dll_pie_framework__mathquill as h}from"../../../@pie-lib/math-edit-module@^4.0.0/module/index.js";import{_dll_pie_lib__drag as f}from"../../../@pie-lib/drag-module@^4.0.0/module/index.js";import{grey as g}from"@mui/material/colors";var m="object"==typeof global&&global&&global.Object===Object&&global,v="object"==typeof self&&self&&self.Object===Object&&self,b=m||v||Function("return this")(),y=b.Symbol,w=Object.prototype,x=w.hasOwnProperty,_=w.toString,C=y?y.toStringTag:void 0;var E=Object.prototype.toString;var k=y?y.toStringTag:void 0;function S(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":k&&k in Object(e)?function(e){var t=x.call(e,C),n=e[C];try{e[C]=void 0;var r=!0}catch(e){}var o=_.call(e);return r&&(t?e[C]=n:delete e[C]),o}(e):function(e){return E.call(e)}(e)}function A(e){return null!=e&&"object"==typeof e}function R(e){return"symbol"==typeof e||A(e)&&"[object Symbol]"==S(e)}var D=Array.isArray,j=y?y.prototype:void 0,O=j?j.toString:void 0;function T(e){if("string"==typeof e)return e;if(D(e))return function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}(e,T)+"";if(R(e))return O?O.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}var M=/\s/;var N=/^\s+/;function I(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&M.test(e.charAt(t)););return t}(e)+1).replace(N,""):e}function $(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var L=/^[-+]0x[0-9a-f]+$/i,W=/^0b[01]+$/i,P=/^0o[0-7]+$/i,B=parseInt;function z(e){if("number"==typeof e)return e;if(R(e))return NaN;if($(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=$(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=I(e);var n=W.test(e);return n||P.test(e)?B(e.slice(2),n?2:8):L.test(e)?NaN:+e}function F(e){return e}function H(e){if(!$(e))return!1;var t=S(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var q,U=b["__core-js_shared__"],K=(q=/[^.]+$/.exec(U&&U.keys&&U.keys.IE_PROTO||""))?"Symbol(src)_1."+q:"";var V=Function.prototype.toString;function Y(e){if(null!=e){try{return V.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var X=/^\[object .+?Constructor\]$/,J=Function.prototype,Q=Object.prototype,G=J.toString,Z=Q.hasOwnProperty,ee=RegExp("^"+G.call(Z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function te(e){return!(!$(e)||(t=e,K&&K in t))&&(H(e)?ee:X).test(Y(e));var t}function ne(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return te(n)?n:void 0}var re=ne(b,"WeakMap"),oe=/^(?:0|[1-9]\d*)$/;function ie(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&oe.test(e))&&e>-1&&e%1==0&&e<t}function ae(e,t){return e===t||e!=e&&t!=t}function se(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function le(e){return null!=e&&se(e.length)&&!H(e)}var ce=Object.prototype;function ue(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ce)}function de(e){return A(e)&&"[object Arguments]"==S(e)}var pe=Object.prototype,he=pe.hasOwnProperty,fe=pe.propertyIsEnumerable,ge=de(function(){return arguments}())?de:function(e){return A(e)&&he.call(e,"callee")&&!fe.call(e,"callee")};var me="object"==typeof exports&&exports&&!exports.nodeType&&exports,ve=me&&"object"==typeof module&&module&&!module.nodeType&&module,be=ve&&ve.exports===me?b.Buffer:void 0,ye=(be?be.isBuffer:void 0)||function(){return!1},we={};we["[object Float32Array]"]=we["[object Float64Array]"]=we["[object Int8Array]"]=we["[object Int16Array]"]=we["[object Int32Array]"]=we["[object Uint8Array]"]=we["[object Uint8ClampedArray]"]=we["[object Uint16Array]"]=we["[object Uint32Array]"]=!0,we["[object Arguments]"]=we["[object Array]"]=we["[object ArrayBuffer]"]=we["[object Boolean]"]=we["[object DataView]"]=we["[object Date]"]=we["[object Error]"]=we["[object Function]"]=we["[object Map]"]=we["[object Number]"]=we["[object Object]"]=we["[object RegExp]"]=we["[object Set]"]=we["[object String]"]=we["[object WeakMap]"]=!1;var xe,_e="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ce=_e&&"object"==typeof module&&module&&!module.nodeType&&module,Ee=Ce&&Ce.exports===_e&&m.process,ke=function(){try{var e=Ce&&Ce.require&&Ce.require("util").types;return e||Ee&&Ee.binding&&Ee.binding("util")}catch(e){}}(),Se=ke&&ke.isTypedArray,Ae=Se?(xe=Se,function(e){return xe(e)}):function(e){return A(e)&&se(e.length)&&!!we[S(e)]},Re=Object.prototype.hasOwnProperty;function De(e,t){var n=D(e),r=!n&&ge(e),o=!n&&!r&&ye(e),i=!n&&!r&&!o&&Ae(e),a=n||r||o||i,s=a?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],l=s.length;for(var c in e)!t&&!Re.call(e,c)||a&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||ie(c,l))||s.push(c);return s}var je=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object),Oe=je,Te=Object.prototype.hasOwnProperty;function Me(e){if(!ue(e))return Oe(e);var t=[];for(var n in Object(e))Te.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Ne(e){return le(e)?De(e):Me(e)}var Ie=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$e=/^\w*$/;function Le(e,t){if(D(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!R(e))||($e.test(e)||!Ie.test(e)||null!=t&&e in Object(t))}var We=ne(Object,"create");var Pe=Object.prototype.hasOwnProperty;var Be=Object.prototype.hasOwnProperty;function ze(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Fe(e,t){for(var n=e.length;n--;)if(ae(e[n][0],t))return n;return-1}ze.prototype.clear=function(){this.__data__=We?We(null):{},this.size=0},ze.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ze.prototype.get=function(e){var t=this.__data__;if(We){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Pe.call(t,e)?t[e]:void 0},ze.prototype.has=function(e){var t=this.__data__;return We?void 0!==t[e]:Be.call(t,e)},ze.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=We&&void 0===t?"__lodash_hash_undefined__":t,this};var He=Array.prototype.splice;function qe(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}qe.prototype.clear=function(){this.__data__=[],this.size=0},qe.prototype.delete=function(e){var t=this.__data__,n=Fe(t,e);return!(n<0)&&(n==t.length-1?t.pop():He.call(t,n,1),--this.size,!0)},qe.prototype.get=function(e){var t=this.__data__,n=Fe(t,e);return n<0?void 0:t[n][1]},qe.prototype.has=function(e){return Fe(this.__data__,e)>-1},qe.prototype.set=function(e,t){var n=this.__data__,r=Fe(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var Ue=ne(b,"Map");function Ke(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function Ve(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ve.prototype.clear=function(){this.size=0,this.__data__={hash:new ze,map:new(Ue||qe),string:new ze}},Ve.prototype.delete=function(e){var t=Ke(this,e).delete(e);return this.size-=t?1:0,t},Ve.prototype.get=function(e){return Ke(this,e).get(e)},Ve.prototype.has=function(e){return Ke(this,e).has(e)},Ve.prototype.set=function(e,t){var n=Ke(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function Ye(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(Ye.Cache||Ve),n}Ye.Cache=Ve;var Xe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Je=/\\(\\)?/g,Qe=function(e){var t=Ye(e,function(e){return 500===n.size&&n.clear(),e}),n=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Xe,function(e,n,r,o){t.push(r?o.replace(Je,"$1"):n||e)}),t}),Ge=Qe;function Ze(e,t){return D(e)?e:Le(e,t)?[e]:Ge(function(e){return null==e?"":T(e)}(e))}function et(e){if("string"==typeof e||R(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function tt(e,t){for(var n=0,r=(t=Ze(t,e)).length;null!=e&&n<r;)e=e[et(t[n++])];return n&&n==r?e:void 0}function nt(e,t,n){var r=null==e?void 0:tt(e,t);return void 0===r?n:r}function rt(e){var t=this.__data__=new qe(e);this.size=t.size}rt.prototype.clear=function(){this.__data__=new qe,this.size=0},rt.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},rt.prototype.get=function(e){return this.__data__.get(e)},rt.prototype.has=function(e){return this.__data__.has(e)},rt.prototype.set=function(e,t){var n=this.__data__;if(n instanceof qe){var r=n.__data__;if(!Ue||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ve(r)}return n.set(e,t),this.size=n.size,this};var ot=Object.prototype.propertyIsEnumerable,it=Object.getOwnPropertySymbols,at=it?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}(it(e),function(t){return ot.call(e,t)}))}:function(){return[]};function st(e){return function(e,t,n){var r=t(e);return D(e)?r:function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}(r,n(e))}(e,Ne,at)}var lt=ne(b,"DataView"),ct=ne(b,"Promise"),ut=ne(b,"Set"),dt="[object Map]",pt="[object Promise]",ht="[object Set]",ft="[object WeakMap]",gt="[object DataView]",mt=Y(lt),vt=Y(Ue),bt=Y(ct),yt=Y(ut),wt=Y(re),xt=S;(lt&&xt(new lt(new ArrayBuffer(1)))!=gt||Ue&&xt(new Ue)!=dt||ct&&xt(ct.resolve())!=pt||ut&&xt(new ut)!=ht||re&&xt(new re)!=ft)&&(xt=function(e){var t=S(e),n="[object Object]"==t?e.constructor:void 0,r=n?Y(n):"";if(r)switch(r){case mt:return gt;case vt:return dt;case bt:return pt;case yt:return ht;case wt:return ft}return t});var _t=xt,Ct=b.Uint8Array;function Et(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Ve;++t<n;)this.add(e[t])}function kt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function St(e,t){return e.has(t)}Et.prototype.add=Et.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Et.prototype.has=function(e){return this.__data__.has(e)};function At(e,t,n,r,o,i){var a=1&n,s=e.length,l=t.length;if(s!=l&&!(a&&l>s))return!1;var c=i.get(e),u=i.get(t);if(c&&u)return c==t&&u==e;var d=-1,p=!0,h=2&n?new Et:void 0;for(i.set(e,t),i.set(t,e);++d<s;){var f=e[d],g=t[d];if(r)var m=a?r(g,f,d,t,e,i):r(f,g,d,e,t,i);if(void 0!==m){if(m)continue;p=!1;break}if(h){if(!kt(t,function(e,t){if(!St(h,t)&&(f===e||o(f,e,n,r,i)))return h.push(t)})){p=!1;break}}else if(f!==g&&!o(f,g,n,r,i)){p=!1;break}}return i.delete(e),i.delete(t),p}function Rt(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function Dt(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var jt=y?y.prototype:void 0,Ot=jt?jt.valueOf:void 0;var Tt=Object.prototype.hasOwnProperty;var Mt="[object Arguments]",Nt="[object Array]",It="[object Object]",$t=Object.prototype.hasOwnProperty;function Lt(e,t,n,r,o,i){var a=D(e),s=D(t),l=a?Nt:_t(e),c=s?Nt:_t(t),u=(l=l==Mt?It:l)==It,d=(c=c==Mt?It:c)==It,p=l==c;if(p&&ye(e)){if(!ye(t))return!1;a=!0,u=!1}if(p&&!u)return i||(i=new rt),a||Ae(e)?At(e,t,n,r,o,i):function(e,t,n,r,o,i,a){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!i(new Ct(e),new Ct(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return ae(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=Rt;case"[object Set]":var l=1&r;if(s||(s=Dt),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=2,a.set(e,t);var u=At(s(e),s(t),r,o,i,a);return a.delete(e),u;case"[object Symbol]":if(Ot)return Ot.call(e)==Ot.call(t)}return!1}(e,t,l,n,r,o,i);if(!(1&n)){var h=u&&$t.call(e,"__wrapped__"),f=d&&$t.call(t,"__wrapped__");if(h||f){var g=h?e.value():e,m=f?t.value():t;return i||(i=new rt),o(g,m,n,r,i)}}return!!p&&(i||(i=new rt),function(e,t,n,r,o,i){var a=1&n,s=st(e),l=s.length;if(l!=st(t).length&&!a)return!1;for(var c=l;c--;){var u=s[c];if(!(a?u in t:Tt.call(t,u)))return!1}var d=i.get(e),p=i.get(t);if(d&&p)return d==t&&p==e;var h=!0;i.set(e,t),i.set(t,e);for(var f=a;++c<l;){var g=e[u=s[c]],m=t[u];if(r)var v=a?r(m,g,u,t,e,i):r(g,m,u,e,t,i);if(!(void 0===v?g===m||o(g,m,n,r,i):v)){h=!1;break}f||(f="constructor"==u)}if(h&&!f){var b=e.constructor,y=t.constructor;b==y||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof y&&y instanceof y||(h=!1)}return i.delete(e),i.delete(t),h}(e,t,n,r,o,i))}function Wt(e,t,n,r,o){return e===t||(null==e||null==t||!A(e)&&!A(t)?e!=e&&t!=t:Lt(e,t,n,r,Wt,o))}function Pt(e){return e==e&&!$(e)}function Bt(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}function zt(e){var t=function(e){for(var t=Ne(e),n=t.length;n--;){var r=t[n],o=e[r];t[n]=[r,o,Pt(o)]}return t}(e);return 1==t.length&&t[0][2]?Bt(t[0][0],t[0][1]):function(n){return n===e||function(e,t,n,r){var o=n.length,i=o,a=!r;if(null==e)return!i;for(e=Object(e);o--;){var s=n[o];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++o<i;){var l=(s=n[o])[0],c=e[l],u=s[1];if(a&&s[2]){if(void 0===c&&!(l in e))return!1}else{var d=new rt;if(r)var p=r(c,u,l,e,t,d);if(!(void 0===p?Wt(u,c,3,r,d):p))return!1}}return!0}(n,e,t)}}function Ft(e,t){return null!=e&&t in Object(e)}function Ht(e,t){return null!=e&&function(e,t,n){for(var r=-1,o=(t=Ze(t,e)).length,i=!1;++r<o;){var a=et(t[r]);if(!(i=null!=e&&n(e,a)))break;e=e[a]}return i||++r!=o?i:!!(o=null==e?0:e.length)&&se(o)&&ie(a,o)&&(D(e)||ge(e))}(e,t,Ft)}function qt(e){return Le(e)?function(e){return function(t){return null==t?void 0:t[e]}}(et(e)):function(e){return function(t){return tt(t,e)}}(e)}function Ut(e){return"function"==typeof e?e:null==e?F:"object"==typeof e?D(e)?(t=e[0],n=e[1],Le(t)&&Pt(n)?Bt(et(t),n):function(e){var r=nt(e,t);return void 0===r&&r===n?Ht(e,t):Wt(n,r,3)}):zt(e):qt(e);var t,n}var Kt,Vt=function(e,t,n){for(var r=-1,o=Object(e),i=n(e),a=i.length;a--;){var s=i[Kt?a:++r];if(!1===t(o[s],s,o))break}return e},Yt=Vt;function Xt(e,t){return e&&Yt(e,t,Ne)}var Jt=function(){return b.Date.now()},Qt=Math.max,Gt=Math.min;function Zt(e,t,n){var r,o,i,a,s,l,c=0,u=!1,d=!1,p=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function h(t){var n=r,i=o;return r=o=void 0,c=t,a=e.apply(i,n)}function f(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-c>=i}function g(){var e=Jt();if(f(e))return m(e);s=setTimeout(g,function(e){var n=t-(e-l);return d?Gt(n,i-(e-c)):n}(e))}function m(e){return s=void 0,p&&r?h(e):(r=o=void 0,a)}function v(){var e=Jt(),n=f(e);if(r=arguments,o=this,l=e,n){if(void 0===s)return function(e){return c=e,s=setTimeout(g,t),u?h(e):a}(l);if(d)return clearTimeout(s),s=setTimeout(g,t),h(l)}return void 0===s&&(s=setTimeout(g,t)),a}return t=z(t)||0,$(n)&&(u=!!n.leading,i=(d="maxWait"in n)?Qt(z(n.maxWait)||0,t):i,p="trailing"in n?!!n.trailing:p),v.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=l=o=s=void 0},v.flush=function(){return void 0===s?a:m(Jt())},v}var en=Object.prototype.hasOwnProperty;function tn(e){if(null==e)return!0;if(le(e)&&(D(e)||"string"==typeof e||"function"==typeof e.splice||ye(e)||Ae(e)||ge(e)))return!e.length;var t=_t(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(ue(e))return!Me(e).length;for(var n in e)if(en.call(e,n))return!1;return!0}function nn(e,t){return Wt(e,t)}var rn,on,an,sn={"border-radius":1,"border-top-left-radius":1,"border-top-right-radius":1,"border-bottom-left-radius":1,"border-bottom-right-radius":1,"box-shadow":1,order:1,flex:function(e,t){return[t+"box-flex"]},"box-flex":1,"box-align":1,animation:1,"animation-duration":1,"animation-name":1,transition:1,"transition-duration":1,transform:1,"transform-style":1,"transform-origin":1,"backface-visibility":1,perspective:1,"box-pack":1},ln={animation:1,"column-count":1,columns:1,"font-weight":1,opacity:1,"order ":1,"z-index":1,zoom:1,flex:1,"box-flex":1,transform:1,perspective:1,"box-pack":1,"box-align":1,colspan:1,rowspan:1},cn=function(e){return e.length?e.charAt(0).toUpperCase()+e.substring(1):e},un=cn,dn=/^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/,pn="undefined"==typeof document?{}:document.documentElement.style,hn=(rn=function(){for(var e in pn)if(dn.test(e))return e.match(dn)[0];return"WebkitOpacity"in pn?"Webkit":"KhtmlOpacity"in pn?"Khtml":""}(),on=rn.toLowerCase(),{style:rn,css:"-"+on+"-",dom:{Webkit:"WebKit",ms:"MS",o:"WebKit"}[rn]||un(rn)}),fn=function(e,t){return t?t.toUpperCase():""},gn=/[-\s]+(.)?/g,mn=function(e){return e?e.replace(gn,fn):""},vn=/::/g,bn=/([A-Z]+)([A-Z][a-z])/g,yn=/([a-z\d])([A-Z])/g,wn=/_/g,xn=function(e,t){return e?e.replace(vn,"/").replace(bn,"$1_$2").replace(yn,"$1_$2").replace(wn,t||"-"):""},_n=function(e){return xn(e).toLowerCase()},Cn=mn,En=_n,kn=function(e){return e.length?e.charAt(0).toLowerCase()+e.substring(1):e},Sn=cn,An=hn,Rn=sn,Dn="undefined"==typeof document?{}:document.documentElement.style,jn=function(e,t){t=t||{};var n=kn(Cn(e)),r=En(e),o=an?n:r,i=An.style?an?An.style:An.css:"";if(n in Dn)return t.asString?o:[o];var a=o,s=Rn[r],l=[];if(an&&(a=Sn(o)),"function"==typeof s){var c=s(o,i)||[];c&&!Array.isArray(c)&&(c=[c]),c.length&&(c=c.map(function(e){return an?kn(Cn(e)):En(e)})),l=l.concat(c)}return i&&l.push(i+a),l.push(o),t.asString||1==l.length?l[0]:l},On=Object.prototype.hasOwnProperty,Tn=function(e,t){return On.call(e,t)},Mn=Object.prototype.toString,Nn=Object.prototype.toString,In=jn,$n=_n,Ln=mn,Wn=Tn,Pn=function(e){return!!e&&"[object Object]"===Mn.call(e)},Bn=function(e){return"[object Function]"===Nn.apply(e)},zn=function(e,t,n,r){In(t).forEach(function(t){e[r?r(t):t]=n})},Fn={cssUnitless:ln},Hn=function(e,t,n,r){"string"==typeof e&&(e=function(e){e=(e||"").split(";");var t={};return e.forEach(function(e){var n=e.split(":");2==n.length&&(t[n[0].trim()]=n[1].trim())}),t}(e)),(t=t||Fn).cssUnitless=t.cssUnitless||Fn.cssUnitless,r=r||{};var o,i,a,s,l,c,u,d,p=t.scope||{},h=null!=t.addUnits?t.addUnits:!p||null==p.addUnits||p.addUnits,f=(null!=t.cssUnitless?t.cssUnitless:p?p.cssUnitless:null)||{},g=(t.cssUnit||p?p.cssUnit:null)||"px",m=t.prefixProperties||(p?p.prefixProperties:null)||{},v=t.camelize?Ln:$n;for(a in e)if(Wn(e,a)){if(s=e[a],i=$n(n?n+a:a),o=!1,d=!1,Bn(s)&&(u=s.call(p||e,s,a,i,e),Pn(u)&&null!=u.value?(s=u.value,d=u.prefix,i=u.name?$n(u.name):i):s=u),c="number"==(l=typeof s)||"string"==l&&""!=s&&1*s==s,null==s||null==i||""===i)continue;if((c||"string"==l)&&(o=!0),!o&&null!=s.value&&s.prefix&&(o=!0,d=s.prefix,s=s.value),o){if(d=d||!!m[i],c&&(s=h&&!(i in f)?s+g:s+""),"border"!=i&&(i.indexOf("border")||~i.indexOf("radius")||~i.indexOf("width"))||!c||(i+="-width"),!i.indexOf("border-radius-")&&(i.replace(/border(-radius)(-(.*))/,function(e,t,n){var r={"-top":["-top-left","-top-right"],"-left":["-top-left","-bottom-left"],"-right":["-top-right","-bottom-right"],"-bottom":["-bottom-left","-bottom-right"]};n in r?(i=[],r[n].forEach(function(e){i.push("border"+e+t)})):i="border"+n+t}),Array.isArray(i))){i.forEach(function(e){d?zn(r,e,s,v):r[v(e)]=s});continue}d?zn(r,i,s,v):r[v(i)]=s}else Hn(s,t,i+"-",r)}return r},qn=Hn,Un=Tn,Kn={prefixProperties:sn,cssUnitless:ln,object:Hn,string:function(e,t){e=qn(e,t);var n,r=[];for(n in e)Un(e,n)&&r.push(n+": "+e[n]);return r.join("; ")}};const Vn=e("@pie-lib:mask-markup:serialization"),Yn=["span"],Xn=["em","strong","u"],Jn=(e,t)=>{const n=e.getAttribute(t);return r=(e=>{const t=/([\w-]*)\s*:\s*([^;]*)/g;let n;const r={};for(;n=t.exec(e);)r[n[1]]=n[2].trim();return r})(n),Kn.object(r,{camelize:!0,addUnits:!1});var r},Qn=["border","class","style"],Gn={b:"bold",em:"italic",u:"underline",s:"strikethrough",code:"code",strong:"strong"},Zn=(e,t=[])=>{if(8===e.nodeType)return null;if(3===e.nodeType){const n={text:e.textContent};return t.length>0&&(n.marks=t.map(e=>({type:e,data:void 0}))),{object:"text",leaves:[n]}}if(1===e.nodeType){const r=e.tagName.toLowerCase(),o=Gn[r];if(o){Vn("[deserialize] mark: ",o);return{_flatten:!0,nodes:er(e.childNodes,[...t,o])}}if("math"===r)return{isMath:!0,nodes:[e]};const i=(e=>{if(!e.attributes||e.attributes.length<=0)return;const t={};let n;for(n=0;n<e.attributes.length;n++){const r=e.attributes[n];t[r.name]=r.value}return t})(e)||{};"audio"===r&&""===i.controls&&(i.controls=!0);const a=Qn.reduce((n=e,(e,t)=>{if(!n.getAttribute)return e;if(n.getAttribute(t))switch(t){case"style":e.style=Jn(n,t);break;case"class":e.className=((e,t,n)=>{const r=e.getAttribute(n);return delete t.class,r})(n,e,t);break;default:e[t]=n.getAttribute(t)}return e}),{...i}),s=(e=>Yn.includes(e)?"inline":Xn.includes(e)?"mark":"block")(r),l=er(e.childNodes,t);return{object:s,type:r,data:{dataset:{...e.dataset},attributes:{...a}},nodes:l}}var n;return null},er=(e,t=[])=>{const n=[];for(let r=0;r<e.length;r++){const o=Zn(e[r],t);null!==o&&(o._flatten&&o.nodes?n.push(...o.nodes):n.push(o))}return n},tr=t,nr=n,{styled:rr}=r,{renderMath:or}=d;function ir(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],i=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=i(n)):"call"!==o&&"optionalCall"!==o||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}const ar=rr("div")(({theme:e})=>({paddingTop:e.spacing(.5),paddingBottom:e.spacing(.5)})),sr=rr("span")(()=>({display:"inline-block",width:".75em"})),lr=["tbody","tr"],cr=(e,t,n,r,o,i)=>{if(!t)return null;const a=[];return(e.nodes||[]).forEach((e,s)=>{const l=e.type?`${e.type}-${s}`:`${s}`;if(e.isMath)return a.push(tr.createElement("span",{dangerouslySetInnerHTML:{__html:`<math displaystyle="true">${e.nodes[0].innerHTML}</math>`}})),a;if(r){const l=r(e,t,n);if(l)return a.push(l),void("td"!==ir([o,"optionalAccess",e=>e.type])&&"drag-in-the-blank"===i&&a.push(tr.createElement(sr,{key:`spacer-${s}`})))}if("text"===e.object){const t=e.leaves.reduce((e,t)=>{const n=t.text,r=((e,t)=>{const n=""===t.trim(),r=e&&e.type;return n&&lr.includes(r)?void 0:t})(o,n);return r?e+r:e},""),n=(e=>{const t=e.leaves.find(e=>nt(e,"marks",[]).length);return t?t.marks[0]:null})(e);if(n){let e;for(e in Gn)if(Gn[e]===n.type){const n=e;a.push(tr.createElement(n,{key:l},t));break}}else t.length>0&&(a.push(t),"td"!==ir([o,"optionalAccess",e=>e.type])&&"drag-in-the-blank"===i&&a.push(tr.createElement(sr,{key:`spacer-${s}`})))}else{const o=cr(e,t,n,r,e,i);if("p"===e.type||"paragraph"===e.type)a.push(tr.createElement(ar,{key:l},o));else{const t=e.type;e.nodes&&e.nodes.length>0?a.push(tr.createElement(t,{key:l,...e.data.attributes},o)):a.push(tr.createElement(t,{key:l,...e.data.attributes}))}}}),a},ur=rr("div")(()=>({display:"initial","&:not(.MathJax) table":{borderCollapse:"collapse"},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:"8px 12px",textAlign:"left"}}));class dr extends tr.Component{constructor(e){super(e),dr.prototype.__init.call(this),this.internalContainerRef=tr.createRef()}static __initStatic(){this.propTypes={renderChildren:nr.func,layout:nr.object,value:nr.object,onChange:nr.func,elementType:nr.string,containerRef:nr.oneOfType([nr.func,nr.shape({current:nr.instanceOf(Element)})])}}componentDidMount(){const e=this.props.containerRef||this.internalContainerRef;e.current&&"function"==typeof or&&or(e.current)}__init(){this.handleChange=(e,t)=>{const n={...this.props.value,[e]:t};this.props.onChange(n)}}render(){const{value:e,layout:t,elementType:n,containerRef:r}=this.props,o=cr(t,e,this.handleChange,this.props.renderChildren,null,n),i=r||this.internalContainerRef;return tr.createElement(ur,{ref:i},o)}}dr.__initStatic();const pr=/\{\{(\d+)\}\}/g;const hr=t,fr=n;var gr;const mr=(e,t)=>{const{markup:n}=(o=t,(r=e)?{markup:r.replace(pr,(e,t)=>`<span data-component="${o}" data-id="${t}"></span>`)}:{markup:""});var r,o;return(e=>{if(!e||!e.trim())return{object:"value",document:{object:"document",data:{},nodes:[{object:"block",type:"span",data:{},isVoid:!1,nodes:[]}]}};const t=(new DOMParser).parseFromString(e,"text/html");let n=er(t.body.childNodes);return!n.some(e=>"block"===e.object||"inline"===e.object)&&n.length>0&&(n=[{object:"block",type:"span",data:{},isVoid:!1,nodes:n}]),0===n.length&&(n=[{object:"block",type:"span",data:{},isVoid:!1,nodes:[]}]),{object:"value",document:{object:"document",data:{},nodes:n}}})(n).document},vr=(e,t)=>((gr=class extends hr.Component{static __initStatic(){this.propTypes={markup:fr.string,layout:fr.object,value:fr.object,onChange:fr.func,customMarkMarkupComponent:fr.func,elementType:fr.string}}constructor(e){super(e),this.containerRef=hr.createRef()}componentDidUpdate(e){if(this.props.markup!==e.markup){const e=this.containerRef.current;(e&&e.querySelectorAll('[data-latex][data-math-handled="true"]')||[]).forEach(e=>{const t=e.querySelector("mjx-container");t&&e.removeChild(t);const n=e.getAttribute("data-raw");e.innerHTML=n,e.removeAttribute("data-math-handled")})}}render(){const{markup:n,layout:r,value:o,onChange:i,elementType:a}=this.props,s=r||mr(n,e);return hr.createElement(dr,{containerRef:this.containerRef,elementType:a,layout:s,value:o,onChange:i,renderChildren:t(this.props)})}}).__initStatic(),gr),{useMemo:br}=t,{useLayoutEffect:yr}=t,{useEffect:wr}=t,{useRef:xr}=t,{useCallback:_r}=t,Cr="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function Er(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function kr(e){return"nodeType"in e}function Sr(e){var t,n;return e?Er(e)?e:kr(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function Ar(e){const{Document:t}=Sr(e);return e instanceof t}function Rr(e){return!Er(e)&&e instanceof Sr(e).HTMLElement}function Dr(e){return e instanceof Sr(e).SVGElement}function jr(e){return e?Er(e)?e.document:kr(e)?Ar(e)?e:Rr(e)||Dr(e)?e.ownerDocument:document:document:document}const Or=Cr?yr:wr;function Tr(e){const t=xr(e);return Or(()=>{t.current=e}),_r(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)},[])}function Mr(e,t){void 0===t&&(t=[e]);const n=xr(e);return Or(()=>{n.current!==e&&(n.current=e)},t),n}function Nr(e,t){const n=xr();return br(()=>{const t=e(n.current);return n.current=t,t},[...t])}function Ir(e){const t=Tr(e),n=xr(null),r=_r(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,r]}function $r(e){const t=xr();return wr(()=>{t.current=e},[e]),t.current}let Lr={};function Wr(e,t){return br(()=>{if(t)return t;const n=null==Lr[e]?0:Lr[e]+1;return Lr[e]=n,e+"-"+n},[e,t])}function Pr(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((t,n)=>{const r=Object.entries(n);for(const[n,o]of r){const r=t[n];null!=r&&(t[n]=r+e*o)}return t},{...t})}}const Br=Pr(1),zr=Pr(-1);function Fr(e){if(!e)return!1;const{KeyboardEvent:t}=Sr(e.target);return t&&e instanceof t}function Hr(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=Sr(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const qr=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[qr.Translate.toString(e),qr.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Ur="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Kr(e){return e.matches(Ur)?e:e.querySelector(Ur)}const Vr=t,{useState:Yr}=t,{useCallback:Xr}=t,Jr={display:"none"};function Qr(e){let{id:t,value:n}=e;return Vr.createElement("div",{id:t,style:Jr},n)}function Gr(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;return Vr.createElement("div",{id:t,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":r,"aria-atomic":!0},n)}const Zr=t,{createContext:eo}=t,{useContext:to}=t,{useEffect:no}=t,{useState:ro}=t,{useCallback:oo}=t,{useMemo:io}=t,{useRef:ao}=t,{memo:so}=t,{useReducer:lo}=t,{cloneElement:co}=t,{forwardRef:uo}=t,{createPortal:po}=o,{unstable_batchedUpdates:ho}=o,fo=eo(null);const go={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},mo={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function vo(e){let{announcements:t=mo,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=go}=e;const{announce:i,announcement:a}=function(){const[e,t]=Yr("");return{announce:Xr(e=>{null!=e&&t(e)},[]),announcement:e}}(),s=Wr("DndLiveRegion"),[l,c]=ro(!1);if(no(()=>{c(!0)},[]),function(e){const t=to(fo);no(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}(io(()=>({onDragStart(e){let{active:n}=e;i(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&i(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;i(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;i(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;i(t.onDragCancel({active:n,over:r}))}}),[i,t])),!l)return null;const u=Zr.createElement(Zr.Fragment,null,Zr.createElement(Qr,{id:r,value:o.draggable}),Zr.createElement(Gr,{id:s,announcement:a}));return n?po(u,n):u}var bo;function yo(){}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(bo||(bo={}));const wo=Object.freeze({x:0,y:0});function xo(e,t){const n=Hr(e);if(!n)return"0 0";return(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%"}function _o(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Co(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),a=o-r,s=i-n;if(r<o&&n<i){const n=t.width*t.height,r=e.width*e.height,o=a*s;return Number((o/(n+r-o)).toFixed(4))}return 0}const Eo=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const e of r){const{id:r}=e,i=n.get(r);if(i){const n=Co(i,t);n>0&&o.push({id:r,data:{droppableContainer:e,value:n}})}}return o.sort(_o)};function ko(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:wo}const So=(Ao=1,function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.reduce((e,t)=>({...e,top:e.top+Ao*t.y,bottom:e.bottom+Ao*t.y,left:e.left+Ao*t.x,right:e.right+Ao*t.x}),{...e})});var Ao;function Ro(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}const Do={ignoreTransform:!1};function jo(e,t){void 0===t&&(t=Do);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=Sr(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=Ro(t);if(!r)return e;const{scaleX:o,scaleY:i,x:a,y:s}=r,l=e.left-a-(1-o)*parseFloat(n),c=e.top-s-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),u=o?e.width/o:e.width,d=i?e.height/i:e.height;return{width:u,height:d,top:c,right:l+u,bottom:c+d,left:l}}(n,t,r))}const{top:r,left:o,width:i,height:a,bottom:s,right:l}=n;return{top:r,left:o,width:i,height:a,bottom:s,right:l}}function Oo(e){return jo(e,{ignoreTransform:!0})}function To(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if(Ar(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Rr(o)||Dr(o))return n;if(n.includes(o))return n;const i=Sr(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=Sr(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(e=>{const r=t[e];return"string"==typeof r&&n.test(r)})}(o,i)&&n.push(o),function(e,t){return void 0===t&&(t=Sr(e).getComputedStyle(e)),"fixed"===t.position}(o,i)?n:r(o.parentNode)}(e):n}function Mo(e){const[t]=To(e,1);return null!=t?t:null}function No(e){return Cr&&e?Er(e)?e:kr(e)?Ar(e)||e===jr(e).scrollingElement?window:Rr(e)?e:null:null:null}function Io(e){return Er(e)?e.scrollX:e.scrollLeft}function $o(e){return Er(e)?e.scrollY:e.scrollTop}function Lo(e){return{x:Io(e),y:$o(e)}}var Wo;function Po(e){return!(!Cr||!e)&&e===document.scrollingElement}function Bo(e){const t={x:0,y:0},n=Po(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(Wo||(Wo={}));const zo={x:.2,y:.2};function Fo(e,t,n,r,o){let{top:i,left:a,right:s,bottom:l}=n;void 0===r&&(r=10),void 0===o&&(o=zo);const{isTop:c,isBottom:u,isLeft:d,isRight:p}=Bo(e),h={x:0,y:0},f={x:0,y:0},g=t.height*o.y,m=t.width*o.x;return!c&&i<=t.top+g?(h.y=Wo.Backward,f.y=r*Math.abs((t.top+g-i)/g)):!u&&l>=t.bottom-g&&(h.y=Wo.Forward,f.y=r*Math.abs((t.bottom-g-l)/g)),!p&&s>=t.right-m?(h.x=Wo.Forward,f.x=r*Math.abs((t.right-m-s)/m)):!d&&a<=t.left+m&&(h.x=Wo.Backward,f.x=r*Math.abs((t.left+m-a)/m)),{direction:h,speed:f}}function Ho(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function qo(e){return e.reduce((e,t)=>Br(e,Lo(t)),wo)}function Uo(e,t){if(void 0===t&&(t=jo),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);Mo(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Ko=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+Io(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+$o(t),0)}]];class Vo{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=To(t),r=qo(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of Ko)for(const i of t)Object.defineProperty(this,i,{get:()=>{const t=o(n),a=r[e]-t;return this.rect[i]+a},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Yo{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)})},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function Xo(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t&&r>t.y}var Jo,Qo;function Go(e){e.preventDefault()}function Zo(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(Jo||(Jo={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"}(Qo||(Qo={}));const ei={start:[Qo.Space,Qo.Enter],cancel:[Qo.Esc],end:[Qo.Space,Qo.Enter,Qo.Tab]},ti=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Qo.Right:return{...n,x:n.x+25};case Qo.Left:return{...n,x:n.x-25};case Qo.Down:return{...n,y:n.y+25};case Qo.Up:return{...n,y:n.y-25}}};class ni{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new Yo(jr(t)),this.windowListeners=new Yo(Sr(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Jo.Resize,this.handleCancel),this.windowListeners.add(Jo.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Jo.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&Uo(n),t(wo)}handleKeyDown(e){if(Fr(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=ei,coordinateGetter:i=ti,scrollBehavior:a="smooth"}=r,{code:s}=e;if(o.end.includes(s))return void this.handleEnd(e);if(o.cancel.includes(s))return void this.handleCancel(e);const{collisionRect:l}=n.current,c=l?{x:l.left,y:l.top}:wo;this.referenceCoordinates||(this.referenceCoordinates=c);const u=i(e,{active:t,context:n.current,currentCoordinates:c});if(u){const t=zr(u,c),r={x:0,y:0},{scrollableAncestors:o}=n.current;for(const n of o){const o=e.code,{isTop:i,isRight:s,isLeft:l,isBottom:c,maxScroll:d,minScroll:p}=Bo(n),h=Ho(n),f={x:Math.min(o===Qo.Right?h.right-h.width/2:h.right,Math.max(o===Qo.Right?h.left:h.left+h.width/2,u.x)),y:Math.min(o===Qo.Down?h.bottom-h.height/2:h.bottom,Math.max(o===Qo.Down?h.top:h.top+h.height/2,u.y))},g=o===Qo.Right&&!s||o===Qo.Left&&!l,m=o===Qo.Down&&!c||o===Qo.Up&&!i;if(g&&f.x!==u.x){const e=n.scrollLeft+t.x,i=o===Qo.Right&&e<=d.x||o===Qo.Left&&e>=p.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:a});r.x=i?n.scrollLeft-e:o===Qo.Right?n.scrollLeft-d.x:n.scrollLeft-p.x,r.x&&n.scrollBy({left:-r.x,behavior:a});break}if(m&&f.y!==u.y){const e=n.scrollTop+t.y,i=o===Qo.Down&&e<=d.y||o===Qo.Up&&e>=p.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:a});r.y=i?n.scrollTop-e:o===Qo.Down?n.scrollTop-d.y:n.scrollTop-p.y,r.y&&n.scrollBy({top:-r.y,behavior:a});break}}this.handleMove(e,Br(zr(u,this.referenceCoordinates),r))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function ri(e){return Boolean(e&&"distance"in e)}function oi(e){return Boolean(e&&"delay"in e)}ni.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=ei,onActivation:o}=t,{active:i}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const t=i.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==o||o({event:e.nativeEvent}),!0)}return!1}}];class ii{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=Sr(e);return e instanceof t?e:jr(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:o}=e,{target:i}=o;this.props=e,this.events=t,this.document=jr(i),this.documentListeners=new Yo(this.document),this.listeners=new Yo(n),this.windowListeners=new Yo(Sr(i)),this.initialCoordinates=null!=(r=Hr(o))?r:wo,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(Jo.Resize,this.handleCancel),this.windowListeners.add(Jo.DragStart,Go),this.windowListeners.add(Jo.VisibilityChange,this.handleCancel),this.windowListeners.add(Jo.ContextMenu,Go),this.documentListeners.add(Jo.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(oi(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(ri(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){const{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(Jo.Click,Zo,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Jo.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:o}=this,{onMove:i,options:{activationConstraint:a}}=o;if(!r)return;const s=null!=(t=Hr(e))?t:wo,l=zr(r,s);if(!n&&a){if(ri(a)){if(null!=a.tolerance&&Xo(l,a.tolerance))return this.handleCancel();if(Xo(l,a.distance))return this.handleStart()}return oi(a)&&Xo(l,a.tolerance)?this.handleCancel():void this.handlePending(a,l)}e.cancelable&&e.preventDefault(),i(s)}handleEnd(){const{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){const{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===Qo.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const ai={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class si extends ii{constructor(e){const{event:t}=e,n=jr(t.target);super(e,ai,n)}}si.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!(!n.isPrimary||0!==n.button)&&(null==r||r({event:n}),!0)}}];const li={move:{name:"mousemove"},end:{name:"mouseup"}};var ci;!function(e){e[e.RightClick=2]="RightClick"}(ci||(ci={}));(class extends ii{constructor(e){super(e,li,jr(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==ci.RightClick&&(null==r||r({event:n}),!0)}}];const ui={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var di,pi;function hi(e){let{acceleration:t,activator:n=di.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:a=5,order:s=pi.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:u,delta:d,threshold:p}=e;const h=function(e){let{delta:t,disabled:n}=e;const r=$r(t);return Nr(e=>{if(n||!r||!e)return fi;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Wo.Backward]:e.x[Wo.Backward]||-1===o.x,[Wo.Forward]:e.x[Wo.Forward]||1===o.x},y:{[Wo.Backward]:e.y[Wo.Backward]||-1===o.y,[Wo.Forward]:e.y[Wo.Forward]||1===o.y}}},[n,t,r])}({delta:d,disabled:!i}),[f,g]=function(){const e=xr(null);return[_r((t,n)=>{e.current=setInterval(t,n)},[]),_r(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}(),m=ao({x:0,y:0}),v=ao({x:0,y:0}),b=io(()=>{switch(n){case di.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case di.DraggableRect:return o}},[n,o,l]),y=ao(null),w=oo(()=>{const e=y.current;if(!e)return;const t=m.current.x*v.current.x,n=m.current.y*v.current.y;e.scrollBy(t,n)},[]),x=io(()=>s===pi.TreeOrder?[...c].reverse():c,[s,c]);no(()=>{if(i&&c.length&&b){for(const e of x){if(!1===(null==r?void 0:r(e)))continue;const n=c.indexOf(e),o=u[n];if(!o)continue;const{direction:i,speed:s}=Fo(e,o,b,t,p);for(const e of["x","y"])h[e][i[e]]||(s[e]=0,i[e]=0);if(s.x>0||s.y>0)return g(),y.current=e,f(w,a),m.current=s,void(v.current=i)}m.current={x:0,y:0},v.current={x:0,y:0},g()}else g()},[t,w,r,g,i,a,JSON.stringify(b),JSON.stringify(h),f,c,x,u,JSON.stringify(p)])}(class extends ii{constructor(e){super(e,ui)}static setup(){return window.addEventListener(ui.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(ui.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return!(o.length>1)&&(null==r||r({event:n}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(di||(di={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(pi||(pi={}));const fi={x:{[Wo.Backward]:!1,[Wo.Forward]:!1},y:{[Wo.Backward]:!1,[Wo.Forward]:!1}};var gi,mi;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(gi||(gi={})),function(e){e.Optimized="optimized"}(mi||(mi={}));const vi=new Map;function bi(e,t){return Nr(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function yi(e){let{callback:t,disabled:n}=e;const r=Tr(t),o=io(()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(r)},[n]);return no(()=>()=>null==o?void 0:o.disconnect(),[o]),o}function wi(e){return new Vo(jo(e),e)}function xi(e,t,n){void 0===t&&(t=wi);const[r,o]=ro(null);function i(){o(r=>{if(!e)return null;var o;if(!1===e.isConnected)return null!=(o=null!=r?r:n)?o:null;const i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}const a=function(e){let{callback:t,disabled:n}=e;const r=Tr(t),o=io(()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(r)},[r,n]);return no(()=>()=>null==o?void 0:o.disconnect(),[o]),o}({callback(t){if(e)for(const n of t){const{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){i();break}}}}),s=yi({callback:i});return Or(()=>{i(),e?(null==s||s.observe(e),null==a||a.observe(document.body,{childList:!0,subtree:!0})):(null==s||s.disconnect(),null==a||a.disconnect())},[e]),r}const _i=[];function Ci(e,t){void 0===t&&(t=[]);const n=ao(null);return no(()=>{n.current=null},t),no(()=>{const t=e!==wo;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?zr(e,n.current):wo}function Ei(e){return io(()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null,[e])}const ki=[];function Si(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Rr(t)?t:e}const Ai=[{sensor:si,options:{}},{sensor:ni,options:{}}],Ri={current:{}},Di={draggable:{measure:Oo},droppable:{measure:Oo,strategy:gi.WhileDragging,frequency:mi.Optimized},dragOverlay:{measure:jo}};class ji extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const Oi={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new ji,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:yo},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Di,measureDroppableContainers:yo,windowRect:null,measuringScheduled:!1},Ti={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:yo,draggableNodes:new Map,over:null,measureDroppableContainers:yo},Mi=eo(Ti),Ni=eo(Oi);function Ii(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new ji}}}function $i(e,t){switch(t.type){case bo.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case bo.DragMove:return null==e.draggable.active?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case bo.DragEnd:case bo.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case bo.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new ji(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case bo.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const a=new ji(e.droppable.containers);return a.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case bo.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new ji(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function Li(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=to(Mi),i=$r(r),a=$r(null==n?void 0:n.id);return no(()=>{if(!t&&!r&&i&&null!=a){if(!Fr(i))return;if(document.activeElement===i.target)return;const e=o.get(a);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=Kr(e);if(t){t.focus();break}}})}},[r,t,o,a,i]),null}function Wi(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}const Pi=eo({...wo,scaleX:1,scaleY:1});var Bi;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(Bi||(Bi={})),so(function(e){var t,n,r,o;let{id:i,accessibility:a,autoScroll:s=!0,children:l,sensors:c=Ai,collisionDetection:u=Eo,measuring:d,modifiers:p,...h}=e;const f=lo($i,void 0,Ii),[g,m]=f,[v,b]=function(){const[e]=ro(()=>new Set),t=oo(t=>(e.add(t),()=>e.delete(t)),[e]);return[oo(t=>{let{type:n,event:r}=t;e.forEach(e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)})},[e]),t]}(),[y,w]=ro(Bi.Uninitialized),x=y===Bi.Initialized,{draggable:{active:_,nodes:C,translate:E},droppable:{containers:k}}=g,S=null!=_?C.get(_):null,A=ao({initial:null,translated:null}),R=io(()=>{var e;return null!=_?{id:_,data:null!=(e=null==S?void 0:S.data)?e:Ri,rect:A}:null},[_,S]),D=ao(null),[j,O]=ro(null),[T,M]=ro(null),N=Mr(h,Object.values(h)),I=Wr("DndDescribedBy",i),$=io(()=>k.getEnabled(),[k]),L=io(()=>({draggable:{...Di.draggable,...null==W?void 0:W.draggable},droppable:{...Di.droppable,...null==W?void 0:W.droppable},dragOverlay:{...Di.dragOverlay,...null==W?void 0:W.dragOverlay}}),[null==(W=d)?void 0:W.draggable,null==W?void 0:W.droppable,null==W?void 0:W.dragOverlay]);var W;const{droppableRects:P,measureDroppableContainers:B,measuringScheduled:z}=function(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,a]=ro(null),{frequency:s,measure:l,strategy:c}=o,u=ao(e),d=function(){switch(c){case gi.Always:return!1;case gi.BeforeDragging:return n;default:return!n}}(),p=Mr(d),h=oo(function(e){void 0===e&&(e=[]),p.current||a(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[p]),f=ao(null),g=Nr(t=>{if(d&&!n)return vi;if(!t||t===vi||u.current!==e||null!=i){const t=new Map;for(let n of e){if(!n)continue;if(i&&i.length>0&&!i.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,r=e?new Vo(l(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,i,n,d,l]);return no(()=>{u.current=e},[e]),no(()=>{d||h()},[n,d]),no(()=>{i&&i.length>0&&a(null)},[JSON.stringify(i)]),no(()=>{d||"number"!=typeof s||null!==f.current||(f.current=setTimeout(()=>{h(),f.current=null},s))},[s,d,h,...r]),{droppableRects:g,measureDroppableContainers:h,measuringScheduled:null!=i}}($,{dragging:x,dependencies:[E.x,E.y],config:L.droppable}),F=function(e,t){const n=null!=t?e.get(t):void 0,r=n?n.node.current:null;return Nr(e=>{var n;return null==t?null:null!=(n=null!=r?r:e)?n:null},[r,t])}(C,_),H=io(()=>T?Hr(T):null,[T]),q=function(){const e=!1===(null==j?void 0:j.autoScrollEnabled),t="object"==typeof s?!1===s.enabled:!1===s,n=x&&!e&&!t;if("object"==typeof s)return{...s,enabled:n};return{enabled:n}}(),U=function(e,t){return bi(e,t)}(F,L.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=ao(!1),{x:a,y:s}="boolean"==typeof o?{x:o,y:o}:o;Or(()=>{if(!a&&!s||!t)return void(i.current=!1);if(i.current||!r)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const o=ko(n(e),r);if(a||(o.x=0),s||(o.y=0),i.current=!0,Math.abs(o.x)>0||Math.abs(o.y)>0){const t=Mo(e);t&&t.scrollBy({top:o.y,left:o.x})}},[t,a,s,r,n])}({activeNode:null!=_?C.get(_):null,config:q.layoutShiftCompensation,initialRect:U,measure:L.draggable.measure});const K=xi(F,L.draggable.measure,U),V=xi(F?F.parentElement:null),Y=ao({activatorEvent:null,active:null,activeNode:F,collisionRect:null,collisions:null,droppableRects:P,draggableNodes:C,draggingNode:null,draggingNodeRect:null,droppableContainers:k,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),X=k.getNodeFor(null==(t=Y.current.over)?void 0:t.id),J=function(e){let{measure:t}=e;const[n,r]=ro(null),o=yi({callback:oo(e=>{for(const{target:n}of e)if(Rr(n)){r(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),i=oo(e=>{const n=Si(e);null==o||o.disconnect(),n&&(null==o||o.observe(n)),r(n?t(n):null)},[t,o]),[a,s]=Ir(i);return io(()=>({nodeRef:a,rect:n,setRef:s}),[n,a,s])}({measure:L.dragOverlay.measure}),Q=null!=(n=J.nodeRef.current)?n:F,G=x?null!=(r=J.rect)?r:K:null,Z=Boolean(J.nodeRef.current&&J.rect),ee=ko(te=Z?null:K,bi(te));var te;const ne=Ei(Q?Sr(Q):null),re=function(e){const t=ao(e),n=Nr(n=>e?n&&n!==_i&&e&&t.current&&e.parentNode===t.current.parentNode?n:To(e):_i,[e]);return no(()=>{t.current=e},[e]),n}(x?null!=X?X:F:null),oe=function(e,t){void 0===t&&(t=jo);const[n]=e,r=Ei(n?Sr(n):null),[o,i]=ro(ki);function a(){i(()=>e.length?e.map(e=>Po(e)?r:new Vo(t(e),e)):ki)}const s=yi({callback:a});return Or(()=>{null==s||s.disconnect(),a(),e.forEach(e=>null==s?void 0:s.observe(e))},[e]),o}(re),ie=Wi(p,{transform:{x:E.x-ee.x,y:E.y-ee.y,scaleX:1,scaleY:1},activatorEvent:T,active:R,activeNodeRect:K,containerNodeRect:V,draggingNodeRect:G,over:Y.current.over,overlayNodeRect:J.rect,scrollableAncestors:re,scrollableAncestorRects:oe,windowRect:ne}),ae=H?Br(H,E):null,se=function(e){const[t,n]=ro(null),r=ao(e),o=oo(e=>{const t=No(e.target);t&&n(e=>e?(e.set(t,Lo(t)),new Map(e)):null)},[]);return no(()=>{const t=r.current;if(e!==t){i(t);const a=e.map(e=>{const t=No(e);return t?(t.addEventListener("scroll",o,{passive:!0}),[t,Lo(t)]):null}).filter(e=>null!=e);n(a.length?new Map(a):null),r.current=e}return()=>{i(e),i(t)};function i(e){e.forEach(e=>{const t=No(e);null==t||t.removeEventListener("scroll",o)})}},[o,e]),io(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>Br(e,t),wo):qo(e):wo,[e,t])}(re),le=Ci(se),ce=Ci(se,[K]),ue=Br(ie,le),de=G?So(G,ie):null,pe=R&&de?u({active:R,collisionRect:de,droppableRects:P,droppableContainers:$,pointerCoordinates:ae}):null,he=function(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}(pe,"id"),[fe,ge]=ro(null),me=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(Z?ie:Br(ie,ce),null!=(o=null==fe?void 0:fe.rect)?o:null,K),ve=ao(null),be=oo((e,t)=>{let{sensor:n,options:r}=t;if(null==D.current)return;const o=C.get(D.current);if(!o)return;const i=e.nativeEvent,a=new n({active:D.current,activeNode:o,event:i,options:r,context:Y,onAbort(e){if(!C.get(e))return;const{onDragAbort:t}=N.current,n={id:e};null==t||t(n),v({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!C.get(e))return;const{onDragPending:o}=N.current,i={id:e,constraint:t,initialCoordinates:n,offset:r};null==o||o(i),v({type:"onDragPending",event:i})},onStart(e){const t=D.current;if(null==t)return;const n=C.get(t);if(!n)return;const{onDragStart:r}=N.current,o={activatorEvent:i,active:{id:t,data:n.data,rect:A}};ho(()=>{null==r||r(o),w(Bi.Initializing),m({type:bo.DragStart,initialCoordinates:e,active:t}),v({type:"onDragStart",event:o}),O(ve.current),M(i)})},onMove(e){m({type:bo.DragMove,coordinates:e})},onEnd:s(bo.DragEnd),onCancel:s(bo.DragCancel)});function s(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:o}=Y.current;let a=null;if(t&&o){const{cancelDrop:s}=N.current;if(a={activatorEvent:i,active:t,collisions:n,delta:o,over:r},e===bo.DragEnd&&"function"==typeof s){await Promise.resolve(s(a))&&(e=bo.DragCancel)}}D.current=null,ho(()=>{m({type:e}),w(Bi.Uninitialized),ge(null),O(null),M(null),ve.current=null;const t=e===bo.DragEnd?"onDragEnd":"onDragCancel";if(a){const e=N.current[t];null==e||e(a),v({type:t,event:a})}})}}ve.current=a},[C]),ye=oo((e,t)=>(n,r)=>{const o=n.nativeEvent,i=C.get(r);if(null!==D.current||!i||o.dndKit||o.defaultPrevented)return;const a={active:i};!0===e(n,t.options,a)&&(o.dndKit={capturedBy:t.sensor},D.current=r,be(n,t))},[C,be]),we=function(e,t){return io(()=>e.reduce((e,n)=>{const{sensor:r}=n;return[...e,...r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}))]},[]),[e,t])}(c,ye);!function(e){no(()=>{if(!Cr)return;const t=e.map(e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()});return()=>{for(const e of t)null==e||e()}},e.map(e=>{let{sensor:t}=e;return t}))}(c),Or(()=>{K&&y===Bi.Initializing&&w(Bi.Initialized)},[K,y]),no(()=>{const{onDragMove:e}=N.current,{active:t,activatorEvent:n,collisions:r,over:o}=Y.current;if(!t||!n)return;const i={active:t,activatorEvent:n,collisions:r,delta:{x:ue.x,y:ue.y},over:o};ho(()=>{null==e||e(i),v({type:"onDragMove",event:i})})},[ue.x,ue.y]),no(()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:o}=Y.current;if(!e||null==D.current||!t||!o)return;const{onDragOver:i}=N.current,a=r.get(he),s=a&&a.rect.current?{id:a.id,rect:a.rect.current,data:a.data,disabled:a.disabled}:null,l={active:e,activatorEvent:t,collisions:n,delta:{x:o.x,y:o.y},over:s};ho(()=>{ge(s),null==i||i(l),v({type:"onDragOver",event:l})})},[he]),Or(()=>{Y.current={activatorEvent:T,active:R,activeNode:F,collisionRect:de,collisions:pe,droppableRects:P,draggableNodes:C,draggingNode:Q,draggingNodeRect:G,droppableContainers:k,over:fe,scrollableAncestors:re,scrollAdjustedTranslate:ue},A.current={initial:G,translated:de}},[R,F,pe,de,C,Q,G,P,k,fe,re,ue]),hi({...q,delta:E,draggingRect:de,pointerCoordinates:ae,scrollableAncestors:re,scrollableAncestorRects:oe});const xe=io(()=>({active:R,activeNode:F,activeNodeRect:K,activatorEvent:T,collisions:pe,containerNodeRect:V,dragOverlay:J,draggableNodes:C,droppableContainers:k,droppableRects:P,over:fe,measureDroppableContainers:B,scrollableAncestors:re,scrollableAncestorRects:oe,measuringConfiguration:L,measuringScheduled:z,windowRect:ne}),[R,F,K,T,pe,V,J,C,k,P,fe,B,re,oe,L,z,ne]),_e=io(()=>({activatorEvent:T,activators:we,active:R,activeNodeRect:K,ariaDescribedById:{draggable:I},dispatch:m,draggableNodes:C,over:fe,measureDroppableContainers:B}),[T,we,R,K,m,I,C,fe,B]);return Zr.createElement(fo.Provider,{value:b},Zr.createElement(Mi.Provider,{value:_e},Zr.createElement(Ni.Provider,{value:xe},Zr.createElement(Pi.Provider,{value:me},l)),Zr.createElement(Li,{disabled:!1===(null==a?void 0:a.restoreFocus)})),Zr.createElement(vo,{...a,hiddenTextDescribedById:I}))});const zi=eo(null),Fi="button";function Hi(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=Wr("Draggable"),{activators:a,activatorEvent:s,active:l,activeNodeRect:c,ariaDescribedById:u,draggableNodes:d,over:p}=to(Mi),{role:h=Fi,roleDescription:f="draggable",tabIndex:g=0}=null!=o?o:{},m=(null==l?void 0:l.id)===t,v=to(m?Pi:zi),[b,y]=Ir(),[w,x]=Ir(),_=function(e,t){return io(()=>e.reduce((e,n)=>{let{eventName:r,handler:o}=n;return e[r]=e=>{o(e,t)},e},{}),[e,t])}(a,t),C=Mr(n);Or(()=>(d.set(t,{id:t,key:i,node:b,activatorNode:w,data:C}),()=>{const e=d.get(t);e&&e.key===i&&d.delete(t)}),[d,t]);return{active:l,activatorEvent:s,activeNodeRect:c,attributes:io(()=>({role:h,tabIndex:g,"aria-disabled":r,"aria-pressed":!(!m||h!==Fi)||void 0,"aria-roledescription":f,"aria-describedby":u.draggable}),[r,h,g,m,f,u.draggable]),isDragging:m,listeners:r?void 0:_,node:b,over:p,setNodeRef:y,setActivatorNodeRef:x,transform:v}}const qi={timeout:25};function Ui(e){let{animation:t,children:n}=e;const[r,o]=ro(null),[i,a]=ro(null),s=$r(n);return n||r||!s||o(s),Or(()=>{if(!i)return;const e=null==r?void 0:r.key,n=null==r?void 0:r.props.id;null!=e&&null!=n?Promise.resolve(t(n,i)).then(()=>{o(null)}):o(null)},[t,r,i]),Zr.createElement(Zr.Fragment,null,n,r?co(r,{ref:a}):null)}const Ki={x:0,y:0,scaleX:1,scaleY:1};function Vi(e){let{children:t}=e;return Zr.createElement(Mi.Provider,{value:Ti},Zr.createElement(Pi.Provider,{value:Ki},t))}const Yi={position:"fixed",touchAction:"none"},Xi=e=>Fr(e)?"transform 250ms ease":void 0,Ji=uo((e,t)=>{let{as:n,activatorEvent:r,adjustScale:o,children:i,className:a,rect:s,style:l,transform:c,transition:u=Xi}=e;if(!s)return null;const d=o?c:{...c,scaleX:1,scaleY:1},p={...Yi,width:s.width,height:s.height,top:s.top,left:s.left,transform:qr.Transform.toString(d),transformOrigin:o&&r?xo(r,s):void 0,transition:"function"==typeof u?u(r):u,...l};return Zr.createElement(n,{className:a,style:p,ref:t},i)}),Qi={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:qr.Transform.toString(t)},{transform:qr.Transform.toString(n)}]},sideEffects:(Gi={styles:{active:{opacity:"0"}}},e=>{let{active:t,dragOverlay:n}=e;const r={},{styles:o,className:i}=Gi;if(null!=o&&o.active)for(const[e,n]of Object.entries(o.active))void 0!==n&&(r[e]=t.node.style.getPropertyValue(e),t.node.style.setProperty(e,n));if(null!=o&&o.dragOverlay)for(const[e,t]of Object.entries(o.dragOverlay))void 0!==t&&n.node.style.setProperty(e,t);return null!=i&&i.active&&t.node.classList.add(i.active),null!=i&&i.dragOverlay&&n.node.classList.add(i.dragOverlay),function(){for(const[e,n]of Object.entries(r))t.node.style.setProperty(e,n);null!=i&&i.active&&t.node.classList.remove(i.active)}})};var Gi;function Zi(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return Tr((e,i)=>{if(null===t)return;const a=n.get(e);if(!a)return;const s=a.node.current;if(!s)return;const l=Si(i);if(!l)return;const{transform:c}=Sr(i).getComputedStyle(i),u=Ro(c);if(!u)return;const d="function"==typeof t?t:function(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...Qi,...e};return e=>{let{active:i,dragOverlay:a,transform:s,...l}=e;if(!t)return;const c={x:a.rect.left-i.rect.left,y:a.rect.top-i.rect.top},u={scaleX:1!==s.scaleX?i.rect.width*s.scaleX/a.rect.width:1,scaleY:1!==s.scaleY?i.rect.height*s.scaleY/a.rect.height:1},d={x:s.x-c.x,y:s.y-c.y,...u},p=o({...l,active:i,dragOverlay:a,transform:{initial:s,final:d}}),[h]=p,f=p[p.length-1];if(JSON.stringify(h)===JSON.stringify(f))return;const g=null==r?void 0:r({active:i,dragOverlay:a,...l}),m=a.node.animate(p,{duration:t,easing:n,fill:"forwards"});return new Promise(e=>{m.onfinish=()=>{null==g||g(),e()}})}}(t);return Uo(s,o.draggable.measure),d({active:{id:e,data:a.data,node:s,rect:o.draggable.measure(s)},draggableNodes:n,dragOverlay:{node:i,rect:o.dragOverlay.measure(l)},droppableContainers:r,measuringConfiguration:o,transform:u})})}let ea=0;function ta(e){return io(()=>{if(null!=e)return ea++,ea},[e])}const na=Zr.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:o,transition:i,modifiers:a,wrapperElement:s="div",className:l,zIndex:c=999}=e;const{activatorEvent:u,active:d,activeNodeRect:p,containerNodeRect:h,draggableNodes:f,droppableContainers:g,dragOverlay:m,over:v,measuringConfiguration:b,scrollableAncestors:y,scrollableAncestorRects:w,windowRect:x}=to(Ni),_=to(Pi),C=ta(null==d?void 0:d.id),E=Wi(a,{activatorEvent:u,active:d,activeNodeRect:p,containerNodeRect:h,draggingNodeRect:m.rect,over:v,overlayNodeRect:m.rect,scrollableAncestors:y,scrollableAncestorRects:w,transform:_,windowRect:x}),k=bi(p),S=Zi({config:r,draggableNodes:f,droppableContainers:g,measuringConfiguration:b}),A=k?m.setRef:void 0;return Zr.createElement(Vi,null,Zr.createElement(Ui,{animation:S},d&&C?Zr.createElement(Ji,{key:C,id:d.id,ref:A,as:s,activatorEvent:u,adjustScale:t,className:l,transition:i,rect:k,style:{zIndex:c,...o},transform:E},n):null))}),ra=t,{useEffect:oa}=t,{useRef:ia}=t,aa=n,{styled:sa}=r,{Chip:la}=i,{color:ca}=a,{renderMath:ua}=d;function da(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],i=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=i(n)):"call"!==o&&"optionalCall"!==o||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}const pa=sa("span")(({theme:e,disabled:t})=>({border:`solid 0px ${e.palette.primary.main}`,borderRadius:e.spacing(2),margin:e.spacing(.5),transform:"translate(0, 0)",display:"inline-flex",...t&&{}})),ha=sa(la)(()=>({backgroundColor:ca.white(),border:`1px solid ${ca.text()}`,color:ca.text(),alignItems:"center",display:"inline-flex",height:"initial",minHeight:"32px",fontSize:"inherit",whiteSpace:"pre-wrap",maxWidth:"374px",pointerEvents:"none",borderRadius:"3px",paddingTop:"12px",paddingBottom:"12px","&.Mui-disabled":{opacity:1}})),fa=sa("span")(()=>({whiteSpace:"normal","& img":{display:"block",padding:"2px 0"},"& mjx-frac":{fontSize:"120% !important"}}));function ga({choice:e,disabled:t,instanceId:n}){const r=ia(null),{attributes:o,listeners:i,setNodeRef:a,isDragging:s}=Hi({id:`choice-${e.id}`,data:{choice:e,instanceId:n,fromChoice:!0,type:"MaskBlank"},disabled:t});return oa(()=>{ua(r.current)},[e.value]),ra.createElement(pa,{ref:a,style:s?{width:da([r,"access",e=>e.current,"optionalAccess",e=>e.offsetWidth]),height:da([r,"access",e=>e.current,"optionalAccess",e=>e.offsetHeight])}:{},disabled:t,...i,...o},ra.createElement(ha,{clickable:!1,disabled:t,ref:r,label:ra.createElement(fa,{dangerouslySetInnerHTML:{__html:e.value}})}))}ga.propTypes={choice:aa.object.isRequired,disabled:aa.bool,instanceId:aa.oneOfType([aa.string,aa.number])};const ma=t,va=n,{DragDroppablePlaceholder:ba}=f;class ya extends ma.Component{constructor(...e){super(...e),ya.prototype.__init.call(this)}static __initStatic(){this.propTypes={disabled:va.bool,duplicates:va.bool,choices:va.arrayOf(va.shape({label:va.string,value:va.string})),value:va.object,choicePosition:va.string.isRequired,instanceId:va.string}}__init(){this.getStyleForWrapper=()=>{const{choicePosition:e}=this.props;switch(e){case"above":return{margin:"0 0 40px 0"};case"below":return{margin:"40px 0 0 0"};case"right":return{margin:"0 0 0 40px"};default:return{margin:"0 40px 0 0"}}}}render(){const{disabled:e,duplicates:t,choices:n,value:r,instanceId:o}=this.props,i=n.filter(e=>{if(!0===t)return!0;const n=function(e,t){var n;return Xt(e,function(e,r,o){if(t(e,r,o))return n=r,!1}),n}(r,Ut(t=>t===e.id));return void 0===n}),a={...this.getStyleForWrapper(),minWidth:"100px"};return ma.createElement("div",{style:a},ma.createElement(ba,{disabled:e,instanceId:o},i.map((t,n)=>ma.createElement(ga,{key:`${t.value}-${n}`,disabled:e,choice:t,instanceId:o}))))}}ya.__initStatic();const wa=t,{useEffect:xa}=t,{useRef:_a}=t,{useState:Ca}=t,Ea=n,ka=e,{styled:Sa}=r,{Chip:Aa}=i,Ra=s,{color:Da}=a,{renderMath:ja}=d;function Oa(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],i=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=i(n)):"call"!==o&&"optionalCall"!==o||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}ka("pie-lib:mask-markup:blank");const Ta=Sa("span")(({dragged:e,over:t})=>({border:`solid 0px ${Da.primary()}`,minWidth:"200px",touchAction:"none",overflow:"hidden",whiteSpace:"nowrap",opacity:1,...t&&{whiteSpace:"nowrap",overflow:"hidden"},...e&&{opacity:.5}})),Ma=Sa(Aa)(()=>({backgroundColor:Da.background(),border:`2px dashed ${Da.text()}`,touchAction:"none",color:Da.text(),fontSize:"inherit",maxWidth:"374px",position:"relative",borderRadius:"3px","&.over":{whiteSpace:"nowrap",overflow:"hidden"},"&.parentOver":{border:`1px solid ${g[500]}`,backgroundColor:`${g[300]}`},"&.correct":{border:`solid 1px ${Da.correct()}`},"&.incorrect":{border:`solid 1px ${Da.incorrect()}`},"&.Mui-disabled":{opacity:1}})),Na=Sa("span")(()=>({whiteSpace:"normal",pointerEvents:"none","& img":{display:"block",padding:"2px 0"},"& p":{marginTop:"0",marginBottom:"0"},"& mjx-frac":{fontSize:"120% !important"},"&.over":{whiteSpace:"nowrap",overflow:"hidden"},"&.hidden":{color:"transparent",opacity:0},"&.dragged":{position:"absolute",left:16,maxWidth:"60px",top:"50%",transform:"translateY(-50%)"}}));function Ia({disabled:e,choice:t,isOver:n,isDragging:r,dragItem:o,correct:i,emptyResponseAreaWidth:a,emptyResponseAreaHeight:s}){const l=_a(null),c=_a(null),u=_a(null),[d,p]=Ca({height:0,width:0}),h=()=>{g()},f=()=>{const e=Oa([c,"access",e=>e.current,"optionalAccess",e=>e.querySelector,"call",e=>e("img")]);e?e.onload=h:setTimeout(()=>{g()},300)},g=()=>{if(c.current&&l.current){l.current.style.width="auto",l.current.style.height="auto",l.current.offsetHeight;const e=(()=>{if(!c.current)return null;if(c.current.querySelector("mjx-container")&&c.current.parentElement)return c.current.parentElement;return c.current.querySelector("img")||c.current})()||c.current,t=e.getBoundingClientRect(),n=(t.width||e.offsetWidth||0)+24,r=Math.max(t.height||0,e.offsetHeight||0,e.scrollHeight||0,c.current.scrollHeight||0)+24,o=parseFloat(a)||0,i=parseFloat(s)||0,u=n<=o?o:n,d=r<=i?i:r;p(e=>({width:u>o?u:e.width,height:d>i?d:e.height})),l.current.style.width=`${u}px`,l.current.style.height=`${d}px`}};xa(()=>{f()},[]),xa(()=>{l.current&&ja(l.current)},[n,Oa([o,"optionalAccess",e=>e.choice,"optionalAccess",e=>e.value])]),xa(()=>{t?f():p({height:0,width:0})},[t]),xa(()=>{n||r||(u.current={width:l.current.offsetWidth,height:l.current.offsetHeight})},[t,n,r]);const m=o&&n&&o.choice&&o.choice.value,v=t&&t.value,b=n||r?{width:Oa([u,"access",e=>e.current,"optionalAccess",e=>e.width]),height:Oa([u,"access",e=>e.current,"optionalAccess",e=>e.height])}:(()=>{const e=isNaN(parseFloat(a))?0:parseFloat(a),t=isNaN(parseFloat(s))?0:parseFloat(s);return{...{height:d.height||t,width:d.width||e},...e?{}:{minWidth:90},...t?{}:{minHeight:32}}})();return wa.createElement(Ma,{clickable:!1,disabled:e,ref:l,component:"span",label:wa.createElement(wa.Fragment,null,wa.createElement(Na,{ref:c,draggable:!0,className:Ra({over:n,hidden:m}),dangerouslySetInnerHTML:{__html:v||""}}),m&&wa.createElement(Na,{draggable:!0,className:Ra({over:n,dragged:!0}),dangerouslySetInnerHTML:{__html:m||""}})),className:Ra({over:n,parentOver:n,correct:void 0!==i&&i,incorrect:void 0!==i&&!i}),variant:e?"outlined":void 0,style:b})}function $a({id:e,disabled:t,duplicates:n,choice:r,correct:o,onChange:i,emptyResponseAreaWidth:a,emptyResponseAreaHeight:s,instanceId:l}){const{attributes:c,listeners:u,setNodeRef:d,transform:p,isDragging:h}=Hi({id:`mask-blank-drag-${e}`,disabled:t||!r,data:{id:e,choice:r,instanceId:l,fromChoice:!1,type:"MaskBlank"}}),{setNodeRef:f,isOver:g,active:m}=function(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=Wr("Droppable"),{active:a,dispatch:s,over:l,measureDroppableContainers:c}=to(Mi),u=ao({disabled:n}),d=ao(!1),p=ao(null),h=ao(null),{disabled:f,updateMeasurementsFor:g,timeout:m}={...qi,...o},v=Mr(null!=g?g:r),b=yi({callback:oo(()=>{d.current?(null!=h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{c(Array.isArray(v.current)?v.current:[v.current]),h.current=null},m)):d.current=!0},[m]),disabled:f||!a}),y=oo((e,t)=>{b&&(t&&(b.unobserve(t),d.current=!1),e&&b.observe(e))},[b]),[w,x]=Ir(y),_=Mr(t);return no(()=>{b&&w.current&&(b.disconnect(),d.current=!1,b.observe(w.current))},[w,b]),no(()=>(s({type:bo.RegisterDroppable,element:{id:r,key:i,disabled:n,node:w,rect:p,data:_}}),()=>s({type:bo.UnregisterDroppable,key:i,id:r})),[r]),no(()=>{n!==u.current.disabled&&(s({type:bo.SetDroppableDisabled,id:r,key:i,disabled:n}),u.current.disabled=n)},[r,i,n,s]),{active:a,rect:p,isOver:(null==l?void 0:l.id)===r,node:w,over:l,setNodeRef:x}}({id:`mask-blank-drop-${e}`,data:{id:e,accepts:["MaskBlank"],instanceId:l}}),v={transform:qr.Translate.toString(p)};return wa.createElement(Ta,{ref:e=>{d(e),f(e)},style:v,dragged:h,over:g,...c,...u},wa.createElement(Ia,{id:e,disabled:t,duplicates:n,choice:r,isOver:g,dragItem:Oa([m,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current]),correct:o,onChange:i,emptyResponseAreaWidth:a,emptyResponseAreaHeight:s,instanceId:l}))}Ia.defaultProps={emptyResponseAreaWidth:0,emptyResponseAreaHeight:0},Ia.propTypes={id:Ea.oneOfType([Ea.string,Ea.number]),disabled:Ea.bool,duplicates:Ea.bool,choice:Ea.object,isOver:Ea.bool,dragItem:Ea.object,correct:Ea.bool,onChange:Ea.func,emptyResponseAreaWidth:Ea.oneOfType([Ea.string,Ea.number]),emptyResponseAreaHeight:Ea.oneOfType([Ea.string,Ea.number]),instanceId:Ea.string},$a.defaultProps={emptyResponseAreaWidth:0,emptyResponseAreaHeight:0},$a.propTypes={id:Ea.oneOfType([Ea.string,Ea.number]),disabled:Ea.bool,duplicates:Ea.bool,choice:Ea.object,correct:Ea.bool,onChange:Ea.func,emptyResponseAreaWidth:Ea.oneOfType([Ea.string,Ea.number]),emptyResponseAreaHeight:Ea.oneOfType([Ea.string,Ea.number]),instanceId:Ea.string};const La=t,Wa=n,{DragProvider:Pa}=f;function Ba(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],i=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=i(n)):"call"!==o&&"optionalCall"!==o||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}const za=vr("blank",e=>(t,n,r)=>{const o=Ba([t,"access",e=>e.data,"optionalAccess",e=>e.dataset])||{};if("blank"===o.component){const{disabled:i,duplicates:a,correctResponse:s,feedback:l,showCorrectAnswer:c,emptyResponseAreaWidth:u,emptyResponseAreaHeight:d,instanceId:p,isDragging:h}=e,f=c?s[o.id]:n[o.id],g=f&&e.choices.find(e=>e.id===f);return La.createElement($a,{key:`${t.type}-${o.id}`,correct:c||l&&l[o.id],disabled:i,duplicates:a,choice:g,id:o.id,emptyResponseAreaWidth:u,emptyResponseAreaHeight:d,onChange:(e,t)=>{const o={...n};void 0===t?delete o[e]:o[e]=t,r(o)},instanceId:p,isDragging:h})}});class Fa extends La.Component{constructor(e){super(e),Fa.prototype.__init.call(this),Fa.prototype.__init2.call(this),Fa.prototype.__init3.call(this),Fa.prototype.__init4.call(this),this.state={activeDragItem:null,dropAnimation:void 0}}static __initStatic(){this.propTypes={markup:Wa.string,layout:Wa.object,choicesPosition:Wa.string,choices:Wa.array,value:Wa.object,onChange:Wa.func,duplicates:Wa.bool,disabled:Wa.bool,feedback:Wa.object,correctResponse:Wa.object,showCorrectAnswer:Wa.bool,emptyResponseAreaWidth:Wa.oneOfType([Wa.string,Wa.number]),emptyResponseAreaHeight:Wa.oneOfType([Wa.string,Wa.number]),instanceId:Wa.string}}static __initStatic2(){this.defaultProps={instanceId:"drag-in-the-blank"}}__init(){this.handleDragStart=e=>{const{active:t}=e;Ba([t,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current])&&this.setState({activeDragItem:t.data.current,dropAnimation:void 0})}}__init2(){this.renderDragOverlay=()=>{const{activeDragItem:e}=this.state;return e&&"MaskBlank"===e.type?La.createElement(ga,{disabled:e.disabled,choice:e.choice,instanceId:e.instanceId}):null}}__init3(){this.handleDragEnd=e=>{const{active:t,over:n}=e,{onChange:r,value:o}=this.props,i=Ba([t,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current]),a=Ba([n,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current]),s=!!t&&!!n&&"MaskBlank"===Ba([i,"optionalAccess",e=>e.type])&&Ba([a,"optionalAccess",e=>e.accepts,"optionalAccess",e=>e.includes,"call",e=>e("MaskBlank")]);if(this.setState({activeDragItem:null,dropAnimation:s?null:void 0}),!s||!r)return;const l=i,c=a.id;if(!0===a.toChoiceBoard){if(!l.fromChoice&&l.id){const e={...o};delete e[l.id],r(e)}}else if(!0===l.fromChoice){if(c&&"drag-in-the-blank-droppable"!==c){const e={...o};e[c]=l.choice.id,r(e)}}else if(l.id&&l.id!==c){const e={...o};e[c]=l.choice.id,delete e[l.id],r(e)}}}__init4(){this.getPositionDirection=e=>{let t,n,r;switch(e){case"left":t="row",r="center";break;case"right":t="row-reverse",n="flex-end",r="center";break;case"below":t="column-reverse";break;default:t="column"}return{flexDirection:t,justifyContent:n,alignItems:r}}}render(){const{markup:e,duplicates:t,value:n,onChange:r,choicesPosition:o,choices:i,correctResponse:a,disabled:s,feedback:l,showCorrectAnswer:c,emptyResponseAreaWidth:u,emptyResponseAreaHeight:d,layout:p,instanceId:h}=this.props,f=o||"below",g={display:"flex",minWidth:"100px",...this.getPositionDirection(f)};return La.createElement(Pa,{onDragStart:this.handleDragStart,onDragEnd:this.handleDragEnd,collisionDetection:Eo},La.createElement("div",{ref:e=>this.rootRef=e,style:g},La.createElement(ya,{choicePosition:f,choices:i,value:n,duplicates:t,disabled:s,instanceId:h}),La.createElement(za,{elementType:"drag-in-the-blank",markup:e,layout:p,value:n,choices:i,onChange:r,disabled:s,duplicates:t,feedback:l,correctResponse:a,showCorrectAnswer:c,emptyResponseAreaWidth:u,emptyResponseAreaHeight:d,instanceId:h,isDragging:!!this.state.activeDragItem}),La.createElement(na,{style:{pointerEvents:"none"},dropAnimation:this.state.dropAnimation},this.renderDragOverlay())))}}Fa.__initStatic(),Fa.__initStatic2();const Ha=t,{styled:qa}=r,Ua=s,{color:Ka}=a;function Va(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],i=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=i(n)):"call"!==o&&"optionalCall"!==o||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}let Ya,Xa;"undefined"!=typeof window&&(Ya=require("@pie-lib/editable-html-tip-tap").default,Xa=qa(Ya)(()=>({display:"inline-block",verticalAlign:"middle",margin:"4px",borderRadius:"4px",border:`1px solid ${Ka.black()}`,"&.correct":{border:`1px solid ${Ka.correct()}`},"&.incorrect":{border:`1px solid ${Ka.incorrect()}`}})));vr("input",e=>(t,n)=>{const{adjustedLimit:r,disabled:o,feedback:i,showCorrectAnswer:a,maxLength:s,spellCheck:l,pluginProps:c,onChange:u}=e,d=Va([t,"access",e=>e.data,"optionalAccess",e=>e.dataset])||{};if("input"===d.component){const p=(e.choices&&d&&e.choices[d.id]||[])[0],h=a?p&&p.label:n[d.id]||"",f=s&&s[d.id],g=i&&i[d.id],m=a||"correct"===g,v=!a&&"incorrect"===g,b=e=>{const t={...n,[d.id]:e};u(t)},y=e=>{if("Enter"===e.key||13===e.keyCode)return!0};return Ha.createElement(Xa,{id:d.id,key:`${t.type}-input-${d.id}`,disabled:a||o,disableUnderline:!0,onChange:b,markup:h||"",charactersLimit:r?f:25,activePlugins:["languageCharacters"],pluginProps:c,languageCharactersProps:[{language:"spanish"}],spellCheck:l,adjustWidthForLimit:!0,onKeyDown:y,autoWidthToolbar:!0,toolbarOpts:{minWidth:"auto",noBorder:!0,isHidden:!!Va([c,"optionalAccess",e=>e.characters,"optionalAccess",e=>e.disabled])},className:Ua({correct:m,incorrect:v})})}});var Ja=vr("input",e=>(t,n,r)=>{const o=t.data&&t.data.dataset||{};if("input"===o.component)return e.customMarkMarkupComponent(o.id)});const Qa=t,Ga=n,{Button:Za}=i,{InputLabel:es}=i,{Menu:ts}=i,{MenuItem:ns}=i,{ArrowDropDown:rs}=l,{ArrowDropUp:os}=l,{Close:is}=l,{Check:as}=l,{styled:ss}=r,{color:ls}=a,{renderMath:cs}=d,us=ss(Za)(()=>({color:ls.text(),border:`1px solid ${ls.borderGray()}`,borderRadius:"4px",justifyContent:"space-between",backgroundColor:ls.background(),position:"relative",height:"45px",width:"fit-content",margin:"2px",textTransform:"none","& span":{paddingRight:"5px"},"& svg":{position:"absolute",right:0,top:"calc(50% - 12px)",pointerEvents:"none",color:ls.text(),marginLeft:"5px"},"&.Mui-focused":{outline:`3px solid ${ls.tertiary()}`,outlineOffset:"2px",borderWidth:"3px"},"&.disabledCorrect":{borderWidth:"2px",borderColor:ls.correct(),color:`${ls.text()} !important`},"&.disabledIncorrect":{borderWidth:"2px",borderColor:ls.incorrectWithIcon(),color:`${ls.text()} !important`}})),ds=ss(ts)(()=>({backgroundColor:ls.background(),border:`1px solid ${ls.correct()} !important`,"&:hover":{border:`1px solid ${ls.text()} `,borderColor:"initial"},"&:focus":{border:`1px solid ${ls.text()}`,borderColor:"initial"},"& .MuiList-root":{padding:0}})),ps=ss(ns)(()=>({height:24,overflow:"hidden",fontSize:"1rem",fontWeight:400,fontFamily:"inherit",lineHeight:"1.5em",whiteSpace:"nowrap",color:ls.text(),backgroundColor:ls.background(),"&.Mui-focusVisible":{outline:`3px solid ${ls.tertiary()}`,outlineOffset:"-1px",color:ls.text(),backgroundColor:ls.background()},"&:hover":{color:ls.text(),backgroundColor:ls.dropdownBackground()},boxSizing:"border-box",padding:"25px",borderRadius:"4px","&.selected":{color:`${ls.text()} !important`,backgroundColor:`${ls.background()} !important`,"&:hover":{color:ls.text(),backgroundColor:`${ls.dropdownBackground()} !important`}}})),hs=ss("span")(()=>({fontSize:"max(1rem, 14px)"})),fs=ss("span")(()=>({fontSize:"max(1rem, 14px)",position:"absolute",right:"10px"})),gs=ss(es)(()=>({position:"absolute",left:"-10000px",top:"auto",width:"1px",height:"1px",overflow:"hidden"})),ms=ss(as)(()=>({color:`${ls.white()} !important`,position:"absolute",top:"-8px !important",left:"-8px",marginLeft:"0 !important",borderRadius:"50%",fontSize:"16px",padding:"2px","&.correct":{backgroundColor:ls.correct()},"&.incorrect":{backgroundColor:ls.incorrectWithIcon()}})),vs=ss(is)(()=>({color:`${ls.white()} !important`,position:"absolute",top:"-8px !important",left:"-8px",marginLeft:"0 !important",borderRadius:"50%",fontSize:"16px",padding:"2px","&.correct":{backgroundColor:ls.correct()},"&.incorrect":{backgroundColor:ls.incorrectWithIcon()}}));class bs extends Qa.Component{static __initStatic(){this.propTypes={id:Ga.string,value:Ga.string,disabled:Ga.bool,onChange:Ga.func,correct:Ga.bool,choices:Ga.arrayOf(Ga.shape({value:Ga.string,label:Ga.string})),showCorrectAnswer:Ga.bool,singleQuery:Ga.bool,correctValue:Ga.string}}constructor(e){super(e),bs.prototype.__init.call(this),bs.prototype.__init2.call(this),bs.prototype.__init3.call(this),bs.prototype.__init4.call(this),bs.prototype.__init5.call(this),this.state={anchorEl:null,highlightedOptionId:null,menuWidth:null,previewValue:null},this.hiddenRef=Qa.createRef(),this.buttonRef=Qa.createRef(),this.previewRef=Qa.createRef(),this.elementRefs=[]}componentDidMount(){this.hiddenRef.current&&null===this.state.menuWidth&&this.setState({menuWidth:this.hiddenRef.current.clientWidth})}componentDidUpdate(e,t){const n=this.hiddenRef.current;if(!t.anchorEl&&this.state.anchorEl&&this.elementRefs.forEach(e=>{if(!e)return;const t=e.querySelector("[data-latex], [data-raw]"),n=e.querySelector("mjx-container"),r=e.querySelector('[data-math-handled="true"]');!t||r&&n||cs(e)}),n){const e=n.clientWidth;e!==this.state.menuWidth&&(this.elementRefs.forEach(e=>{e&&cs(e)}),cs(n),this.setState({menuWidth:e}))}}__init(){this.handleClick=e=>this.setState({anchorEl:e.currentTarget})}__init2(){this.handleClose=()=>{const{value:e}=this.props;this.setState({anchorEl:null,previewValue:null,highlightedOptionId:null}),!e&&this.previewRef.current&&(this.previewRef.current.innerHTML="")}}__init3(){this.handleHighlight=e=>{const t={highlightedOptionId:`dropdown-option-${this.props.id}-${e}`};this.props.value||(t.previewValue=this.props.choices[e].value),this.setState(t)}}__init4(){this.handleSelect=(e,t)=>{this.props.onChange(this.props.id,e),this.handleHighlight(t),this.handleClose()}}__init5(){this.handleHover=e=>{if(this.props.value)return;const t=`dropdown-option-${this.props.id}-${e}`,n=this.state.previewValue;this.setState({highlightedOptionId:t,previewValue:n},()=>{const t=this.elementRefs[e],n=this.previewRef.current;t&&n&&(n.innerHTML=t.innerHTML)})}}getLabel(e,t){const n=(e||[]).find(e=>e.value===t);return n?n.label.trim():void 0}render(){const{id:e,correct:t,disabled:n,value:r,choices:o,showCorrectAnswer:i,singleQuery:a,correctValue:s}=this.props,{anchorEl:l}=this.state,c=Boolean(l),u=`dropdown-button-${e}`,d=`dropdown-menu-${e}`,p=`dropdown-value-${e}`;let h;this.elementRefs=[],n&&void 0!==t&&(h=t||i?"disabledCorrect":"disabledIncorrect");const f=parseInt(e,10)+1,g=a?"Query-label":`Query-label-${f}`,m=a?"Query":`Query ${f}`;let v=null;return n&&void 0!==t&&(v=t||i?Qa.createElement(ms,{className:"correct"}):Qa.createElement(vs,{className:"incorrect"})),Qa.createElement(Qa.Fragment,null,Qa.createElement("div",{ref:this.hiddenRef,style:{position:"absolute",visibility:"hidden",top:0,left:0},tabIndex:-1,"aria-hidden":"true"},(o||[]).map((e,t)=>Qa.createElement(ps,{key:t,tabIndex:-1,"aria-hidden":"true"},Qa.createElement(hs,{dangerouslySetInnerHTML:{__html:e.label}})))),Qa.createElement(gs,{id:g,tabIndex:-1,"aria-hidden":"true"},m),Qa.createElement(us,{ref:this.buttonRef,style:{...this.state.menuWidth&&{minWidth:`calc(${this.state.menuWidth}px + 8px)`},borderWidth:c?"2px":"1px",transition:"border-width 0.2s ease-in-out"},"aria-controls":c?d:void 0,"aria-haspopup":"listbox","aria-expanded":c?"true":void 0,"aria-activedescendant":this.state.highlightedOptionId,onClick:this.handleClick,className:h,disabled:n,id:u,role:"combobox","aria-label":`Select an option for ${m}`,"aria-labelledby":p},v,Qa.createElement(hs,{id:p,ref:this.previewRef,dangerouslySetInnerHTML:{__html:s||(c&&this.state.previewValue?this.getLabel(o,this.state.previewValue):this.getLabel(o,r)||"")}}),c?Qa.createElement(os,null):Qa.createElement(rs,null)),Qa.createElement(ds,{id:d,anchorEl:l,keepMounted:!0,open:c,onClose:this.handleClose,getContentAnchorEl:null,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},transitionDuration:{enter:225,exit:195},slotProps:{paper:this.state.menuWidth?{style:{minWidth:this.state.menuWidth,padding:"4px"}}:void 0,list:{"aria-labelledby":u,role:"listbox",disablePadding:!0}}},(o||[]).map((t,n)=>{const o=`dropdown-option-${e}-${n}`;return Qa.createElement(ps,{id:o,className:t.value===r?"selected":"",key:`${t.label}-${n}`,value:t.value,onClick:()=>this.handleSelect(t.value,n),role:"option","aria-selected":this.state.highlightedOptionId===o?"true":void 0,onMouseOver:()=>this.handleHover(n)},Qa.createElement(hs,{ref:e=>this.elementRefs[n]=e,dangerouslySetInnerHTML:{__html:t.label}}),Qa.createElement(fs,{dangerouslySetInnerHTML:{__html:t.value===r?" ✓":""}}))})))}}bs.__initStatic();const ys=t;vr("dropdown",e=>(t,n,r)=>{const o=t.data&&t.data.dataset||{};if("dropdown"===o.component){const{choices:i,disabled:a,feedback:s,showCorrectAnswer:l}=e,c=i&&i[o.id]&&i[o.id].find(e=>e.correct),u=l?c&&c.value:n[o.id];return ys.createElement(bs,{key:`${t.type}-dropdown-${o.id}`,correct:s&&s[o.id]&&"correct"===s[o.id],disabled:a||l,value:u,correctValue:l?c&&c.label:void 0,id:o.id,onChange:r,choices:i[o.id],showCorrectAnswer:l,singleQuery:1==Object.keys(i).length})}});const ws=t,xs=n,{styled:_s}=r,{Tooltip:Cs}=i,{color:Es}=a,{Collapsible:ks}=a,{Readable:Ss}=a,{hasText:As}=a,{hasMedia:Rs}=a,{PreviewPrompt:Ds}=a,{UiLayout:js}=a,Os=c,Ts=o,{mq:Ms}=p,{HorizontalKeypad:Ns}=p,{updateSpans:Is}=p,$s=h,{renderMath:Ls}=d;function Ws(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],i=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=i(n)):"call"!==o&&"optionalCall"!==o||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}const Ps=_s(js)({color:Es.text(),backgroundColor:Es.background(),display:"inline-block"}),Bs=_s("div")({width:"100%",position:"relative",backgroundColor:Es.background(),color:Es.text()}),zs=_s("div")(({theme:e})=>({marginBottom:e.spacing(2)})),Fs=_s("div")(({theme:e})=>({marginBottom:e.spacing(2)})),Hs=_s("div")({position:"relative","& > div > div":{display:"flex",alignItems:"baseline",flexWrap:"wrap"},"& .mq-overarrow-inner":{border:"none !important",padding:"0 !important"},"& .mq-overarrow-inner-right":{display:"none !important"},"& .mq-overarrow-inner-left":{display:"none !important"},"& .mq-overarrow.mq-arrow-both":{minWidth:"1.23em","& *":{lineHeight:"1 !important"},"&:before":{top:"-0.4em",left:"-1px"},"&:after":{top:"-2.4em",right:"-1px"},"&.mq-empty:after":{top:"-0.45em"}},"& .mq-overarrow.mq-arrow-right":{"&:before":{top:"-0.4em",right:"-1px"}},"& .mq-longdiv-inner":{borderTop:"1px solid !important",paddingTop:"1.5px !important"},"& .mq-parallelogram":{lineHeight:.85}}),qs=_s("div")(({theme:e,$incorrect:t,$correct:n,$showCorrectness:r,$correctAnswerShown:o})=>({maxWidth:"fit-content",...t&&{borderColor:`${Es.incorrect()} !important`},...n&&{borderColor:`${Es.correct()} !important`},...r&&{border:"2px solid"},...o&&{padding:e.spacing(1),letterSpacing:"0.5px"},"& > .mq-math-mode":{"& > .mq-root-block":{"& > .mq-editable-field":{minWidth:"10px",padding:e.spacing(.25)}},"& sup":{top:0}}})),Us=_s(Ms.Static)({"& > .mq-root-block":{"& > .mq-editable-field":{borderColor:Es.text()}}}),Ks=_s("div")(({theme:e})=>({zIndex:10,minWidth:"400px",marginTop:e.spacing(2)})),Vs=_s("div")(({theme:e})=>({marginBottom:e.spacing(1),pointerEvents:"none"})),Ys=_s("h2")({position:"absolute",left:"-10000px",top:"auto",width:"1px",height:"1px",overflow:"hidden"}),Xs=_s("div")(({theme:e})=>({marginBottom:e.spacing(2)})),Js=_s(Os)(({theme:e})=>({color:Es.text(),marginBottom:e.spacing(2)}));if("undefined"!=typeof document){const e="math-templated-main-styles";if(!document.getElementById(e)){const t=document.createElement("style");t.id=e,t.textContent=`\n .block-container {\n margin: 8px !important;\n display: inline-flex;\n border: 2px solid grey !important;\n }\n .block-response {\n flex: 2;\n color: grey;\n background: rgba(0, 0, 0, 0.04);\n font-size: 0.8rem !important;\n padding: 4px !important;\n display: flex;\n align-items: center;\n justify-content: center;\n border-right: 2px solid #bdbdbd !important;\n }\n .block-math {\n color: ${Es.text()};\n background-color: ${Es.background()};\n padding: 4px !important;\n display: flex;\n align-items: center;\n justify-content: center;\n flex: 8;\n }\n .block-math > .mq-math-mode > .mq-hasCursor > .mq-cursor {\n display: none;\n }\n .correct {\n border-color: ${Es.correct()} !important;\n }\n .incorrect {\n border-color: ${Es.incorrect()} !important;\n }\n `,document.head.appendChild(t)}}let Qs=!1;const Gs=/(\{\{\d+\}\})/gm,Zs=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);function el(e=[],t){return 30*Math.floor(e.length/5)+("miscellaneous"===t?600:500)}function tl(e,t){const{responses:n,disabled:r,markup:o,printMode:i,alwaysShowCorrect:a}=e||{};if(o){if(t.showCorrect)return Object.keys(n||{}).reduce((e,t)=>(e[t]=Ws([n,"optionalAccess",e=>e[t],"optionalAccess",e=>e.answer]),e),{});return o.split(Gs).filter(e=>e).reduce((e,n)=>{if(n.match(Gs)){const o=rl.getResponseKey(n),s=t.session.answers[`r${o}`];if(i&&!a){const t="\\ \\ ".repeat(30)+"\\embed{newLine}[] ";return{...e,[o]:`\\MathQuillMathField[r${o}]{${t.repeat(3)}}`}}return r?{...e,[o]:`\\embed{answerBlock}[r${o}]`}:{...e,[o]:`\\MathQuillMathField[r${o}]{${s&&s.value||""}}`}}return e},{})}}const nl={name:"smartHorizontalPlacement",enabled:!0,phase:"main",requires:["popperOffsets"],fn:({state:e})=>{const t=e.modifiersData.popperOffsets;if(!t)return;const n=window.innerWidth||document.documentElement.clientWidth,r=e.rects.popper.width,o=e.elements.reference.getBoundingClientRect().left,i=Ws([e,"access",e=>e.elements,"access",e=>e.popper,"optionalAccess",e=>e.offsetParent]),a=Ws([i,"optionalAccess",e=>e.getBoundingClientRect,"optionalCall",e=>e()])||{left:0},s=Ws([i,"optionalAccess",e=>e.scrollLeft])||0,l=o-a.left+s,c=l-o,u=c+8,d=c+n-r-8;t.x=o+r<=n?l:l-r,t.x=d<u?u:Math.min(Math.max(t.x,u),d)}};class rl extends ws.Component{static __initStatic(){this.getResponseKey=e=>(e||"").replaceAll("{{","").replaceAll("}}","")}static __initStatic2(){this.propTypes={session:xs.object.isRequired,onSessionChange:xs.func,model:xs.object.isRequired}}constructor(e){super(e),rl.prototype.__init.call(this),rl.prototype.__init2.call(this),rl.prototype.__init3.call(this),rl.prototype.__init4.call(this),rl.prototype.__init5.call(this),rl.prototype.__init6.call(this),rl.prototype.__init7.call(this),rl.prototype.__init8.call(this),rl.prototype.__init9.call(this),rl.prototype.__init10.call(this),rl.prototype.__init11.call(this),rl.prototype.__init12.call(this),rl.prototype.__init13.call(this);const t={},{model:n,session:r}=e||{},{markup:o,alwaysShowCorrect:i}=n||{},{answers:a}=r||{};o&&(o||"").replace(Gs,e=>{const n=rl.getResponseKey(e),r=a&&a[`r${n}`];t[`r${n}`]={value:Ws([r,"optionalAccess",e=>e.value])||""}}),this.state={session:{...e.session,answers:t},activeAnswerBlock:"",showCorrect:i||!1,tooltipContainerRef:ws.createRef()}}UNSAFE_componentWillMount(){if("undefined"!=typeof window){let e=$s.getInterface(3);Qs||(e.registerEmbed("answerBlock",e=>({htmlString:`<div class="block-container">\n <div class="block-response" id="${e}Index">R</div>\n <div class="block-math">\n <span id="${e}"></span>\n </div>\n </div>`,text:()=>"text",latex:()=>`\\embed{answerBlock}[${e}]`})),Qs=!0)}}__init(){this.handleAnswerBlockDomUpdate=()=>{const{model:e}=this.props,{session:t,showCorrect:n}=this.state,r=t.answers;this.root&&e.disabled&&!n&&Object.keys(r).forEach(t=>{const n=this.root.querySelector(`#${t}`),o=this.root.querySelector(`#${t}Index`);if(n){let i=$s.getInterface(3);const a=r[t];n.textContent=a&&a.value||"",e.view&&(n.parentElement.parentElement.classList.remove("correct"),n.parentElement.parentElement.classList.remove("incorrect")),i.StaticMath(n),o.textContent="R"}}),Ls(this.root)}}UNSAFE_componentWillReceiveProps(e){const{model:t}=this.props,{model:n={}}=e||{},{markup:r="",env:o={}}=t||{},{markup:i="",env:a={},alwaysShowCorrect:s=!1}=n,l=e=>e&&"evaluate"===e.mode;l(o)&&l(a)||this.setState(e=>({...e.session,showCorrect:!1})),s&&this.setState({showCorrect:!0});const c=r.match(Gs),u=i.match(Gs);if(!nn(c,u)){const e={},t=this.state.session.answers;(u||[]).forEach(n=>{const r=rl.getResponseKey(n),o=t&&t[`r${r}`];e[`r${r}`]={value:Ws([o,"optionalAccess",e=>e.value])||""}}),this.setState(t=>({session:{...t.session,answers:e}}),()=>{this.props.onSessionChange(this.state.session),this.handleAnswerBlockDomUpdate()})}}shouldComponentUpdate(e,t){const n=nn(this.props.model,e.model),r=nn(this.state,t);return!n||!r}componentDidMount(){this.handleAnswerBlockDomUpdate(),setTimeout(()=>Ls(this.root),100)}componentDidUpdate(){this.handleAnswerBlockDomUpdate()}__init2(){this.onSubFieldFocus=e=>{const t=Array.from(Ws([this,"access",e=>e.root,"optionalAccess",e=>e.querySelectorAll,"call",e=>e(".mq-editable-field")])||[]).map(e=>({el:e,left:e.scrollLeft,top:e.scrollTop})),n=()=>{t.forEach(({el:e,left:t,top:n})=>{e.scrollLeft=t,e.scrollTop=n})};this.setState({activeAnswerBlock:e},()=>{n(),requestAnimationFrame(n),setTimeout(n,0)})}}__init3(){this.toNodeData=e=>{if(!e)return;const{type:t,value:n}=e;return"command"===t||"cursor"===t?e:"answer"===t?{type:"answer",...e}:"clear"===n?{type:"clear"}:{type:"write",value:n}}}__init4(){this.setInput=e=>{this.input=e}}__init5(){this.onClick=e=>{const t=this.toNodeData(e);"clear"===t.type?this.input.clear():"command"===t.type?Array.isArray(t.value)?t.value.forEach(e=>{this.input.cmd(e)}):this.input.cmd(t.value):"cursor"===t.type?this.input.keystroke(t.value):this.input.write(t.value);const n=[];let r=Ws([this,"access",e=>e.input,"optionalAccess",e=>e.el,"optionalCall",e=>e()])||this.root;for(;r&&r!==document.body&&r!==document.documentElement;){(r.scrollWidth>r.clientWidth||r.scrollHeight>r.clientHeight)&&n.push(r),r=r.parentElement}document.scrollingElement&&n.push(document.scrollingElement);const o=n.map(e=>({el:e,left:e.scrollLeft,top:e.scrollTop})),i={x:window.scrollX,y:window.scrollY},a=()=>{o.forEach(({el:e,left:t,top:n})=>{e.scrollLeft=t,e.scrollTop=n}),window.scrollTo(i.x,i.y)};this.input.focus(),a(),requestAnimationFrame(a),setTimeout(a,0)}}__init6(){this.callOnSessionChange=()=>{const{onSessionChange:e}=this.props;e&&e(this.state.session)}}__init7(){this.toggleShowCorrect=e=>{this.setState({showCorrect:e},this.handleAnswerBlockDomUpdate)}}__init8(){this.subFieldChanged=(e,t)=>{Is(),e&&this.setState(n=>({session:{...n.session,answers:{...n.session.answers,[e]:{value:t}}}}),this.callOnSessionChange)}}__init9(){this.getFieldName=(e,t)=>{const{answers:n}=this.state.session;if(Object.keys(n||{}).length){return Object.keys(n).find(n=>{const r=t[n];return r&&r.id==e.id})}}}__init10(){this.onBlur=e=>{const{relatedTarget:t,currentTarget:n}=e||{};const r=function e(t,n=0){if(!t||n>=16)return null;const r=t.offsetParent;return r?"tooltip"===r.getAttribute("role")?r:e(r,n+1):null}(t),o=r?function e(t,n=0){if(!t||n>=4)return null;const r=Ws([t,"optionalAccess",e=>e.children,"optionalAccess",e=>e[0]]);return r?r.attributes&&r.attributes["data-keypad"]?r:e(r,n+1):null}(r):null;t&&n&&Ws([o,"optionalAccess",e=>e.attributes,"access",e=>e["data-keypad"]])||this.setState({activeAnswerBlock:""})}}setTooltipRef(e){setTimeout(()=>{if(e&&Zs){const e=document.querySelector("[role='tooltip']");if(e){e.firstChild.setAttribute("tabindex","-1")}}},1)}__init11(){this.renderTeacherInstructions=()=>{const{model:e}=this.props,{teacherInstructions:t,animationsDisabled:n}=e||{},r=t&&(As(t)||Rs(t)),o=ws.createElement(Ds,{defaultClassName:"teacher-instructions",prompt:t});return r&&ws.createElement(Fs,null,n?o:ws.createElement(ks,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},o))}}__init12(){this.renderRationale=()=>{const{model:e}=this.props,{rationale:t,animationsDisabled:n}=e||{},r=ws.createElement(Ds,{prompt:t});return t&&(As(t)||Rs(t))&&ws.createElement(Fs,null,n?r:ws.createElement(ks,{labels:{hidden:"Show Rationale",visible:"Hide Rationale"}},r))}}__init13(){this.renderPlayerContent=()=>{const{model:e}=this.props,{activeAnswerBlock:t,showCorrect:n,session:r,tooltipContainerRef:o}=this.state,{correctness:i,disabled:a,view:s,responses:l,equationEditor:c,customKeys:u,feedback:d,env:{mode:p}={},printMode:h,alwaysShowCorrect:f}=e||{},g=tn(l),m=function(e=[]){return e.map(e=>({name:e,latex:e,write:e,label:e}))}(u),v=tl(e,this.state)||"",b=h&&!f;return ws.createElement(Hs,null,ws.createElement(Ja,{disabled:a,markup:e.markup,value:{},customMarkMarkupComponent:e=>{const l="evaluate"===p&&d&&d[e],u=ws.createElement(Us,{ref:e=>{this.mqStatic=e||this.mqStatic},latex:v[e],onSubFieldChange:this.subFieldChanged,getFieldName:this.getFieldName,setInput:this.setInput,onSubFieldFocus:this.onSubFieldFocus,onBlur:this.onBlur});return ws.createElement(qs,{ref:o,$incorrect:!g&&!l&&!n,$correct:!g&&(l||n),$showCorrectness:!g&&a&&i&&!s,$correctAnswerShown:n},ws.createElement(Cs,{ref:e=>this.setTooltipRef(e),enterTouchDelay:0,interactive:!0,open:t===`r${e}`,slotProps:{popper:{container:Ws([o,"optionalAccess",e=>e.current])||void 0,placement:"bottom-start",sx:{backgroundColor:"transparent",width:"auto",opacity:1,"& .MuiTooltip-arrow":{display:"none"}},modifiers:[{name:"preventOverflow",enabled:!0,options:{boundary:"viewport",mainAxis:!1,altAxis:!0}},{name:"flip",enabled:!1},nl]},tooltip:{sx:{fontSize:"initial",backgroundColor:"transparent",width:"auto",maxWidth:"none",marginTop:0,paddingTop:0,boxShadow:"none"}}},title:Object.keys(r.answers).map(e=>e===t&&!(n||a)&&ws.createElement(Ks,{"data-keypad":!0,key:e,style:{width:el(m,c)}},ws.createElement(Ns,{additionalKeys:m,mode:c||6,onClick:this.onClick}))||null)},b?ws.createElement(Vs,null,u):ws.createElement("div",null,u)))}}))}}render(){const{model:e}=this.props,{showCorrect:t}=this.state,{prompt:n,env:{mode:r,role:o}={},extraCSSRules:i,correctness:a,responses:s,language:l,showNote:c,note:u}=e||{},d=!tn(s)&&a&&"correct"!==a.correctness,p=(t||"view"===r&&"instructor"===o)&&c&&u;return ws.createElement(Ps,{extraCSSRules:i,ref:e=>{const t=Ts.findDOMNode(e);this.root=t||this.root}},ws.createElement(Bs,null,"gather"===r&&ws.createElement(Ys,null,"Math Equation Response Question"),ws.createElement(Bs,null,d&&ws.createElement(Js,{language:l,show:!0,toggled:t,onToggle:this.toggleShowCorrect})),this.renderTeacherInstructions(),n&&ws.createElement(zs,null,ws.createElement(Ds,{prompt:n})),ws.createElement(Ss,{false:!0},this.renderPlayerContent()),p&&ws.createElement(Xs,{className:"note",dangerouslySetInnerHTML:{__html:u}}),this.renderRationale()))}}rl.__initStatic(),rl.__initStatic2();const ol=t,{createRoot:il}=u,al=e,{renderMath:sl}=d,ll=al("pie-element:math-templated:print");class cl extends HTMLElement{constructor(){super(),this._options=null,this._model=null,this._session=[],this._root=null,this._rerender=Zt(()=>{if(this._model&&this._session){const e=((e,t)=>{const n="instructor"===t.role;return e.prompt=!1!==e.promptEnabled?e.prompt:void 0,e.teacherInstructions=n&&!1!==e.teacherInstructionsEnabled?e.teacherInstructions:void 0,e.rationale=n&&!1!==e.rationaleEnabled?e.rationale:void 0,e.showTeacherInstructions=n,e.alwaysShowCorrect=n,e.printMode=!0,e.feedback=void 0,e.markup=e.markup||"{{0}}",{...e,disabled:!0,env:{mode:n?"evaluate":e.mode,role:t.role}}})(this._model,this._options),t=this._options&&ol.createElement(rl,{model:e,session:{}});this._root||(this._root=il(this)),this._root.render(t),queueMicrotask(()=>{ll("render complete - render math"),sl(this)})}else ll("skip")},50,{leading:!1,trailing:!0})}set options(e){this._options=e}set model(e){this._model=e,this._rerender()}connectedCallback(){}disconnectedCallback(){this._root&&this._root.unmount()}}export{cl as default};
|