@pie-element/math-templated 7.1.2 → 7.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/module/element.js CHANGED
@@ -1 +1 @@
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_mui__material_colors as s,_dll_classnames as l,_dll_mui__icons_material as c,_dll_pie_lib__correct_answer_toggle as d,_dll_react_dom_client as u}from"../../../@pie-lib/shared-module@^5.2.4/module/index.js";import{_dll_pie_lib__math_input as p}from"../../../@pie-lib/math-edit-module@^4.2.4/module/index.js";import{_dll_pie_lib__math_rendering as h}from"../../../@pie-lib/math-rendering-module@^5.0.9/module/index.js";import{_dll_pie_lib__drag as f}from"../../../@pie-lib/drag-module@^4.0.9/module/index.js";var g={};Object.defineProperty(g,"__esModule",{value:!0});class m extends CustomEvent{constructor(e,t,n){super(m.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e,hasModel:n}}),this.component=e,this.complete=t}}m.TYPE="model-set";var v=g.ModelSetEvent=m;class b extends CustomEvent{constructor(e,t){super(b.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e}}),this.component=e,this.complete=t}}b.TYPE="session-changed";var y=g.SessionChangedEvent=b,w="object"==typeof global&&global&&global.Object===Object&&global,x="object"==typeof self&&self&&self.Object===Object&&self,_=w||x||Function("return this")(),C=_.Symbol,E=Object.prototype,k=E.hasOwnProperty,S=E.toString,A=C?C.toStringTag:void 0;var R=Object.prototype.toString;var D=C?C.toStringTag:void 0;function j(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":D&&D in Object(e)?function(e){var t=k.call(e,A),n=e[A];try{e[A]=void 0;var r=!0}catch(e){}var o=S.call(e);return r&&(t?e[A]=n:delete e[A]),o}(e):function(e){return R.call(e)}(e)}function O(e){return null!=e&&"object"==typeof e}function T(e){return"symbol"==typeof e||O(e)&&"[object Symbol]"==j(e)}var M=Array.isArray,N=C?C.prototype:void 0,$=N?N.toString:void 0;function I(e){if("string"==typeof e)return e;if(M(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,I)+"";if(T(e))return $?$.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}var L=/\s/;var P=/^\s+/;function W(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&L.test(e.charAt(t)););return t}(e)+1).replace(P,""):e}function B(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var z=/^[-+]0x[0-9a-f]+$/i,F=/^0b[01]+$/i,H=/^0o[0-7]+$/i,q=parseInt;function U(e){if("number"==typeof e)return e;if(T(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=W(e);var n=F.test(e);return n||H.test(e)?q(e.slice(2),n?2:8):z.test(e)?NaN:+e}function K(e){return e}function V(e){if(!B(e))return!1;var t=j(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var Y,X=_["__core-js_shared__"],J=(Y=/[^.]+$/.exec(X&&X.keys&&X.keys.IE_PROTO||""))?"Symbol(src)_1."+Y:"";var Q=Function.prototype.toString;function G(e){if(null!=e){try{return Q.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var Z=/^\[object .+?Constructor\]$/,ee=Function.prototype,te=Object.prototype,ne=ee.toString,re=te.hasOwnProperty,oe=RegExp("^"+ne.call(re).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ie(e){return!(!B(e)||(t=e,J&&J in t))&&(V(e)?oe:Z).test(G(e));var t}function ae(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return ie(n)?n:void 0}var se=ae(_,"WeakMap"),le=/^(?:0|[1-9]\d*)$/;function ce(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&le.test(e))&&e>-1&&e%1==0&&e<t}function de(e,t){return e===t||e!=e&&t!=t}function ue(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function pe(e){return null!=e&&ue(e.length)&&!V(e)}var he=Object.prototype;function fe(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||he)}function ge(e){return O(e)&&"[object Arguments]"==j(e)}var me=Object.prototype,ve=me.hasOwnProperty,be=me.propertyIsEnumerable,ye=ge(function(){return arguments}())?ge:function(e){return O(e)&&ve.call(e,"callee")&&!be.call(e,"callee")};var we="object"==typeof exports&&exports&&!exports.nodeType&&exports,xe=we&&"object"==typeof module&&module&&!module.nodeType&&module,_e=xe&&xe.exports===we?_.Buffer:void 0,Ce=(_e?_e.isBuffer:void 0)||function(){return!1},Ee={};Ee["[object Float32Array]"]=Ee["[object Float64Array]"]=Ee["[object Int8Array]"]=Ee["[object Int16Array]"]=Ee["[object Int32Array]"]=Ee["[object Uint8Array]"]=Ee["[object Uint8ClampedArray]"]=Ee["[object Uint16Array]"]=Ee["[object Uint32Array]"]=!0,Ee["[object Arguments]"]=Ee["[object Array]"]=Ee["[object ArrayBuffer]"]=Ee["[object Boolean]"]=Ee["[object DataView]"]=Ee["[object Date]"]=Ee["[object Error]"]=Ee["[object Function]"]=Ee["[object Map]"]=Ee["[object Number]"]=Ee["[object Object]"]=Ee["[object RegExp]"]=Ee["[object Set]"]=Ee["[object String]"]=Ee["[object WeakMap]"]=!1;var ke,Se="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ae=Se&&"object"==typeof module&&module&&!module.nodeType&&module,Re=Ae&&Ae.exports===Se&&w.process,De=function(){try{var e=Ae&&Ae.require&&Ae.require("util").types;return e||Re&&Re.binding&&Re.binding("util")}catch(e){}}(),je=De&&De.isTypedArray,Oe=je?(ke=je,function(e){return ke(e)}):function(e){return O(e)&&ue(e.length)&&!!Ee[j(e)]},Te=Object.prototype.hasOwnProperty;function Me(e,t){var n=M(e),r=!n&&ye(e),o=!n&&!r&&Ce(e),i=!n&&!r&&!o&&Oe(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&&!Te.call(e,c)||a&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||ce(c,l))||s.push(c);return s}var Ne=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object),$e=Ne,Ie=Object.prototype.hasOwnProperty;function Le(e){if(!fe(e))return $e(e);var t=[];for(var n in Object(e))Ie.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Pe(e){return pe(e)?Me(e):Le(e)}var We=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Be=/^\w*$/;function ze(e,t){if(M(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!T(e))||(Be.test(e)||!We.test(e)||null!=t&&e in Object(t))}var Fe=ae(Object,"create");var He=Object.prototype.hasOwnProperty;var qe=Object.prototype.hasOwnProperty;function Ue(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 Ke(e,t){for(var n=e.length;n--;)if(de(e[n][0],t))return n;return-1}Ue.prototype.clear=function(){this.__data__=Fe?Fe(null):{},this.size=0},Ue.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ue.prototype.get=function(e){var t=this.__data__;if(Fe){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return He.call(t,e)?t[e]:void 0},Ue.prototype.has=function(e){var t=this.__data__;return Fe?void 0!==t[e]:qe.call(t,e)},Ue.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Fe&&void 0===t?"__lodash_hash_undefined__":t,this};var Ve=Array.prototype.splice;function Ye(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])}}Ye.prototype.clear=function(){this.__data__=[],this.size=0},Ye.prototype.delete=function(e){var t=this.__data__,n=Ke(t,e);return!(n<0)&&(n==t.length-1?t.pop():Ve.call(t,n,1),--this.size,!0)},Ye.prototype.get=function(e){var t=this.__data__,n=Ke(t,e);return n<0?void 0:t[n][1]},Ye.prototype.has=function(e){return Ke(this.__data__,e)>-1},Ye.prototype.set=function(e,t){var n=this.__data__,r=Ke(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var Xe=ae(_,"Map");function Je(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 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.size=0,this.__data__={hash:new Ue,map:new(Xe||Ye),string:new Ue}},Qe.prototype.delete=function(e){var t=Je(this,e).delete(e);return this.size-=t?1:0,t},Qe.prototype.get=function(e){return Je(this,e).get(e)},Qe.prototype.has=function(e){return Je(this,e).has(e)},Qe.prototype.set=function(e,t){var n=Je(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function Ge(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(Ge.Cache||Qe),n}Ge.Cache=Qe;var Ze=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,et=/\\(\\)?/g,tt=function(e){var t=Ge(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(Ze,function(e,n,r,o){t.push(r?o.replace(et,"$1"):n||e)}),t}),nt=tt;function rt(e,t){return M(e)?e:ze(e,t)?[e]:nt(function(e){return null==e?"":I(e)}(e))}function ot(e){if("string"==typeof e||T(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function it(e,t){for(var n=0,r=(t=rt(t,e)).length;null!=e&&n<r;)e=e[ot(t[n++])];return n&&n==r?e:void 0}function at(e,t,n){var r=null==e?void 0:it(e,t);return void 0===r?n:r}function st(e){var t=this.__data__=new Ye(e);this.size=t.size}st.prototype.clear=function(){this.__data__=new Ye,this.size=0},st.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},st.prototype.get=function(e){return this.__data__.get(e)},st.prototype.has=function(e){return this.__data__.has(e)},st.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Ye){var r=n.__data__;if(!Xe||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Qe(r)}return n.set(e,t),this.size=n.size,this};var lt=Object.prototype.propertyIsEnumerable,ct=Object.getOwnPropertySymbols,dt=ct?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}(ct(e),function(t){return lt.call(e,t)}))}:function(){return[]};function ut(e){return function(e,t,n){var r=t(e);return M(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,Pe,dt)}var pt=ae(_,"DataView"),ht=ae(_,"Promise"),ft=ae(_,"Set"),gt="[object Map]",mt="[object Promise]",vt="[object Set]",bt="[object WeakMap]",yt="[object DataView]",wt=G(pt),xt=G(Xe),_t=G(ht),Ct=G(ft),Et=G(se),kt=j;(pt&&kt(new pt(new ArrayBuffer(1)))!=yt||Xe&&kt(new Xe)!=gt||ht&&kt(ht.resolve())!=mt||ft&&kt(new ft)!=vt||se&&kt(new se)!=bt)&&(kt=function(e){var t=j(e),n="[object Object]"==t?e.constructor:void 0,r=n?G(n):"";if(r)switch(r){case wt:return yt;case xt:return gt;case _t:return mt;case Ct:return vt;case Et:return bt}return t});var St=kt,At=_.Uint8Array;function Rt(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Qe;++t<n;)this.add(e[t])}function Dt(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 jt(e,t){return e.has(t)}Rt.prototype.add=Rt.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Rt.prototype.has=function(e){return this.__data__.has(e)};function Ot(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 Rt:void 0;for(i.set(e,t),i.set(t,e);++u<s;){var f=e[u],g=t[u];if(r)var m=a?r(g,f,u,t,e,i):r(f,g,u,e,t,i);if(void 0!==m){if(m)continue;p=!1;break}if(h){if(!Dt(t,function(e,t){if(!jt(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 Tt(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function Mt(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var Nt=C?C.prototype:void 0,$t=Nt?Nt.valueOf:void 0;var It=Object.prototype.hasOwnProperty;var Lt="[object Arguments]",Pt="[object Array]",Wt="[object Object]",Bt=Object.prototype.hasOwnProperty;function zt(e,t,n,r,o,i){var a=M(e),s=M(t),l=a?Pt:St(e),c=s?Pt:St(t),d=(l=l==Lt?Wt:l)==Wt,u=(c=c==Lt?Wt:c)==Wt,p=l==c;if(p&&Ce(e)){if(!Ce(t))return!1;a=!0,d=!1}if(p&&!d)return i||(i=new st),a||Oe(e)?Ot(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 At(e),new At(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return de(+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=Tt;case"[object Set]":var l=1&r;if(s||(s=Mt),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=Ot(s(e),s(t),r,o,i,a);return a.delete(e),d;case"[object Symbol]":if($t)return $t.call(e)==$t.call(t)}return!1}(e,t,l,n,r,o,i);if(!(1&n)){var h=d&&Bt.call(e,"__wrapped__"),f=u&&Bt.call(t,"__wrapped__");if(h||f){var g=h?e.value():e,m=f?t.value():t;return i||(i=new st),o(g,m,n,r,i)}}return!!p&&(i||(i=new st),function(e,t,n,r,o,i){var a=1&n,s=ut(e),l=s.length;if(l!=ut(t).length&&!a)return!1;for(var c=l;c--;){var d=s[c];if(!(a?d in t:It.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 f=a;++c<l;){var g=e[d=s[c]],m=t[d];if(r)var v=a?r(m,g,d,t,e,i):r(g,m,d,e,t,i);if(!(void 0===v?g===m||o(g,m,n,r,i):v)){h=!1;break}f||(f="constructor"==d)}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 Ft(e,t,n,r,o){return e===t||(null==e||null==t||!O(e)&&!O(t)?e!=e&&t!=t:zt(e,t,n,r,Ft,o))}function Ht(e){return e==e&&!B(e)}function qt(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}function Ut(e){var t=function(e){for(var t=Pe(e),n=t.length;n--;){var r=t[n],o=e[r];t[n]=[r,o,Ht(o)]}return t}(e);return 1==t.length&&t[0][2]?qt(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 st;if(r)var p=r(c,d,l,e,t,u);if(!(void 0===p?Ft(d,c,3,r,u):p))return!1}}return!0}(n,e,t)}}function Kt(e,t){return null!=e&&t in Object(e)}function Vt(e,t){return null!=e&&function(e,t,n){for(var r=-1,o=(t=rt(t,e)).length,i=!1;++r<o;){var a=ot(t[r]);if(!(i=null!=e&&n(e,a)))break;e=e[a]}return i||++r!=o?i:!!(o=null==e?0:e.length)&&ue(o)&&ce(a,o)&&(M(e)||ye(e))}(e,t,Kt)}function Yt(e){return ze(e)?function(e){return function(t){return null==t?void 0:t[e]}}(ot(e)):function(e){return function(t){return it(t,e)}}(e)}function Xt(e){return"function"==typeof e?e:null==e?K:"object"==typeof e?M(e)?(t=e[0],n=e[1],ze(t)&&Ht(n)?qt(ot(t),n):function(e){var r=at(e,t);return void 0===r&&r===n?Vt(e,t):Ft(n,r,3)}):Ut(e):Yt(e);var t,n}var Jt,Qt=function(e,t,n){for(var r=-1,o=Object(e),i=n(e),a=i.length;a--;){var s=i[Jt?a:++r];if(!1===t(o[s],s,o))break}return e},Gt=Qt;function Zt(e,t){return e&&Gt(e,t,Pe)}var en=function(){return _.Date.now()},tn=Math.max,nn=Math.min;function rn(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 f(e){var n=e-l;return void 0===l||n>=t||n<0||u&&e-c>=i}function g(){var e=en();if(f(e))return m(e);s=setTimeout(g,function(e){var n=t-(e-l);return u?nn(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=en(),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),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=U(t)||0,B(n)&&(d=!!n.leading,i=(u="maxWait"in n)?tn(U(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(en())},v}var on=Object.prototype.hasOwnProperty;function an(e){if(null==e)return!0;if(pe(e)&&(M(e)||"string"==typeof e||"function"==typeof e.splice||Ce(e)||Oe(e)||ye(e)))return!e.length;var t=St(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(fe(e))return!Le(e).length;for(var n in e)if(on.call(e,n))return!1;return!0}function sn(e,t){return Ft(e,t)}var ln,cn,dn,un={"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},pn={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},hn=function(e){return e.length?e.charAt(0).toUpperCase()+e.substring(1):e},fn=hn,gn=/^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/,mn="undefined"==typeof document?{}:document.documentElement.style,vn=(ln=function(){for(var e in mn)if(gn.test(e))return e.match(gn)[0];return"WebkitOpacity"in mn?"Webkit":"KhtmlOpacity"in mn?"Khtml":""}(),cn=ln.toLowerCase(),{style:ln,css:"-"+cn+"-",dom:{Webkit:"WebKit",ms:"MS",o:"WebKit"}[ln]||fn(ln)}),bn=function(e,t){return t?t.toUpperCase():""},yn=/[-\s]+(.)?/g,wn=function(e){return e?e.replace(yn,bn):""},xn=/::/g,_n=/([A-Z]+)([A-Z][a-z])/g,Cn=/([a-z\d])([A-Z])/g,En=/_/g,kn=function(e,t){return e?e.replace(xn,"/").replace(_n,"$1_$2").replace(Cn,"$1_$2").replace(En,t||"-"):""},Sn=function(e){return kn(e).toLowerCase()},An=wn,Rn=Sn,Dn=function(e){return e.length?e.charAt(0).toLowerCase()+e.substring(1):e},jn=hn,On=vn,Tn=un,Mn="undefined"==typeof document?{}:document.documentElement.style,Nn=function(e,t){t=t||{};var n=Dn(An(e)),r=Rn(e),o=dn?n:r,i=On.style?dn?On.style:On.css:"";if(n in Mn)return t.asString?o:[o];var a=o,s=Tn[r],l=[];if(dn&&(a=jn(o)),"function"==typeof s){var c=s(o,i)||[];c&&!Array.isArray(c)&&(c=[c]),c.length&&(c=c.map(function(e){return dn?Dn(An(e)):Rn(e)})),l=l.concat(c)}return i&&l.push(i+a),l.push(o),t.asString||1==l.length?l[0]:l},$n=Object.prototype.hasOwnProperty,In=function(e,t){return $n.call(e,t)},Ln=Object.prototype.toString,Pn=Object.prototype.toString,Wn=Nn,Bn=Sn,zn=wn,Fn=In,Hn=function(e){return!!e&&"[object Object]"===Ln.call(e)},qn=function(e){return"[object Function]"===Pn.apply(e)},Un=function(e,t,n,r){Wn(t).forEach(function(t){e[r?r(t):t]=n})},Kn={cssUnitless:pn},Vn=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||Kn).cssUnitless=t.cssUnitless||Kn.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,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?zn:Bn;for(a in e)if(Fn(e,a)){if(s=e[a],i=Bn(n?n+a:a),o=!1,u=!1,qn(s)&&(d=s.call(p||e,s,a,i,e),Hn(d)&&null!=d.value?(s=d.value,u=d.prefix,i=d.name?Bn(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||!!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){u?Un(r,e,s,v):r[v(e)]=s});continue}u?Un(r,i,s,v):r[v(i)]=s}else Vn(s,t,i+"-",r)}return r},Yn=Vn,Xn=In,Jn={prefixProperties:un,cssUnitless:pn,object:Vn,string:function(e,t){e=Yn(e,t);var n,r=[];for(n in e)Xn(e,n)&&r.push(n+": "+e[n]);return r.join("; ")}};const Qn=e("@pie-lib:mask-markup:serialization"),Gn=["span"],Zn=["em","strong","u"],er=(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),Jn.object(r,{camelize:!0,addUnits:!1});var r},tr=["border","class","style"],nr={b:"bold",em:"italic",u:"underline",s:"strikethrough",code:"code",strong:"strong"},rr=(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=nr[r];if(o){Qn("[deserialize] mark: ",o);return{_flatten:!0,nodes:or(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=tr.reduce((n=e,(e,t)=>{if(!n.getAttribute)return e;if(n.getAttribute(t))switch(t){case"style":e.style=er(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=>Gn.includes(e)?"inline":Zn.includes(e)?"mark":"block")(r),l=or(e.childNodes,t);return{object:s,type:r,data:{dataset:{...e.dataset},attributes:{...a}},nodes:l}}var n;return null},or=(e,t=[])=>{const n=[];for(let r=0;r<e.length;r++){const o=rr(e[r],t);null!==o&&(o._flatten&&o.nodes?n.push(...o.nodes):n.push(o))}return n},ir=t,ar=n,{styled:sr}=r,{renderMath:lr}=h;const cr=sr("div")(({theme:e})=>({paddingTop:e.spacing(.5),paddingBottom:e.spacing(.5)})),dr=sr("span")(()=>({display:"inline-block",width:".75em"})),ur=["tbody","tr"],pr=(e,t,n,r,o,i)=>{if(!t)return null;const a=[];return(e.nodes||[]).forEach((e,i)=>{const s=e.type?`${e.type}-${i}`:`${i}`;if(e.isMath)return a.push(ir.createElement("span",{dangerouslySetInnerHTML:{__html:`<math displaystyle="true">${e.nodes[0].innerHTML}</math>`}})),a;if(r){const o=r(e,t,n);if(o){const t="blank"===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}([e,"access",e=>e.data,"optionalAccess",e=>e.dataset,"optionalAccess",e=>e.component]);return t&&a.push(ir.createElement(dr,{key:`spacer-${i}`})),a.push(o),void(t&&a.push(ir.createElement(dr,{key:`spacer-${i}`})))}}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&&ur.includes(r)?void 0:t})(o,n);return r?e+r:e},""),n=(e=>{const t=e.leaves.find(e=>at(e,"marks",[]).length);return t?t.marks[0]:null})(e);if(n){let e;for(e in nr)if(nr[e]===n.type){const n=e;a.push(ir.createElement(n,{key:s},t));break}}else t.length>0&&a.push(t)}else{const o=pr(e,t,n,r,e);if("p"===e.type||"paragraph"===e.type)a.push(ir.createElement(cr,{key:s},o));else{const t=e.type;e.nodes&&e.nodes.length>0?a.push(ir.createElement(t,{key:s,...e.data.attributes},o)):a.push(ir.createElement(t,{key:s,...e.data.attributes}))}}}),a},hr=sr("div")(()=>({display:"initial","&:not(.MathJax) table":{borderCollapse:"collapse"},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:"8px 12px",textAlign:"left"}}));class fr extends ir.Component{constructor(e){super(e),fr.prototype.__init.call(this),this.internalContainerRef=ir.createRef()}static __initStatic(){this.propTypes={renderChildren:ar.func,layout:ar.object,value:ar.object,onChange:ar.func,elementType:ar.string,containerRef:ar.oneOfType([ar.func,ar.shape({current:ar.instanceOf(Element)})])}}componentDidMount(){const e=this.props.containerRef||this.internalContainerRef;e.current&&"function"==typeof lr&&lr(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=pr(t,e,this.handleChange,this.props.renderChildren,null),i=r||this.internalContainerRef;return ir.createElement(hr,{ref:i},o)}}fr.__initStatic();const gr=/\{\{(\d+)\}\}/g;const mr=t,vr=n;var br;const yr=(e,t)=>{const{markup:n}=(o=t,(r=e)?{markup:r.replace(gr,(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=or(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},wr=(e,t)=>((br=class extends mr.Component{static __initStatic(){this.propTypes={markup:vr.string,layout:vr.object,value:vr.object,onChange:vr.func,customMarkMarkupComponent:vr.func,elementType:vr.string}}constructor(e){super(e),this.containerRef=mr.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||yr(n,e);return mr.createElement(fr,{containerRef:this.containerRef,elementType:a,layout:s,value:o,onChange:i,renderChildren:t(this.props)})}}).__initStatic(),br),{useMemo:xr}=t,{useLayoutEffect:_r}=t,{useEffect:Cr}=t,{useRef:Er}=t,{useCallback:kr}=t,Sr="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function Ar(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function Rr(e){return"nodeType"in e}function Dr(e){var t,n;return e?Ar(e)?e:Rr(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function jr(e){const{Document:t}=Dr(e);return e instanceof t}function Or(e){return!Ar(e)&&e instanceof Dr(e).HTMLElement}function Tr(e){return e instanceof Dr(e).SVGElement}function Mr(e){return e?Ar(e)?e.document:Rr(e)?jr(e)?e:Or(e)||Tr(e)?e.ownerDocument:document:document:document}const Nr=Sr?_r:Cr;function $r(e){const t=Er(e);return Nr(()=>{t.current=e}),kr(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 Ir(e,t){void 0===t&&(t=[e]);const n=Er(e);return Nr(()=>{n.current!==e&&(n.current=e)},t),n}function Lr(e,t){const n=Er();return xr(()=>{const t=e(n.current);return n.current=t,t},[...t])}function Pr(e){const t=$r(e),n=Er(null),r=kr(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,r]}function Wr(e){const t=Er();return Cr(()=>{t.current=e},[e]),t.current}let Br={};function zr(e,t){return xr(()=>{if(t)return t;const n=null==Br[e]?0:Br[e]+1;return Br[e]=n,e+"-"+n},[e,t])}function Fr(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 Hr=Fr(1),qr=Fr(-1);function Ur(e){if(!e)return!1;const{KeyboardEvent:t}=Dr(e.target);return t&&e instanceof t}function Kr(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=Dr(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 Vr=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[Vr.Translate.toString(e),Vr.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Yr="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Xr(e){return e.matches(Yr)?e:e.querySelector(Yr)}const Jr=t,{useState:Qr}=t,{useCallback:Gr}=t,Zr={display:"none"};function eo(e){let{id:t,value:n}=e;return Jr.createElement("div",{id:t,style:Zr},n)}function to(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;return Jr.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 no=t,{createContext:ro}=t,{useContext:oo}=t,{useEffect:io}=t,{useState:ao}=t,{useCallback:so}=t,{useMemo:lo}=t,{useRef:co}=t,{memo:uo}=t,{useReducer:po}=t,{cloneElement:ho}=t,{forwardRef:fo}=t,{createPortal:go}=o,{unstable_batchedUpdates:mo}=o,vo=ro(null);const bo={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 "},yo={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 wo(e){let{announcements:t=yo,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=bo}=e;const{announce:i,announcement:a}=function(){const[e,t]=Qr("");return{announce:Gr(e=>{null!=e&&t(e)},[]),announcement:e}}(),s=zr("DndLiveRegion"),[l,c]=ao(!1);if(io(()=>{c(!0)},[]),function(e){const t=oo(vo);io(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}(lo(()=>({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=no.createElement(no.Fragment,null,no.createElement(eo,{id:r,value:o.draggable}),no.createElement(to,{id:s,announcement:a}));return n?go(d,n):d}var xo;function _o(){}!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"}(xo||(xo={}));const Co=Object.freeze({x:0,y:0});function Eo(e,t){const n=Kr(e);if(!n)return"0 0";return(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%"}function ko(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function So(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 Ao=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=So(i,t);n>0&&o.push({id:r,data:{droppableContainer:e,value:n}})}}return o.sort(ko)};function Ro(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Co}const Do=(jo=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+jo*t.y,bottom:e.bottom+jo*t.y,left:e.left+jo*t.x,right:e.right+jo*t.x}),{...e})});var jo;function Oo(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 To={ignoreTransform:!1};function Mo(e,t){void 0===t&&(t=To);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=Dr(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=Oo(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 No(e){return Mo(e,{ignoreTransform:!0})}function $o(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if(jr(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Or(o)||Tr(o))return n;if(n.includes(o))return n;const i=Dr(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=Dr(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=Dr(e).getComputedStyle(e)),"fixed"===t.position}(o,i)?n:r(o.parentNode)}(e):n}function Io(e){const[t]=$o(e,1);return null!=t?t:null}function Lo(e){return Sr&&e?Ar(e)?e:Rr(e)?jr(e)||e===Mr(e).scrollingElement?window:Or(e)?e:null:null:null}function Po(e){return Ar(e)?e.scrollX:e.scrollLeft}function Wo(e){return Ar(e)?e.scrollY:e.scrollTop}function Bo(e){return{x:Po(e),y:Wo(e)}}var zo;function Fo(e){return!(!Sr||!e)&&e===document.scrollingElement}function Ho(e){const t={x:0,y:0},n=Fo(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"}(zo||(zo={}));const qo={x:.2,y:.2};function Uo(e,t,n,r,o){let{top:i,left:a,right:s,bottom:l}=n;void 0===r&&(r=10),void 0===o&&(o=qo);const{isTop:c,isBottom:d,isLeft:u,isRight:p}=Ho(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=zo.Backward,f.y=r*Math.abs((t.top+g-i)/g)):!d&&l>=t.bottom-g&&(h.y=zo.Forward,f.y=r*Math.abs((t.bottom-g-l)/g)),!p&&s>=t.right-m?(h.x=zo.Forward,f.x=r*Math.abs((t.right-m-s)/m)):!u&&a<=t.left+m&&(h.x=zo.Backward,f.x=r*Math.abs((t.left+m-a)/m)),{direction:h,speed:f}}function Ko(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 Vo(e){return e.reduce((e,t)=>Hr(e,Bo(t)),Co)}function Yo(e,t){if(void 0===t&&(t=Mo),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);Io(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Xo=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+Po(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+Wo(t),0)}]];class Jo{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=$o(t),r=Vo(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of Xo)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 Qo{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 Go(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 Zo,ei;function ti(e){e.preventDefault()}function ni(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"}(Zo||(Zo={})),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"}(ei||(ei={}));const ri={start:[ei.Space,ei.Enter],cancel:[ei.Esc],end:[ei.Space,ei.Enter,ei.Tab]},oi=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case ei.Right:return{...n,x:n.x+25};case ei.Left:return{...n,x:n.x-25};case ei.Down:return{...n,y:n.y+25};case ei.Up:return{...n,y:n.y-25}}};class ii{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 Qo(Mr(t)),this.windowListeners=new Qo(Dr(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Zo.Resize,this.handleCancel),this.windowListeners.add(Zo.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Zo.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&Yo(n),t(Co)}handleKeyDown(e){if(Ur(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=ri,coordinateGetter:i=oi,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}:Co;this.referenceCoordinates||(this.referenceCoordinates=c);const d=i(e,{active:t,context:n.current,currentCoordinates:c});if(d){const t=qr(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}=Ho(n),h=Ko(n),f={x:Math.min(o===ei.Right?h.right-h.width/2:h.right,Math.max(o===ei.Right?h.left:h.left+h.width/2,d.x)),y:Math.min(o===ei.Down?h.bottom-h.height/2:h.bottom,Math.max(o===ei.Down?h.top:h.top+h.height/2,d.y))},g=o===ei.Right&&!s||o===ei.Left&&!l,m=o===ei.Down&&!c||o===ei.Up&&!i;if(g&&f.x!==d.x){const e=n.scrollLeft+t.x,i=o===ei.Right&&e<=u.x||o===ei.Left&&e>=p.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:a});r.x=i?n.scrollLeft-e:o===ei.Right?n.scrollLeft-u.x:n.scrollLeft-p.x,r.x&&n.scrollBy({left:-r.x,behavior:a});break}if(m&&f.y!==d.y){const e=n.scrollTop+t.y,i=o===ei.Down&&e<=u.y||o===ei.Up&&e>=p.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:a});r.y=i?n.scrollTop-e:o===ei.Down?n.scrollTop-u.y:n.scrollTop-p.y,r.y&&n.scrollBy({top:-r.y,behavior:a});break}}this.handleMove(e,Hr(qr(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 ai(e){return Boolean(e&&"distance"in e)}function si(e){return Boolean(e&&"delay"in e)}ii.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=ri,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 li{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=Dr(e);return e instanceof t?e:Mr(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=Mr(i),this.documentListeners=new Qo(this.document),this.listeners=new Qo(n),this.windowListeners=new Qo(Dr(i)),this.initialCoordinates=null!=(r=Kr(o))?r:Co,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(Zo.Resize,this.handleCancel),this.windowListeners.add(Zo.DragStart,ti),this.windowListeners.add(Zo.VisibilityChange,this.handleCancel),this.windowListeners.add(Zo.ContextMenu,ti),this.documentListeners.add(Zo.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(si(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(ai(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(Zo.Click,ni,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Zo.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=Kr(e))?t:Co,l=qr(r,s);if(!n&&a){if(ai(a)){if(null!=a.tolerance&&Go(l,a.tolerance))return this.handleCancel();if(Go(l,a.distance))return this.handleStart()}return si(a)&&Go(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===ei.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const ci={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class di extends li{constructor(e){const{event:t}=e,n=Mr(t.target);super(e,ci,n)}}di.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 ui={move:{name:"mousemove"},end:{name:"mouseup"}};var pi;!function(e){e[e.RightClick=2]="RightClick"}(pi||(pi={}));(class extends li{constructor(e){super(e,ui,Mr(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==pi.RightClick&&(null==r||r({event:n}),!0)}}];const hi={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var fi,gi;function mi(e){let{acceleration:t,activator:n=fi.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:a=5,order:s=gi.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:d,delta:u,threshold:p}=e;const h=function(e){let{delta:t,disabled:n}=e;const r=Wr(t);return Lr(e=>{if(n||!r||!e)return vi;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[zo.Backward]:e.x[zo.Backward]||-1===o.x,[zo.Forward]:e.x[zo.Forward]||1===o.x},y:{[zo.Backward]:e.y[zo.Backward]||-1===o.y,[zo.Forward]:e.y[zo.Forward]||1===o.y}}},[n,t,r])}({delta:u,disabled:!i}),[f,g]=function(){const e=Er(null);return[kr((t,n)=>{e.current=setInterval(t,n)},[]),kr(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}(),m=co({x:0,y:0}),v=co({x:0,y:0}),b=lo(()=>{switch(n){case fi.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case fi.DraggableRect:return o}},[n,o,l]),y=co(null),w=so(()=>{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=lo(()=>s===gi.TreeOrder?[...c].reverse():c,[s,c]);io(()=>{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=d[n];if(!o)continue;const{direction:i,speed:s}=Uo(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,d,JSON.stringify(p)])}(class extends li{constructor(e){super(e,hi)}static setup(){return window.addEventListener(hi.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(hi.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"}(fi||(fi={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(gi||(gi={}));const vi={x:{[zo.Backward]:!1,[zo.Forward]:!1},y:{[zo.Backward]:!1,[zo.Forward]:!1}};var bi,yi;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(bi||(bi={})),function(e){e.Optimized="optimized"}(yi||(yi={}));const wi=new Map;function xi(e,t){return Lr(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function _i(e){let{callback:t,disabled:n}=e;const r=$r(t),o=lo(()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(r)},[n]);return io(()=>()=>null==o?void 0:o.disconnect(),[o]),o}function Ci(e){return new Jo(Mo(e),e)}function Ei(e,t,n){void 0===t&&(t=Ci);const[r,o]=ao(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=$r(t),o=lo(()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(r)},[r,n]);return io(()=>()=>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=_i({callback:i});return Nr(()=>{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 ki=[];function Si(e,t){void 0===t&&(t=[]);const n=co(null);return io(()=>{n.current=null},t),io(()=>{const t=e!==Co;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?qr(e,n.current):Co}function Ai(e){return lo(()=>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 Ri=[];function Di(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Or(t)?t:e}const ji=[{sensor:di,options:{}},{sensor:ii,options:{}}],Oi={current:{}},Ti={draggable:{measure:No},droppable:{measure:No,strategy:bi.WhileDragging,frequency:yi.Optimized},dragOverlay:{measure:Mo}};class Mi 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 Ni={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Mi,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:_o},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ti,measureDroppableContainers:_o,windowRect:null,measuringScheduled:!1},$i={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:_o,draggableNodes:new Map,over:null,measureDroppableContainers:_o},Ii=ro($i),Li=ro(Ni);function Pi(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Mi}}}function Wi(e,t){switch(t.type){case xo.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case xo.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 xo.DragEnd:case xo.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case xo.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Mi(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case xo.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 Mi(e.droppable.containers);return a.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case xo.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new Mi(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function Bi(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=oo(Ii),i=Wr(r),a=Wr(null==n?void 0:n.id);return io(()=>{if(!t&&!r&&i&&null!=a){if(!Ur(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=Xr(e);if(t){t.focus();break}}})}},[r,t,o,a,i]),null}function zi(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}const Fi=ro({...Co,scaleX:1,scaleY:1});var Hi;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(Hi||(Hi={})),uo(function(e){var t,n,r,o;let{id:i,accessibility:a,autoScroll:s=!0,children:l,sensors:c=ji,collisionDetection:d=Ao,measuring:u,modifiers:p,...h}=e;const f=po(Wi,void 0,Pi),[g,m]=f,[v,b]=function(){const[e]=ao(()=>new Set),t=so(t=>(e.add(t),()=>e.delete(t)),[e]);return[so(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]=ao(Hi.Uninitialized),x=y===Hi.Initialized,{draggable:{active:_,nodes:C,translate:E},droppable:{containers:k}}=g,S=null!=_?C.get(_):null,A=co({initial:null,translated:null}),R=lo(()=>{var e;return null!=_?{id:_,data:null!=(e=null==S?void 0:S.data)?e:Oi,rect:A}:null},[_,S]),D=co(null),[j,O]=ao(null),[T,M]=ao(null),N=Ir(h,Object.values(h)),$=zr("DndDescribedBy",i),I=lo(()=>k.getEnabled(),[k]),L=lo(()=>({draggable:{...Ti.draggable,...null==P?void 0:P.draggable},droppable:{...Ti.droppable,...null==P?void 0:P.droppable},dragOverlay:{...Ti.dragOverlay,...null==P?void 0:P.dragOverlay}}),[null==(P=u)?void 0:P.draggable,null==P?void 0:P.droppable,null==P?void 0:P.dragOverlay]);var P;const{droppableRects:W,measureDroppableContainers:B,measuringScheduled:z}=function(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,a]=ao(null),{frequency:s,measure:l,strategy:c}=o,d=co(e),u=function(){switch(c){case bi.Always:return!1;case bi.BeforeDragging:return n;default:return!n}}(),p=Ir(u),h=so(function(e){void 0===e&&(e=[]),p.current||a(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[p]),f=co(null),g=Lr(t=>{if(u&&!n)return wi;if(!t||t===wi||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 Jo(l(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,i,n,u,l]);return io(()=>{d.current=e},[e]),io(()=>{u||h()},[n,u]),io(()=>{i&&i.length>0&&a(null)},[JSON.stringify(i)]),io(()=>{u||"number"!=typeof s||null!==f.current||(f.current=setTimeout(()=>{h(),f.current=null},s))},[s,u,h,...r]),{droppableRects:g,measureDroppableContainers:h,measuringScheduled:null!=i}}(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 Lr(e=>{var n;return null==t?null:null!=(n=null!=r?r:e)?n:null},[r,t])}(C,_),H=lo(()=>T?Kr(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 xi(e,t)}(F,L.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=co(!1),{x:a,y:s}="boolean"==typeof o?{x:o,y:o}:o;Nr(()=>{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=Ro(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=Io(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=Ei(F,L.draggable.measure,U),V=Ei(F?F.parentElement:null),Y=co({activatorEvent:null,active:null,activeNode:F,collisionRect:null,collisions:null,droppableRects:W,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]=ao(null),o=_i({callback:so(e=>{for(const{target:n}of e)if(Or(n)){r(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),i=so(e=>{const n=Di(e);null==o||o.disconnect(),n&&(null==o||o.observe(n)),r(n?t(n):null)},[t,o]),[a,s]=Pr(i);return lo(()=>({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=Ro(te=Z?null:K,xi(te));var te;const ne=Ai(Q?Dr(Q):null),re=function(e){const t=co(e),n=Lr(n=>e?n&&n!==ki&&e&&t.current&&e.parentNode===t.current.parentNode?n:$o(e):ki,[e]);return io(()=>{t.current=e},[e]),n}(x?null!=X?X:F:null),oe=function(e,t){void 0===t&&(t=Mo);const[n]=e,r=Ai(n?Dr(n):null),[o,i]=ao(Ri);function a(){i(()=>e.length?e.map(e=>Fo(e)?r:new Jo(t(e),e)):Ri)}const s=_i({callback:a});return Nr(()=>{null==s||s.disconnect(),a(),e.forEach(e=>null==s?void 0:s.observe(e))},[e]),o}(re),ie=zi(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?Hr(H,E):null,se=function(e){const[t,n]=ao(null),r=co(e),o=so(e=>{const t=Lo(e.target);t&&n(e=>e?(e.set(t,Bo(t)),new Map(e)):null)},[]);return io(()=>{const t=r.current;if(e!==t){i(t);const a=e.map(e=>{const t=Lo(e);return t?(t.addEventListener("scroll",o,{passive:!0}),[t,Bo(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=Lo(e);null==t||t.removeEventListener("scroll",o)})}},[o,e]),lo(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>Hr(e,t),Co):Vo(e):Co,[e,t])}(re),le=Si(se),ce=Si(se,[K]),de=Hr(ie,le),ue=G?Do(G,ie):null,pe=R&&ue?d({active:R,collisionRect:ue,droppableRects:W,droppableContainers:I,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]=ao(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:Hr(ie,ce),null!=(o=null==fe?void 0:fe.rect)?o:null,K),ve=co(null),be=so((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}};mo(()=>{null==r||r(o),w(Hi.Initializing),m({type:xo.DragStart,initialCoordinates:e,active:t}),v({type:"onDragStart",event:o}),O(ve.current),M(i)})},onMove(e){m({type:xo.DragMove,coordinates:e})},onEnd:s(xo.DragEnd),onCancel:s(xo.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===xo.DragEnd&&"function"==typeof s){await Promise.resolve(s(a))&&(e=xo.DragCancel)}}D.current=null,mo(()=>{m({type:e}),w(Hi.Uninitialized),ge(null),O(null),M(null),ve.current=null;const t=e===xo.DragEnd?"onDragEnd":"onDragCancel";if(a){const e=N.current[t];null==e||e(a),v({type:t,event:a})}})}}ve.current=a},[C]),ye=so((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 lo(()=>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){io(()=>{if(!Sr)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),Nr(()=>{K&&y===Hi.Initializing&&w(Hi.Initialized)},[K,y]),io(()=>{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:de.x,y:de.y},over:o};mo(()=>{null==e||e(i),v({type:"onDragMove",event:i})})},[de.x,de.y]),io(()=>{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};mo(()=>{ge(s),null==i||i(l),v({type:"onDragOver",event:l})})},[he]),Nr(()=>{Y.current={activatorEvent:T,active:R,activeNode:F,collisionRect:ue,collisions:pe,droppableRects:W,draggableNodes:C,draggingNode:Q,draggingNodeRect:G,droppableContainers:k,over:fe,scrollableAncestors:re,scrollAdjustedTranslate:de},A.current={initial:G,translated:ue}},[R,F,pe,ue,C,Q,G,W,k,fe,re,de]),mi({...q,delta:E,draggingRect:ue,pointerCoordinates:ae,scrollableAncestors:re,scrollableAncestorRects:oe});const xe=lo(()=>({active:R,activeNode:F,activeNodeRect:K,activatorEvent:T,collisions:pe,containerNodeRect:V,dragOverlay:J,draggableNodes:C,droppableContainers:k,droppableRects:W,over:fe,measureDroppableContainers:B,scrollableAncestors:re,scrollableAncestorRects:oe,measuringConfiguration:L,measuringScheduled:z,windowRect:ne}),[R,F,K,T,pe,V,J,C,k,W,fe,B,re,oe,L,z,ne]),_e=lo(()=>({activatorEvent:T,activators:we,active:R,activeNodeRect:K,ariaDescribedById:{draggable:$},dispatch:m,draggableNodes:C,over:fe,measureDroppableContainers:B}),[T,we,R,K,m,$,C,fe,B]);return no.createElement(vo.Provider,{value:b},no.createElement(Ii.Provider,{value:_e},no.createElement(Li.Provider,{value:xe},no.createElement(Fi.Provider,{value:me},l)),no.createElement(Bi,{disabled:!1===(null==a?void 0:a.restoreFocus)})),no.createElement(wo,{...a,hiddenTextDescribedById:$}))});const qi=ro(null),Ui="button";function Ki(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=zr("Draggable"),{activators:a,activatorEvent:s,active:l,activeNodeRect:c,ariaDescribedById:d,draggableNodes:u,over:p}=oo(Ii),{role:h=Ui,roleDescription:f="draggable",tabIndex:g=0}=null!=o?o:{},m=(null==l?void 0:l.id)===t,v=oo(m?Fi:qi),[b,y]=Pr(),[w,x]=Pr(),_=function(e,t){return lo(()=>e.reduce((e,n)=>{let{eventName:r,handler:o}=n;return e[r]=e=>{o(e,t)},e},{}),[e,t])}(a,t),C=Ir(n);Nr(()=>(u.set(t,{id:t,key:i,node:b,activatorNode:w,data:C}),()=>{const e=u.get(t);e&&e.key===i&&u.delete(t)}),[u,t]);return{active:l,activatorEvent:s,activeNodeRect:c,attributes:lo(()=>({role:h,tabIndex:g,"aria-disabled":r,"aria-pressed":!(!m||h!==Ui)||void 0,"aria-roledescription":f,"aria-describedby":d.draggable}),[r,h,g,m,f,d.draggable]),isDragging:m,listeners:r?void 0:_,node:b,over:p,setNodeRef:y,setActivatorNodeRef:x,transform:v}}const Vi={timeout:25};function Yi(e){let{animation:t,children:n}=e;const[r,o]=ao(null),[i,a]=ao(null),s=Wr(n);return n||r||!s||o(s),Nr(()=>{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]),no.createElement(no.Fragment,null,n,r?ho(r,{ref:a}):null)}const Xi={x:0,y:0,scaleX:1,scaleY:1};function Ji(e){let{children:t}=e;return no.createElement(Ii.Provider,{value:$i},no.createElement(Fi.Provider,{value:Xi},t))}const Qi={position:"fixed",touchAction:"none"},Gi=e=>Ur(e)?"transform 250ms ease":void 0,Zi=fo((e,t)=>{let{as:n,activatorEvent:r,adjustScale:o,children:i,className:a,rect:s,style:l,transform:c,transition:d=Gi}=e;if(!s)return null;const u=o?c:{...c,scaleX:1,scaleY:1},p={...Qi,width:s.width,height:s.height,top:s.top,left:s.left,transform:Vr.Transform.toString(u),transformOrigin:o&&r?Eo(r,s):void 0,transition:"function"==typeof d?d(r):d,...l};return no.createElement(n,{className:a,style:p,ref:t},i)}),ea={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Vr.Transform.toString(t)},{transform:Vr.Transform.toString(n)}]},sideEffects:(ta={styles:{active:{opacity:"0"}}},e=>{let{active:t,dragOverlay:n}=e;const r={},{styles:o,className:i}=ta;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 ta;function na(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return $r((e,i)=>{if(null===t)return;const a=n.get(e);if(!a)return;const s=a.node.current;if(!s)return;const l=Di(i);if(!l)return;const{transform:c}=Dr(i).getComputedStyle(i),d=Oo(c);if(!d)return;const u="function"==typeof t?t:function(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...ea,...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,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 Yo(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 ra=0;function oa(e){return lo(()=>{if(null!=e)return ra++,ra},[e])}const ia=no.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:f,droppableContainers:g,dragOverlay:m,over:v,measuringConfiguration:b,scrollableAncestors:y,scrollableAncestorRects:w,windowRect:x}=oo(Li),_=oo(Fi),C=oa(null==u?void 0:u.id),E=zi(a,{activatorEvent:d,active:u,activeNodeRect:p,containerNodeRect:h,draggingNodeRect:m.rect,over:v,overlayNodeRect:m.rect,scrollableAncestors:y,scrollableAncestorRects:w,transform:_,windowRect:x}),k=xi(p),S=na({config:r,draggableNodes:f,droppableContainers:g,measuringConfiguration:b}),A=k?m.setRef:void 0;return no.createElement(Ji,null,no.createElement(Yi,{animation:S},u&&C?no.createElement(Zi,{key:C,id:u.id,ref:A,as:s,activatorEvent:d,adjustScale:t,className:l,transition:i,rect:k,style:{zIndex:c,...o},transform:E},n):null))}),aa=t,{useEffect:sa}=t,{useRef:la}=t,ca=n,{styled:da}=r,{Chip:ua}=i,{color:pa}=a,{renderMath:ha}=h;function fa(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 ga=da("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&&{}})),ma=da(ua)(()=>({backgroundColor:pa.white(),border:`1px solid ${pa.text()}`,color:pa.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}})),va=da("span")(()=>({whiteSpace:"normal","& img":{display:"block",padding:"2px 0"},"& mjx-frac":{fontSize:"120% !important"}}));function ba({choice:e,disabled:t,instanceId:n}){const r=la(null),{attributes:o,listeners:i,setNodeRef:a,isDragging:s}=Ki({id:`choice-${e.id}`,data:{choice:e,instanceId:n,fromChoice:!0,type:"MaskBlank"},disabled:t});return sa(()=>{ha(r.current)},[e.value]),aa.createElement(ga,{ref:a,style:s?{width:fa([r,"access",e=>e.current,"optionalAccess",e=>e.offsetWidth]),height:fa([r,"access",e=>e.current,"optionalAccess",e=>e.offsetHeight])}:{},disabled:t,...i,...o},aa.createElement(ma,{clickable:!1,disabled:t,ref:r,label:aa.createElement(va,{dangerouslySetInnerHTML:{__html:e.value}})}))}ba.propTypes={choice:ca.object.isRequired,disabled:ca.bool,instanceId:ca.oneOfType([ca.string,ca.number])};const ya=t,wa=n,{DragDroppablePlaceholder:xa}=f;class _a extends ya.Component{constructor(...e){super(...e),_a.prototype.__init.call(this)}static __initStatic(){this.propTypes={disabled:wa.bool,duplicates:wa.bool,choices:wa.arrayOf(wa.shape({label:wa.string,value:wa.string})),value:wa.object,choicePosition:wa.string.isRequired,instanceId:wa.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 Zt(e,function(e,r,o){if(t(e,r,o))return n=r,!1}),n}(r,Xt(t=>t===e.id));return void 0===n}),a={...this.getStyleForWrapper(),minWidth:"100px"};return ya.createElement("div",{style:a},ya.createElement(xa,{disabled:e,instanceId:o},i.map((t,n)=>ya.createElement(ba,{key:`${t.value}-${n}`,disabled:e,choice:t,instanceId:o}))))}}_a.__initStatic();const Ca=t,{useEffect:Ea}=t,{useRef:ka}=t,{useState:Sa}=t,Aa=n,Ra=e,{styled:Da}=r,{Chip:ja}=i,Oa=l,{color:Ta}=a,{grey:Ma}=s,{renderMath:Na}=h;function $a(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}Ra("pie-lib:mask-markup:blank");const Ia=Da("span")(({dragged:e,over:t})=>({border:`solid 0px ${Ta.primary()}`,minWidth:"200px",touchAction:"none",overflow:"hidden",whiteSpace:"nowrap",opacity:1,...t&&{whiteSpace:"nowrap",overflow:"hidden"},...e&&{opacity:.5}})),La=Da(ja)(()=>({backgroundColor:Ta.background(),border:`2px dashed ${Ta.text()}`,touchAction:"none",color:Ta.text(),fontSize:"inherit",maxWidth:"374px",position:"relative",borderRadius:"3px","&.over":{whiteSpace:"nowrap",overflow:"hidden"},"&.parentOver":{border:`1px solid ${Ma[500]}`,backgroundColor:`${Ma[300]}`},"&.correct":{border:`solid 1px ${Ta.correct()}`},"&.incorrect":{border:`solid 1px ${Ta.incorrect()}`},"&.Mui-disabled":{opacity:1}})),Pa=Da("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 Wa({disabled:e,choice:t,isOver:n,isDragging:r,dragItem:o,correct:i,emptyResponseAreaWidth:a,emptyResponseAreaHeight:s}){const l=ka(null),c=ka(null),d=ka(null),[u,p]=Sa({height:0,width:0}),h=()=>{g()},f=()=>{const e=$a([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`}};Ea(()=>{f()},[]),Ea(()=>{l.current&&Na(l.current)},[i,n,$a([o,"optionalAccess",e=>e.choice,"optionalAccess",e=>e.value])]),Ea(()=>{t?f():p({height:0,width:0})},[t]),Ea(()=>{n||r||(d.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:$a([d,"access",e=>e.current,"optionalAccess",e=>e.width]),height:$a([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 Ca.createElement(La,{clickable:!1,disabled:e,ref:l,component:"span",label:Ca.createElement(Ca.Fragment,null,Ca.createElement(Pa,{ref:c,draggable:!0,className:Oa({over:n,hidden:m}),dangerouslySetInnerHTML:{__html:v||""}}),m&&Ca.createElement(Pa,{draggable:!0,className:Oa({over:n,dragged:!0}),dangerouslySetInnerHTML:{__html:m||""}})),className:Oa({over:n,parentOver:n,correct:void 0!==i&&i,incorrect:void 0!==i&&!i}),variant:e?"outlined":void 0,style:b})}function Ba({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}=Ki({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=zr("Droppable"),{active:a,dispatch:s,over:l,measureDroppableContainers:c}=oo(Ii),d=co({disabled:n}),u=co(!1),p=co(null),h=co(null),{disabled:f,updateMeasurementsFor:g,timeout:m}={...Vi,...o},v=Ir(null!=g?g:r),b=_i({callback:so(()=>{u.current?(null!=h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{c(Array.isArray(v.current)?v.current:[v.current]),h.current=null},m)):u.current=!0},[m]),disabled:f||!a}),y=so((e,t)=>{b&&(t&&(b.unobserve(t),u.current=!1),e&&b.observe(e))},[b]),[w,x]=Pr(y),_=Ir(t);return io(()=>{b&&w.current&&(b.disconnect(),u.current=!1,b.observe(w.current))},[w,b]),io(()=>(s({type:xo.RegisterDroppable,element:{id:r,key:i,disabled:n,node:w,rect:p,data:_}}),()=>s({type:xo.UnregisterDroppable,key:i,id:r})),[r]),io(()=>{n!==d.current.disabled&&(s({type:xo.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:w,over:l,setNodeRef:x}}({id:`mask-blank-drop-${e}`,data:{id:e,accepts:["MaskBlank"],instanceId:l}}),v={transform:Vr.Translate.toString(p)};return Ca.createElement(Ia,{ref:e=>{u(e),f(e)},style:v,dragged:h,over:g,...c,...d},Ca.createElement(Wa,{id:e,disabled:t,duplicates:n,choice:r,isOver:g,dragItem:$a([m,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current]),correct:o,onChange:i,emptyResponseAreaWidth:a,emptyResponseAreaHeight:s,instanceId:l}))}Wa.defaultProps={emptyResponseAreaWidth:0,emptyResponseAreaHeight:0},Wa.propTypes={id:Aa.oneOfType([Aa.string,Aa.number]),disabled:Aa.bool,duplicates:Aa.bool,choice:Aa.object,isOver:Aa.bool,dragItem:Aa.object,correct:Aa.bool,onChange:Aa.func,emptyResponseAreaWidth:Aa.oneOfType([Aa.string,Aa.number]),emptyResponseAreaHeight:Aa.oneOfType([Aa.string,Aa.number]),instanceId:Aa.string},Ba.defaultProps={emptyResponseAreaWidth:0,emptyResponseAreaHeight:0},Ba.propTypes={id:Aa.oneOfType([Aa.string,Aa.number]),disabled:Aa.bool,duplicates:Aa.bool,choice:Aa.object,correct:Aa.bool,onChange:Aa.func,emptyResponseAreaWidth:Aa.oneOfType([Aa.string,Aa.number]),emptyResponseAreaHeight:Aa.oneOfType([Aa.string,Aa.number]),instanceId:Aa.string};const za=t,Fa=n,{DragProvider:Ha}=f;function qa(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 Ua=wr("blank",e=>(t,n,r)=>{const o=qa([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,f=c?s[o.id]:n[o.id],g=f&&e.choices.find(e=>e.id===f);return za.createElement(Ba,{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 Ka extends za.Component{constructor(e){super(e),Ka.prototype.__init.call(this),Ka.prototype.__init2.call(this),Ka.prototype.__init3.call(this),Ka.prototype.__init4.call(this),this.state={activeDragItem:null,dropAnimation:void 0}}static __initStatic(){this.propTypes={markup:Fa.string,layout:Fa.object,choicesPosition:Fa.string,choices:Fa.array,value:Fa.object,onChange:Fa.func,duplicates:Fa.bool,disabled:Fa.bool,feedback:Fa.object,correctResponse:Fa.object,showCorrectAnswer:Fa.bool,emptyResponseAreaWidth:Fa.oneOfType([Fa.string,Fa.number]),emptyResponseAreaHeight:Fa.oneOfType([Fa.string,Fa.number]),instanceId:Fa.string}}static __initStatic2(){this.defaultProps={instanceId:"drag-in-the-blank"}}__init(){this.handleDragStart=e=>{const{active:t}=e;qa([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?za.createElement(ba,{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=qa([t,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current]),a=qa([n,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current]),s=!!t&&!!n&&"MaskBlank"===qa([i,"optionalAccess",e=>e.type])&&qa([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,f=o||"below",g={display:"flex",minWidth:"100px",...this.getPositionDirection(f)};return za.createElement(Ha,{onDragStart:this.handleDragStart,onDragEnd:this.handleDragEnd,collisionDetection:Ao},za.createElement("div",{ref:e=>this.rootRef=e,style:g},za.createElement(_a,{choicePosition:f,choices:i,value:n,duplicates:t,disabled:s,instanceId:h}),za.createElement(Ua,{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}),za.createElement(ia,{style:{pointerEvents:"none"},dropAnimation:this.state.dropAnimation},this.renderDragOverlay())))}}Ka.__initStatic(),Ka.__initStatic2();const Va=t,{styled:Ya}=r,Xa=l,{color:Ja}=a;function Qa(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 Ga,Za;"undefined"!=typeof window&&(Ga=require("@pie-lib/editable-html-tip-tap").default,Za=Ya(Ga)(()=>({display:"inline-block",verticalAlign:"middle",margin:"4px",borderRadius:"4px",border:`1px solid ${Ja.black()}`,"&.correct":{border:`1px solid ${Ja.correct()}`},"&.incorrect":{border:`1px solid ${Ja.incorrect()}`}})));wr("input",e=>(t,n)=>{const{adjustedLimit:r,disabled:o,feedback:i,showCorrectAnswer:a,maxLength:s,spellCheck:l,pluginProps:c,onChange:d}=e,u=Qa([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]||"",f=s&&s[u.id],g=i&&i[u.id],m=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 Va.createElement(Za,{id:u.id,key:`${t.type}-input-${u.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:!!Qa([c,"optionalAccess",e=>e.characters,"optionalAccess",e=>e.disabled])},className:Xa({correct:m,incorrect:v})})}});var es=wr("input",e=>(t,n,r)=>{const o=t.data&&t.data.dataset||{};if("input"===o.component)return e.customMarkMarkupComponent(o.id)});const ts=t,ns=n,{Button:rs}=i,{InputLabel:os}=i,{Menu:is}=i,{MenuItem:as}=i,{ArrowDropDown:ss}=c,{ArrowDropUp:ls}=c,{Close:cs}=c,{Check:ds}=c,{styled:us}=r,{color:ps}=a,{renderMath:hs}=h,fs=us(rs)(()=>({color:ps.text(),border:`1px solid ${ps.borderGray()}`,borderRadius:"4px",justifyContent:"space-between",backgroundColor:ps.background(),position:"relative",height:"45px",width:"fit-content",margin:"2px",textTransform:"none","& span":{paddingRight:"24px"},"& svg":{position:"absolute",right:"4px",top:"calc(50% - 12px)",pointerEvents:"none",color:ps.text(),marginLeft:"5px"},"&.Mui-focused":{outline:`3px solid ${ps.tertiary()}`,outlineOffset:"2px",borderWidth:"3px"},"&.disabledCorrect":{borderWidth:"2px",borderColor:ps.correct(),color:`${ps.text()} !important`},"&.disabledIncorrect":{borderWidth:"2px",borderColor:ps.incorrectWithIcon(),color:`${ps.text()} !important`}})),gs=us(is)(()=>({backgroundColor:ps.background(),border:`1px solid ${ps.correct()} !important`,"&:hover":{border:`1px solid ${ps.text()} `,borderColor:"initial"},"&:focus":{border:`1px solid ${ps.text()}`,borderColor:"initial"},"& .MuiList-root":{padding:0}})),ms=us(as)(()=>({height:24,overflow:"hidden",fontSize:"1rem",fontWeight:400,fontFamily:"inherit",lineHeight:"1.5em",whiteSpace:"nowrap",color:ps.text(),backgroundColor:ps.background(),"&.Mui-focusVisible":{outline:`3px solid ${ps.tertiary()}`,outlineOffset:"-1px",color:ps.text(),backgroundColor:ps.background()},"&:hover":{color:ps.text(),backgroundColor:ps.dropdownBackground()},boxSizing:"border-box",padding:"16px 8px",borderRadius:"4px","&.selected":{color:`${ps.text()} !important`,backgroundColor:`${ps.background()} !important`,"&:hover":{color:ps.text(),backgroundColor:`${ps.dropdownBackground()} !important`}}})),vs=us("span")(()=>({fontSize:"max(1rem, 14px)"})),bs=us("span")(()=>({fontSize:"max(1rem, 14px)",flexShrink:0,paddingLeft:"8px"})),ys=us(os)(()=>({position:"absolute",left:"-10000px",top:"auto",width:"1px",height:"1px",overflow:"hidden"})),ws=us(ds)(()=>({color:`${ps.white()} !important`,position:"absolute",top:"-8px !important",left:"-8px",marginLeft:"0 !important",borderRadius:"50%",fontSize:"16px",padding:"2px","&.correct":{backgroundColor:ps.correct()},"&.incorrect":{backgroundColor:ps.incorrectWithIcon()}})),xs=us(cs)(()=>({color:`${ps.white()} !important`,position:"absolute",top:"-8px !important",left:"-8px",marginLeft:"0 !important",borderRadius:"50%",fontSize:"16px",padding:"2px","&.correct":{backgroundColor:ps.correct()},"&.incorrect":{backgroundColor:ps.incorrectWithIcon()}}));class _s extends ts.Component{static __initStatic(){this.propTypes={id:ns.string,value:ns.string,disabled:ns.bool,onChange:ns.func,correct:ns.bool,choices:ns.arrayOf(ns.shape({value:ns.string,label:ns.string})),showCorrectAnswer:ns.bool,singleQuery:ns.bool,correctValue:ns.string}}constructor(e){super(e),_s.prototype.__init.call(this),_s.prototype.__init2.call(this),_s.prototype.__init3.call(this),_s.prototype.__init4.call(this),_s.prototype.__init5.call(this),this.state={anchorEl:null,highlightedOptionId:null,menuWidth:null,previewValue:null},this.hiddenRef=ts.createRef(),this.buttonRef=ts.createRef(),this.previewRef=ts.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||hs(e)}),n){const e=n.clientWidth;e!==this.state.menuWidth&&(this.elementRefs.forEach(e=>{e&&hs(e)}),hs(n),this.setState({menuWidth:e}))}}__init(){this.handleClick=e=>{const{id:t,value:n,choices:r}=this.props;let o=null;if(n){const e=(r||[]).findIndex(e=>e.value===n);e>=0&&(o=`dropdown-option-${t}-${e}`)}this.setState({anchorEl:e.currentTarget,highlightedOptionId:o})}}__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 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?ts.createElement(ws,{className:"correct"}):ts.createElement(xs,{className:"incorrect"})),ts.createElement(ts.Fragment,null,ts.createElement("div",{ref:this.hiddenRef,style:{position:"absolute",visibility:"hidden",top:0,left:0},tabIndex:-1,"aria-hidden":"true"},(o||[]).map((e,t)=>ts.createElement(ms,{key:t,tabIndex:-1,"aria-hidden":"true"},ts.createElement(vs,{dangerouslySetInnerHTML:{__html:e.label}})))),ts.createElement(ys,{id:g,tabIndex:-1,"aria-hidden":"true"},m),ts.createElement(fs,{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 ${m}`,"aria-labelledby":p},v,ts.createElement(vs,{id:p,ref:this.previewRef,dangerouslySetInnerHTML:{__html:s||(c&&this.state.previewValue?this.getLabel(o,this.state.previewValue):this.getLabel(o,r)||"")}}),c?ts.createElement(ls,null):ts.createElement(ss,null)),ts.createElement(gs,{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 ts.createElement(ms,{id:o,className:t.value===r?"selected":"",selected:t.value===r,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)},ts.createElement(vs,{ref:e=>this.elementRefs[n]=e,dangerouslySetInnerHTML:{__html:t.label}}),ts.createElement(bs,{dangerouslySetInnerHTML:{__html:t.value===r?" &check;":""}}))})))}}_s.__initStatic();const Cs=t;wr("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 Cs.createElement(_s,{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 Es=t,ks=n,{styled:Ss}=r,{Tooltip:As}=i,{color:Rs}=a,{Collapsible:Ds}=a,{Readable:js}=a,{hasText:Os}=a,{hasMedia:Ts}=a,{PreviewPrompt:Ms}=a,{UiLayout:Ns}=a,$s=d,Is=o,{mq:Ls}=p,{HorizontalKeypad:Ps}=p,{updateSpans:Ws}=p,{registerEmbed:Bs}=p,{applyStaticMath:zs}=p,{renderMath:Fs}=h;function Hs(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 qs=Ss(Ns)({color:Rs.text(),backgroundColor:Rs.background(),display:"inline-block"}),Us=Ss("div")({width:"100%",position:"relative",backgroundColor:Rs.background(),color:Rs.text()}),Ks=Ss("div")(({theme:e})=>({marginBottom:e.spacing(2)})),Vs=Ss("div")(({theme:e})=>({marginBottom:e.spacing(2)})),Ys=Ss("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}}),Xs=Ss("div")(({theme:e,$incorrect:t,$correct:n,$showCorrectness:r,$correctAnswerShown:o})=>({maxWidth:"fit-content",...t&&{borderColor:`${Rs.incorrect()} !important`},...n&&{borderColor:`${Rs.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}}})),Js=Ss(Ls.Static)({"& > .mq-root-block":{"& > .mq-editable-field":{borderColor:Rs.text()}}}),Qs=Ss("div")(({theme:e})=>({zIndex:10,minWidth:"400px",marginTop:e.spacing(2)})),Gs=Ss("div")(({theme:e})=>({marginBottom:e.spacing(1),pointerEvents:"none"})),Zs=Ss("h2")({position:"absolute",left:"-10000px",top:"auto",width:"1px",height:"1px",overflow:"hidden"}),el=Ss("div")(({theme:e})=>({marginBottom:e.spacing(2)})),tl=Ss($s)(({theme:e})=>({color:Rs.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: ${Rs.text()};\n background-color: ${Rs.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: ${Rs.correct()} !important;\n }\n .incorrect {\n border-color: ${Rs.incorrect()} !important;\n }\n `,document.head.appendChild(t)}}let nl=!1;const rl=/(\{\{\d+\}\})/gm,ol=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);function il(e=[],t){return 30*Math.floor(e.length/5)+("miscellaneous"===t?600:500)}function al(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]=Hs([n,"optionalAccess",e=>e[t],"optionalAccess",e=>e.answer]),e),{});return o.split(rl).filter(e=>e).reduce((e,n)=>{if(n.match(rl)){const o=ll.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 sl={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=Hs([e,"access",e=>e.elements,"access",e=>e.popper,"optionalAccess",e=>e.offsetParent]),a=Hs([i,"optionalAccess",e=>e.getBoundingClientRect,"optionalCall",e=>e()])||{left:0},s=Hs([i,"optionalAccess",e=>e.scrollLeft])||0,l=o-a.left+s,c=l-o,d=c+8,u=c+n-r-8;t.x=o+r<=n?l:l-r,t.x=u<d?d:Math.min(Math.max(t.x,d),u)}};class ll extends Es.Component{static __initStatic(){this.getResponseKey=e=>(e||"").replaceAll("{{","").replaceAll("}}","")}static __initStatic2(){this.propTypes={session:ks.object.isRequired,onSessionChange:ks.func,model:ks.object.isRequired}}constructor(e){super(e),ll.prototype.__init.call(this),ll.prototype.__init2.call(this),ll.prototype.__init3.call(this),ll.prototype.__init4.call(this),ll.prototype.__init5.call(this),ll.prototype.__init6.call(this),ll.prototype.__init7.call(this),ll.prototype.__init8.call(this),ll.prototype.__init9.call(this),ll.prototype.__init10.call(this),ll.prototype.__init11.call(this),ll.prototype.__init12.call(this),ll.prototype.__init13.call(this);const t={},{model:n,session:r}=e||{},{markup:o,alwaysShowCorrect:i}=n||{},{answers:a}=r||{};o&&(o||"").replace(rl,e=>{const n=ll.getResponseKey(e),r=a&&a[`r${n}`];t[`r${n}`]={value:Hs([r,"optionalAccess",e=>e.value])||""}}),this.state={session:{...e.session,answers:t},activeAnswerBlock:"",showCorrect:i||!1,tooltipContainerRef:Es.createRef()}}UNSAFE_componentWillMount(){"undefined"!=typeof window&&(nl||(Bs("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}]`})),nl=!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){const i=r[t];zs(n,i&&i.value||""),e.view&&(n.parentElement.parentElement.classList.remove("correct"),n.parentElement.parentElement.classList.remove("incorrect")),o.textContent="R"}}),Fs(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(rl),d=i.match(rl);if(!sn(c,d)){const e={},t=this.state.session.answers;(d||[]).forEach(n=>{const r=ll.getResponseKey(n),o=t&&t[`r${r}`];e[`r${r}`]={value:Hs([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(()=>Fs(this.root),100)}componentDidUpdate(){this.handleAnswerBlockDomUpdate()}__init2(){this.onSubFieldFocus=e=>{const t=Array.from(Hs([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=Hs([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)=>{Ws(),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=Hs([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&&Hs([o,"optionalAccess",e=>e.attributes,"access",e=>e["data-keypad"]])||this.setState({activeAnswerBlock:""})}}setTooltipRef(e){setTimeout(()=>{if(e&&ol){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&&(Os(t)||Ts(t)),o=Es.createElement(Ms,{defaultClassName:"teacher-instructions",prompt:t});return r&&Es.createElement(Vs,null,n?o:Es.createElement(Ds,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},o))}}__init12(){this.renderRationale=()=>{const{model:e}=this.props,{rationale:t,animationsDisabled:n}=e||{},r=Es.createElement(Ms,{prompt:t});return t&&(Os(t)||Ts(t))&&Es.createElement(Vs,null,n?r:Es.createElement(Ds,{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:f}=e||{},g=an(l),m=function(e=[]){return e.map(e=>({name:e,latex:e,write:e,label:e}))}(d),v=al(e,this.state)||"",b=h&&!f;return Es.createElement(Ys,null,Es.createElement(es,{disabled:a,markup:e.markup,value:{},customMarkMarkupComponent:e=>{const l="evaluate"===p&&u&&u[e],d=Es.createElement(Js,{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 Es.createElement(Xs,{ref:o,$incorrect:!g&&!l&&!n,$correct:!g&&(l||n),$showCorrectness:!g&&a&&i&&!s,$correctAnswerShown:n},Es.createElement(As,{ref:e=>this.setTooltipRef(e),enterTouchDelay:0,interactive:!0,open:t===`r${e}`,slotProps:{popper:{container:Hs([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:!1},{name:"flip",enabled:!1},sl]},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)&&Es.createElement(Qs,{"data-keypad":!0,key:e,style:{width:il(m,c)}},Es.createElement(Ps,{additionalKeys:m,mode:c||6,onClick:this.onClick}))||null)},b?Es.createElement(Gs,null,d):Es.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=!an(s)&&a&&"correct"!==a.correctness,p=(t||"view"===r&&"instructor"===o)&&c&&d;return Es.createElement(qs,{extraCSSRules:i,ref:e=>{const t=Is.findDOMNode(e);this.root=t||this.root}},Es.createElement(Us,null,"gather"===r&&Es.createElement(Zs,null,"Math Equation Response Question"),Es.createElement(Us,null,u&&Es.createElement(tl,{language:l,show:!0,toggled:t,onToggle:this.toggleShowCorrect})),this.renderTeacherInstructions(),n&&Es.createElement(Ks,null,Es.createElement(Ms,{prompt:n})),Es.createElement(js,{false:!0},this.renderPlayerContent()),p&&Es.createElement(el,{className:"note",dangerouslySetInnerHTML:{__html:d}}),this.renderRationale()))}}ll.__initStatic(),ll.__initStatic2();const cl=t,{createRoot:dl}=u;class ul extends HTMLElement{constructor(){super(),this._root=null,this.sessionChangedEventCaller=rn(()=>{this.dispatchEvent(new y(this.tagName.toLowerCase(),!0))},1e3)}set model(e){this._model=e,this.render(),this.dispatchEvent(new v(this.tagName.toLowerCase(),this.isSessionComplete(),void 0!==this._model))}get model(){return this._model}set session(e){this._session=e,this.render()}get session(){return this._session}isSessionComplete(){return!0}onSessionChange(e){Object.keys(e).map(t=>{this._session[t]=e[t]}),this.sessionChangedEventCaller(),this.render()}connectedCallback(){this.render()}render(){if(this._model&&this._session&&this._model&&this._session){const e=cl.createElement(ll,{model:this._model,session:this._session,onSessionChange:this.onSessionChange.bind(this)});this._root||(this._root=dl(this)),this._root.render(e)}}disconnectedCallback(){this._root&&this._root.unmount()}}export{ul 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_mui__material_colors as s,_dll_classnames as l,_dll_mui__icons_material as c,_dll_pie_lib__correct_answer_toggle as d,_dll_react_dom_client as u}from"../../../@pie-lib/shared-module@^5.2.5/module/index.js";import{_dll_pie_lib__math_input as p}from"../../../@pie-lib/math-edit-module@^4.2.5/module/index.js";import{_dll_pie_lib__math_rendering as h}from"../../../@pie-lib/math-rendering-module@^5.0.10/module/index.js";import{_dll_pie_lib__drag as f}from"../../../@pie-lib/drag-module@^4.0.10/module/index.js";var g={};Object.defineProperty(g,"__esModule",{value:!0});class m extends CustomEvent{constructor(e,t,n){super(m.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e,hasModel:n}}),this.component=e,this.complete=t}}m.TYPE="model-set";var v=g.ModelSetEvent=m;class b extends CustomEvent{constructor(e,t){super(b.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e}}),this.component=e,this.complete=t}}b.TYPE="session-changed";var y=g.SessionChangedEvent=b,w="object"==typeof global&&global&&global.Object===Object&&global,x="object"==typeof self&&self&&self.Object===Object&&self,_=w||x||Function("return this")(),C=_.Symbol,E=Object.prototype,k=E.hasOwnProperty,S=E.toString,A=C?C.toStringTag:void 0;var R=Object.prototype.toString;var D=C?C.toStringTag:void 0;function j(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":D&&D in Object(e)?function(e){var t=k.call(e,A),n=e[A];try{e[A]=void 0;var r=!0}catch(e){}var o=S.call(e);return r&&(t?e[A]=n:delete e[A]),o}(e):function(e){return R.call(e)}(e)}function O(e){return null!=e&&"object"==typeof e}function T(e){return"symbol"==typeof e||O(e)&&"[object Symbol]"==j(e)}var M=Array.isArray,N=C?C.prototype:void 0,$=N?N.toString:void 0;function I(e){if("string"==typeof e)return e;if(M(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,I)+"";if(T(e))return $?$.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}var L=/\s/;var P=/^\s+/;function W(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&L.test(e.charAt(t)););return t}(e)+1).replace(P,""):e}function B(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var z=/^[-+]0x[0-9a-f]+$/i,F=/^0b[01]+$/i,H=/^0o[0-7]+$/i,q=parseInt;function U(e){if("number"==typeof e)return e;if(T(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=W(e);var n=F.test(e);return n||H.test(e)?q(e.slice(2),n?2:8):z.test(e)?NaN:+e}function K(e){return e}function V(e){if(!B(e))return!1;var t=j(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var Y,X=_["__core-js_shared__"],J=(Y=/[^.]+$/.exec(X&&X.keys&&X.keys.IE_PROTO||""))?"Symbol(src)_1."+Y:"";var Q=Function.prototype.toString;function G(e){if(null!=e){try{return Q.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var Z=/^\[object .+?Constructor\]$/,ee=Function.prototype,te=Object.prototype,ne=ee.toString,re=te.hasOwnProperty,oe=RegExp("^"+ne.call(re).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ie(e){return!(!B(e)||(t=e,J&&J in t))&&(V(e)?oe:Z).test(G(e));var t}function ae(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return ie(n)?n:void 0}var se=ae(_,"WeakMap"),le=/^(?:0|[1-9]\d*)$/;function ce(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&le.test(e))&&e>-1&&e%1==0&&e<t}function de(e,t){return e===t||e!=e&&t!=t}function ue(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function pe(e){return null!=e&&ue(e.length)&&!V(e)}var he=Object.prototype;function fe(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||he)}function ge(e){return O(e)&&"[object Arguments]"==j(e)}var me=Object.prototype,ve=me.hasOwnProperty,be=me.propertyIsEnumerable,ye=ge(function(){return arguments}())?ge:function(e){return O(e)&&ve.call(e,"callee")&&!be.call(e,"callee")};var we="object"==typeof exports&&exports&&!exports.nodeType&&exports,xe=we&&"object"==typeof module&&module&&!module.nodeType&&module,_e=xe&&xe.exports===we?_.Buffer:void 0,Ce=(_e?_e.isBuffer:void 0)||function(){return!1},Ee={};Ee["[object Float32Array]"]=Ee["[object Float64Array]"]=Ee["[object Int8Array]"]=Ee["[object Int16Array]"]=Ee["[object Int32Array]"]=Ee["[object Uint8Array]"]=Ee["[object Uint8ClampedArray]"]=Ee["[object Uint16Array]"]=Ee["[object Uint32Array]"]=!0,Ee["[object Arguments]"]=Ee["[object Array]"]=Ee["[object ArrayBuffer]"]=Ee["[object Boolean]"]=Ee["[object DataView]"]=Ee["[object Date]"]=Ee["[object Error]"]=Ee["[object Function]"]=Ee["[object Map]"]=Ee["[object Number]"]=Ee["[object Object]"]=Ee["[object RegExp]"]=Ee["[object Set]"]=Ee["[object String]"]=Ee["[object WeakMap]"]=!1;var ke,Se="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ae=Se&&"object"==typeof module&&module&&!module.nodeType&&module,Re=Ae&&Ae.exports===Se&&w.process,De=function(){try{var e=Ae&&Ae.require&&Ae.require("util").types;return e||Re&&Re.binding&&Re.binding("util")}catch(e){}}(),je=De&&De.isTypedArray,Oe=je?(ke=je,function(e){return ke(e)}):function(e){return O(e)&&ue(e.length)&&!!Ee[j(e)]},Te=Object.prototype.hasOwnProperty;function Me(e,t){var n=M(e),r=!n&&ye(e),o=!n&&!r&&Ce(e),i=!n&&!r&&!o&&Oe(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&&!Te.call(e,c)||a&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||ce(c,l))||s.push(c);return s}var Ne=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object),$e=Ne,Ie=Object.prototype.hasOwnProperty;function Le(e){if(!fe(e))return $e(e);var t=[];for(var n in Object(e))Ie.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Pe(e){return pe(e)?Me(e):Le(e)}var We=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Be=/^\w*$/;function ze(e,t){if(M(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!T(e))||(Be.test(e)||!We.test(e)||null!=t&&e in Object(t))}var Fe=ae(Object,"create");var He=Object.prototype.hasOwnProperty;var qe=Object.prototype.hasOwnProperty;function Ue(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 Ke(e,t){for(var n=e.length;n--;)if(de(e[n][0],t))return n;return-1}Ue.prototype.clear=function(){this.__data__=Fe?Fe(null):{},this.size=0},Ue.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ue.prototype.get=function(e){var t=this.__data__;if(Fe){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return He.call(t,e)?t[e]:void 0},Ue.prototype.has=function(e){var t=this.__data__;return Fe?void 0!==t[e]:qe.call(t,e)},Ue.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Fe&&void 0===t?"__lodash_hash_undefined__":t,this};var Ve=Array.prototype.splice;function Ye(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])}}Ye.prototype.clear=function(){this.__data__=[],this.size=0},Ye.prototype.delete=function(e){var t=this.__data__,n=Ke(t,e);return!(n<0)&&(n==t.length-1?t.pop():Ve.call(t,n,1),--this.size,!0)},Ye.prototype.get=function(e){var t=this.__data__,n=Ke(t,e);return n<0?void 0:t[n][1]},Ye.prototype.has=function(e){return Ke(this.__data__,e)>-1},Ye.prototype.set=function(e,t){var n=this.__data__,r=Ke(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var Xe=ae(_,"Map");function Je(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 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.size=0,this.__data__={hash:new Ue,map:new(Xe||Ye),string:new Ue}},Qe.prototype.delete=function(e){var t=Je(this,e).delete(e);return this.size-=t?1:0,t},Qe.prototype.get=function(e){return Je(this,e).get(e)},Qe.prototype.has=function(e){return Je(this,e).has(e)},Qe.prototype.set=function(e,t){var n=Je(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function Ge(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(Ge.Cache||Qe),n}Ge.Cache=Qe;var Ze=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,et=/\\(\\)?/g,tt=function(e){var t=Ge(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(Ze,function(e,n,r,o){t.push(r?o.replace(et,"$1"):n||e)}),t}),nt=tt;function rt(e,t){return M(e)?e:ze(e,t)?[e]:nt(function(e){return null==e?"":I(e)}(e))}function ot(e){if("string"==typeof e||T(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function it(e,t){for(var n=0,r=(t=rt(t,e)).length;null!=e&&n<r;)e=e[ot(t[n++])];return n&&n==r?e:void 0}function at(e,t,n){var r=null==e?void 0:it(e,t);return void 0===r?n:r}function st(e){var t=this.__data__=new Ye(e);this.size=t.size}st.prototype.clear=function(){this.__data__=new Ye,this.size=0},st.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},st.prototype.get=function(e){return this.__data__.get(e)},st.prototype.has=function(e){return this.__data__.has(e)},st.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Ye){var r=n.__data__;if(!Xe||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Qe(r)}return n.set(e,t),this.size=n.size,this};var lt=Object.prototype.propertyIsEnumerable,ct=Object.getOwnPropertySymbols,dt=ct?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}(ct(e),function(t){return lt.call(e,t)}))}:function(){return[]};function ut(e){return function(e,t,n){var r=t(e);return M(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,Pe,dt)}var pt=ae(_,"DataView"),ht=ae(_,"Promise"),ft=ae(_,"Set"),gt="[object Map]",mt="[object Promise]",vt="[object Set]",bt="[object WeakMap]",yt="[object DataView]",wt=G(pt),xt=G(Xe),_t=G(ht),Ct=G(ft),Et=G(se),kt=j;(pt&&kt(new pt(new ArrayBuffer(1)))!=yt||Xe&&kt(new Xe)!=gt||ht&&kt(ht.resolve())!=mt||ft&&kt(new ft)!=vt||se&&kt(new se)!=bt)&&(kt=function(e){var t=j(e),n="[object Object]"==t?e.constructor:void 0,r=n?G(n):"";if(r)switch(r){case wt:return yt;case xt:return gt;case _t:return mt;case Ct:return vt;case Et:return bt}return t});var St=kt,At=_.Uint8Array;function Rt(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Qe;++t<n;)this.add(e[t])}function Dt(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 jt(e,t){return e.has(t)}Rt.prototype.add=Rt.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Rt.prototype.has=function(e){return this.__data__.has(e)};function Ot(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 Rt:void 0;for(i.set(e,t),i.set(t,e);++u<s;){var f=e[u],g=t[u];if(r)var m=a?r(g,f,u,t,e,i):r(f,g,u,e,t,i);if(void 0!==m){if(m)continue;p=!1;break}if(h){if(!Dt(t,function(e,t){if(!jt(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 Tt(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function Mt(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var Nt=C?C.prototype:void 0,$t=Nt?Nt.valueOf:void 0;var It=Object.prototype.hasOwnProperty;var Lt="[object Arguments]",Pt="[object Array]",Wt="[object Object]",Bt=Object.prototype.hasOwnProperty;function zt(e,t,n,r,o,i){var a=M(e),s=M(t),l=a?Pt:St(e),c=s?Pt:St(t),d=(l=l==Lt?Wt:l)==Wt,u=(c=c==Lt?Wt:c)==Wt,p=l==c;if(p&&Ce(e)){if(!Ce(t))return!1;a=!0,d=!1}if(p&&!d)return i||(i=new st),a||Oe(e)?Ot(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 At(e),new At(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return de(+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=Tt;case"[object Set]":var l=1&r;if(s||(s=Mt),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=Ot(s(e),s(t),r,o,i,a);return a.delete(e),d;case"[object Symbol]":if($t)return $t.call(e)==$t.call(t)}return!1}(e,t,l,n,r,o,i);if(!(1&n)){var h=d&&Bt.call(e,"__wrapped__"),f=u&&Bt.call(t,"__wrapped__");if(h||f){var g=h?e.value():e,m=f?t.value():t;return i||(i=new st),o(g,m,n,r,i)}}return!!p&&(i||(i=new st),function(e,t,n,r,o,i){var a=1&n,s=ut(e),l=s.length;if(l!=ut(t).length&&!a)return!1;for(var c=l;c--;){var d=s[c];if(!(a?d in t:It.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 f=a;++c<l;){var g=e[d=s[c]],m=t[d];if(r)var v=a?r(m,g,d,t,e,i):r(g,m,d,e,t,i);if(!(void 0===v?g===m||o(g,m,n,r,i):v)){h=!1;break}f||(f="constructor"==d)}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 Ft(e,t,n,r,o){return e===t||(null==e||null==t||!O(e)&&!O(t)?e!=e&&t!=t:zt(e,t,n,r,Ft,o))}function Ht(e){return e==e&&!B(e)}function qt(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}function Ut(e){var t=function(e){for(var t=Pe(e),n=t.length;n--;){var r=t[n],o=e[r];t[n]=[r,o,Ht(o)]}return t}(e);return 1==t.length&&t[0][2]?qt(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 st;if(r)var p=r(c,d,l,e,t,u);if(!(void 0===p?Ft(d,c,3,r,u):p))return!1}}return!0}(n,e,t)}}function Kt(e,t){return null!=e&&t in Object(e)}function Vt(e,t){return null!=e&&function(e,t,n){for(var r=-1,o=(t=rt(t,e)).length,i=!1;++r<o;){var a=ot(t[r]);if(!(i=null!=e&&n(e,a)))break;e=e[a]}return i||++r!=o?i:!!(o=null==e?0:e.length)&&ue(o)&&ce(a,o)&&(M(e)||ye(e))}(e,t,Kt)}function Yt(e){return ze(e)?function(e){return function(t){return null==t?void 0:t[e]}}(ot(e)):function(e){return function(t){return it(t,e)}}(e)}function Xt(e){return"function"==typeof e?e:null==e?K:"object"==typeof e?M(e)?(t=e[0],n=e[1],ze(t)&&Ht(n)?qt(ot(t),n):function(e){var r=at(e,t);return void 0===r&&r===n?Vt(e,t):Ft(n,r,3)}):Ut(e):Yt(e);var t,n}var Jt,Qt=function(e,t,n){for(var r=-1,o=Object(e),i=n(e),a=i.length;a--;){var s=i[Jt?a:++r];if(!1===t(o[s],s,o))break}return e},Gt=Qt;function Zt(e,t){return e&&Gt(e,t,Pe)}var en=function(){return _.Date.now()},tn=Math.max,nn=Math.min;function rn(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 f(e){var n=e-l;return void 0===l||n>=t||n<0||u&&e-c>=i}function g(){var e=en();if(f(e))return m(e);s=setTimeout(g,function(e){var n=t-(e-l);return u?nn(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=en(),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),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=U(t)||0,B(n)&&(d=!!n.leading,i=(u="maxWait"in n)?tn(U(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(en())},v}var on=Object.prototype.hasOwnProperty;function an(e){if(null==e)return!0;if(pe(e)&&(M(e)||"string"==typeof e||"function"==typeof e.splice||Ce(e)||Oe(e)||ye(e)))return!e.length;var t=St(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(fe(e))return!Le(e).length;for(var n in e)if(on.call(e,n))return!1;return!0}function sn(e,t){return Ft(e,t)}var ln,cn,dn,un={"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},pn={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},hn=function(e){return e.length?e.charAt(0).toUpperCase()+e.substring(1):e},fn=hn,gn=/^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/,mn="undefined"==typeof document?{}:document.documentElement.style,vn=(ln=function(){for(var e in mn)if(gn.test(e))return e.match(gn)[0];return"WebkitOpacity"in mn?"Webkit":"KhtmlOpacity"in mn?"Khtml":""}(),cn=ln.toLowerCase(),{style:ln,css:"-"+cn+"-",dom:{Webkit:"WebKit",ms:"MS",o:"WebKit"}[ln]||fn(ln)}),bn=function(e,t){return t?t.toUpperCase():""},yn=/[-\s]+(.)?/g,wn=function(e){return e?e.replace(yn,bn):""},xn=/::/g,_n=/([A-Z]+)([A-Z][a-z])/g,Cn=/([a-z\d])([A-Z])/g,En=/_/g,kn=function(e,t){return e?e.replace(xn,"/").replace(_n,"$1_$2").replace(Cn,"$1_$2").replace(En,t||"-"):""},Sn=function(e){return kn(e).toLowerCase()},An=wn,Rn=Sn,Dn=function(e){return e.length?e.charAt(0).toLowerCase()+e.substring(1):e},jn=hn,On=vn,Tn=un,Mn="undefined"==typeof document?{}:document.documentElement.style,Nn=function(e,t){t=t||{};var n=Dn(An(e)),r=Rn(e),o=dn?n:r,i=On.style?dn?On.style:On.css:"";if(n in Mn)return t.asString?o:[o];var a=o,s=Tn[r],l=[];if(dn&&(a=jn(o)),"function"==typeof s){var c=s(o,i)||[];c&&!Array.isArray(c)&&(c=[c]),c.length&&(c=c.map(function(e){return dn?Dn(An(e)):Rn(e)})),l=l.concat(c)}return i&&l.push(i+a),l.push(o),t.asString||1==l.length?l[0]:l},$n=Object.prototype.hasOwnProperty,In=function(e,t){return $n.call(e,t)},Ln=Object.prototype.toString,Pn=Object.prototype.toString,Wn=Nn,Bn=Sn,zn=wn,Fn=In,Hn=function(e){return!!e&&"[object Object]"===Ln.call(e)},qn=function(e){return"[object Function]"===Pn.apply(e)},Un=function(e,t,n,r){Wn(t).forEach(function(t){e[r?r(t):t]=n})},Kn={cssUnitless:pn},Vn=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||Kn).cssUnitless=t.cssUnitless||Kn.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,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?zn:Bn;for(a in e)if(Fn(e,a)){if(s=e[a],i=Bn(n?n+a:a),o=!1,u=!1,qn(s)&&(d=s.call(p||e,s,a,i,e),Hn(d)&&null!=d.value?(s=d.value,u=d.prefix,i=d.name?Bn(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||!!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){u?Un(r,e,s,v):r[v(e)]=s});continue}u?Un(r,i,s,v):r[v(i)]=s}else Vn(s,t,i+"-",r)}return r},Yn=Vn,Xn=In,Jn={prefixProperties:un,cssUnitless:pn,object:Vn,string:function(e,t){e=Yn(e,t);var n,r=[];for(n in e)Xn(e,n)&&r.push(n+": "+e[n]);return r.join("; ")}};const Qn=e("@pie-lib:mask-markup:serialization"),Gn=["span"],Zn=["em","strong","u"],er=(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),Jn.object(r,{camelize:!0,addUnits:!1});var r},tr=["border","class","style"],nr={b:"bold",em:"italic",u:"underline",s:"strikethrough",code:"code",strong:"strong"},rr=(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=nr[r];if(o){Qn("[deserialize] mark: ",o);return{_flatten:!0,nodes:or(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=tr.reduce((n=e,(e,t)=>{if(!n.getAttribute)return e;if(n.getAttribute(t))switch(t){case"style":e.style=er(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=>Gn.includes(e)?"inline":Zn.includes(e)?"mark":"block")(r),l=or(e.childNodes,t);return{object:s,type:r,data:{dataset:{...e.dataset},attributes:{...a}},nodes:l}}var n;return null},or=(e,t=[])=>{const n=[];for(let r=0;r<e.length;r++){const o=rr(e[r],t);null!==o&&(o._flatten&&o.nodes?n.push(...o.nodes):n.push(o))}return n},ir=t,ar=n,{styled:sr}=r,{renderMath:lr}=h;const cr=sr("div")(({theme:e})=>({paddingTop:e.spacing(.5),paddingBottom:e.spacing(.5)})),dr=sr("span")(()=>({display:"inline-block",width:".75em"})),ur=["tbody","tr"],pr=(e,t,n,r,o,i)=>{if(!t)return null;const a=[];return(e.nodes||[]).forEach((e,i)=>{const s=e.type?`${e.type}-${i}`:`${i}`;if(e.isMath)return a.push(ir.createElement("span",{dangerouslySetInnerHTML:{__html:`<math displaystyle="true">${e.nodes[0].innerHTML}</math>`}})),a;if(r){const o=r(e,t,n);if(o){const t="blank"===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}([e,"access",e=>e.data,"optionalAccess",e=>e.dataset,"optionalAccess",e=>e.component]);return t&&a.push(ir.createElement(dr,{key:`spacer-${i}`})),a.push(o),void(t&&a.push(ir.createElement(dr,{key:`spacer-${i}`})))}}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&&ur.includes(r)?void 0:t})(o,n);return r?e+r:e},""),n=(e=>{const t=e.leaves.find(e=>at(e,"marks",[]).length);return t?t.marks[0]:null})(e);if(n){let e;for(e in nr)if(nr[e]===n.type){const n=e;a.push(ir.createElement(n,{key:s},t));break}}else t.length>0&&a.push(t)}else{const o=pr(e,t,n,r,e);if("p"===e.type||"paragraph"===e.type)a.push(ir.createElement(cr,{key:s},o));else{const t=e.type;e.nodes&&e.nodes.length>0?a.push(ir.createElement(t,{key:s,...e.data.attributes},o)):a.push(ir.createElement(t,{key:s,...e.data.attributes}))}}}),a},hr=sr("div")(()=>({display:"initial","&:not(.MathJax) table":{borderCollapse:"collapse"},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:"8px 12px",textAlign:"left"}}));class fr extends ir.Component{constructor(e){super(e),fr.prototype.__init.call(this),this.internalContainerRef=ir.createRef()}static __initStatic(){this.propTypes={renderChildren:ar.func,layout:ar.object,value:ar.object,onChange:ar.func,elementType:ar.string,containerRef:ar.oneOfType([ar.func,ar.shape({current:ar.instanceOf(Element)})])}}componentDidMount(){const e=this.props.containerRef||this.internalContainerRef;e.current&&"function"==typeof lr&&lr(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=pr(t,e,this.handleChange,this.props.renderChildren,null),i=r||this.internalContainerRef;return ir.createElement(hr,{ref:i},o)}}fr.__initStatic();const gr=/\{\{(\d+)\}\}/g;const mr=t,vr=n;var br;const yr=(e,t)=>{const{markup:n}=(o=t,(r=e)?{markup:r.replace(gr,(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=or(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},wr=(e,t)=>((br=class extends mr.Component{static __initStatic(){this.propTypes={markup:vr.string,layout:vr.object,value:vr.object,onChange:vr.func,customMarkMarkupComponent:vr.func,elementType:vr.string}}constructor(e){super(e),this.containerRef=mr.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||yr(n,e);return mr.createElement(fr,{containerRef:this.containerRef,elementType:a,layout:s,value:o,onChange:i,renderChildren:t(this.props)})}}).__initStatic(),br),{useMemo:xr}=t,{useLayoutEffect:_r}=t,{useEffect:Cr}=t,{useRef:Er}=t,{useCallback:kr}=t,Sr="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function Ar(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function Rr(e){return"nodeType"in e}function Dr(e){var t,n;return e?Ar(e)?e:Rr(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function jr(e){const{Document:t}=Dr(e);return e instanceof t}function Or(e){return!Ar(e)&&e instanceof Dr(e).HTMLElement}function Tr(e){return e instanceof Dr(e).SVGElement}function Mr(e){return e?Ar(e)?e.document:Rr(e)?jr(e)?e:Or(e)||Tr(e)?e.ownerDocument:document:document:document}const Nr=Sr?_r:Cr;function $r(e){const t=Er(e);return Nr(()=>{t.current=e}),kr(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 Ir(e,t){void 0===t&&(t=[e]);const n=Er(e);return Nr(()=>{n.current!==e&&(n.current=e)},t),n}function Lr(e,t){const n=Er();return xr(()=>{const t=e(n.current);return n.current=t,t},[...t])}function Pr(e){const t=$r(e),n=Er(null),r=kr(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,r]}function Wr(e){const t=Er();return Cr(()=>{t.current=e},[e]),t.current}let Br={};function zr(e,t){return xr(()=>{if(t)return t;const n=null==Br[e]?0:Br[e]+1;return Br[e]=n,e+"-"+n},[e,t])}function Fr(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 Hr=Fr(1),qr=Fr(-1);function Ur(e){if(!e)return!1;const{KeyboardEvent:t}=Dr(e.target);return t&&e instanceof t}function Kr(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=Dr(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 Vr=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[Vr.Translate.toString(e),Vr.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Yr="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Xr(e){return e.matches(Yr)?e:e.querySelector(Yr)}const Jr=t,{useState:Qr}=t,{useCallback:Gr}=t,Zr={display:"none"};function eo(e){let{id:t,value:n}=e;return Jr.createElement("div",{id:t,style:Zr},n)}function to(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;return Jr.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 no=t,{createContext:ro}=t,{useContext:oo}=t,{useEffect:io}=t,{useState:ao}=t,{useCallback:so}=t,{useMemo:lo}=t,{useRef:co}=t,{memo:uo}=t,{useReducer:po}=t,{cloneElement:ho}=t,{forwardRef:fo}=t,{createPortal:go}=o,{unstable_batchedUpdates:mo}=o,vo=ro(null);const bo={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 "},yo={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 wo(e){let{announcements:t=yo,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=bo}=e;const{announce:i,announcement:a}=function(){const[e,t]=Qr("");return{announce:Gr(e=>{null!=e&&t(e)},[]),announcement:e}}(),s=zr("DndLiveRegion"),[l,c]=ao(!1);if(io(()=>{c(!0)},[]),function(e){const t=oo(vo);io(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}(lo(()=>({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=no.createElement(no.Fragment,null,no.createElement(eo,{id:r,value:o.draggable}),no.createElement(to,{id:s,announcement:a}));return n?go(d,n):d}var xo;function _o(){}!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"}(xo||(xo={}));const Co=Object.freeze({x:0,y:0});function Eo(e,t){const n=Kr(e);if(!n)return"0 0";return(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%"}function ko(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function So(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 Ao=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=So(i,t);n>0&&o.push({id:r,data:{droppableContainer:e,value:n}})}}return o.sort(ko)};function Ro(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Co}const Do=(jo=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+jo*t.y,bottom:e.bottom+jo*t.y,left:e.left+jo*t.x,right:e.right+jo*t.x}),{...e})});var jo;function Oo(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 To={ignoreTransform:!1};function Mo(e,t){void 0===t&&(t=To);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=Dr(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=Oo(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 No(e){return Mo(e,{ignoreTransform:!0})}function $o(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if(jr(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Or(o)||Tr(o))return n;if(n.includes(o))return n;const i=Dr(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=Dr(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=Dr(e).getComputedStyle(e)),"fixed"===t.position}(o,i)?n:r(o.parentNode)}(e):n}function Io(e){const[t]=$o(e,1);return null!=t?t:null}function Lo(e){return Sr&&e?Ar(e)?e:Rr(e)?jr(e)||e===Mr(e).scrollingElement?window:Or(e)?e:null:null:null}function Po(e){return Ar(e)?e.scrollX:e.scrollLeft}function Wo(e){return Ar(e)?e.scrollY:e.scrollTop}function Bo(e){return{x:Po(e),y:Wo(e)}}var zo;function Fo(e){return!(!Sr||!e)&&e===document.scrollingElement}function Ho(e){const t={x:0,y:0},n=Fo(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"}(zo||(zo={}));const qo={x:.2,y:.2};function Uo(e,t,n,r,o){let{top:i,left:a,right:s,bottom:l}=n;void 0===r&&(r=10),void 0===o&&(o=qo);const{isTop:c,isBottom:d,isLeft:u,isRight:p}=Ho(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=zo.Backward,f.y=r*Math.abs((t.top+g-i)/g)):!d&&l>=t.bottom-g&&(h.y=zo.Forward,f.y=r*Math.abs((t.bottom-g-l)/g)),!p&&s>=t.right-m?(h.x=zo.Forward,f.x=r*Math.abs((t.right-m-s)/m)):!u&&a<=t.left+m&&(h.x=zo.Backward,f.x=r*Math.abs((t.left+m-a)/m)),{direction:h,speed:f}}function Ko(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 Vo(e){return e.reduce((e,t)=>Hr(e,Bo(t)),Co)}function Yo(e,t){if(void 0===t&&(t=Mo),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);Io(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Xo=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+Po(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+Wo(t),0)}]];class Jo{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=$o(t),r=Vo(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of Xo)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 Qo{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 Go(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 Zo,ei;function ti(e){e.preventDefault()}function ni(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"}(Zo||(Zo={})),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"}(ei||(ei={}));const ri={start:[ei.Space,ei.Enter],cancel:[ei.Esc],end:[ei.Space,ei.Enter,ei.Tab]},oi=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case ei.Right:return{...n,x:n.x+25};case ei.Left:return{...n,x:n.x-25};case ei.Down:return{...n,y:n.y+25};case ei.Up:return{...n,y:n.y-25}}};class ii{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 Qo(Mr(t)),this.windowListeners=new Qo(Dr(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Zo.Resize,this.handleCancel),this.windowListeners.add(Zo.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Zo.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&Yo(n),t(Co)}handleKeyDown(e){if(Ur(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=ri,coordinateGetter:i=oi,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}:Co;this.referenceCoordinates||(this.referenceCoordinates=c);const d=i(e,{active:t,context:n.current,currentCoordinates:c});if(d){const t=qr(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}=Ho(n),h=Ko(n),f={x:Math.min(o===ei.Right?h.right-h.width/2:h.right,Math.max(o===ei.Right?h.left:h.left+h.width/2,d.x)),y:Math.min(o===ei.Down?h.bottom-h.height/2:h.bottom,Math.max(o===ei.Down?h.top:h.top+h.height/2,d.y))},g=o===ei.Right&&!s||o===ei.Left&&!l,m=o===ei.Down&&!c||o===ei.Up&&!i;if(g&&f.x!==d.x){const e=n.scrollLeft+t.x,i=o===ei.Right&&e<=u.x||o===ei.Left&&e>=p.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:a});r.x=i?n.scrollLeft-e:o===ei.Right?n.scrollLeft-u.x:n.scrollLeft-p.x,r.x&&n.scrollBy({left:-r.x,behavior:a});break}if(m&&f.y!==d.y){const e=n.scrollTop+t.y,i=o===ei.Down&&e<=u.y||o===ei.Up&&e>=p.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:a});r.y=i?n.scrollTop-e:o===ei.Down?n.scrollTop-u.y:n.scrollTop-p.y,r.y&&n.scrollBy({top:-r.y,behavior:a});break}}this.handleMove(e,Hr(qr(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 ai(e){return Boolean(e&&"distance"in e)}function si(e){return Boolean(e&&"delay"in e)}ii.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=ri,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 li{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=Dr(e);return e instanceof t?e:Mr(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=Mr(i),this.documentListeners=new Qo(this.document),this.listeners=new Qo(n),this.windowListeners=new Qo(Dr(i)),this.initialCoordinates=null!=(r=Kr(o))?r:Co,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(Zo.Resize,this.handleCancel),this.windowListeners.add(Zo.DragStart,ti),this.windowListeners.add(Zo.VisibilityChange,this.handleCancel),this.windowListeners.add(Zo.ContextMenu,ti),this.documentListeners.add(Zo.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(si(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(ai(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(Zo.Click,ni,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Zo.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=Kr(e))?t:Co,l=qr(r,s);if(!n&&a){if(ai(a)){if(null!=a.tolerance&&Go(l,a.tolerance))return this.handleCancel();if(Go(l,a.distance))return this.handleStart()}return si(a)&&Go(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===ei.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const ci={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class di extends li{constructor(e){const{event:t}=e,n=Mr(t.target);super(e,ci,n)}}di.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 ui={move:{name:"mousemove"},end:{name:"mouseup"}};var pi;!function(e){e[e.RightClick=2]="RightClick"}(pi||(pi={}));(class extends li{constructor(e){super(e,ui,Mr(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==pi.RightClick&&(null==r||r({event:n}),!0)}}];const hi={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var fi,gi;function mi(e){let{acceleration:t,activator:n=fi.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:a=5,order:s=gi.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:d,delta:u,threshold:p}=e;const h=function(e){let{delta:t,disabled:n}=e;const r=Wr(t);return Lr(e=>{if(n||!r||!e)return vi;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[zo.Backward]:e.x[zo.Backward]||-1===o.x,[zo.Forward]:e.x[zo.Forward]||1===o.x},y:{[zo.Backward]:e.y[zo.Backward]||-1===o.y,[zo.Forward]:e.y[zo.Forward]||1===o.y}}},[n,t,r])}({delta:u,disabled:!i}),[f,g]=function(){const e=Er(null);return[kr((t,n)=>{e.current=setInterval(t,n)},[]),kr(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}(),m=co({x:0,y:0}),v=co({x:0,y:0}),b=lo(()=>{switch(n){case fi.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case fi.DraggableRect:return o}},[n,o,l]),y=co(null),w=so(()=>{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=lo(()=>s===gi.TreeOrder?[...c].reverse():c,[s,c]);io(()=>{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=d[n];if(!o)continue;const{direction:i,speed:s}=Uo(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,d,JSON.stringify(p)])}(class extends li{constructor(e){super(e,hi)}static setup(){return window.addEventListener(hi.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(hi.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"}(fi||(fi={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(gi||(gi={}));const vi={x:{[zo.Backward]:!1,[zo.Forward]:!1},y:{[zo.Backward]:!1,[zo.Forward]:!1}};var bi,yi;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(bi||(bi={})),function(e){e.Optimized="optimized"}(yi||(yi={}));const wi=new Map;function xi(e,t){return Lr(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function _i(e){let{callback:t,disabled:n}=e;const r=$r(t),o=lo(()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(r)},[n]);return io(()=>()=>null==o?void 0:o.disconnect(),[o]),o}function Ci(e){return new Jo(Mo(e),e)}function Ei(e,t,n){void 0===t&&(t=Ci);const[r,o]=ao(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=$r(t),o=lo(()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(r)},[r,n]);return io(()=>()=>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=_i({callback:i});return Nr(()=>{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 ki=[];function Si(e,t){void 0===t&&(t=[]);const n=co(null);return io(()=>{n.current=null},t),io(()=>{const t=e!==Co;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?qr(e,n.current):Co}function Ai(e){return lo(()=>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 Ri=[];function Di(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Or(t)?t:e}const ji=[{sensor:di,options:{}},{sensor:ii,options:{}}],Oi={current:{}},Ti={draggable:{measure:No},droppable:{measure:No,strategy:bi.WhileDragging,frequency:yi.Optimized},dragOverlay:{measure:Mo}};class Mi 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 Ni={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Mi,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:_o},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ti,measureDroppableContainers:_o,windowRect:null,measuringScheduled:!1},$i={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:_o,draggableNodes:new Map,over:null,measureDroppableContainers:_o},Ii=ro($i),Li=ro(Ni);function Pi(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Mi}}}function Wi(e,t){switch(t.type){case xo.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case xo.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 xo.DragEnd:case xo.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case xo.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Mi(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case xo.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 Mi(e.droppable.containers);return a.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case xo.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new Mi(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function Bi(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=oo(Ii),i=Wr(r),a=Wr(null==n?void 0:n.id);return io(()=>{if(!t&&!r&&i&&null!=a){if(!Ur(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=Xr(e);if(t){t.focus();break}}})}},[r,t,o,a,i]),null}function zi(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}const Fi=ro({...Co,scaleX:1,scaleY:1});var Hi;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(Hi||(Hi={})),uo(function(e){var t,n,r,o;let{id:i,accessibility:a,autoScroll:s=!0,children:l,sensors:c=ji,collisionDetection:d=Ao,measuring:u,modifiers:p,...h}=e;const f=po(Wi,void 0,Pi),[g,m]=f,[v,b]=function(){const[e]=ao(()=>new Set),t=so(t=>(e.add(t),()=>e.delete(t)),[e]);return[so(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]=ao(Hi.Uninitialized),x=y===Hi.Initialized,{draggable:{active:_,nodes:C,translate:E},droppable:{containers:k}}=g,S=null!=_?C.get(_):null,A=co({initial:null,translated:null}),R=lo(()=>{var e;return null!=_?{id:_,data:null!=(e=null==S?void 0:S.data)?e:Oi,rect:A}:null},[_,S]),D=co(null),[j,O]=ao(null),[T,M]=ao(null),N=Ir(h,Object.values(h)),$=zr("DndDescribedBy",i),I=lo(()=>k.getEnabled(),[k]),L=lo(()=>({draggable:{...Ti.draggable,...null==P?void 0:P.draggable},droppable:{...Ti.droppable,...null==P?void 0:P.droppable},dragOverlay:{...Ti.dragOverlay,...null==P?void 0:P.dragOverlay}}),[null==(P=u)?void 0:P.draggable,null==P?void 0:P.droppable,null==P?void 0:P.dragOverlay]);var P;const{droppableRects:W,measureDroppableContainers:B,measuringScheduled:z}=function(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,a]=ao(null),{frequency:s,measure:l,strategy:c}=o,d=co(e),u=function(){switch(c){case bi.Always:return!1;case bi.BeforeDragging:return n;default:return!n}}(),p=Ir(u),h=so(function(e){void 0===e&&(e=[]),p.current||a(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[p]),f=co(null),g=Lr(t=>{if(u&&!n)return wi;if(!t||t===wi||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 Jo(l(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,i,n,u,l]);return io(()=>{d.current=e},[e]),io(()=>{u||h()},[n,u]),io(()=>{i&&i.length>0&&a(null)},[JSON.stringify(i)]),io(()=>{u||"number"!=typeof s||null!==f.current||(f.current=setTimeout(()=>{h(),f.current=null},s))},[s,u,h,...r]),{droppableRects:g,measureDroppableContainers:h,measuringScheduled:null!=i}}(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 Lr(e=>{var n;return null==t?null:null!=(n=null!=r?r:e)?n:null},[r,t])}(C,_),H=lo(()=>T?Kr(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 xi(e,t)}(F,L.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=co(!1),{x:a,y:s}="boolean"==typeof o?{x:o,y:o}:o;Nr(()=>{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=Ro(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=Io(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=Ei(F,L.draggable.measure,U),V=Ei(F?F.parentElement:null),Y=co({activatorEvent:null,active:null,activeNode:F,collisionRect:null,collisions:null,droppableRects:W,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]=ao(null),o=_i({callback:so(e=>{for(const{target:n}of e)if(Or(n)){r(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),i=so(e=>{const n=Di(e);null==o||o.disconnect(),n&&(null==o||o.observe(n)),r(n?t(n):null)},[t,o]),[a,s]=Pr(i);return lo(()=>({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=Ro(te=Z?null:K,xi(te));var te;const ne=Ai(Q?Dr(Q):null),re=function(e){const t=co(e),n=Lr(n=>e?n&&n!==ki&&e&&t.current&&e.parentNode===t.current.parentNode?n:$o(e):ki,[e]);return io(()=>{t.current=e},[e]),n}(x?null!=X?X:F:null),oe=function(e,t){void 0===t&&(t=Mo);const[n]=e,r=Ai(n?Dr(n):null),[o,i]=ao(Ri);function a(){i(()=>e.length?e.map(e=>Fo(e)?r:new Jo(t(e),e)):Ri)}const s=_i({callback:a});return Nr(()=>{null==s||s.disconnect(),a(),e.forEach(e=>null==s?void 0:s.observe(e))},[e]),o}(re),ie=zi(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?Hr(H,E):null,se=function(e){const[t,n]=ao(null),r=co(e),o=so(e=>{const t=Lo(e.target);t&&n(e=>e?(e.set(t,Bo(t)),new Map(e)):null)},[]);return io(()=>{const t=r.current;if(e!==t){i(t);const a=e.map(e=>{const t=Lo(e);return t?(t.addEventListener("scroll",o,{passive:!0}),[t,Bo(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=Lo(e);null==t||t.removeEventListener("scroll",o)})}},[o,e]),lo(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>Hr(e,t),Co):Vo(e):Co,[e,t])}(re),le=Si(se),ce=Si(se,[K]),de=Hr(ie,le),ue=G?Do(G,ie):null,pe=R&&ue?d({active:R,collisionRect:ue,droppableRects:W,droppableContainers:I,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]=ao(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:Hr(ie,ce),null!=(o=null==fe?void 0:fe.rect)?o:null,K),ve=co(null),be=so((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}};mo(()=>{null==r||r(o),w(Hi.Initializing),m({type:xo.DragStart,initialCoordinates:e,active:t}),v({type:"onDragStart",event:o}),O(ve.current),M(i)})},onMove(e){m({type:xo.DragMove,coordinates:e})},onEnd:s(xo.DragEnd),onCancel:s(xo.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===xo.DragEnd&&"function"==typeof s){await Promise.resolve(s(a))&&(e=xo.DragCancel)}}D.current=null,mo(()=>{m({type:e}),w(Hi.Uninitialized),ge(null),O(null),M(null),ve.current=null;const t=e===xo.DragEnd?"onDragEnd":"onDragCancel";if(a){const e=N.current[t];null==e||e(a),v({type:t,event:a})}})}}ve.current=a},[C]),ye=so((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 lo(()=>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){io(()=>{if(!Sr)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),Nr(()=>{K&&y===Hi.Initializing&&w(Hi.Initialized)},[K,y]),io(()=>{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:de.x,y:de.y},over:o};mo(()=>{null==e||e(i),v({type:"onDragMove",event:i})})},[de.x,de.y]),io(()=>{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};mo(()=>{ge(s),null==i||i(l),v({type:"onDragOver",event:l})})},[he]),Nr(()=>{Y.current={activatorEvent:T,active:R,activeNode:F,collisionRect:ue,collisions:pe,droppableRects:W,draggableNodes:C,draggingNode:Q,draggingNodeRect:G,droppableContainers:k,over:fe,scrollableAncestors:re,scrollAdjustedTranslate:de},A.current={initial:G,translated:ue}},[R,F,pe,ue,C,Q,G,W,k,fe,re,de]),mi({...q,delta:E,draggingRect:ue,pointerCoordinates:ae,scrollableAncestors:re,scrollableAncestorRects:oe});const xe=lo(()=>({active:R,activeNode:F,activeNodeRect:K,activatorEvent:T,collisions:pe,containerNodeRect:V,dragOverlay:J,draggableNodes:C,droppableContainers:k,droppableRects:W,over:fe,measureDroppableContainers:B,scrollableAncestors:re,scrollableAncestorRects:oe,measuringConfiguration:L,measuringScheduled:z,windowRect:ne}),[R,F,K,T,pe,V,J,C,k,W,fe,B,re,oe,L,z,ne]),_e=lo(()=>({activatorEvent:T,activators:we,active:R,activeNodeRect:K,ariaDescribedById:{draggable:$},dispatch:m,draggableNodes:C,over:fe,measureDroppableContainers:B}),[T,we,R,K,m,$,C,fe,B]);return no.createElement(vo.Provider,{value:b},no.createElement(Ii.Provider,{value:_e},no.createElement(Li.Provider,{value:xe},no.createElement(Fi.Provider,{value:me},l)),no.createElement(Bi,{disabled:!1===(null==a?void 0:a.restoreFocus)})),no.createElement(wo,{...a,hiddenTextDescribedById:$}))});const qi=ro(null),Ui="button";function Ki(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=zr("Draggable"),{activators:a,activatorEvent:s,active:l,activeNodeRect:c,ariaDescribedById:d,draggableNodes:u,over:p}=oo(Ii),{role:h=Ui,roleDescription:f="draggable",tabIndex:g=0}=null!=o?o:{},m=(null==l?void 0:l.id)===t,v=oo(m?Fi:qi),[b,y]=Pr(),[w,x]=Pr(),_=function(e,t){return lo(()=>e.reduce((e,n)=>{let{eventName:r,handler:o}=n;return e[r]=e=>{o(e,t)},e},{}),[e,t])}(a,t),C=Ir(n);Nr(()=>(u.set(t,{id:t,key:i,node:b,activatorNode:w,data:C}),()=>{const e=u.get(t);e&&e.key===i&&u.delete(t)}),[u,t]);return{active:l,activatorEvent:s,activeNodeRect:c,attributes:lo(()=>({role:h,tabIndex:g,"aria-disabled":r,"aria-pressed":!(!m||h!==Ui)||void 0,"aria-roledescription":f,"aria-describedby":d.draggable}),[r,h,g,m,f,d.draggable]),isDragging:m,listeners:r?void 0:_,node:b,over:p,setNodeRef:y,setActivatorNodeRef:x,transform:v}}const Vi={timeout:25};function Yi(e){let{animation:t,children:n}=e;const[r,o]=ao(null),[i,a]=ao(null),s=Wr(n);return n||r||!s||o(s),Nr(()=>{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]),no.createElement(no.Fragment,null,n,r?ho(r,{ref:a}):null)}const Xi={x:0,y:0,scaleX:1,scaleY:1};function Ji(e){let{children:t}=e;return no.createElement(Ii.Provider,{value:$i},no.createElement(Fi.Provider,{value:Xi},t))}const Qi={position:"fixed",touchAction:"none"},Gi=e=>Ur(e)?"transform 250ms ease":void 0,Zi=fo((e,t)=>{let{as:n,activatorEvent:r,adjustScale:o,children:i,className:a,rect:s,style:l,transform:c,transition:d=Gi}=e;if(!s)return null;const u=o?c:{...c,scaleX:1,scaleY:1},p={...Qi,width:s.width,height:s.height,top:s.top,left:s.left,transform:Vr.Transform.toString(u),transformOrigin:o&&r?Eo(r,s):void 0,transition:"function"==typeof d?d(r):d,...l};return no.createElement(n,{className:a,style:p,ref:t},i)}),ea={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Vr.Transform.toString(t)},{transform:Vr.Transform.toString(n)}]},sideEffects:(ta={styles:{active:{opacity:"0"}}},e=>{let{active:t,dragOverlay:n}=e;const r={},{styles:o,className:i}=ta;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 ta;function na(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return $r((e,i)=>{if(null===t)return;const a=n.get(e);if(!a)return;const s=a.node.current;if(!s)return;const l=Di(i);if(!l)return;const{transform:c}=Dr(i).getComputedStyle(i),d=Oo(c);if(!d)return;const u="function"==typeof t?t:function(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...ea,...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,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 Yo(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 ra=0;function oa(e){return lo(()=>{if(null!=e)return ra++,ra},[e])}const ia=no.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:f,droppableContainers:g,dragOverlay:m,over:v,measuringConfiguration:b,scrollableAncestors:y,scrollableAncestorRects:w,windowRect:x}=oo(Li),_=oo(Fi),C=oa(null==u?void 0:u.id),E=zi(a,{activatorEvent:d,active:u,activeNodeRect:p,containerNodeRect:h,draggingNodeRect:m.rect,over:v,overlayNodeRect:m.rect,scrollableAncestors:y,scrollableAncestorRects:w,transform:_,windowRect:x}),k=xi(p),S=na({config:r,draggableNodes:f,droppableContainers:g,measuringConfiguration:b}),A=k?m.setRef:void 0;return no.createElement(Ji,null,no.createElement(Yi,{animation:S},u&&C?no.createElement(Zi,{key:C,id:u.id,ref:A,as:s,activatorEvent:d,adjustScale:t,className:l,transition:i,rect:k,style:{zIndex:c,...o},transform:E},n):null))}),aa=t,{useEffect:sa}=t,{useRef:la}=t,ca=n,{styled:da}=r,{Chip:ua}=i,{color:pa}=a,{renderMath:ha}=h;function fa(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 ga=da("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&&{}})),ma=da(ua)(()=>({backgroundColor:pa.white(),border:`1px solid ${pa.text()}`,color:pa.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}})),va=da("span")(()=>({whiteSpace:"normal","& img":{display:"block",padding:"2px 0"},"& mjx-frac":{fontSize:"120% !important"}}));function ba({choice:e,disabled:t,instanceId:n}){const r=la(null),{attributes:o,listeners:i,setNodeRef:a,isDragging:s}=Ki({id:`choice-${e.id}`,data:{choice:e,instanceId:n,fromChoice:!0,type:"MaskBlank"},disabled:t});return sa(()=>{ha(r.current)},[e.value]),aa.createElement(ga,{ref:a,style:s?{width:fa([r,"access",e=>e.current,"optionalAccess",e=>e.offsetWidth]),height:fa([r,"access",e=>e.current,"optionalAccess",e=>e.offsetHeight])}:{},disabled:t,...i,...o},aa.createElement(ma,{clickable:!1,disabled:t,ref:r,label:aa.createElement(va,{dangerouslySetInnerHTML:{__html:e.value}})}))}ba.propTypes={choice:ca.object.isRequired,disabled:ca.bool,instanceId:ca.oneOfType([ca.string,ca.number])};const ya=t,wa=n,{DragDroppablePlaceholder:xa}=f;class _a extends ya.Component{constructor(...e){super(...e),_a.prototype.__init.call(this)}static __initStatic(){this.propTypes={disabled:wa.bool,duplicates:wa.bool,choices:wa.arrayOf(wa.shape({label:wa.string,value:wa.string})),value:wa.object,choicePosition:wa.string.isRequired,instanceId:wa.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 Zt(e,function(e,r,o){if(t(e,r,o))return n=r,!1}),n}(r,Xt(t=>t===e.id));return void 0===n}),a={...this.getStyleForWrapper(),minWidth:"100px"};return ya.createElement("div",{style:a},ya.createElement(xa,{disabled:e,instanceId:o},i.map((t,n)=>ya.createElement(ba,{key:`${t.value}-${n}`,disabled:e,choice:t,instanceId:o}))))}}_a.__initStatic();const Ca=t,{useEffect:Ea}=t,{useRef:ka}=t,{useState:Sa}=t,Aa=n,Ra=e,{styled:Da}=r,{Chip:ja}=i,Oa=l,{color:Ta}=a,{grey:Ma}=s,{renderMath:Na}=h;function $a(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}Ra("pie-lib:mask-markup:blank");const Ia=Da("span")(({dragged:e,over:t})=>({border:`solid 0px ${Ta.primary()}`,minWidth:"200px",touchAction:"none",overflow:"hidden",whiteSpace:"nowrap",opacity:1,...t&&{whiteSpace:"nowrap",overflow:"hidden"},...e&&{opacity:.5}})),La=Da(ja)(()=>({backgroundColor:Ta.background(),border:`2px dashed ${Ta.text()}`,touchAction:"none",color:Ta.text(),fontSize:"inherit",maxWidth:"374px",position:"relative",borderRadius:"3px","&.over":{whiteSpace:"nowrap",overflow:"hidden"},"&.parentOver":{border:`1px solid ${Ma[500]}`,backgroundColor:`${Ma[300]}`},"&.correct":{border:`solid 1px ${Ta.correct()}`},"&.incorrect":{border:`solid 1px ${Ta.incorrect()}`},"&.Mui-disabled":{opacity:1}})),Pa=Da("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 Wa({disabled:e,choice:t,isOver:n,isDragging:r,dragItem:o,correct:i,emptyResponseAreaWidth:a,emptyResponseAreaHeight:s}){const l=ka(null),c=ka(null),d=ka(null),[u,p]=Sa({height:0,width:0}),h=()=>{g()},f=()=>{const e=$a([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`}};Ea(()=>{f()},[]),Ea(()=>{l.current&&Na(l.current)},[i,n,$a([o,"optionalAccess",e=>e.choice,"optionalAccess",e=>e.value])]),Ea(()=>{t?f():p({height:0,width:0})},[t]),Ea(()=>{n||r||(d.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:$a([d,"access",e=>e.current,"optionalAccess",e=>e.width]),height:$a([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 Ca.createElement(La,{clickable:!1,disabled:e,ref:l,component:"span",label:Ca.createElement(Ca.Fragment,null,Ca.createElement(Pa,{ref:c,draggable:!0,className:Oa({over:n,hidden:m}),dangerouslySetInnerHTML:{__html:v||""}}),m&&Ca.createElement(Pa,{draggable:!0,className:Oa({over:n,dragged:!0}),dangerouslySetInnerHTML:{__html:m||""}})),className:Oa({over:n,parentOver:n,correct:void 0!==i&&i,incorrect:void 0!==i&&!i}),variant:e?"outlined":void 0,style:b})}function Ba({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}=Ki({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=zr("Droppable"),{active:a,dispatch:s,over:l,measureDroppableContainers:c}=oo(Ii),d=co({disabled:n}),u=co(!1),p=co(null),h=co(null),{disabled:f,updateMeasurementsFor:g,timeout:m}={...Vi,...o},v=Ir(null!=g?g:r),b=_i({callback:so(()=>{u.current?(null!=h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{c(Array.isArray(v.current)?v.current:[v.current]),h.current=null},m)):u.current=!0},[m]),disabled:f||!a}),y=so((e,t)=>{b&&(t&&(b.unobserve(t),u.current=!1),e&&b.observe(e))},[b]),[w,x]=Pr(y),_=Ir(t);return io(()=>{b&&w.current&&(b.disconnect(),u.current=!1,b.observe(w.current))},[w,b]),io(()=>(s({type:xo.RegisterDroppable,element:{id:r,key:i,disabled:n,node:w,rect:p,data:_}}),()=>s({type:xo.UnregisterDroppable,key:i,id:r})),[r]),io(()=>{n!==d.current.disabled&&(s({type:xo.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:w,over:l,setNodeRef:x}}({id:`mask-blank-drop-${e}`,data:{id:e,accepts:["MaskBlank"],instanceId:l}}),v={transform:Vr.Translate.toString(p)};return Ca.createElement(Ia,{ref:e=>{u(e),f(e)},style:v,dragged:h,over:g,...c,...d},Ca.createElement(Wa,{id:e,disabled:t,duplicates:n,choice:r,isOver:g,dragItem:$a([m,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current]),correct:o,onChange:i,emptyResponseAreaWidth:a,emptyResponseAreaHeight:s,instanceId:l}))}Wa.defaultProps={emptyResponseAreaWidth:0,emptyResponseAreaHeight:0},Wa.propTypes={id:Aa.oneOfType([Aa.string,Aa.number]),disabled:Aa.bool,duplicates:Aa.bool,choice:Aa.object,isOver:Aa.bool,dragItem:Aa.object,correct:Aa.bool,onChange:Aa.func,emptyResponseAreaWidth:Aa.oneOfType([Aa.string,Aa.number]),emptyResponseAreaHeight:Aa.oneOfType([Aa.string,Aa.number]),instanceId:Aa.string},Ba.defaultProps={emptyResponseAreaWidth:0,emptyResponseAreaHeight:0},Ba.propTypes={id:Aa.oneOfType([Aa.string,Aa.number]),disabled:Aa.bool,duplicates:Aa.bool,choice:Aa.object,correct:Aa.bool,onChange:Aa.func,emptyResponseAreaWidth:Aa.oneOfType([Aa.string,Aa.number]),emptyResponseAreaHeight:Aa.oneOfType([Aa.string,Aa.number]),instanceId:Aa.string};const za=t,Fa=n,{DragProvider:Ha}=f;function qa(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 Ua=wr("blank",e=>(t,n,r)=>{const o=qa([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,f=c?s[o.id]:n[o.id],g=f&&e.choices.find(e=>e.id===f);return za.createElement(Ba,{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 Ka extends za.Component{constructor(e){super(e),Ka.prototype.__init.call(this),Ka.prototype.__init2.call(this),Ka.prototype.__init3.call(this),Ka.prototype.__init4.call(this),this.state={activeDragItem:null,dropAnimation:void 0}}static __initStatic(){this.propTypes={markup:Fa.string,layout:Fa.object,choicesPosition:Fa.string,choices:Fa.array,value:Fa.object,onChange:Fa.func,duplicates:Fa.bool,disabled:Fa.bool,feedback:Fa.object,correctResponse:Fa.object,showCorrectAnswer:Fa.bool,emptyResponseAreaWidth:Fa.oneOfType([Fa.string,Fa.number]),emptyResponseAreaHeight:Fa.oneOfType([Fa.string,Fa.number]),instanceId:Fa.string}}static __initStatic2(){this.defaultProps={instanceId:"drag-in-the-blank"}}__init(){this.handleDragStart=e=>{const{active:t}=e;qa([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?za.createElement(ba,{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=qa([t,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current]),a=qa([n,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current]),s=!!t&&!!n&&"MaskBlank"===qa([i,"optionalAccess",e=>e.type])&&qa([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,f=o||"below",g={display:"flex",minWidth:"100px",...this.getPositionDirection(f)};return za.createElement(Ha,{onDragStart:this.handleDragStart,onDragEnd:this.handleDragEnd,collisionDetection:Ao},za.createElement("div",{ref:e=>this.rootRef=e,style:g},za.createElement(_a,{choicePosition:f,choices:i,value:n,duplicates:t,disabled:s,instanceId:h}),za.createElement(Ua,{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}),za.createElement(ia,{style:{pointerEvents:"none"},dropAnimation:this.state.dropAnimation},this.renderDragOverlay())))}}Ka.__initStatic(),Ka.__initStatic2();const Va=t,{styled:Ya}=r,Xa=l,{color:Ja}=a;function Qa(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 Ga,Za;"undefined"!=typeof window&&(Ga=require("@pie-lib/editable-html-tip-tap").default,Za=Ya(Ga)(()=>({display:"inline-block",verticalAlign:"middle",margin:"4px",borderRadius:"4px",border:`1px solid ${Ja.black()}`,"&.correct":{border:`1px solid ${Ja.correct()}`},"&.incorrect":{border:`1px solid ${Ja.incorrect()}`}})));wr("input",e=>(t,n)=>{const{adjustedLimit:r,disabled:o,feedback:i,showCorrectAnswer:a,maxLength:s,spellCheck:l,pluginProps:c,onChange:d}=e,u=Qa([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]||"",f=s&&s[u.id],g=i&&i[u.id],m=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 Va.createElement(Za,{id:u.id,key:`${t.type}-input-${u.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:!!Qa([c,"optionalAccess",e=>e.characters,"optionalAccess",e=>e.disabled])},className:Xa({correct:m,incorrect:v})})}});var es=wr("input",e=>(t,n,r)=>{const o=t.data&&t.data.dataset||{};if("input"===o.component)return e.customMarkMarkupComponent(o.id)});const ts=t,ns=n,{Button:rs}=i,{InputLabel:os}=i,{Menu:is}=i,{MenuItem:as}=i,{ArrowDropDown:ss}=c,{ArrowDropUp:ls}=c,{Close:cs}=c,{Check:ds}=c,{styled:us}=r,{color:ps}=a,{renderMath:hs}=h,fs=us(rs)(()=>({color:ps.text(),border:`1px solid ${ps.borderGray()}`,borderRadius:"4px",justifyContent:"space-between",backgroundColor:ps.background(),position:"relative",height:"45px",width:"fit-content",margin:"2px",textTransform:"none","& span":{paddingRight:"24px"},"& svg":{position:"absolute",right:"4px",top:"calc(50% - 12px)",pointerEvents:"none",color:ps.text(),marginLeft:"5px"},"&.Mui-focused":{outline:`3px solid ${ps.tertiary()}`,outlineOffset:"2px",borderWidth:"3px"},"&.disabledCorrect":{borderWidth:"2px",borderColor:ps.correct(),color:`${ps.text()} !important`},"&.disabledIncorrect":{borderWidth:"2px",borderColor:ps.incorrectWithIcon(),color:`${ps.text()} !important`}})),gs=us(is)(()=>({backgroundColor:ps.background(),border:`1px solid ${ps.correct()} !important`,"&:hover":{border:`1px solid ${ps.text()} `,borderColor:"initial"},"&:focus":{border:`1px solid ${ps.text()}`,borderColor:"initial"},"& .MuiList-root":{padding:0}})),ms=us(as)(()=>({height:24,overflow:"hidden",fontSize:"1rem",fontWeight:400,fontFamily:"inherit",lineHeight:"1.5em",whiteSpace:"nowrap",color:ps.text(),backgroundColor:ps.background(),"&.Mui-focusVisible":{outline:`3px solid ${ps.tertiary()}`,outlineOffset:"-1px",color:ps.text(),backgroundColor:ps.background()},"&:hover":{color:ps.text(),backgroundColor:ps.dropdownBackground()},boxSizing:"border-box",padding:"16px 8px",borderRadius:"4px","&.selected":{color:`${ps.text()} !important`,backgroundColor:`${ps.background()} !important`,"&:hover":{color:ps.text(),backgroundColor:`${ps.dropdownBackground()} !important`}}})),vs=us("span")(()=>({fontSize:"max(1rem, 14px)"})),bs=us("span")(()=>({fontSize:"max(1rem, 14px)",flexShrink:0,paddingLeft:"8px"})),ys=us(os)(()=>({position:"absolute",left:"-10000px",top:"auto",width:"1px",height:"1px",overflow:"hidden"})),ws=us(ds)(()=>({color:`${ps.white()} !important`,position:"absolute",top:"-8px !important",left:"-8px",marginLeft:"0 !important",borderRadius:"50%",fontSize:"16px",padding:"2px","&.correct":{backgroundColor:ps.correct()},"&.incorrect":{backgroundColor:ps.incorrectWithIcon()}})),xs=us(cs)(()=>({color:`${ps.white()} !important`,position:"absolute",top:"-8px !important",left:"-8px",marginLeft:"0 !important",borderRadius:"50%",fontSize:"16px",padding:"2px","&.correct":{backgroundColor:ps.correct()},"&.incorrect":{backgroundColor:ps.incorrectWithIcon()}}));class _s extends ts.Component{static __initStatic(){this.propTypes={id:ns.string,value:ns.string,disabled:ns.bool,onChange:ns.func,correct:ns.bool,choices:ns.arrayOf(ns.shape({value:ns.string,label:ns.string})),showCorrectAnswer:ns.bool,singleQuery:ns.bool,correctValue:ns.string}}constructor(e){super(e),_s.prototype.__init.call(this),_s.prototype.__init2.call(this),_s.prototype.__init3.call(this),_s.prototype.__init4.call(this),_s.prototype.__init5.call(this),this.state={anchorEl:null,highlightedOptionId:null,menuWidth:null,previewValue:null},this.hiddenRef=ts.createRef(),this.buttonRef=ts.createRef(),this.previewRef=ts.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||hs(e)}),n){const e=n.clientWidth;e!==this.state.menuWidth&&(this.elementRefs.forEach(e=>{e&&hs(e)}),hs(n),this.setState({menuWidth:e}))}}__init(){this.handleClick=e=>{const{id:t,value:n,choices:r}=this.props;let o=null;if(n){const e=(r||[]).findIndex(e=>e.value===n);e>=0&&(o=`dropdown-option-${t}-${e}`)}this.setState({anchorEl:e.currentTarget,highlightedOptionId:o})}}__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 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?ts.createElement(ws,{className:"correct"}):ts.createElement(xs,{className:"incorrect"})),ts.createElement(ts.Fragment,null,ts.createElement("div",{ref:this.hiddenRef,style:{position:"absolute",visibility:"hidden",top:0,left:0},tabIndex:-1,"aria-hidden":"true"},(o||[]).map((e,t)=>ts.createElement(ms,{key:t,tabIndex:-1,"aria-hidden":"true"},ts.createElement(vs,{dangerouslySetInnerHTML:{__html:e.label}})))),ts.createElement(ys,{id:g,tabIndex:-1,"aria-hidden":"true"},m),ts.createElement(fs,{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 ${m}`,"aria-labelledby":p},v,ts.createElement(vs,{id:p,ref:this.previewRef,dangerouslySetInnerHTML:{__html:s||(c&&this.state.previewValue?this.getLabel(o,this.state.previewValue):this.getLabel(o,r)||"")}}),c?ts.createElement(ls,null):ts.createElement(ss,null)),ts.createElement(gs,{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 ts.createElement(ms,{id:o,className:t.value===r?"selected":"",selected:t.value===r,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)},ts.createElement(vs,{ref:e=>this.elementRefs[n]=e,dangerouslySetInnerHTML:{__html:t.label}}),ts.createElement(bs,{dangerouslySetInnerHTML:{__html:t.value===r?" &check;":""}}))})))}}_s.__initStatic();const Cs=t;wr("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 Cs.createElement(_s,{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 Es=t,ks=n,{styled:Ss}=r,{Tooltip:As}=i,{color:Rs}=a,{Collapsible:Ds}=a,{Readable:js}=a,{hasText:Os}=a,{hasMedia:Ts}=a,{PreviewPrompt:Ms}=a,{UiLayout:Ns}=a,$s=d,Is=o,{mq:Ls}=p,{HorizontalKeypad:Ps}=p,{updateSpans:Ws}=p,{registerEmbed:Bs}=p,{applyStaticMath:zs}=p,{renderMath:Fs}=h;function Hs(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 qs=Ss(Ns)({color:Rs.text(),backgroundColor:Rs.background(),display:"inline-block"}),Us=Ss("div")({width:"100%",position:"relative",backgroundColor:Rs.background(),color:Rs.text()}),Ks=Ss("div")(({theme:e})=>({marginBottom:e.spacing(2)})),Vs=Ss("div")(({theme:e})=>({marginBottom:e.spacing(2)})),Ys=Ss("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}}),Xs=Ss("div")(({theme:e,$incorrect:t,$correct:n,$showCorrectness:r,$correctAnswerShown:o})=>({maxWidth:"fit-content",...t&&{borderColor:`${Rs.incorrect()} !important`},...n&&{borderColor:`${Rs.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}}})),Js=Ss(Ls.Static)({"& > .mq-root-block":{"& > .mq-editable-field":{borderColor:Rs.text()}}}),Qs=Ss("div")(({theme:e})=>({zIndex:10,minWidth:"400px",marginTop:e.spacing(2)})),Gs=Ss("div")(({theme:e})=>({marginBottom:e.spacing(1),pointerEvents:"none"})),Zs=Ss("h2")({position:"absolute",left:"-10000px",top:"auto",width:"1px",height:"1px",overflow:"hidden"}),el=Ss("div")(({theme:e})=>({marginBottom:e.spacing(2)})),tl=Ss($s)(({theme:e})=>({color:Rs.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: ${Rs.text()};\n background-color: ${Rs.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: ${Rs.correct()} !important;\n }\n .incorrect {\n border-color: ${Rs.incorrect()} !important;\n }\n `,document.head.appendChild(t)}}let nl=!1;const rl=/(\{\{\d+\}\})/gm,ol=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);function il(e=[],t){return 30*Math.floor(e.length/5)+("miscellaneous"===t?600:500)}function al(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]=Hs([n,"optionalAccess",e=>e[t],"optionalAccess",e=>e.answer]),e),{});return o.split(rl).filter(e=>e).reduce((e,n)=>{if(n.match(rl)){const o=ll.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 sl={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=Hs([e,"access",e=>e.elements,"access",e=>e.popper,"optionalAccess",e=>e.offsetParent]),a=Hs([i,"optionalAccess",e=>e.getBoundingClientRect,"optionalCall",e=>e()])||{left:0},s=Hs([i,"optionalAccess",e=>e.scrollLeft])||0,l=o-a.left+s,c=l-o,d=c+8,u=c+n-r-8;t.x=o+r<=n?l:l-r,t.x=u<d?d:Math.min(Math.max(t.x,d),u)}};class ll extends Es.Component{static __initStatic(){this.getResponseKey=e=>(e||"").replaceAll("{{","").replaceAll("}}","")}static __initStatic2(){this.propTypes={session:ks.object.isRequired,onSessionChange:ks.func,model:ks.object.isRequired}}constructor(e){super(e),ll.prototype.__init.call(this),ll.prototype.__init2.call(this),ll.prototype.__init3.call(this),ll.prototype.__init4.call(this),ll.prototype.__init5.call(this),ll.prototype.__init6.call(this),ll.prototype.__init7.call(this),ll.prototype.__init8.call(this),ll.prototype.__init9.call(this),ll.prototype.__init10.call(this),ll.prototype.__init11.call(this),ll.prototype.__init12.call(this),ll.prototype.__init13.call(this);const t={},{model:n,session:r}=e||{},{markup:o,alwaysShowCorrect:i}=n||{},{answers:a}=r||{};o&&(o||"").replace(rl,e=>{const n=ll.getResponseKey(e),r=a&&a[`r${n}`];t[`r${n}`]={value:Hs([r,"optionalAccess",e=>e.value])||""}}),this.state={session:{...e.session,answers:t},activeAnswerBlock:"",showCorrect:i||!1,tooltipContainerRef:Es.createRef()}}UNSAFE_componentWillMount(){"undefined"!=typeof window&&(nl||(Bs("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}]`})),nl=!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){const i=r[t];zs(n,i&&i.value||""),e.view&&(n.parentElement.parentElement.classList.remove("correct"),n.parentElement.parentElement.classList.remove("incorrect")),o.textContent="R"}}),Fs(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(rl),d=i.match(rl);if(!sn(c,d)){const e={},t=this.state.session.answers;(d||[]).forEach(n=>{const r=ll.getResponseKey(n),o=t&&t[`r${r}`];e[`r${r}`]={value:Hs([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(()=>Fs(this.root),100)}componentDidUpdate(){this.handleAnswerBlockDomUpdate()}__init2(){this.onSubFieldFocus=e=>{const t=Array.from(Hs([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=Hs([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)=>{Ws(),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=Hs([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&&Hs([o,"optionalAccess",e=>e.attributes,"access",e=>e["data-keypad"]])||this.setState({activeAnswerBlock:""})}}setTooltipRef(e){setTimeout(()=>{if(e&&ol){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&&(Os(t)||Ts(t)),o=Es.createElement(Ms,{defaultClassName:"teacher-instructions",prompt:t});return r&&Es.createElement(Vs,null,n?o:Es.createElement(Ds,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},o))}}__init12(){this.renderRationale=()=>{const{model:e}=this.props,{rationale:t,animationsDisabled:n}=e||{},r=Es.createElement(Ms,{prompt:t});return t&&(Os(t)||Ts(t))&&Es.createElement(Vs,null,n?r:Es.createElement(Ds,{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:f}=e||{},g=an(l),m=function(e=[]){return e.map(e=>({name:e,latex:e,write:e,label:e}))}(d),v=al(e,this.state)||"",b=h&&!f;return Es.createElement(Ys,null,Es.createElement(es,{disabled:a,markup:e.markup,value:{},customMarkMarkupComponent:e=>{const l="evaluate"===p&&u&&u[e],d=Es.createElement(Js,{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 Es.createElement(Xs,{ref:o,$incorrect:!g&&!l&&!n,$correct:!g&&(l||n),$showCorrectness:!g&&a&&i&&!s,$correctAnswerShown:n},Es.createElement(As,{ref:e=>this.setTooltipRef(e),enterTouchDelay:0,interactive:!0,open:t===`r${e}`,slotProps:{popper:{container:Hs([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:!1},{name:"flip",enabled:!1},sl]},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)&&Es.createElement(Qs,{"data-keypad":!0,key:e,style:{width:il(m,c)}},Es.createElement(Ps,{additionalKeys:m,mode:c||6,onClick:this.onClick}))||null)},b?Es.createElement(Gs,null,d):Es.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=!an(s)&&a&&"correct"!==a.correctness,p=(t||"view"===r&&"instructor"===o)&&c&&d;return Es.createElement(qs,{extraCSSRules:i,ref:e=>{const t=Is.findDOMNode(e);this.root=t||this.root}},Es.createElement(Us,null,"gather"===r&&Es.createElement(Zs,null,"Math Equation Response Question"),Es.createElement(Us,null,u&&Es.createElement(tl,{language:l,show:!0,toggled:t,onToggle:this.toggleShowCorrect})),this.renderTeacherInstructions(),n&&Es.createElement(Ks,null,Es.createElement(Ms,{prompt:n})),Es.createElement(js,{false:!0},this.renderPlayerContent()),p&&Es.createElement(el,{className:"note",dangerouslySetInnerHTML:{__html:d}}),this.renderRationale()))}}ll.__initStatic(),ll.__initStatic2();const cl=t,{createRoot:dl}=u;class ul extends HTMLElement{constructor(){super(),this._root=null,this.sessionChangedEventCaller=rn(()=>{this.dispatchEvent(new y(this.tagName.toLowerCase(),!0))},1e3)}set model(e){this._model=e,this.render(),this.dispatchEvent(new v(this.tagName.toLowerCase(),this.isSessionComplete(),void 0!==this._model))}get model(){return this._model}set session(e){this._session=e,this.render()}get session(){return this._session}isSessionComplete(){return!0}onSessionChange(e){Object.keys(e).map(t=>{this._session[t]=e[t]}),this.sessionChangedEventCaller(),this.render()}connectedCallback(){this.render()}render(){if(this._model&&this._session&&this._model&&this._session){const e=cl.createElement(ll,{model:this._model,session:this._session,onSessionChange:this.onSessionChange.bind(this)});this._root||(this._root=dl(this)),this._root.render(e)}}disconnectedCallback(){this._root&&this._root.unmount()}}export{ul as default};
package/module/index.html CHANGED
@@ -2,7 +2,7 @@
2
2
  <!doctype html>
3
3
  <html>
4
4
  <head>
5
- <title>@pie-element/math-templated@7.1.1</title>
5
+ <title>@pie-element/math-templated@7.1.2</title>
6
6
  <script
7
7
  type="module"
8
8
  src="https://cdn.jsdelivr.net/npm/@pslb/demo-el@^1.0.0/dist/demo-el/demo-el.esm.js"></script>
@@ -1,22 +1,22 @@
1
1
  {
2
2
  "name": "@pie-element/math-templated",
3
- "version": "7.1.1",
3
+ "version": "7.1.2",
4
4
  "modules": [
5
5
  {
6
6
  "name": "@pie-lib/shared-module",
7
- "version": "^5.2.4"
7
+ "version": "^5.2.5"
8
8
  },
9
9
  {
10
10
  "name": "@pie-lib/math-rendering-module",
11
- "version": "^5.0.9"
11
+ "version": "^5.0.10"
12
12
  },
13
13
  {
14
14
  "name": "@pie-lib/math-edit-module",
15
- "version": "^4.2.4"
15
+ "version": "^4.2.5"
16
16
  },
17
17
  {
18
18
  "name": "@pie-lib/drag-module",
19
- "version": "^4.0.9"
19
+ "version": "^4.0.10"
20
20
  }
21
21
  ]
22
22
  }
package/module/print.html CHANGED
@@ -2,7 +2,7 @@
2
2
  <!doctype html>
3
3
  <html>
4
4
  <head>
5
- <title>@pie-element/math-templated@7.1.1</title>
5
+ <title>@pie-element/math-templated@7.1.2</title>
6
6
  <link
7
7
  href="https://fonts.googleapis.com/css?family=Roboto&display=swap"
8
8
  rel="stylesheet"