@pie-element/math-templated 6.0.0-next.42 → 6.0.0-next.43
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 +1 -1
- package/module/manifest.json +4 -4
- package/module/print.js +1 -0
- package/package.json +9 -5
package/module/element.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_dll_react_dom as e,_dll_debug as t,_dll_prop_types as n,_dll_mui__material_styles as r,_dll_lodash as o,_dll_react as a,_dll_mui__material as l,_dll_pie_lib__render_ui as i,_dll_classnames as s,_dll_mui__icons_material as u,_dll_pie_lib__correct_answer_toggle as c}from"../../../@pie-lib/shared-module@^3.0.5/module/index.js";import{_dll_pie_lib__math_input as d,_dll_pie_framework__mathquill as f}from"../../../@pie-lib/math-edit-module@^3.0.5/module/index.js";import{_dll_pie_lib__math_rendering as p}from"../../../@pie-lib/math-rendering-module@^4.0.5/module/index.js";import{_dll_pie_lib__drag as h}from"../../../@pie-lib/drag-module@^3.0.5/module/index.js";var m={exports:{}},g={},v=Symbol.for("react.element"),b=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),k=Symbol.for("react.provider"),S=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),_=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),N=Symbol.iterator;var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},D=Object.assign,P={};function M(e,t,n){this.props=e,this.context=t,this.refs=P,this.updater=n||T}function z(){}function L(e,t,n){this.props=e,this.context=t,this.refs=P,this.updater=n||T}M.prototype.isReactComponent={},M.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},M.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},z.prototype=M.prototype;var O=L.prototype=new z;O.constructor=L,D(O,M.prototype),O.isPureReactComponent=!0;var A=Array.isArray,I=Object.prototype.hasOwnProperty,F={current:null},$={key:!0,ref:!0,__self:!0,__source:!0};function U(e,t,n){var r,o={},a=null,l=null;if(null!=t)for(r in void 0!==t.ref&&(l=t.ref),void 0!==t.key&&(a=""+t.key),t)I.call(t,r)&&!$.hasOwnProperty(r)&&(o[r]=t[r]);var i=arguments.length-2;if(1===i)o.children=n;else if(1<i){for(var s=Array(i),u=0;u<i;u++)s[u]=arguments[u+2];o.children=s}if(e&&e.defaultProps)for(r in i=e.defaultProps)void 0===o[r]&&(o[r]=i[r]);return{$$typeof:v,type:e,key:a,ref:l,props:o,_owner:F.current}}function j(e){return"object"==typeof e&&null!==e&&e.$$typeof===v}var B=/\/+/g;function W(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(e){return t[e]})}(""+e.key):t.toString(36)}function H(e,t,n,r,o){var a=typeof e;"undefined"!==a&&"boolean"!==a||(e=null);var l=!1;if(null===e)l=!0;else switch(a){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case v:case b:l=!0}}if(l)return o=o(l=e),e=""===r?"."+W(l,0):r,A(o)?(n="",null!=e&&(n=e.replace(B,"$&/")+"/"),H(o,t,n,"",function(e){return e})):null!=o&&(j(o)&&(o=function(e,t){return{$$typeof:v,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(o,n+(!o.key||l&&l.key===o.key?"":(""+o.key).replace(B,"$&/")+"/")+e)),t.push(o)),1;if(l=0,r=""===r?".":r+":",A(e))for(var i=0;i<e.length;i++){var s=r+W(a=e[i],i);l+=H(a,t,n,s,o)}else if(s=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=N&&e[N]||e["@@iterator"])?e:null}(e),"function"==typeof s)for(e=s.call(e),i=0;!(a=e.next()).done;)l+=H(a=a.value,t,n,s=r+W(a,i++),o);else if("object"===a)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return l}function V(e,t,n){if(null==e)return e;var r=[],o=0;return H(e,r,"","",function(e){return t.call(n,e,o++)}),r}function q(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var Q={current:null},K={transition:null},Y={ReactCurrentDispatcher:Q,ReactCurrentBatchConfig:K,ReactCurrentOwner:F};function X(){throw Error("act(...) is not supported in production builds of React.")}g.Children={map:V,forEach:function(e,t,n){V(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return V(e,function(){t++}),t},toArray:function(e){return V(e,function(e){return e})||[]},only:function(e){if(!j(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},g.Component=M,g.Fragment=y,g.Profiler=x,g.PureComponent=L,g.StrictMode=w,g.Suspense=E,g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Y,g.act=X,g.cloneElement=function(e,t,n){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=D({},e.props),o=e.key,a=e.ref,l=e._owner;if(null!=t){if(void 0!==t.ref&&(a=t.ref,l=F.current),void 0!==t.key&&(o=""+t.key),e.type&&e.type.defaultProps)var i=e.type.defaultProps;for(s in t)I.call(t,s)&&!$.hasOwnProperty(s)&&(r[s]=void 0===t[s]&&void 0!==i?i[s]:t[s])}var s=arguments.length-2;if(1===s)r.children=n;else if(1<s){i=Array(s);for(var u=0;u<s;u++)i[u]=arguments[u+2];r.children=i}return{$$typeof:v,type:e.type,key:o,ref:a,props:r,_owner:l}},g.createContext=function(e){return(e={$$typeof:S,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:k,_context:e},e.Consumer=e},g.createElement=U,g.createFactory=function(e){var t=U.bind(null,e);return t.type=e,t},g.createRef=function(){return{current:null}},g.forwardRef=function(e){return{$$typeof:C,render:e}},g.isValidElement=j,g.lazy=function(e){return{$$typeof:R,_payload:{_status:-1,_result:e},_init:q}},g.memo=function(e,t){return{$$typeof:_,type:e,compare:void 0===t?null:t}},g.startTransition=function(e){var t=K.transition;K.transition={};try{e()}finally{K.transition=t}},g.unstable_act=X,g.useCallback=function(e,t){return Q.current.useCallback(e,t)},g.useContext=function(e){return Q.current.useContext(e)},g.useDebugValue=function(){},g.useDeferredValue=function(e){return Q.current.useDeferredValue(e)},g.useEffect=function(e,t){return Q.current.useEffect(e,t)},g.useId=function(){return Q.current.useId()},g.useImperativeHandle=function(e,t,n){return Q.current.useImperativeHandle(e,t,n)},g.useInsertionEffect=function(e,t){return Q.current.useInsertionEffect(e,t)},g.useLayoutEffect=function(e,t){return Q.current.useLayoutEffect(e,t)},g.useMemo=function(e,t){return Q.current.useMemo(e,t)},g.useReducer=function(e,t,n){return Q.current.useReducer(e,t,n)},g.useRef=function(e){return Q.current.useRef(e)},g.useState=function(e){return Q.current.useState(e)},g.useSyncExternalStore=function(e,t,n){return Q.current.useSyncExternalStore(e,t,n)},g.useTransition=function(){return Q.current.useTransition()},g.version="18.3.1",m.exports=g;var J=m.exports;var G,Z=e;G=Z.createRoot,Z.hydrateRoot;var ee={};Object.defineProperty(ee,"__esModule",{value:!0});class te extends CustomEvent{constructor(e,t,n){super(te.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e,hasModel:n}}),this.component=e,this.complete=t}}te.TYPE="model-set";var ne=ee.ModelSetEvent=te;class re extends CustomEvent{constructor(e,t){super(re.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e}}),this.component=e,this.complete=t}}re.TYPE="session-changed";var oe,ae,le,ie=ee.SessionChangedEvent=re,se={"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},ue={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},ce=function(e){return e.length?e.charAt(0).toUpperCase()+e.substring(1):e},de=ce,fe=/^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/,pe="undefined"==typeof document?{}:document.documentElement.style,he=(oe=function(){for(var e in pe)if(fe.test(e))return e.match(fe)[0];return"WebkitOpacity"in pe?"Webkit":"KhtmlOpacity"in pe?"Khtml":""}(),ae=oe.toLowerCase(),{style:oe,css:"-"+ae+"-",dom:{Webkit:"WebKit",ms:"MS",o:"WebKit"}[oe]||de(oe)}),me=function(e,t){return t?t.toUpperCase():""},ge=/[-\s]+(.)?/g,ve=function(e){return e?e.replace(ge,me):""},be=/::/g,ye=/([A-Z]+)([A-Z][a-z])/g,we=/([a-z\d])([A-Z])/g,xe=/_/g,ke=function(e,t){return e?e.replace(be,"/").replace(ye,"$1_$2").replace(we,"$1_$2").replace(xe,t||"-"):""},Se=function(e){return ke(e).toLowerCase()},Ce=ve,Ee=Se,_e=function(e){return e.length?e.charAt(0).toLowerCase()+e.substring(1):e},Re=ce,Ne=he,Te=se,De="undefined"==typeof document?{}:document.documentElement.style,Pe=function(e,t){t=t||{};var n=_e(Ce(e)),r=Ee(e),o=le?n:r,a=Ne.style?le?Ne.style:Ne.css:"";if(n in De)return t.asString?o:[o];var l=o,i=Te[r],s=[];if(le&&(l=Re(o)),"function"==typeof i){var u=i(o,a)||[];u&&!Array.isArray(u)&&(u=[u]),u.length&&(u=u.map(function(e){return le?_e(Ce(e)):Ee(e)})),s=s.concat(u)}return a&&s.push(a+l),s.push(o),t.asString||1==s.length?s[0]:s},Me=Object.prototype.hasOwnProperty,ze=function(e,t){return Me.call(e,t)},Le=Object.prototype.toString,Oe=Object.prototype.toString,Ae=Pe,Ie=Se,Fe=ve,$e=ze,Ue=function(e){return!!e&&"[object Object]"===Le.call(e)},je=function(e){return"[object Function]"===Oe.apply(e)},Be=function(e,t,n,r){Ae(t).forEach(function(t){e[r?r(t):t]=n})},We={cssUnitless:ue},He=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||We).cssUnitless=t.cssUnitless||We.cssUnitless,r=r||{};var o,a,l,i,s,u,c,d,f=t.scope||{},p=null!=t.addUnits?t.addUnits:!f||null==f.addUnits||f.addUnits,h=(null!=t.cssUnitless?t.cssUnitless:f?f.cssUnitless:null)||{},m=(t.cssUnit||f?f.cssUnit:null)||"px",g=t.prefixProperties||(f?f.prefixProperties:null)||{},v=t.camelize?Fe:Ie;for(l in e)if($e(e,l)){if(i=e[l],a=Ie(n?n+l:l),o=!1,d=!1,je(i)&&(c=i.call(f||e,i,l,a,e),Ue(c)&&null!=c.value?(i=c.value,d=c.prefix,a=c.name?Ie(c.name):a):i=c),u="number"==(s=typeof i)||"string"==s&&""!=i&&1*i==i,null==i||null==a||""===a)continue;if((u||"string"==s)&&(o=!0),!o&&null!=i.value&&i.prefix&&(o=!0,d=i.prefix,i=i.value),o){if(d=d||!!g[a],u&&(i=p&&!(a in h)?i+m:i+""),"border"!=a&&(a.indexOf("border")||~a.indexOf("radius")||~a.indexOf("width"))||!u||(a+="-width"),!a.indexOf("border-radius-")&&(a.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?(a=[],r[n].forEach(function(e){a.push("border"+e+t)})):a="border"+n+t}),Array.isArray(a))){a.forEach(function(e){d?Be(r,e,i,v):r[v(e)]=i});continue}d?Be(r,a,i,v):r[v(a)]=i}else He(i,t,a+"-",r)}return r},Ve=He,qe=ze,Qe={prefixProperties:se,cssUnitless:ue,object:He,string:function(e,t){e=Ve(e,t);var n,r=[];for(n in e)qe(e,n)&&r.push(n+": "+e[n]);return r.join("; ")}};const Ke=t("@pie-lib:mask-markup:serialization"),Ye=["span"],Xe=["em","strong","u"],Je=(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),Qe.object(r,{camelize:!0,addUnits:!1});var r},Ge=["border","class","style"],Ze={b:"bold",em:"italic",u:"underline",s:"strikethrough",code:"code",strong:"strong"},et=(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 n=e.tagName.toLowerCase(),r=Ze[n];if(r){Ke("[deserialize] mark: ",r);return{_flatten:!0,nodes:tt(e.childNodes,[...t,r])}}if("math"===n)return{isMath:!0,nodes:[e]};const o=(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"===n&&""===o.controls&&(o.controls=!0);const a=Ge.reduce((e=>(t,n)=>{if(!e.getAttribute)return t;if(e.getAttribute(n))switch(n){case"style":t.style=Je(e,n);break;case"class":t.className=((e,t,n)=>{const r=e.getAttribute(n);return delete t.class,r})(e,t,n);break;default:t[n]=e.getAttribute(n)}return t})(e),{...o}),l=(e=>Ye.includes(e)?"inline":Xe.includes(e)?"mark":"block")(n),i=tt(e.childNodes,t);return{object:l,type:n,data:{dataset:{...e.dataset},attributes:{...a}},nodes:i}}return null},tt=(e,t=[])=>{const n=[];for(let r=0;r<e.length;r++){const o=et(e[r],t);null!==o&&(o._flatten&&o.nodes?n.push(...o.nodes):n.push(o))}return n},nt=n,{get:rt}=o,{styled:ot}=r,{renderMath:at}=p;function lt(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],a=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=a(n)):"call"!==o&&"optionalCall"!==o||(n=a((...e)=>n.call(t,...e)),t=void 0)}return n}const it=ot("div")(({theme:e})=>({paddingTop:e.spacing(2),paddingBottom:e.spacing(2)})),st=ot("span")(()=>({display:"inline-block",width:".75em"})),ut=["tbody","tr"],ct=(e,t,n,r,o,a)=>{if(!t)return null;const l=[];return(e.nodes||[]).forEach((e,i)=>{const s=e.type?`${e.type}-${i}`:`${i}`;if(e.isMath)return l.push(J.createElement("span",{dangerouslySetInnerHTML:{__html:`<math displaystyle="true">${e.nodes[0].innerHTML}</math>`}})),l;if(r){const s=r(e,t,n);if(s)return l.push(s),void("td"!==lt([o,"optionalAccess",e=>e.type])&&"drag-in-the-blank"===a&&l.push(J.createElement(st,{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&&ut.includes(r)?void 0:t})(o,n);return r?e+r:e},""),n=(e=>{const t=e.leaves.find(e=>rt(e,"marks",[]).length);return t?t.marks[0]:null})(e);if(n){let e;for(e in Ze)if(Ze[e]===n.type){const n=e;l.push(J.createElement(n,{key:s},t));break}}else t.length>0&&(l.push(t),"td"!==lt([o,"optionalAccess",e=>e.type])&&"drag-in-the-blank"===a&&l.push(J.createElement(st,{key:`spacer-${i}`})))}else{const o=ct(e,t,n,r,e,a);if("p"===e.type||"paragraph"===e.type)l.push(J.createElement(it,{key:s},o));else{const t=e.type;e.nodes&&e.nodes.length>0?l.push(J.createElement(t,{key:s,...e.data.attributes},o)):l.push(J.createElement(t,{key:s,...e.data.attributes}))}}}),l},dt=ot("div")(()=>({display:"initial","&:not(.MathJax) table":{borderCollapse:"collapse"},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:"8px 12px",textAlign:"left"}}));class ft extends J.Component{constructor(e){super(e),ft.prototype.__init.call(this),this.internalContainerRef=J.createRef()}static __initStatic(){this.propTypes={renderChildren:nt.func,layout:nt.object,value:nt.object,onChange:nt.func,elementType:nt.string,containerRef:nt.oneOfType([nt.func,nt.shape({current:nt.instanceOf(Element)})])}}componentDidMount(){const e=this.props.containerRef||this.internalContainerRef;e.current&&"function"==typeof at&&at(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=ct(t,e,this.handleChange,this.props.renderChildren,null,n),a=r||this.internalContainerRef;return J.createElement(dt,{ref:a},o)}}ft.__initStatic();const pt=/\{\{(\d+)\}\}/g;const ht=n;var mt;const gt=(e,t)=>{const{markup:n}=((e,t)=>e?{markup:e.replace(pt,(e,n)=>`<span data-component="${t}" data-id="${n}"></span>`)}:{markup:""})(e,t);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=tt(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},vt=(e,t)=>(mt=class extends J.Component{static __initStatic(){this.propTypes={markup:ht.string,layout:ht.object,value:ht.object,onChange:ht.func,customMarkMarkupComponent:ht.func,elementType:ht.string}}constructor(e){super(e),this.containerRef=J.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:a,elementType:l}=this.props,i=r||gt(n,e);return J.createElement(ft,{containerRef:this.containerRef,elementType:l,layout:i,value:o,onChange:a,renderChildren:t(this.props)})}},mt.__initStatic(),mt);var bt={exports:{}},yt={},wt={exports:{}},xt={};!function(e){function t(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,a=e[r];if(!(0<o(a,t)))break e;e[r]=t,e[n]=a,n=r}}function n(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,a=e.length,l=a>>>1;r<l;){var i=2*(r+1)-1,s=e[i],u=i+1,c=e[u];if(0>o(s,n))u<a&&0>o(c,s)?(e[r]=c,e[u]=n,r=u):(e[r]=s,e[i]=n,r=i);else{if(!(u<a&&0>o(c,n)))break e;e[r]=c,e[u]=n,r=u}}}return t}function o(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var a=performance;e.unstable_now=function(){return a.now()}}else{var l=Date,i=l.now();e.unstable_now=function(){return l.now()-i}}var s=[],u=[],c=1,d=null,f=3,p=!1,h=!1,m=!1,g="function"==typeof setTimeout?setTimeout:null,v="function"==typeof clearTimeout?clearTimeout:null,b="undefined"!=typeof setImmediate?setImmediate:null;function y(e){for(var o=n(u);null!==o;){if(null===o.callback)r(u);else{if(!(o.startTime<=e))break;r(u),o.sortIndex=o.expirationTime,t(s,o)}o=n(u)}}function w(e){if(m=!1,y(e),!h)if(null!==n(s))h=!0,M(x);else{var t=n(u);null!==t&&z(w,t.startTime-e)}}function x(t,o){h=!1,m&&(m=!1,v(E),E=-1),p=!0;var a=f;try{for(y(o),d=n(s);null!==d&&(!(d.expirationTime>o)||t&&!N());){var l=d.callback;if("function"==typeof l){d.callback=null,f=d.priorityLevel;var i=l(d.expirationTime<=o);o=e.unstable_now(),"function"==typeof i?d.callback=i:d===n(s)&&r(s),y(o)}else r(s);d=n(s)}if(null!==d)var c=!0;else{var g=n(u);null!==g&&z(w,g.startTime-o),c=!1}return c}finally{d=null,f=a,p=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var k,S=!1,C=null,E=-1,_=5,R=-1;function N(){return!(e.unstable_now()-R<_)}function T(){if(null!==C){var t=e.unstable_now();R=t;var n=!0;try{n=C(!0,t)}finally{n?k():(S=!1,C=null)}}else S=!1}if("function"==typeof b)k=function(){b(T)};else if("undefined"!=typeof MessageChannel){var D=new MessageChannel,P=D.port2;D.port1.onmessage=T,k=function(){P.postMessage(null)}}else k=function(){g(T,0)};function M(e){C=e,S||(S=!0,k())}function z(t,n){E=g(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){h||p||(h=!0,M(x))},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):_=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(s)},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,o,a){var l=e.unstable_now();switch("object"==typeof a&&null!==a?a="number"==typeof(a=a.delay)&&0<a?l+a:l:a=l,r){case 1:var i=-1;break;case 2:i=250;break;case 5:i=1073741823;break;case 4:i=1e4;break;default:i=5e3}return r={id:c++,callback:o,priorityLevel:r,startTime:a,expirationTime:i=a+i,sortIndex:-1},a>l?(r.sortIndex=a,t(u,r),null===n(s)&&r===n(u)&&(m?(v(E),E=-1):m=!0,z(w,a-l))):(r.sortIndex=i,t(s,r),h||p||(h=!0,M(x))),r},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}}(xt),wt.exports=xt;var kt=a,St=wt.exports;function Ct(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Et=new Set,_t={};function Rt(e,t){Nt(e,t),Nt(e+"Capture",t)}function Nt(e,t){for(_t[e]=t,e=0;e<t.length;e++)Et.add(t[e])}var Tt=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),Dt=Object.prototype.hasOwnProperty,Pt=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Mt={},zt={};function Lt(e,t,n,r,o,a,l){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=l}var Ot={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ot[e]=new Lt(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ot[t]=new Lt(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ot[e]=new Lt(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ot[e]=new Lt(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ot[e]=new Lt(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){Ot[e]=new Lt(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){Ot[e]=new Lt(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){Ot[e]=new Lt(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){Ot[e]=new Lt(e,5,!1,e.toLowerCase(),null,!1,!1)});var At=/[\-:]([a-z])/g;function It(e){return e[1].toUpperCase()}function Ft(e,t,n,r){var o=Ot.hasOwnProperty(t)?Ot[t]:null;(null!==o?0!==o.type:r||!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1])&&(function(e,t,n,r){if(null==t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,o,r)&&(n=null),r||null===o?function(e){return!!Dt.call(zt,e)||!Dt.call(Mt,e)&&(Pt.test(e)?zt[e]=!0:(Mt[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=null===n?3!==o.type&&"":n:(t=o.attributeName,r=o.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(o=o.type)||4===o&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(At,It);Ot[t]=new Lt(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(At,It);Ot[t]=new Lt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(At,It);Ot[t]=new Lt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){Ot[e]=new Lt(e,1,!1,e.toLowerCase(),null,!1,!1)}),Ot.xlinkHref=new Lt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){Ot[e]=new Lt(e,1,!1,e.toLowerCase(),null,!0,!0)});var $t=kt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ut=Symbol.for("react.element"),jt=Symbol.for("react.portal"),Bt=Symbol.for("react.fragment"),Wt=Symbol.for("react.strict_mode"),Ht=Symbol.for("react.profiler"),Vt=Symbol.for("react.provider"),qt=Symbol.for("react.context"),Qt=Symbol.for("react.forward_ref"),Kt=Symbol.for("react.suspense"),Yt=Symbol.for("react.suspense_list"),Xt=Symbol.for("react.memo"),Jt=Symbol.for("react.lazy"),Gt=Symbol.for("react.offscreen"),Zt=Symbol.iterator;function en(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=Zt&&e[Zt]||e["@@iterator"])?e:null}var tn,nn=Object.assign;function rn(e){if(void 0===tn)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);tn=t&&t[1]||""}return"\n"+tn+e}var on=!1;function an(e,t){if(!e||on)return"";on=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&"string"==typeof t.stack){for(var o=t.stack.split("\n"),a=r.stack.split("\n"),l=o.length-1,i=a.length-1;1<=l&&0<=i&&o[l]!==a[i];)i--;for(;1<=l&&0<=i;l--,i--)if(o[l]!==a[i]){if(1!==l||1!==i)do{if(l--,0>--i||o[l]!==a[i]){var s="\n"+o[l].replace(" at new "," at ");return e.displayName&&s.includes("<anonymous>")&&(s=s.replace("<anonymous>",e.displayName)),s}}while(1<=l&&0<=i);break}}}finally{on=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?rn(e):""}function ln(e){switch(e.tag){case 5:return rn(e.type);case 16:return rn("Lazy");case 13:return rn("Suspense");case 19:return rn("SuspenseList");case 0:case 2:case 15:return e=an(e.type,!1);case 11:return e=an(e.type.render,!1);case 1:return e=an(e.type,!0);default:return""}}function sn(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case Bt:return"Fragment";case jt:return"Portal";case Ht:return"Profiler";case Wt:return"StrictMode";case Kt:return"Suspense";case Yt:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case qt:return(e.displayName||"Context")+".Consumer";case Vt:return(e._context.displayName||"Context")+".Provider";case Qt:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case Xt:return null!==(t=e.displayName||null)?t:sn(e.type)||"Memo";case Jt:t=e._payload,e=e._init;try{return sn(e(t))}catch(e){}}return null}function un(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return sn(t);case 8:return t===Wt?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t}return null}function cn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function dn(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function fn(e){e._valueTracker||(e._valueTracker=function(e){var t=dn(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var o=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(e){r=""+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function pn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=dn(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function hn(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function mn(e,t){var n=t.checked;return nn({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function gn(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=cn(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function vn(e,t){null!=(t=t.checked)&&Ft(e,"checked",t,!1)}function bn(e,t){vn(e,t);var n=cn(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?wn(e,t.type,n):t.hasOwnProperty("defaultValue")&&wn(e,t.type,cn(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function yn(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function wn(e,t,n){"number"===t&&hn(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var xn=Array.isArray;function kn(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+cn(n),t=null,o=0;o<e.length;o++){if(e[o].value===n)return e[o].selected=!0,void(r&&(e[o].defaultSelected=!0));null!==t||e[o].disabled||(t=e[o])}null!==t&&(t.selected=!0)}}function Sn(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(Ct(91));return nn({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Cn(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(Ct(92));if(xn(n)){if(1<n.length)throw Error(Ct(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:cn(n)}}function En(e,t){var n=cn(t.value),r=cn(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function _n(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}function Rn(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Nn(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?Rn(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var Tn,Dn,Pn=(Dn=function(e,t){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"innerHTML"in e)e.innerHTML=t;else{for((Tn=Tn||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Tn.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction(function(){return Dn(e,t)})}:Dn);function Mn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var zn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ln=["Webkit","ms","Moz","O"];function On(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||zn.hasOwnProperty(e)&&zn[e]?(""+t).trim():t+"px"}function An(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),o=On(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}Object.keys(zn).forEach(function(e){Ln.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),zn[t]=zn[e]})});var In=nn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Fn(e,t){if(t){if(In[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(Ct(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(Ct(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(Ct(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(Ct(62))}}function $n(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Un=null;function jn(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Bn=null,Wn=null,Hn=null;function Vn(e){if(e=$l(e)){if("function"!=typeof Bn)throw Error(Ct(280));var t=e.stateNode;t&&(t=jl(t),Bn(e.stateNode,e.type,t))}}function qn(e){Wn?Hn?Hn.push(e):Hn=[e]:Wn=e}function Qn(){if(Wn){var e=Wn,t=Hn;if(Hn=Wn=null,Vn(e),t)for(e=0;e<t.length;e++)Vn(t[e])}}function Kn(e,t){return e(t)}function Yn(){}var Xn=!1;function Jn(e,t,n){if(Xn)return e(t,n);Xn=!0;try{return Kn(e,t,n)}finally{Xn=!1,(null!==Wn||null!==Hn)&&(Yn(),Qn())}}function Gn(e,t){var n=e.stateNode;if(null===n)return null;var r=jl(n);if(null===r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(Ct(231,t,typeof n));return n}var Zn=!1;if(Tt)try{var er={};Object.defineProperty(er,"passive",{get:function(){Zn=!0}}),window.addEventListener("test",er,er),window.removeEventListener("test",er,er)}catch(Dn){Zn=!1}function tr(e,t,n,r,o,a,l,i,s){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(e){this.onError(e)}}var nr=!1,rr=null,or=!1,ar=null,lr={onError:function(e){nr=!0,rr=e}};function ir(e,t,n,r,o,a,l,i,s){nr=!1,rr=null,tr.apply(lr,arguments)}function sr(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{!!(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function ur(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function cr(e){if(sr(e)!==e)throw Error(Ct(188))}function dr(e){return null!==(e=function(e){var t=e.alternate;if(!t){if(null===(t=sr(e)))throw Error(Ct(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(null===o)break;var a=o.alternate;if(null===a){if(null!==(r=o.return)){n=r;continue}break}if(o.child===a.child){for(a=o.child;a;){if(a===n)return cr(o),e;if(a===r)return cr(o),t;a=a.sibling}throw Error(Ct(188))}if(n.return!==r.return)n=o,r=a;else{for(var l=!1,i=o.child;i;){if(i===n){l=!0,n=o,r=a;break}if(i===r){l=!0,r=o,n=a;break}i=i.sibling}if(!l){for(i=a.child;i;){if(i===n){l=!0,n=a,r=o;break}if(i===r){l=!0,r=a,n=o;break}i=i.sibling}if(!l)throw Error(Ct(189))}}if(n.alternate!==r)throw Error(Ct(190))}if(3!==n.tag)throw Error(Ct(188));return n.stateNode.current===n?e:t}(e))?fr(e):null}function fr(e){if(5===e.tag||6===e.tag)return e;for(e=e.child;null!==e;){var t=fr(e);if(null!==t)return t;e=e.sibling}return null}var pr=St.unstable_scheduleCallback,hr=St.unstable_cancelCallback,mr=St.unstable_shouldYield,gr=St.unstable_requestPaint,vr=St.unstable_now,br=St.unstable_getCurrentPriorityLevel,yr=St.unstable_ImmediatePriority,wr=St.unstable_UserBlockingPriority,xr=St.unstable_NormalPriority,kr=St.unstable_LowPriority,Sr=St.unstable_IdlePriority,Cr=null,Er=null;var _r=Math.clz32?Math.clz32:function(e){return e>>>=0,0===e?32:31-(Rr(e)/Nr|0)|0},Rr=Math.log,Nr=Math.LN2;var Tr=64,Dr=4194304;function Pr(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Mr(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,o=e.suspendedLanes,a=e.pingedLanes,l=268435455&n;if(0!==l){var i=l&~o;0!==i?r=Pr(i):0!==(a&=l)&&(r=Pr(a))}else 0!==(l=n&~o)?r=Pr(l):0!==a&&(r=Pr(a));if(0===r)return 0;if(0!==t&&t!==r&&0===(t&o)&&((o=r&-r)>=(a=t&-t)||16===o&&4194240&a))return t;if(4&r&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)o=1<<(n=31-_r(t)),r|=e[n],t&=~o;return r}function zr(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function Lr(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function Or(){var e=Tr;return!(4194240&(Tr<<=1))&&(Tr=64),e}function Ar(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ir(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-_r(t)]=n}function Fr(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-_r(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var $r=0;function Ur(e){return 1<(e&=-e)?4<e?268435455&e?16:536870912:4:1}var jr,Br,Wr,Hr,Vr,qr=!1,Qr=[],Kr=null,Yr=null,Xr=null,Jr=new Map,Gr=new Map,Zr=[],eo="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function to(e,t){switch(e){case"focusin":case"focusout":Kr=null;break;case"dragenter":case"dragleave":Yr=null;break;case"mouseover":case"mouseout":Xr=null;break;case"pointerover":case"pointerout":Jr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Gr.delete(t.pointerId)}}function no(e,t,n,r,o,a){return null===e||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[o]},null!==t&&(null!==(t=$l(t))&&Br(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==o&&-1===t.indexOf(o)&&t.push(o),e)}function ro(e){var t=Fl(e.target);if(null!==t){var n=sr(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=ur(n)))return e.blockedOn=t,void Vr(e.priority,function(){Wr(n)})}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function oo(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=go(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=$l(n))&&Br(t),e.blockedOn=n,!1;var r=new(n=e.nativeEvent).constructor(n.type,n);Un=r,n.target.dispatchEvent(r),Un=null,t.shift()}return!0}function ao(e,t,n){oo(e)&&n.delete(t)}function lo(){qr=!1,null!==Kr&&oo(Kr)&&(Kr=null),null!==Yr&&oo(Yr)&&(Yr=null),null!==Xr&&oo(Xr)&&(Xr=null),Jr.forEach(ao),Gr.forEach(ao)}function io(e,t){e.blockedOn===t&&(e.blockedOn=null,qr||(qr=!0,St.unstable_scheduleCallback(St.unstable_NormalPriority,lo)))}function so(e){function t(t){return io(t,e)}if(0<Qr.length){io(Qr[0],e);for(var n=1;n<Qr.length;n++){var r=Qr[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==Kr&&io(Kr,e),null!==Yr&&io(Yr,e),null!==Xr&&io(Xr,e),Jr.forEach(t),Gr.forEach(t),n=0;n<Zr.length;n++)(r=Zr[n]).blockedOn===e&&(r.blockedOn=null);for(;0<Zr.length&&null===(n=Zr[0]).blockedOn;)ro(n),null===n.blockedOn&&Zr.shift()}var uo=$t.ReactCurrentBatchConfig,co=!0;function fo(e,t,n,r){var o=$r,a=uo.transition;uo.transition=null;try{$r=1,ho(e,t,n,r)}finally{$r=o,uo.transition=a}}function po(e,t,n,r){var o=$r,a=uo.transition;uo.transition=null;try{$r=4,ho(e,t,n,r)}finally{$r=o,uo.transition=a}}function ho(e,t,n,r){if(co){var o=go(e,t,n,r);if(null===o)cl(e,t,r,mo,n),to(e,r);else if(function(e,t,n,r,o){switch(t){case"focusin":return Kr=no(Kr,e,t,n,r,o),!0;case"dragenter":return Yr=no(Yr,e,t,n,r,o),!0;case"mouseover":return Xr=no(Xr,e,t,n,r,o),!0;case"pointerover":var a=o.pointerId;return Jr.set(a,no(Jr.get(a)||null,e,t,n,r,o)),!0;case"gotpointercapture":return a=o.pointerId,Gr.set(a,no(Gr.get(a)||null,e,t,n,r,o)),!0}return!1}(o,e,t,n,r))r.stopPropagation();else if(to(e,r),4&t&&-1<eo.indexOf(e)){for(;null!==o;){var a=$l(o);if(null!==a&&jr(a),null===(a=go(e,t,n,r))&&cl(e,t,r,mo,n),a===o)break;o=a}null!==o&&r.stopPropagation()}else cl(e,t,r,null,n)}}var mo=null;function go(e,t,n,r){if(mo=null,null!==(e=Fl(e=jn(r))))if(null===(t=sr(e)))e=null;else if(13===(n=t.tag)){if(null!==(e=ur(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return mo=e,null}function vo(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(br()){case yr:return 1;case wr:return 4;case xr:case kr:return 16;case Sr:return 536870912;default:return 16}default:return 16}}var bo=null,yo=null,wo=null;function xo(){if(wo)return wo;var e,t,n=yo,r=n.length,o="value"in bo?bo.value:bo.textContent,a=o.length;for(e=0;e<r&&n[e]===o[e];e++);var l=r-e;for(t=1;t<=l&&n[r-t]===o[a-t];t++);return wo=o.slice(e,1<t?1-t:void 0)}function ko(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function So(){return!0}function Co(){return!1}function Eo(e){function t(t,n,r,o,a){for(var l in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=o,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(l)&&(t=e[l],this[l]=t?t(o):o[l]);return this.isDefaultPrevented=(null!=o.defaultPrevented?o.defaultPrevented:!1===o.returnValue)?So:Co,this.isPropagationStopped=Co,this}return nn(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=So)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=So)},persist:function(){},isPersistent:So}),t}var _o,Ro,No,To={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Do=Eo(To),Po=nn({},To,{view:0,detail:0}),Mo=Eo(Po),zo=nn({},Po,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Vo,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==No&&(No&&"mousemove"===e.type?(_o=e.screenX-No.screenX,Ro=e.screenY-No.screenY):Ro=_o=0,No=e),_o)},movementY:function(e){return"movementY"in e?e.movementY:Ro}}),Lo=Eo(zo),Oo=Eo(nn({},zo,{dataTransfer:0})),Ao=Eo(nn({},Po,{relatedTarget:0})),Io=Eo(nn({},To,{animationName:0,elapsedTime:0,pseudoElement:0})),Fo=nn({},To,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),$o=Eo(Fo),Uo=Eo(nn({},To,{data:0})),jo={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Bo={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Wo={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ho(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=Wo[e])&&!!t[e]}function Vo(){return Ho}var qo=nn({},Po,{key:function(e){if(e.key){var t=jo[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=ko(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?Bo[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Vo,charCode:function(e){return"keypress"===e.type?ko(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?ko(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),Qo=Eo(qo),Ko=Eo(nn({},zo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Yo=Eo(nn({},Po,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Vo})),Xo=Eo(nn({},To,{propertyName:0,elapsedTime:0,pseudoElement:0})),Jo=nn({},zo,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Go=Eo(Jo),Zo=[9,13,27,32],ea=Tt&&"CompositionEvent"in window,ta=null;Tt&&"documentMode"in document&&(ta=document.documentMode);var na=Tt&&"TextEvent"in window&&!ta,ra=Tt&&(!ea||ta&&8<ta&&11>=ta),oa=String.fromCharCode(32),aa=!1;function la(e,t){switch(e){case"keyup":return-1!==Zo.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ia(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var sa=!1;var ua={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function ca(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!ua[e.type]:"textarea"===t}function da(e,t,n,r){qn(r),0<(t=fl(t,"onChange")).length&&(n=new Do("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var fa=null,pa=null;function ha(e){ol(e,0)}function ma(e){if(pn(Ul(e)))return e}function ga(e,t){if("change"===e)return t}var va=!1;if(Tt){var ba;if(Tt){var ya="oninput"in document;if(!ya){var wa=document.createElement("div");wa.setAttribute("oninput","return;"),ya="function"==typeof wa.oninput}ba=ya}else ba=!1;va=ba&&(!document.documentMode||9<document.documentMode)}function xa(){fa&&(fa.detachEvent("onpropertychange",ka),pa=fa=null)}function ka(e){if("value"===e.propertyName&&ma(pa)){var t=[];da(t,pa,e,jn(e)),Jn(ha,t)}}function Sa(e,t,n){"focusin"===e?(xa(),pa=n,(fa=t).attachEvent("onpropertychange",ka)):"focusout"===e&&xa()}function Ca(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return ma(pa)}function Ea(e,t){if("click"===e)return ma(t)}function _a(e,t){if("input"===e||"change"===e)return ma(t)}var Ra="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t};function Na(e,t){if(Ra(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!Dt.call(t,o)||!Ra(e[o],t[o]))return!1}return!0}function Ta(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Da(e,t){var n,r=Ta(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Ta(r)}}function Pa(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?Pa(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function Ma(){for(var e=window,t=hn();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=hn((e=t.contentWindow).document)}return t}function za(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function La(e){var t=Ma(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Pa(n.ownerDocument.documentElement,n)){if(null!==r&&za(n))if(t=r.start,void 0===(e=r.end)&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if((e=(t=n.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var o=n.textContent.length,a=Math.min(r.start,o);r=void 0===r.end?a:Math.min(r.end,o),!e.extend&&a>r&&(o=r,r=a,a=o),o=Da(n,a);var l=Da(n,r);o&&l&&(1!==e.rangeCount||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&((t=t.createRange()).setStart(o.node,o.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"==typeof n.focus&&n.focus(),n=0;n<t.length;n++)(e=t[n]).element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Oa=Tt&&"documentMode"in document&&11>=document.documentMode,Aa=null,Ia=null,Fa=null,$a=!1;function Ua(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;$a||null==Aa||Aa!==hn(r)||("selectionStart"in(r=Aa)&&za(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},Fa&&Na(Fa,r)||(Fa=r,0<(r=fl(Ia,"onSelect")).length&&(t=new Do("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Aa)))}function ja(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ba={animationend:ja("Animation","AnimationEnd"),animationiteration:ja("Animation","AnimationIteration"),animationstart:ja("Animation","AnimationStart"),transitionend:ja("Transition","TransitionEnd")},Wa={},Ha={};function Va(e){if(Wa[e])return Wa[e];if(!Ba[e])return e;var t,n=Ba[e];for(t in n)if(n.hasOwnProperty(t)&&t in Ha)return Wa[e]=n[t];return e}Tt&&(Ha=document.createElement("div").style,"AnimationEvent"in window||(delete Ba.animationend.animation,delete Ba.animationiteration.animation,delete Ba.animationstart.animation),"TransitionEvent"in window||delete Ba.transitionend.transition);var qa=Va("animationend"),Qa=Va("animationiteration"),Ka=Va("animationstart"),Ya=Va("transitionend"),Xa=new Map,Ja="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Ga(e,t){Xa.set(e,t),Rt(t,[e])}for(var Za=0;Za<Ja.length;Za++){var el=Ja[Za];Ga(el.toLowerCase(),"on"+(el[0].toUpperCase()+el.slice(1)))}Ga(qa,"onAnimationEnd"),Ga(Qa,"onAnimationIteration"),Ga(Ka,"onAnimationStart"),Ga("dblclick","onDoubleClick"),Ga("focusin","onFocus"),Ga("focusout","onBlur"),Ga(Ya,"onTransitionEnd"),Nt("onMouseEnter",["mouseout","mouseover"]),Nt("onMouseLeave",["mouseout","mouseover"]),Nt("onPointerEnter",["pointerout","pointerover"]),Nt("onPointerLeave",["pointerout","pointerover"]),Rt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Rt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Rt("onBeforeInput",["compositionend","keypress","textInput","paste"]),Rt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Rt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Rt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var tl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),nl=new Set("cancel close invalid load scroll toggle".split(" ").concat(tl));function rl(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,r,o,a,l,i,s){if(ir.apply(this,arguments),nr){if(!nr)throw Error(Ct(198));var u=rr;nr=!1,rr=null,or||(or=!0,ar=u)}}(r,t,void 0,e),e.currentTarget=null}function ol(e,t){t=!!(4&t);for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var a=void 0;if(t)for(var l=r.length-1;0<=l;l--){var i=r[l],s=i.instance,u=i.currentTarget;if(i=i.listener,s!==a&&o.isPropagationStopped())break e;rl(o,i,u),a=s}else for(l=0;l<r.length;l++){if(s=(i=r[l]).instance,u=i.currentTarget,i=i.listener,s!==a&&o.isPropagationStopped())break e;rl(o,i,u),a=s}}}if(or)throw e=ar,or=!1,ar=null,e}function al(e,t){var n=t[Ol];void 0===n&&(n=t[Ol]=new Set);var r=e+"__bubble";n.has(r)||(ul(t,e,2,!1),n.add(r))}function ll(e,t,n){var r=0;t&&(r|=4),ul(n,e,r,t)}var il="_reactListening"+Math.random().toString(36).slice(2);function sl(e){if(!e[il]){e[il]=!0,Et.forEach(function(t){"selectionchange"!==t&&(nl.has(t)||ll(t,!1,e),ll(t,!0,e))});var t=9===e.nodeType?e:e.ownerDocument;null===t||t[il]||(t[il]=!0,ll("selectionchange",!1,t))}}function ul(e,t,n,r){switch(vo(t)){case 1:var o=fo;break;case 4:o=po;break;default:o=ho}n=o.bind(null,t,n,e),o=void 0,!Zn||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(o=!0),r?void 0!==o?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):void 0!==o?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function cl(e,t,n,r,o){var a=r;if(!(1&t||2&t||null===r))e:for(;;){if(null===r)return;var l=r.tag;if(3===l||4===l){var i=r.stateNode.containerInfo;if(i===o||8===i.nodeType&&i.parentNode===o)break;if(4===l)for(l=r.return;null!==l;){var s=l.tag;if((3===s||4===s)&&((s=l.stateNode.containerInfo)===o||8===s.nodeType&&s.parentNode===o))return;l=l.return}for(;null!==i;){if(null===(l=Fl(i)))return;if(5===(s=l.tag)||6===s){r=a=l;continue e}i=i.parentNode}}r=r.return}Jn(function(){var r=a,o=jn(n),l=[];e:{var i=Xa.get(e);if(void 0!==i){var s=Do,u=e;switch(e){case"keypress":if(0===ko(n))break e;case"keydown":case"keyup":s=Qo;break;case"focusin":u="focus",s=Ao;break;case"focusout":u="blur",s=Ao;break;case"beforeblur":case"afterblur":s=Ao;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":s=Lo;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":s=Oo;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":s=Yo;break;case qa:case Qa:case Ka:s=Io;break;case Ya:s=Xo;break;case"scroll":s=Mo;break;case"wheel":s=Go;break;case"copy":case"cut":case"paste":s=$o;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":s=Ko}var c=!!(4&t),d=!c&&"scroll"===e,f=c?null!==i?i+"Capture":null:i;c=[];for(var p,h=r;null!==h;){var m=(p=h).stateNode;if(5===p.tag&&null!==m&&(p=m,null!==f&&(null!=(m=Gn(h,f))&&c.push(dl(h,m,p)))),d)break;h=h.return}0<c.length&&(i=new s(i,u,null,n,o),l.push({event:i,listeners:c}))}}if(!(7&t)){if(s="mouseout"===e||"pointerout"===e,(!(i="mouseover"===e||"pointerover"===e)||n===Un||!(u=n.relatedTarget||n.fromElement)||!Fl(u)&&!u[Ll])&&(s||i)&&(i=o.window===o?o:(i=o.ownerDocument)?i.defaultView||i.parentWindow:window,s?(s=r,null!==(u=(u=n.relatedTarget||n.toElement)?Fl(u):null)&&(u!==(d=sr(u))||5!==u.tag&&6!==u.tag)&&(u=null)):(s=null,u=r),s!==u)){if(c=Lo,m="onMouseLeave",f="onMouseEnter",h="mouse","pointerout"!==e&&"pointerover"!==e||(c=Ko,m="onPointerLeave",f="onPointerEnter",h="pointer"),d=null==s?i:Ul(s),p=null==u?i:Ul(u),(i=new c(m,h+"leave",s,n,o)).target=d,i.relatedTarget=p,m=null,Fl(o)===r&&((c=new c(f,h+"enter",u,n,o)).target=p,c.relatedTarget=d,m=c),d=m,s&&u)e:{for(f=u,h=0,p=c=s;p;p=pl(p))h++;for(p=0,m=f;m;m=pl(m))p++;for(;0<h-p;)c=pl(c),h--;for(;0<p-h;)f=pl(f),p--;for(;h--;){if(c===f||null!==f&&c===f.alternate)break e;c=pl(c),f=pl(f)}c=null}else c=null;null!==s&&hl(l,i,s,c,!1),null!==u&&null!==d&&hl(l,d,u,c,!0)}if("select"===(s=(i=r?Ul(r):window).nodeName&&i.nodeName.toLowerCase())||"input"===s&&"file"===i.type)var g=ga;else if(ca(i))if(va)g=_a;else{g=Ca;var v=Sa}else(s=i.nodeName)&&"input"===s.toLowerCase()&&("checkbox"===i.type||"radio"===i.type)&&(g=Ea);switch(g&&(g=g(e,r))?da(l,g,n,o):(v&&v(e,i,r),"focusout"===e&&(v=i._wrapperState)&&v.controlled&&"number"===i.type&&wn(i,"number",i.value)),v=r?Ul(r):window,e){case"focusin":(ca(v)||"true"===v.contentEditable)&&(Aa=v,Ia=r,Fa=null);break;case"focusout":Fa=Ia=Aa=null;break;case"mousedown":$a=!0;break;case"contextmenu":case"mouseup":case"dragend":$a=!1,Ua(l,n,o);break;case"selectionchange":if(Oa)break;case"keydown":case"keyup":Ua(l,n,o)}var b;if(ea)e:{switch(e){case"compositionstart":var y="onCompositionStart";break e;case"compositionend":y="onCompositionEnd";break e;case"compositionupdate":y="onCompositionUpdate";break e}y=void 0}else sa?la(e,n)&&(y="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(y="onCompositionStart");y&&(ra&&"ko"!==n.locale&&(sa||"onCompositionStart"!==y?"onCompositionEnd"===y&&sa&&(b=xo()):(yo="value"in(bo=o)?bo.value:bo.textContent,sa=!0)),0<(v=fl(r,y)).length&&(y=new Uo(y,e,null,n,o),l.push({event:y,listeners:v}),b?y.data=b:null!==(b=ia(n))&&(y.data=b))),(b=na?function(e,t){switch(e){case"compositionend":return ia(t);case"keypress":return 32!==t.which?null:(aa=!0,oa);case"textInput":return(e=t.data)===oa&&aa?null:e;default:return null}}(e,n):function(e,t){if(sa)return"compositionend"===e||!ea&&la(e,t)?(e=xo(),wo=yo=bo=null,sa=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return ra&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(r=fl(r,"onBeforeInput")).length&&(o=new Uo("onBeforeInput","beforeinput",null,n,o),l.push({event:o,listeners:r}),o.data=b))}ol(l,t)})}function dl(e,t,n){return{instance:e,listener:t,currentTarget:n}}function fl(e,t){for(var n=t+"Capture",r=[];null!==e;){var o=e,a=o.stateNode;5===o.tag&&null!==a&&(o=a,null!=(a=Gn(e,n))&&r.unshift(dl(e,a,o)),null!=(a=Gn(e,t))&&r.push(dl(e,a,o))),e=e.return}return r}function pl(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function hl(e,t,n,r,o){for(var a=t._reactName,l=[];null!==n&&n!==r;){var i=n,s=i.alternate,u=i.stateNode;if(null!==s&&s===r)break;5===i.tag&&null!==u&&(i=u,o?null!=(s=Gn(n,a))&&l.unshift(dl(n,s,i)):o||null!=(s=Gn(n,a))&&l.push(dl(n,s,i))),n=n.return}0!==l.length&&e.push({event:t,listeners:l})}var ml=/\r\n?/g,gl=/\u0000|\uFFFD/g;function vl(e){return("string"==typeof e?e:""+e).replace(ml,"\n").replace(gl,"")}function bl(e,t,n){if(t=vl(t),vl(e)!==t&&n)throw Error(Ct(425))}function yl(){}var wl=null,xl=null;function kl(e,t){return"textarea"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var Sl="function"==typeof setTimeout?setTimeout:void 0,Cl="function"==typeof clearTimeout?clearTimeout:void 0,El="function"==typeof Promise?Promise:void 0,_l="function"==typeof queueMicrotask?queueMicrotask:void 0!==El?function(e){return El.resolve(null).then(e).catch(Rl)}:Sl;function Rl(e){setTimeout(function(){throw e})}function Nl(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&8===o.nodeType)if("/$"===(n=o.data)){if(0===r)return e.removeChild(o),void so(t);r--}else"$"!==n&&"$?"!==n&&"$!"!==n||r++;n=o}while(n);so(t)}function Tl(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t)break;if("/$"===t)return null}}return e}function Dl(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var Pl=Math.random().toString(36).slice(2),Ml="__reactFiber$"+Pl,zl="__reactProps$"+Pl,Ll="__reactContainer$"+Pl,Ol="__reactEvents$"+Pl,Al="__reactListeners$"+Pl,Il="__reactHandles$"+Pl;function Fl(e){var t=e[Ml];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ll]||n[Ml]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=Dl(e);null!==e;){if(n=e[Ml])return n;e=Dl(e)}return t}n=(e=n).parentNode}return null}function $l(e){return!(e=e[Ml]||e[Ll])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function Ul(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(Ct(33))}function jl(e){return e[zl]||null}var Bl=[],Wl=-1;function Hl(e){return{current:e}}function Vl(e){0>Wl||(e.current=Bl[Wl],Bl[Wl]=null,Wl--)}function ql(e,t){Wl++,Bl[Wl]=e.current,e.current=t}var Ql={},Kl=Hl(Ql),Yl=Hl(!1),Xl=Ql;function Jl(e,t){var n=e.type.contextTypes;if(!n)return Ql;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o,a={};for(o in n)a[o]=t[o];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function Gl(e){return null!=(e=e.childContextTypes)}function Zl(){Vl(Yl),Vl(Kl)}function ei(e,t,n){if(Kl.current!==Ql)throw Error(Ct(168));ql(Kl,t),ql(Yl,n)}function ti(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var o in r=r.getChildContext())if(!(o in t))throw Error(Ct(108,un(e)||"Unknown",o));return nn({},n,r)}function ni(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ql,Xl=Kl.current,ql(Kl,e),ql(Yl,Yl.current),!0}function ri(e,t,n){var r=e.stateNode;if(!r)throw Error(Ct(169));n?(e=ti(e,t,Xl),r.__reactInternalMemoizedMergedChildContext=e,Vl(Yl),Vl(Kl),ql(Kl,e)):Vl(Yl),ql(Yl,n)}var oi=null,ai=!1,li=!1;function ii(e){null===oi?oi=[e]:oi.push(e)}function si(){if(!li&&null!==oi){li=!0;var e=0,t=$r;try{var n=oi;for($r=1;e<n.length;e++){var r=n[e];do{r=r(!0)}while(null!==r)}oi=null,ai=!1}catch(t){throw null!==oi&&(oi=oi.slice(e+1)),pr(yr,si),t}finally{$r=t,li=!1}}return null}var ui=[],ci=0,di=null,fi=0,pi=[],hi=0,mi=null,gi=1,vi="";function bi(e,t){ui[ci++]=fi,ui[ci++]=di,di=e,fi=t}function yi(e,t,n){pi[hi++]=gi,pi[hi++]=vi,pi[hi++]=mi,mi=e;var r=gi;e=vi;var o=32-_r(r)-1;r&=~(1<<o),n+=1;var a=32-_r(t)+o;if(30<a){var l=o-o%5;a=(r&(1<<l)-1).toString(32),r>>=l,o-=l,gi=1<<32-_r(t)+o|n<<o|r,vi=a+e}else gi=1<<a|n<<o|r,vi=e}function wi(e){null!==e.return&&(bi(e,1),yi(e,1,0))}function xi(e){for(;e===di;)di=ui[--ci],ui[ci]=null,fi=ui[--ci],ui[ci]=null;for(;e===mi;)mi=pi[--hi],pi[hi]=null,vi=pi[--hi],pi[hi]=null,gi=pi[--hi],pi[hi]=null}var ki=null,Si=null,Ci=!1,Ei=null;function _i(e,t){var n=Xd(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,null===(t=e.deletions)?(e.deletions=[n],e.flags|=16):t.push(n)}function Ri(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,ki=e,Si=Tl(t.firstChild),!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,ki=e,Si=null,!0);case 13:return null!==(t=8!==t.nodeType?null:t)&&(n=null!==mi?{id:gi,overflow:vi}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},(n=Xd(18,null,null,0)).stateNode=t,n.return=e,e.child=n,ki=e,Si=null,!0);default:return!1}}function Ni(e){return!(!(1&e.mode)||128&e.flags)}function Ti(e){if(Ci){var t=Si;if(t){var n=t;if(!Ri(e,t)){if(Ni(e))throw Error(Ct(418));t=Tl(n.nextSibling);var r=ki;t&&Ri(e,t)?_i(r,n):(e.flags=-4097&e.flags|2,Ci=!1,ki=e)}}else{if(Ni(e))throw Error(Ct(418));e.flags=-4097&e.flags|2,Ci=!1,ki=e}}}function Di(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;ki=e}function Pi(e){if(e!==ki)return!1;if(!Ci)return Di(e),Ci=!0,!1;var t;if((t=3!==e.tag)&&!(t=5!==e.tag)&&(t="head"!==(t=e.type)&&"body"!==t&&!kl(e.type,e.memoizedProps)),t&&(t=Si)){if(Ni(e))throw Mi(),Error(Ct(418));for(;t;)_i(e,t),t=Tl(t.nextSibling)}if(Di(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(Ct(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){Si=Tl(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}Si=null}}else Si=ki?Tl(e.stateNode.nextSibling):null;return!0}function Mi(){for(var e=Si;e;)e=Tl(e.nextSibling)}function zi(){Si=ki=null,Ci=!1}function Li(e){null===Ei?Ei=[e]:Ei.push(e)}var Oi=$t.ReactCurrentBatchConfig;function Ai(e,t,n){if(null!==(e=n.ref)&&"function"!=typeof e&&"object"!=typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(Ct(309));var r=n.stateNode}if(!r)throw Error(Ct(147,e));var o=r,a=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===a?t.ref:(t=function(e){var t=o.refs;null===e?delete t[a]:t[a]=e},t._stringRef=a,t)}if("string"!=typeof e)throw Error(Ct(284));if(!n._owner)throw Error(Ct(290,e))}return e}function Ii(e,t){throw e=Object.prototype.toString.call(t),Error(Ct(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Fi(e){return(0,e._init)(e._payload)}function $i(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function o(e,t){return(e=Gd(e,t)).index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags|=2,n):r:(t.flags|=2,n):(t.flags|=1048576,n)}function l(t){return e&&null===t.alternate&&(t.flags|=2),t}function i(e,t,n,r){return null===t||6!==t.tag?((t=nf(n,e.mode,r)).return=e,t):((t=o(t,n)).return=e,t)}function s(e,t,n,r){var a=n.type;return a===Bt?c(e,t,n.props.children,r,n.key):null!==t&&(t.elementType===a||"object"==typeof a&&null!==a&&a.$$typeof===Jt&&Fi(a)===t.type)?((r=o(t,n.props)).ref=Ai(e,t,n),r.return=e,r):((r=Zd(n.type,n.key,n.props,null,e.mode,r)).ref=Ai(e,t,n),r.return=e,r)}function u(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=rf(n,e.mode,r)).return=e,t):((t=o(t,n.children||[])).return=e,t)}function c(e,t,n,r,a){return null===t||7!==t.tag?((t=ef(n,e.mode,r,a)).return=e,t):((t=o(t,n)).return=e,t)}function d(e,t,n){if("string"==typeof t&&""!==t||"number"==typeof t)return(t=nf(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case Ut:return(n=Zd(t.type,t.key,t.props,null,e.mode,n)).ref=Ai(e,null,t),n.return=e,n;case jt:return(t=rf(t,e.mode,n)).return=e,t;case Jt:return d(e,(0,t._init)(t._payload),n)}if(xn(t)||en(t))return(t=ef(t,e.mode,n,null)).return=e,t;Ii(e,t)}return null}function f(e,t,n,r){var o=null!==t?t.key:null;if("string"==typeof n&&""!==n||"number"==typeof n)return null!==o?null:i(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case Ut:return n.key===o?s(e,t,n,r):null;case jt:return n.key===o?u(e,t,n,r):null;case Jt:return f(e,t,(o=n._init)(n._payload),r)}if(xn(n)||en(n))return null!==o?null:c(e,t,n,r,null);Ii(e,n)}return null}function p(e,t,n,r,o){if("string"==typeof r&&""!==r||"number"==typeof r)return i(t,e=e.get(n)||null,""+r,o);if("object"==typeof r&&null!==r){switch(r.$$typeof){case Ut:return s(t,e=e.get(null===r.key?n:r.key)||null,r,o);case jt:return u(t,e=e.get(null===r.key?n:r.key)||null,r,o);case Jt:return p(e,t,n,(0,r._init)(r._payload),o)}if(xn(r)||en(r))return c(t,e=e.get(n)||null,r,o,null);Ii(t,r)}return null}function h(o,l,i,s){for(var u=null,c=null,h=l,m=l=0,g=null;null!==h&&m<i.length;m++){h.index>m?(g=h,h=null):g=h.sibling;var v=f(o,h,i[m],s);if(null===v){null===h&&(h=g);break}e&&h&&null===v.alternate&&t(o,h),l=a(v,l,m),null===c?u=v:c.sibling=v,c=v,h=g}if(m===i.length)return n(o,h),Ci&&bi(o,m),u;if(null===h){for(;m<i.length;m++)null!==(h=d(o,i[m],s))&&(l=a(h,l,m),null===c?u=h:c.sibling=h,c=h);return Ci&&bi(o,m),u}for(h=r(o,h);m<i.length;m++)null!==(g=p(h,o,m,i[m],s))&&(e&&null!==g.alternate&&h.delete(null===g.key?m:g.key),l=a(g,l,m),null===c?u=g:c.sibling=g,c=g);return e&&h.forEach(function(e){return t(o,e)}),Ci&&bi(o,m),u}function m(o,l,i,s){var u=en(i);if("function"!=typeof u)throw Error(Ct(150));if(null==(i=u.call(i)))throw Error(Ct(151));for(var c=u=null,h=l,m=l=0,g=null,v=i.next();null!==h&&!v.done;m++,v=i.next()){h.index>m?(g=h,h=null):g=h.sibling;var b=f(o,h,v.value,s);if(null===b){null===h&&(h=g);break}e&&h&&null===b.alternate&&t(o,h),l=a(b,l,m),null===c?u=b:c.sibling=b,c=b,h=g}if(v.done)return n(o,h),Ci&&bi(o,m),u;if(null===h){for(;!v.done;m++,v=i.next())null!==(v=d(o,v.value,s))&&(l=a(v,l,m),null===c?u=v:c.sibling=v,c=v);return Ci&&bi(o,m),u}for(h=r(o,h);!v.done;m++,v=i.next())null!==(v=p(h,o,m,v.value,s))&&(e&&null!==v.alternate&&h.delete(null===v.key?m:v.key),l=a(v,l,m),null===c?u=v:c.sibling=v,c=v);return e&&h.forEach(function(e){return t(o,e)}),Ci&&bi(o,m),u}return function e(r,a,i,s){if("object"==typeof i&&null!==i&&i.type===Bt&&null===i.key&&(i=i.props.children),"object"==typeof i&&null!==i){switch(i.$$typeof){case Ut:e:{for(var u=i.key,c=a;null!==c;){if(c.key===u){if((u=i.type)===Bt){if(7===c.tag){n(r,c.sibling),(a=o(c,i.props.children)).return=r,r=a;break e}}else if(c.elementType===u||"object"==typeof u&&null!==u&&u.$$typeof===Jt&&Fi(u)===c.type){n(r,c.sibling),(a=o(c,i.props)).ref=Ai(r,c,i),a.return=r,r=a;break e}n(r,c);break}t(r,c),c=c.sibling}i.type===Bt?((a=ef(i.props.children,r.mode,s,i.key)).return=r,r=a):((s=Zd(i.type,i.key,i.props,null,r.mode,s)).ref=Ai(r,a,i),s.return=r,r=s)}return l(r);case jt:e:{for(c=i.key;null!==a;){if(a.key===c){if(4===a.tag&&a.stateNode.containerInfo===i.containerInfo&&a.stateNode.implementation===i.implementation){n(r,a.sibling),(a=o(a,i.children||[])).return=r,r=a;break e}n(r,a);break}t(r,a),a=a.sibling}(a=rf(i,r.mode,s)).return=r,r=a}return l(r);case Jt:return e(r,a,(c=i._init)(i._payload),s)}if(xn(i))return h(r,a,i,s);if(en(i))return m(r,a,i,s);Ii(r,i)}return"string"==typeof i&&""!==i||"number"==typeof i?(i=""+i,null!==a&&6===a.tag?(n(r,a.sibling),(a=o(a,i)).return=r,r=a):(n(r,a),(a=nf(i,r.mode,s)).return=r,r=a),l(r)):n(r,a)}}var Ui=$i(!0),ji=$i(!1),Bi=Hl(null),Wi=null,Hi=null,Vi=null;function qi(){Vi=Hi=Wi=null}function Qi(e){var t=Bi.current;Vl(Bi),e._currentValue=t}function Ki(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Yi(e,t){Wi=e,Vi=Hi=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!==(e.lanes&t)&&(Fu=!0),e.firstContext=null)}function Xi(e){var t=e._currentValue;if(Vi!==e)if(e={context:e,memoizedValue:t,next:null},null===Hi){if(null===Wi)throw Error(Ct(308));Hi=e,Wi.dependencies={lanes:0,firstContext:e}}else Hi=Hi.next=e;return t}var Ji=null;function Gi(e){null===Ji?Ji=[e]:Ji.push(e)}function Zi(e,t,n,r){var o=t.interleaved;return null===o?(n.next=n,Gi(t)):(n.next=o.next,o.next=n),t.interleaved=n,es(e,r)}function es(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}var ts=!1;function ns(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function rs(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function os(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function as(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,2&Qc){var o=r.pending;return null===o?t.next=t:(t.next=o.next,o.next=t),r.pending=t,es(e,n)}return null===(o=r.interleaved)?(t.next=t,Gi(r)):(t.next=o.next,o.next=t),r.interleaved=t,es(e,n)}function ls(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,4194240&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,Fr(e,n)}}function is(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var o=null,a=null;if(null!==(n=n.firstBaseUpdate)){do{var l={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===a?o=a=l:a=a.next=l,n=n.next}while(null!==n);null===a?o=a=t:a=a.next=t}else o=a=t;return n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:a,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function ss(e,t,n,r){var o=e.updateQueue;ts=!1;var a=o.firstBaseUpdate,l=o.lastBaseUpdate,i=o.shared.pending;if(null!==i){o.shared.pending=null;var s=i,u=s.next;s.next=null,null===l?a=u:l.next=u,l=s;var c=e.alternate;null!==c&&((i=(c=c.updateQueue).lastBaseUpdate)!==l&&(null===i?c.firstBaseUpdate=u:i.next=u,c.lastBaseUpdate=s))}if(null!==a){var d=o.baseState;for(l=0,c=u=s=null,i=a;;){var f=i.lane,p=i.eventTime;if((r&f)===f){null!==c&&(c=c.next={eventTime:p,lane:0,tag:i.tag,payload:i.payload,callback:i.callback,next:null});e:{var h=e,m=i;switch(f=t,p=n,m.tag){case 1:if("function"==typeof(h=m.payload)){d=h.call(p,d,f);break e}d=h;break e;case 3:h.flags=-65537&h.flags|128;case 0:if(null==(f="function"==typeof(h=m.payload)?h.call(p,d,f):h))break e;d=nn({},d,f);break e;case 2:ts=!0}}null!==i.callback&&0!==i.lane&&(e.flags|=64,null===(f=o.effects)?o.effects=[i]:f.push(i))}else p={eventTime:p,lane:f,tag:i.tag,payload:i.payload,callback:i.callback,next:null},null===c?(u=c=p,s=d):c=c.next=p,l|=f;if(null===(i=i.next)){if(null===(i=o.shared.pending))break;i=(f=i).next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}if(null===c&&(s=d),o.baseState=s,o.firstBaseUpdate=u,o.lastBaseUpdate=c,null!==(t=o.shared.interleaved)){o=t;do{l|=o.lane,o=o.next}while(o!==t)}else null===a&&(o.shared.lanes=0);td|=l,e.lanes=l,e.memoizedState=d}}function us(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(null!==o){if(r.callback=null,r=n,"function"!=typeof o)throw Error(Ct(191,o));o.call(r)}}}var cs={},ds=Hl(cs),fs=Hl(cs),ps=Hl(cs);function hs(e){if(e===cs)throw Error(Ct(174));return e}function ms(e,t){switch(ql(ps,t),ql(fs,e),ql(ds,cs),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Nn(null,"");break;default:t=Nn(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}Vl(ds),ql(ds,t)}function gs(){Vl(ds),Vl(fs),Vl(ps)}function vs(e){hs(ps.current);var t=hs(ds.current),n=Nn(t,e.type);t!==n&&(ql(fs,e),ql(ds,n))}function bs(e){fs.current===e&&(Vl(ds),Vl(fs))}var ys=Hl(0);function ws(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(128&t.flags)return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var xs=[];function ks(){for(var e=0;e<xs.length;e++)xs[e]._workInProgressVersionPrimary=null;xs.length=0}var Ss=$t.ReactCurrentDispatcher,Cs=$t.ReactCurrentBatchConfig,Es=0,_s=null,Rs=null,Ns=null,Ts=!1,Ds=!1,Ps=0,Ms=0;function zs(){throw Error(Ct(321))}function Ls(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ra(e[n],t[n]))return!1;return!0}function Os(e,t,n,r,o,a){if(Es=a,_s=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ss.current=null===e||null===e.memoizedState?bu:yu,e=n(r,o),Ds){a=0;do{if(Ds=!1,Ps=0,25<=a)throw Error(Ct(301));a+=1,Ns=Rs=null,t.updateQueue=null,Ss.current=wu,e=n(r,o)}while(Ds)}if(Ss.current=vu,t=null!==Rs&&null!==Rs.next,Es=0,Ns=Rs=_s=null,Ts=!1,t)throw Error(Ct(300));return e}function As(){var e=0!==Ps;return Ps=0,e}function Is(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===Ns?_s.memoizedState=Ns=e:Ns=Ns.next=e,Ns}function Fs(){if(null===Rs){var e=_s.alternate;e=null!==e?e.memoizedState:null}else e=Rs.next;var t=null===Ns?_s.memoizedState:Ns.next;if(null!==t)Ns=t,Rs=e;else{if(null===e)throw Error(Ct(310));e={memoizedState:(Rs=e).memoizedState,baseState:Rs.baseState,baseQueue:Rs.baseQueue,queue:Rs.queue,next:null},null===Ns?_s.memoizedState=Ns=e:Ns=Ns.next=e}return Ns}function $s(e,t){return"function"==typeof t?t(e):t}function Us(e){var t=Fs(),n=t.queue;if(null===n)throw Error(Ct(311));n.lastRenderedReducer=e;var r=Rs,o=r.baseQueue,a=n.pending;if(null!==a){if(null!==o){var l=o.next;o.next=a.next,a.next=l}r.baseQueue=o=a,n.pending=null}if(null!==o){a=o.next,r=r.baseState;var i=l=null,s=null,u=a;do{var c=u.lane;if((Es&c)===c)null!==s&&(s=s.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var d={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};null===s?(i=s=d,l=r):s=s.next=d,_s.lanes|=c,td|=c}u=u.next}while(null!==u&&u!==a);null===s?l=r:s.next=i,Ra(r,t.memoizedState)||(Fu=!0),t.memoizedState=r,t.baseState=l,t.baseQueue=s,n.lastRenderedState=r}if(null!==(e=n.interleaved)){o=e;do{a=o.lane,_s.lanes|=a,td|=a,o=o.next}while(o!==e)}else null===o&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function js(e){var t=Fs(),n=t.queue;if(null===n)throw Error(Ct(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,a=t.memoizedState;if(null!==o){n.pending=null;var l=o=o.next;do{a=e(a,l.action),l=l.next}while(l!==o);Ra(a,t.memoizedState)||(Fu=!0),t.memoizedState=a,null===t.baseQueue&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function Bs(){}function Ws(e,t){var n=_s,r=Fs(),o=t(),a=!Ra(r.memoizedState,o);if(a&&(r.memoizedState=o,Fu=!0),r=r.queue,tu(qs.bind(null,n,r,e),[e]),r.getSnapshot!==t||a||null!==Ns&&1&Ns.memoizedState.tag){if(n.flags|=2048,Xs(9,Vs.bind(null,n,r,o,t),void 0,null),null===Kc)throw Error(Ct(349));30&Es||Hs(n,t,o)}return o}function Hs(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=_s.updateQueue)?(t={lastEffect:null,stores:null},_s.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function Vs(e,t,n,r){t.value=n,t.getSnapshot=r,Qs(t)&&Ks(e)}function qs(e,t,n){return n(function(){Qs(t)&&Ks(e)})}function Qs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ra(e,n)}catch(e){return!0}}function Ks(e){var t=es(e,1);null!==t&&xd(t,e,1,-1)}function Ys(e){var t=Is();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:$s,lastRenderedState:e},t.queue=e,e=e.dispatch=pu.bind(null,_s,e),[t.memoizedState,e]}function Xs(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=_s.updateQueue)?(t={lastEffect:null,stores:null},_s.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Js(){return Fs().memoizedState}function Gs(e,t,n,r){var o=Is();_s.flags|=e,o.memoizedState=Xs(1|t,n,void 0,void 0===r?null:r)}function Zs(e,t,n,r){var o=Fs();r=void 0===r?null:r;var a=void 0;if(null!==Rs){var l=Rs.memoizedState;if(a=l.destroy,null!==r&&Ls(r,l.deps))return void(o.memoizedState=Xs(t,n,a,r))}_s.flags|=e,o.memoizedState=Xs(1|t,n,a,r)}function eu(e,t){return Gs(8390656,8,e,t)}function tu(e,t){return Zs(2048,8,e,t)}function nu(e,t){return Zs(4,2,e,t)}function ru(e,t){return Zs(4,4,e,t)}function ou(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function au(e,t,n){return n=null!=n?n.concat([e]):null,Zs(4,4,ou.bind(null,t,e),n)}function lu(){}function iu(e,t){var n=Fs();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&Ls(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function su(e,t){var n=Fs();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&Ls(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function uu(e,t,n){return 21&Es?(Ra(n,t)||(n=Or(),_s.lanes|=n,td|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Fu=!0),e.memoizedState=n)}function cu(e,t){var n=$r;$r=0!==n&&4>n?n:4,e(!0);var r=Cs.transition;Cs.transition={};try{e(!1),t()}finally{$r=n,Cs.transition=r}}function du(){return Fs().memoizedState}function fu(e,t,n){var r=wd(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},hu(e))mu(t,n);else if(null!==(n=Zi(e,t,n,r))){xd(n,e,r,yd()),gu(n,t,r)}}function pu(e,t,n){var r=wd(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(hu(e))mu(t,o);else{var a=e.alternate;if(0===e.lanes&&(null===a||0===a.lanes)&&null!==(a=t.lastRenderedReducer))try{var l=t.lastRenderedState,i=a(l,n);if(o.hasEagerState=!0,o.eagerState=i,Ra(i,l)){var s=t.interleaved;return null===s?(o.next=o,Gi(t)):(o.next=s.next,s.next=o),void(t.interleaved=o)}}catch(e){}null!==(n=Zi(e,t,o,r))&&(xd(n,e,r,o=yd()),gu(n,t,r))}}function hu(e){var t=e.alternate;return e===_s||null!==t&&t===_s}function mu(e,t){Ds=Ts=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function gu(e,t,n){if(4194240&n){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,Fr(e,n)}}var vu={readContext:Xi,useCallback:zs,useContext:zs,useEffect:zs,useImperativeHandle:zs,useInsertionEffect:zs,useLayoutEffect:zs,useMemo:zs,useReducer:zs,useRef:zs,useState:zs,useDebugValue:zs,useDeferredValue:zs,useTransition:zs,useMutableSource:zs,useSyncExternalStore:zs,useId:zs,unstable_isNewReconciler:!1},bu={readContext:Xi,useCallback:function(e,t){return Is().memoizedState=[e,void 0===t?null:t],e},useContext:Xi,useEffect:eu,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,Gs(4194308,4,ou.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Gs(4194308,4,e,t)},useInsertionEffect:function(e,t){return Gs(4,2,e,t)},useMemo:function(e,t){var n=Is();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Is();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=fu.bind(null,_s,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},Is().memoizedState=e},useState:Ys,useDebugValue:lu,useDeferredValue:function(e){return Is().memoizedState=e},useTransition:function(){var e=Ys(!1),t=e[0];return e=cu.bind(null,e[1]),Is().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=_s,o=Is();if(Ci){if(void 0===n)throw Error(Ct(407));n=n()}else{if(n=t(),null===Kc)throw Error(Ct(349));30&Es||Hs(r,t,n)}o.memoizedState=n;var a={value:n,getSnapshot:t};return o.queue=a,eu(qs.bind(null,r,a,e),[e]),r.flags|=2048,Xs(9,Vs.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=Is(),t=Kc.identifierPrefix;if(Ci){var n=vi;t=":"+t+"R"+(n=(gi&~(1<<32-_r(gi)-1)).toString(32)+n),0<(n=Ps++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=Ms++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},yu={readContext:Xi,useCallback:iu,useContext:Xi,useEffect:tu,useImperativeHandle:au,useInsertionEffect:nu,useLayoutEffect:ru,useMemo:su,useReducer:Us,useRef:Js,useState:function(){return Us($s)},useDebugValue:lu,useDeferredValue:function(e){return uu(Fs(),Rs.memoizedState,e)},useTransition:function(){return[Us($s)[0],Fs().memoizedState]},useMutableSource:Bs,useSyncExternalStore:Ws,useId:du,unstable_isNewReconciler:!1},wu={readContext:Xi,useCallback:iu,useContext:Xi,useEffect:tu,useImperativeHandle:au,useInsertionEffect:nu,useLayoutEffect:ru,useMemo:su,useReducer:js,useRef:Js,useState:function(){return js($s)},useDebugValue:lu,useDeferredValue:function(e){var t=Fs();return null===Rs?t.memoizedState=e:uu(t,Rs.memoizedState,e)},useTransition:function(){return[js($s)[0],Fs().memoizedState]},useMutableSource:Bs,useSyncExternalStore:Ws,useId:du,unstable_isNewReconciler:!1};function xu(e,t){if(e&&e.defaultProps){for(var n in t=nn({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}function ku(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:nn({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var Su={isMounted:function(e){return!!(e=e._reactInternals)&&sr(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=yd(),o=wd(e),a=os(r,o);a.payload=t,null!=n&&(a.callback=n),null!==(t=as(e,a,o))&&(xd(t,e,o,r),ls(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=yd(),o=wd(e),a=os(r,o);a.tag=1,a.payload=t,null!=n&&(a.callback=n),null!==(t=as(e,a,o))&&(xd(t,e,o,r),ls(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=yd(),r=wd(e),o=os(n,r);o.tag=2,null!=t&&(o.callback=t),null!==(t=as(e,o,r))&&(xd(t,e,r,n),ls(t,e,r))}};function Cu(e,t,n,r,o,a,l){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,a,l):!t.prototype||!t.prototype.isPureReactComponent||(!Na(n,r)||!Na(o,a))}function Eu(e,t,n){var r=!1,o=Ql,a=t.contextType;return"object"==typeof a&&null!==a?a=Xi(a):(o=Gl(t)?Xl:Kl.current,a=(r=null!=(r=t.contextTypes))?Jl(e,o):Ql),t=new t(n,a),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=Su,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=a),t}function _u(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Su.enqueueReplaceState(t,t.state,null)}function Ru(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},ns(e);var a=t.contextType;"object"==typeof a&&null!==a?o.context=Xi(a):(a=Gl(t)?Xl:Kl.current,o.context=Jl(e,a)),o.state=e.memoizedState,"function"==typeof(a=t.getDerivedStateFromProps)&&(ku(e,t,a,n),o.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof o.getSnapshotBeforeUpdate||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||(t=o.state,"function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount(),t!==o.state&&Su.enqueueReplaceState(o,o.state,null),ss(e,n,o,r),o.state=e.memoizedState),"function"==typeof o.componentDidMount&&(e.flags|=4194308)}function Nu(e,t){try{var n="",r=t;do{n+=ln(r),r=r.return}while(r);var o=n}catch(e){o="\nError generating stack: "+e.message+"\n"+e.stack}return{value:e,source:t,stack:o,digest:null}}function Tu(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function Du(e,t){try{console.error(t.value)}catch(e){setTimeout(function(){throw e})}}var Pu="function"==typeof WeakMap?WeakMap:Map;function Mu(e,t,n){(n=os(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){ud||(ud=!0,cd=r),Du(0,t)},n}function zu(e,t,n){(n=os(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){Du(0,t)}}var a=e.stateNode;return null!==a&&"function"==typeof a.componentDidCatch&&(n.callback=function(){Du(0,t),"function"!=typeof r&&(null===dd?dd=new Set([this]):dd.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function Lu(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new Pu;var o=new Set;r.set(t,o)}else void 0===(o=r.get(t))&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=Hd.bind(null,e,t,n),t.then(e,e))}function Ou(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function Au(e,t,n,r,o){return 1&e.mode?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=os(-1,1)).tag=2,as(n,t,1))),n.lanes|=1),e)}var Iu=$t.ReactCurrentOwner,Fu=!1;function $u(e,t,n,r){t.child=null===e?ji(t,null,n,r):Ui(t,e.child,n,r)}function Uu(e,t,n,r,o){n=n.render;var a=t.ref;return Yi(t,o),r=Os(e,t,n,r,a,o),n=As(),null===e||Fu?(Ci&&n&&wi(t),t.flags|=1,$u(e,t,r,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,uc(e,t,o))}function ju(e,t,n,r,o){if(null===e){var a=n.type;return"function"!=typeof a||Jd(a)||void 0!==a.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Zd(n.type,null,r,t,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,Bu(e,t,a,r,o))}if(a=e.child,0===(e.lanes&o)){var l=a.memoizedProps;if((n=null!==(n=n.compare)?n:Na)(l,r)&&e.ref===t.ref)return uc(e,t,o)}return t.flags|=1,(e=Gd(a,r)).ref=t.ref,e.return=t,t.child=e}function Bu(e,t,n,r,o){if(null!==e){var a=e.memoizedProps;if(Na(a,r)&&e.ref===t.ref){if(Fu=!1,t.pendingProps=r=a,0===(e.lanes&o))return t.lanes=e.lanes,uc(e,t,o);131072&e.flags&&(Fu=!0)}}return Vu(e,t,n,r,o)}function Wu(e,t,n){var r=t.pendingProps,o=r.children,a=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(1&t.mode){if(!(1073741824&n))return e=null!==a?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ql(Gc,Jc),Jc|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==a?a.baseLanes:n,ql(Gc,Jc),Jc|=r}else t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ql(Gc,Jc),Jc|=n;else null!==a?(r=a.baseLanes|n,t.memoizedState=null):r=n,ql(Gc,Jc),Jc|=r;return $u(e,t,o,n),t.child}function Hu(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Vu(e,t,n,r,o){var a=Gl(n)?Xl:Kl.current;return a=Jl(t,a),Yi(t,o),n=Os(e,t,n,r,a,o),r=As(),null===e||Fu?(Ci&&r&&wi(t),t.flags|=1,$u(e,t,n,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,uc(e,t,o))}function qu(e,t,n,r,o){if(Gl(n)){var a=!0;ni(t)}else a=!1;if(Yi(t,o),null===t.stateNode)sc(e,t),Eu(t,n,r),Ru(t,n,r,o),r=!0;else if(null===e){var l=t.stateNode,i=t.memoizedProps;l.props=i;var s=l.context,u=n.contextType;"object"==typeof u&&null!==u?u=Xi(u):u=Jl(t,u=Gl(n)?Xl:Kl.current);var c=n.getDerivedStateFromProps,d="function"==typeof c||"function"==typeof l.getSnapshotBeforeUpdate;d||"function"!=typeof l.UNSAFE_componentWillReceiveProps&&"function"!=typeof l.componentWillReceiveProps||(i!==r||s!==u)&&_u(t,l,r,u),ts=!1;var f=t.memoizedState;l.state=f,ss(t,r,l,o),s=t.memoizedState,i!==r||f!==s||Yl.current||ts?("function"==typeof c&&(ku(t,n,c,r),s=t.memoizedState),(i=ts||Cu(t,n,i,r,f,s,u))?(d||"function"!=typeof l.UNSAFE_componentWillMount&&"function"!=typeof l.componentWillMount||("function"==typeof l.componentWillMount&&l.componentWillMount(),"function"==typeof l.UNSAFE_componentWillMount&&l.UNSAFE_componentWillMount()),"function"==typeof l.componentDidMount&&(t.flags|=4194308)):("function"==typeof l.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=s),l.props=r,l.state=s,l.context=u,r=i):("function"==typeof l.componentDidMount&&(t.flags|=4194308),r=!1)}else{l=t.stateNode,rs(e,t),i=t.memoizedProps,u=t.type===t.elementType?i:xu(t.type,i),l.props=u,d=t.pendingProps,f=l.context,"object"==typeof(s=n.contextType)&&null!==s?s=Xi(s):s=Jl(t,s=Gl(n)?Xl:Kl.current);var p=n.getDerivedStateFromProps;(c="function"==typeof p||"function"==typeof l.getSnapshotBeforeUpdate)||"function"!=typeof l.UNSAFE_componentWillReceiveProps&&"function"!=typeof l.componentWillReceiveProps||(i!==d||f!==s)&&_u(t,l,r,s),ts=!1,f=t.memoizedState,l.state=f,ss(t,r,l,o);var h=t.memoizedState;i!==d||f!==h||Yl.current||ts?("function"==typeof p&&(ku(t,n,p,r),h=t.memoizedState),(u=ts||Cu(t,n,u,r,f,h,s)||!1)?(c||"function"!=typeof l.UNSAFE_componentWillUpdate&&"function"!=typeof l.componentWillUpdate||("function"==typeof l.componentWillUpdate&&l.componentWillUpdate(r,h,s),"function"==typeof l.UNSAFE_componentWillUpdate&&l.UNSAFE_componentWillUpdate(r,h,s)),"function"==typeof l.componentDidUpdate&&(t.flags|=4),"function"==typeof l.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof l.componentDidUpdate||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof l.getSnapshotBeforeUpdate||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=h),l.props=r,l.state=h,l.context=s,r=u):("function"!=typeof l.componentDidUpdate||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof l.getSnapshotBeforeUpdate||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Qu(e,t,n,r,a,o)}function Qu(e,t,n,r,o,a){Hu(e,t);var l=!!(128&t.flags);if(!r&&!l)return o&&ri(t,n,!1),uc(e,t,a);r=t.stateNode,Iu.current=t;var i=l&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&l?(t.child=Ui(t,e.child,null,a),t.child=Ui(t,null,i,a)):$u(e,t,i,a),t.memoizedState=r.state,o&&ri(t,n,!0),t.child}function Ku(e){var t=e.stateNode;t.pendingContext?ei(0,t.pendingContext,t.pendingContext!==t.context):t.context&&ei(0,t.context,!1),ms(e,t.containerInfo)}function Yu(e,t,n,r,o){return zi(),Li(o),t.flags|=256,$u(e,t,n,r),t.child}var Xu,Ju,Gu,Zu,ec={dehydrated:null,treeContext:null,retryLane:0};function tc(e){return{baseLanes:e,cachePool:null,transitions:null}}function nc(e,t,n){var r,o=t.pendingProps,a=ys.current,l=!1,i=!!(128&t.flags);if((r=i)||(r=(null===e||null!==e.memoizedState)&&!!(2&a)),r?(l=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(a|=1),ql(ys,1&a),null===e)return Ti(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(1&t.mode?"$!"===e.data?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(i=o.children,e=o.fallback,l?(o=t.mode,l=t.child,i={mode:"hidden",children:i},1&o||null===l?l=tf(i,o,0,null):(l.childLanes=0,l.pendingProps=i),e=ef(e,o,n,null),l.return=t,e.return=t,l.sibling=e,t.child=l,t.child.memoizedState=tc(n),t.memoizedState=ec,e):rc(t,i));if(null!==(a=e.memoizedState)&&null!==(r=a.dehydrated))return function(e,t,n,r,o,a,l){if(n)return 256&t.flags?(t.flags&=-257,oc(e,t,l,r=Tu(Error(Ct(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(a=r.fallback,o=t.mode,r=tf({mode:"visible",children:r.children},o,0,null),(a=ef(a,o,l,null)).flags|=2,r.return=t,a.return=t,r.sibling=a,t.child=r,1&t.mode&&Ui(t,e.child,null,l),t.child.memoizedState=tc(l),t.memoizedState=ec,a);if(!(1&t.mode))return oc(e,t,l,null);if("$!"===o.data){if(r=o.nextSibling&&o.nextSibling.dataset)var i=r.dgst;return r=i,oc(e,t,l,r=Tu(a=Error(Ct(419)),r,void 0))}if(i=0!==(l&e.childLanes),Fu||i){if(null!==(r=Kc)){switch(l&-l){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}0!==(o=0!==(o&(r.suspendedLanes|l))?0:o)&&o!==a.retryLane&&(a.retryLane=o,es(e,o),xd(r,e,o,-1))}return Ld(),oc(e,t,l,r=Tu(Error(Ct(421))))}return"$?"===o.data?(t.flags|=128,t.child=e.child,t=qd.bind(null,e),o._reactRetry=t,null):(e=a.treeContext,Si=Tl(o.nextSibling),ki=t,Ci=!0,Ei=null,null!==e&&(pi[hi++]=gi,pi[hi++]=vi,pi[hi++]=mi,gi=e.id,vi=e.overflow,mi=t),t=rc(t,r.children),t.flags|=4096,t)}(e,t,i,o,r,a,n);if(l){l=o.fallback,i=t.mode,r=(a=e.child).sibling;var s={mode:"hidden",children:o.children};return 1&i||t.child===a?(o=Gd(a,s)).subtreeFlags=14680064&a.subtreeFlags:((o=t.child).childLanes=0,o.pendingProps=s,t.deletions=null),null!==r?l=Gd(r,l):(l=ef(l,i,n,null)).flags|=2,l.return=t,o.return=t,o.sibling=l,t.child=o,o=l,l=t.child,i=null===(i=e.child.memoizedState)?tc(n):{baseLanes:i.baseLanes|n,cachePool:null,transitions:i.transitions},l.memoizedState=i,l.childLanes=e.childLanes&~n,t.memoizedState=ec,o}return e=(l=e.child).sibling,o=Gd(l,{mode:"visible",children:o.children}),!(1&t.mode)&&(o.lanes=n),o.return=t,o.sibling=null,null!==e&&(null===(n=t.deletions)?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=o,t.memoizedState=null,o}function rc(e,t){return(t=tf({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function oc(e,t,n,r){return null!==r&&Li(r),Ui(t,e.child,null,n),(e=rc(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function ac(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),Ki(e.return,t,n)}function lc(e,t,n,r,o){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=o)}function ic(e,t,n){var r=t.pendingProps,o=r.revealOrder,a=r.tail;if($u(e,t,r.children,n),2&(r=ys.current))r=1&r|2,t.flags|=128;else{if(null!==e&&128&e.flags)e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&ac(e,n,t);else if(19===e.tag)ac(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ql(ys,r),1&t.mode)switch(o){case"forwards":for(n=t.child,o=null;null!==n;)null!==(e=n.alternate)&&null===ws(e)&&(o=n),n=n.sibling;null===(n=o)?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),lc(t,!1,o,n,a);break;case"backwards":for(n=null,o=t.child,t.child=null;null!==o;){if(null!==(e=o.alternate)&&null===ws(e)){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}lc(t,!0,n,null,a);break;case"together":lc(t,!1,null,null,void 0);break;default:t.memoizedState=null}else t.memoizedState=null;return t.child}function sc(e,t){!(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function uc(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),td|=t.lanes,0===(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(Ct(153));if(null!==t.child){for(n=Gd(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Gd(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function cc(e,t){if(!Ci)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function dc(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=14680064&o.subtreeFlags,r|=14680064&o.flags,o.return=e,o=o.sibling;else for(o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function fc(e,t,n){var r=t.pendingProps;switch(xi(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return dc(t),null;case 1:case 17:return Gl(t.type)&&Zl(),dc(t),null;case 3:return r=t.stateNode,gs(),Vl(Yl),Vl(Kl),ks(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(Pi(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&!(256&t.flags)||(t.flags|=1024,null!==Ei&&(Ed(Ei),Ei=null))),Ju(e,t),dc(t),null;case 5:bs(t);var o=hs(ps.current);if(n=t.type,null!==e&&null!=t.stateNode)Gu(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(null===t.stateNode)throw Error(Ct(166));return dc(t),null}if(e=hs(ds.current),Pi(t)){r=t.stateNode,n=t.type;var a=t.memoizedProps;switch(r[Ml]=t,r[zl]=a,e=!!(1&t.mode),n){case"dialog":al("cancel",r),al("close",r);break;case"iframe":case"object":case"embed":al("load",r);break;case"video":case"audio":for(o=0;o<tl.length;o++)al(tl[o],r);break;case"source":al("error",r);break;case"img":case"image":case"link":al("error",r),al("load",r);break;case"details":al("toggle",r);break;case"input":gn(r,a),al("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!a.multiple},al("invalid",r);break;case"textarea":Cn(r,a),al("invalid",r)}for(var l in Fn(n,a),o=null,a)if(a.hasOwnProperty(l)){var i=a[l];"children"===l?"string"==typeof i?r.textContent!==i&&(!0!==a.suppressHydrationWarning&&bl(r.textContent,i,e),o=["children",i]):"number"==typeof i&&r.textContent!==""+i&&(!0!==a.suppressHydrationWarning&&bl(r.textContent,i,e),o=["children",""+i]):_t.hasOwnProperty(l)&&null!=i&&"onScroll"===l&&al("scroll",r)}switch(n){case"input":fn(r),yn(r,a,!0);break;case"textarea":fn(r),_n(r);break;case"select":case"option":break;default:"function"==typeof a.onClick&&(r.onclick=yl)}r=o,t.updateQueue=r,null!==r&&(t.flags|=4)}else{l=9===o.nodeType?o:o.ownerDocument,"http://www.w3.org/1999/xhtml"===e&&(e=Rn(n)),"http://www.w3.org/1999/xhtml"===e?"script"===n?((e=l.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof r.is?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),"select"===n&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[Ml]=t,e[zl]=r,Xu(e,t,!1,!1),t.stateNode=e;e:{switch(l=$n(n,r),n){case"dialog":al("cancel",e),al("close",e),o=r;break;case"iframe":case"object":case"embed":al("load",e),o=r;break;case"video":case"audio":for(o=0;o<tl.length;o++)al(tl[o],e);o=r;break;case"source":al("error",e),o=r;break;case"img":case"image":case"link":al("error",e),al("load",e),o=r;break;case"details":al("toggle",e),o=r;break;case"input":gn(e,r),o=mn(e,r),al("invalid",e);break;case"option":default:o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=nn({},r,{value:void 0}),al("invalid",e);break;case"textarea":Cn(e,r),o=Sn(e,r),al("invalid",e)}for(a in Fn(n,o),i=o)if(i.hasOwnProperty(a)){var s=i[a];"style"===a?An(e,s):"dangerouslySetInnerHTML"===a?null!=(s=s?s.__html:void 0)&&Pn(e,s):"children"===a?"string"==typeof s?("textarea"!==n||""!==s)&&Mn(e,s):"number"==typeof s&&Mn(e,""+s):"suppressContentEditableWarning"!==a&&"suppressHydrationWarning"!==a&&"autoFocus"!==a&&(_t.hasOwnProperty(a)?null!=s&&"onScroll"===a&&al("scroll",e):null!=s&&Ft(e,a,s,l))}switch(n){case"input":fn(e),yn(e,r,!1);break;case"textarea":fn(e),_n(e);break;case"option":null!=r.value&&e.setAttribute("value",""+cn(r.value));break;case"select":e.multiple=!!r.multiple,null!=(a=r.value)?kn(e,!!r.multiple,a,!1):null!=r.defaultValue&&kn(e,!!r.multiple,r.defaultValue,!0);break;default:"function"==typeof o.onClick&&(e.onclick=yl)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return dc(t),null;case 6:if(e&&null!=t.stateNode)Zu(e,t,e.memoizedProps,r);else{if("string"!=typeof r&&null===t.stateNode)throw Error(Ct(166));if(n=hs(ps.current),hs(ds.current),Pi(t)){if(r=t.stateNode,n=t.memoizedProps,r[Ml]=t,(a=r.nodeValue!==n)&&null!==(e=ki))switch(e.tag){case 3:bl(r.nodeValue,n,!!(1&e.mode));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&bl(r.nodeValue,n,!!(1&e.mode))}a&&(t.flags|=4)}else(r=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[Ml]=t,t.stateNode=r}return dc(t),null;case 13:if(Vl(ys),r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(Ci&&null!==Si&&1&t.mode&&!(128&t.flags))Mi(),zi(),t.flags|=98560,a=!1;else if(a=Pi(t),null!==r&&null!==r.dehydrated){if(null===e){if(!a)throw Error(Ct(318));if(!(a=null!==(a=t.memoizedState)?a.dehydrated:null))throw Error(Ct(317));a[Ml]=t}else zi(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;dc(t),a=!1}else null!==Ei&&(Ed(Ei),Ei=null),a=!0;if(!a)return 65536&t.flags?t:null}return 128&t.flags?(t.lanes=n,t):((r=null!==r)!==(null!==e&&null!==e.memoizedState)&&r&&(t.child.flags|=8192,1&t.mode&&(null===e||1&ys.current?0===Zc&&(Zc=3):Ld())),null!==t.updateQueue&&(t.flags|=4),dc(t),null);case 4:return gs(),Ju(e,t),null===e&&sl(t.stateNode.containerInfo),dc(t),null;case 10:return Qi(t.type._context),dc(t),null;case 19:if(Vl(ys),null===(a=t.memoizedState))return dc(t),null;if(r=!!(128&t.flags),null===(l=a.rendering))if(r)cc(a,!1);else{if(0!==Zc||null!==e&&128&e.flags)for(e=t.child;null!==e;){if(null!==(l=ws(e))){for(t.flags|=128,cc(a,!1),null!==(r=l.updateQueue)&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;null!==n;)e=r,(a=n).flags&=14680066,null===(l=a.alternate)?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=l.childLanes,a.lanes=l.lanes,a.child=l.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=l.memoizedProps,a.memoizedState=l.memoizedState,a.updateQueue=l.updateQueue,a.type=l.type,e=l.dependencies,a.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ql(ys,1&ys.current|2),t.child}e=e.sibling}null!==a.tail&&vr()>id&&(t.flags|=128,r=!0,cc(a,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=ws(l))){if(t.flags|=128,r=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),cc(a,!0),null===a.tail&&"hidden"===a.tailMode&&!l.alternate&&!Ci)return dc(t),null}else 2*vr()-a.renderingStartTime>id&&1073741824!==n&&(t.flags|=128,r=!0,cc(a,!1),t.lanes=4194304);a.isBackwards?(l.sibling=t.child,t.child=l):(null!==(n=a.last)?n.sibling=l:t.child=l,a.last=l)}return null!==a.tail?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=vr(),t.sibling=null,n=ys.current,ql(ys,r?1&n|2:1&n),t):(dc(t),null);case 22:case 23:return Dd(),r=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==r&&(t.flags|=8192),r&&1&t.mode?!!(1073741824&Jc)&&(dc(t),6&t.subtreeFlags&&(t.flags|=8192)):dc(t),null;case 24:case 25:return null}throw Error(Ct(156,t.tag))}function pc(e,t){switch(xi(t),t.tag){case 1:return Gl(t.type)&&Zl(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return gs(),Vl(Yl),Vl(Kl),ks(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 5:return bs(t),null;case 13:if(Vl(ys),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(Ct(340));zi()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return Vl(ys),null;case 4:return gs(),null;case 10:return Qi(t.type._context),null;case 22:case 23:return Dd(),null;default:return null}}Xu=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Ju=function(){},Gu=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,hs(ds.current);var a,l=null;switch(n){case"input":o=mn(e,o),r=mn(e,r),l=[];break;case"select":o=nn({},o,{value:void 0}),r=nn({},r,{value:void 0}),l=[];break;case"textarea":o=Sn(e,o),r=Sn(e,r),l=[];break;default:"function"!=typeof o.onClick&&"function"==typeof r.onClick&&(e.onclick=yl)}for(u in Fn(n,r),n=null,o)if(!r.hasOwnProperty(u)&&o.hasOwnProperty(u)&&null!=o[u])if("style"===u){var i=o[u];for(a in i)i.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else"dangerouslySetInnerHTML"!==u&&"children"!==u&&"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&"autoFocus"!==u&&(_t.hasOwnProperty(u)?l||(l=[]):(l=l||[]).push(u,null));for(u in r){var s=r[u];if(i=null!=o?o[u]:void 0,r.hasOwnProperty(u)&&s!==i&&(null!=s||null!=i))if("style"===u)if(i){for(a in i)!i.hasOwnProperty(a)||s&&s.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in s)s.hasOwnProperty(a)&&i[a]!==s[a]&&(n||(n={}),n[a]=s[a])}else n||(l||(l=[]),l.push(u,n)),n=s;else"dangerouslySetInnerHTML"===u?(s=s?s.__html:void 0,i=i?i.__html:void 0,null!=s&&i!==s&&(l=l||[]).push(u,s)):"children"===u?"string"!=typeof s&&"number"!=typeof s||(l=l||[]).push(u,""+s):"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&(_t.hasOwnProperty(u)?(null!=s&&"onScroll"===u&&al("scroll",e),l||i===s||(l=[])):(l=l||[]).push(u,s))}n&&(l=l||[]).push("style",n);var u=l;(t.updateQueue=u)&&(t.flags|=4)}},Zu=function(e,t,n,r){n!==r&&(t.flags|=4)};var hc=!1,mc=!1,gc="function"==typeof WeakSet?WeakSet:Set,vc=null;function bc(e,t){var n=e.ref;if(null!==n)if("function"==typeof n)try{n(null)}catch(n){Wd(e,t,n)}else n.current=null}function yc(e,t,n){try{n()}catch(n){Wd(e,t,n)}}var wc=!1;function xc(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var o=r=r.next;do{if((o.tag&e)===e){var a=o.destroy;o.destroy=void 0,void 0!==a&&yc(t,n,a)}o=o.next}while(o!==r)}}function kc(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Sc(e){var t=e.ref;if(null!==t){var n=e.stateNode;e.tag,e=n,"function"==typeof t?t(e):t.current=e}}function Cc(e){var t=e.alternate;null!==t&&(e.alternate=null,Cc(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&(delete t[Ml],delete t[zl],delete t[Ol],delete t[Al],delete t[Il])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Ec(e){return 5===e.tag||3===e.tag||4===e.tag}function _c(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||Ec(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function Rc(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=yl));else if(4!==r&&null!==(e=e.child))for(Rc(e,t,n),e=e.sibling;null!==e;)Rc(e,t,n),e=e.sibling}function Nc(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(Nc(e,t,n),e=e.sibling;null!==e;)Nc(e,t,n),e=e.sibling}var Tc=null,Dc=!1;function Pc(e,t,n){for(n=n.child;null!==n;)Mc(e,t,n),n=n.sibling}function Mc(e,t,n){if(Er&&"function"==typeof Er.onCommitFiberUnmount)try{Er.onCommitFiberUnmount(Cr,n)}catch(e){}switch(n.tag){case 5:mc||bc(n,t);case 6:var r=Tc,o=Dc;Tc=null,Pc(e,t,n),Dc=o,null!==(Tc=r)&&(Dc?(e=Tc,n=n.stateNode,8===e.nodeType?e.parentNode.removeChild(n):e.removeChild(n)):Tc.removeChild(n.stateNode));break;case 18:null!==Tc&&(Dc?(e=Tc,n=n.stateNode,8===e.nodeType?Nl(e.parentNode,n):1===e.nodeType&&Nl(e,n),so(e)):Nl(Tc,n.stateNode));break;case 4:r=Tc,o=Dc,Tc=n.stateNode.containerInfo,Dc=!0,Pc(e,t,n),Tc=r,Dc=o;break;case 0:case 11:case 14:case 15:if(!mc&&(null!==(r=n.updateQueue)&&null!==(r=r.lastEffect))){o=r=r.next;do{var a=o,l=a.destroy;a=a.tag,void 0!==l&&(2&a||4&a)&&yc(n,t,l),o=o.next}while(o!==r)}Pc(e,t,n);break;case 1:if(!mc&&(bc(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){Wd(n,t,e)}Pc(e,t,n);break;case 21:Pc(e,t,n);break;case 22:1&n.mode?(mc=(r=mc)||null!==n.memoizedState,Pc(e,t,n),mc=r):Pc(e,t,n);break;default:Pc(e,t,n)}}function zc(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new gc),t.forEach(function(t){var r=Qd.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function Lc(e,t){var n=t.deletions;if(null!==n)for(var r=0;r<n.length;r++){var o=n[r];try{var a=e,l=t,i=l;e:for(;null!==i;){switch(i.tag){case 5:Tc=i.stateNode,Dc=!1;break e;case 3:case 4:Tc=i.stateNode.containerInfo,Dc=!0;break e}i=i.return}if(null===Tc)throw Error(Ct(160));Mc(a,l,o),Tc=null,Dc=!1;var s=o.alternate;null!==s&&(s.return=null),o.return=null}catch(e){Wd(o,t,e)}}if(12854&t.subtreeFlags)for(t=t.child;null!==t;)Oc(t,e),t=t.sibling}function Oc(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Lc(t,e),Ac(e),4&r){try{xc(3,e,e.return),kc(3,e)}catch(t){Wd(e,e.return,t)}try{xc(5,e,e.return)}catch(t){Wd(e,e.return,t)}}break;case 1:Lc(t,e),Ac(e),512&r&&null!==n&&bc(n,n.return);break;case 5:if(Lc(t,e),Ac(e),512&r&&null!==n&&bc(n,n.return),32&e.flags){var o=e.stateNode;try{Mn(o,"")}catch(t){Wd(e,e.return,t)}}if(4&r&&null!=(o=e.stateNode)){var a=e.memoizedProps,l=null!==n?n.memoizedProps:a,i=e.type,s=e.updateQueue;if(e.updateQueue=null,null!==s)try{"input"===i&&"radio"===a.type&&null!=a.name&&vn(o,a),$n(i,l);var u=$n(i,a);for(l=0;l<s.length;l+=2){var c=s[l],d=s[l+1];"style"===c?An(o,d):"dangerouslySetInnerHTML"===c?Pn(o,d):"children"===c?Mn(o,d):Ft(o,c,d,u)}switch(i){case"input":bn(o,a);break;case"textarea":En(o,a);break;case"select":var f=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!a.multiple;var p=a.value;null!=p?kn(o,!!a.multiple,p,!1):f!==!!a.multiple&&(null!=a.defaultValue?kn(o,!!a.multiple,a.defaultValue,!0):kn(o,!!a.multiple,a.multiple?[]:"",!1))}o[zl]=a}catch(t){Wd(e,e.return,t)}}break;case 6:if(Lc(t,e),Ac(e),4&r){if(null===e.stateNode)throw Error(Ct(162));o=e.stateNode,a=e.memoizedProps;try{o.nodeValue=a}catch(t){Wd(e,e.return,t)}}break;case 3:if(Lc(t,e),Ac(e),4&r&&null!==n&&n.memoizedState.isDehydrated)try{so(t.containerInfo)}catch(t){Wd(e,e.return,t)}break;case 4:default:Lc(t,e),Ac(e);break;case 13:Lc(t,e),Ac(e),8192&(o=e.child).flags&&(a=null!==o.memoizedState,o.stateNode.isHidden=a,!a||null!==o.alternate&&null!==o.alternate.memoizedState||(ld=vr())),4&r&&zc(e);break;case 22:if(c=null!==n&&null!==n.memoizedState,1&e.mode?(mc=(u=mc)||c,Lc(t,e),mc=u):Lc(t,e),Ac(e),8192&r){if(u=null!==e.memoizedState,(e.stateNode.isHidden=u)&&!c&&1&e.mode)for(vc=e,c=e.child;null!==c;){for(d=vc=c;null!==vc;){switch(p=(f=vc).child,f.tag){case 0:case 11:case 14:case 15:xc(4,f,f.return);break;case 1:bc(f,f.return);var h=f.stateNode;if("function"==typeof h.componentWillUnmount){r=f,n=f.return;try{t=r,h.props=t.memoizedProps,h.state=t.memoizedState,h.componentWillUnmount()}catch(e){Wd(r,n,e)}}break;case 5:bc(f,f.return);break;case 22:if(null!==f.memoizedState){Uc(d);continue}}null!==p?(p.return=f,vc=p):Uc(d)}c=c.sibling}e:for(c=null,d=e;;){if(5===d.tag){if(null===c){c=d;try{o=d.stateNode,u?"function"==typeof(a=o.style).setProperty?a.setProperty("display","none","important"):a.display="none":(i=d.stateNode,l=null!=(s=d.memoizedProps.style)&&s.hasOwnProperty("display")?s.display:null,i.style.display=On("display",l))}catch(t){Wd(e,e.return,t)}}}else if(6===d.tag){if(null===c)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(t){Wd(e,e.return,t)}}else if((22!==d.tag&&23!==d.tag||null===d.memoizedState||d===e)&&null!==d.child){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;null===d.sibling;){if(null===d.return||d.return===e)break e;c===d&&(c=null),d=d.return}c===d&&(c=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:Lc(t,e),Ac(e),4&r&&zc(e);case 21:}}function Ac(e){var t=e.flags;if(2&t){try{e:{for(var n=e.return;null!==n;){if(Ec(n)){var r=n;break e}n=n.return}throw Error(Ct(160))}switch(r.tag){case 5:var o=r.stateNode;32&r.flags&&(Mn(o,""),r.flags&=-33),Nc(e,_c(e),o);break;case 3:case 4:var a=r.stateNode.containerInfo;Rc(e,_c(e),a);break;default:throw Error(Ct(161))}}catch(t){Wd(e,e.return,t)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function Ic(e,t,n){vc=e,Fc(e)}function Fc(e,t,n){for(var r=!!(1&e.mode);null!==vc;){var o=vc,a=o.child;if(22===o.tag&&r){var l=null!==o.memoizedState||hc;if(!l){var i=o.alternate,s=null!==i&&null!==i.memoizedState||mc;i=hc;var u=mc;if(hc=l,(mc=s)&&!u)for(vc=o;null!==vc;)s=(l=vc).child,22===l.tag&&null!==l.memoizedState?jc(o):null!==s?(s.return=l,vc=s):jc(o);for(;null!==a;)vc=a,Fc(a),a=a.sibling;vc=o,hc=i,mc=u}$c(e)}else 8772&o.subtreeFlags&&null!==a?(a.return=o,vc=a):$c(e)}}function $c(e){for(;null!==vc;){var t=vc;if(8772&t.flags){var n=t.alternate;try{if(8772&t.flags)switch(t.tag){case 0:case 11:case 15:mc||kc(5,t);break;case 1:var r=t.stateNode;if(4&t.flags&&!mc)if(null===n)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:xu(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;null!==a&&us(t,a,r);break;case 3:var l=t.updateQueue;if(null!==l){if(n=null,null!==t.child)switch(t.child.tag){case 5:case 1:n=t.child.stateNode}us(t,l,n)}break;case 5:var i=t.stateNode;if(null===n&&4&t.flags){n=i;var s=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":s.autoFocus&&n.focus();break;case"img":s.src&&(n.src=s.src)}}break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(null===t.memoizedState){var u=t.alternate;if(null!==u){var c=u.memoizedState;if(null!==c){var d=c.dehydrated;null!==d&&so(d)}}}break;default:throw Error(Ct(163))}mc||512&t.flags&&Sc(t)}catch(e){Wd(t,t.return,e)}}if(t===e){vc=null;break}if(null!==(n=t.sibling)){n.return=t.return,vc=n;break}vc=t.return}}function Uc(e){for(;null!==vc;){var t=vc;if(t===e){vc=null;break}var n=t.sibling;if(null!==n){n.return=t.return,vc=n;break}vc=t.return}}function jc(e){for(;null!==vc;){var t=vc;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{kc(4,t)}catch(e){Wd(t,n,e)}break;case 1:var r=t.stateNode;if("function"==typeof r.componentDidMount){var o=t.return;try{r.componentDidMount()}catch(e){Wd(t,o,e)}}var a=t.return;try{Sc(t)}catch(e){Wd(t,a,e)}break;case 5:var l=t.return;try{Sc(t)}catch(e){Wd(t,l,e)}}}catch(e){Wd(t,t.return,e)}if(t===e){vc=null;break}var i=t.sibling;if(null!==i){i.return=t.return,vc=i;break}vc=t.return}}var Bc,Wc=Math.ceil,Hc=$t.ReactCurrentDispatcher,Vc=$t.ReactCurrentOwner,qc=$t.ReactCurrentBatchConfig,Qc=0,Kc=null,Yc=null,Xc=0,Jc=0,Gc=Hl(0),Zc=0,ed=null,td=0,nd=0,rd=0,od=null,ad=null,ld=0,id=1/0,sd=null,ud=!1,cd=null,dd=null,fd=!1,pd=null,hd=0,md=0,gd=null,vd=-1,bd=0;function yd(){return 6&Qc?vr():-1!==vd?vd:vd=vr()}function wd(e){return 1&e.mode?2&Qc&&0!==Xc?Xc&-Xc:null!==Oi.transition?(0===bd&&(bd=Or()),bd):0!==(e=$r)?e:e=void 0===(e=window.event)?16:vo(e.type):1}function xd(e,t,n,r){if(50<md)throw md=0,gd=null,Error(Ct(185));Ir(e,n,r),2&Qc&&e===Kc||(e===Kc&&(!(2&Qc)&&(nd|=n),4===Zc&&_d(e,Xc)),kd(e,r),1===n&&0===Qc&&!(1&t.mode)&&(id=vr()+500,ai&&si()))}function kd(e,t){var n=e.callbackNode;!function(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,a=e.pendingLanes;0<a;){var l=31-_r(a),i=1<<l,s=o[l];-1===s?0!==(i&n)&&0===(i&r)||(o[l]=zr(i,t)):s<=t&&(e.expiredLanes|=i),a&=~i}}(e,t);var r=Mr(e,e===Kc?Xc:0);if(0===r)null!==n&&hr(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(null!=n&&hr(n),1===t)0===e.tag?function(e){ai=!0,ii(e)}(Rd.bind(null,e)):ii(Rd.bind(null,e)),_l(function(){!(6&Qc)&&si()}),n=null;else{switch(Ur(r)){case 1:n=yr;break;case 4:n=wr;break;case 16:default:n=xr;break;case 536870912:n=Sr}n=Kd(n,Sd.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Sd(e,t){if(vd=-1,bd=0,6&Qc)throw Error(Ct(327));var n=e.callbackNode;if(jd()&&e.callbackNode!==n)return null;var r=Mr(e,e===Kc?Xc:0);if(0===r)return null;if(30&r||0!==(r&e.expiredLanes)||t)t=Od(e,r);else{t=r;var o=Qc;Qc|=2;var a=zd();for(Kc===e&&Xc===t||(sd=null,id=vr()+500,Pd(e,t));;)try{Id();break}catch(t){Md(e,t)}qi(),Hc.current=a,Qc=o,null!==Yc?t=0:(Kc=null,Xc=0,t=Zc)}if(0!==t){if(2===t&&(0!==(o=Lr(e))&&(r=o,t=Cd(e,o))),1===t)throw n=ed,Pd(e,0),_d(e,r),kd(e,vr()),n;if(6===t)_d(e,r);else{if(o=e.current.alternate,!(30&r||function(e){for(var t=e;;){if(16384&t.flags){var n=t.updateQueue;if(null!==n&&null!==(n=n.stores))for(var r=0;r<n.length;r++){var o=n[r],a=o.getSnapshot;o=o.value;try{if(!Ra(a(),o))return!1}catch(e){return!1}}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(o)||(t=Od(e,r),2===t&&(a=Lr(e),0!==a&&(r=a,t=Cd(e,a))),1!==t)))throw n=ed,Pd(e,0),_d(e,r),kd(e,vr()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(Ct(345));case 2:case 5:Ud(e,ad,sd);break;case 3:if(_d(e,r),(130023424&r)===r&&10<(t=ld+500-vr())){if(0!==Mr(e,0))break;if(((o=e.suspendedLanes)&r)!==r){yd(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Sl(Ud.bind(null,e,ad,sd),t);break}Ud(e,ad,sd);break;case 4:if(_d(e,r),(4194240&r)===r)break;for(t=e.eventTimes,o=-1;0<r;){var l=31-_r(r);a=1<<l,(l=t[l])>o&&(o=l),r&=~a}if(r=o,10<(r=(120>(r=vr()-r)?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Wc(r/1960))-r)){e.timeoutHandle=Sl(Ud.bind(null,e,ad,sd),r);break}Ud(e,ad,sd);break;default:throw Error(Ct(329))}}}return kd(e,vr()),e.callbackNode===n?Sd.bind(null,e):null}function Cd(e,t){var n=od;return e.current.memoizedState.isDehydrated&&(Pd(e,t).flags|=256),2!==(e=Od(e,t))&&(t=ad,ad=n,null!==t&&Ed(t)),e}function Ed(e){null===ad?ad=e:ad.push.apply(ad,e)}function _d(e,t){for(t&=~rd,t&=~nd,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-_r(t),r=1<<n;e[n]=-1,t&=~r}}function Rd(e){if(6&Qc)throw Error(Ct(327));jd();var t=Mr(e,0);if(!(1&t))return kd(e,vr()),null;var n=Od(e,t);if(0!==e.tag&&2===n){var r=Lr(e);0!==r&&(t=r,n=Cd(e,r))}if(1===n)throw n=ed,Pd(e,0),_d(e,t),kd(e,vr()),n;if(6===n)throw Error(Ct(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ud(e,ad,sd),kd(e,vr()),null}function Nd(e,t){var n=Qc;Qc|=1;try{return e(t)}finally{0===(Qc=n)&&(id=vr()+500,ai&&si())}}function Td(e){null!==pd&&0===pd.tag&&!(6&Qc)&&jd();var t=Qc;Qc|=1;var n=qc.transition,r=$r;try{if(qc.transition=null,$r=1,e)return e()}finally{$r=r,qc.transition=n,!(6&(Qc=t))&&si()}}function Dd(){Jc=Gc.current,Vl(Gc)}function Pd(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,Cl(n)),null!==Yc)for(n=Yc.return;null!==n;){var r=n;switch(xi(r),r.tag){case 1:null!=(r=r.type.childContextTypes)&&Zl();break;case 3:gs(),Vl(Yl),Vl(Kl),ks();break;case 5:bs(r);break;case 4:gs();break;case 13:case 19:Vl(ys);break;case 10:Qi(r.type._context);break;case 22:case 23:Dd()}n=n.return}if(Kc=e,Yc=e=Gd(e.current,null),Xc=Jc=t,Zc=0,ed=null,rd=nd=td=0,ad=od=null,null!==Ji){for(t=0;t<Ji.length;t++)if(null!==(r=(n=Ji[t]).interleaved)){n.interleaved=null;var o=r.next,a=n.pending;if(null!==a){var l=a.next;a.next=o,r.next=l}n.pending=r}Ji=null}return e}function Md(e,t){for(;;){var n=Yc;try{if(qi(),Ss.current=vu,Ts){for(var r=_s.memoizedState;null!==r;){var o=r.queue;null!==o&&(o.pending=null),r=r.next}Ts=!1}if(Es=0,Ns=Rs=_s=null,Ds=!1,Ps=0,Vc.current=null,null===n||null===n.return){Zc=1,ed=t,Yc=null;break}e:{var a=e,l=n.return,i=n,s=t;if(t=Xc,i.flags|=32768,null!==s&&"object"==typeof s&&"function"==typeof s.then){var u=s,c=i,d=c.tag;if(!(1&c.mode||0!==d&&11!==d&&15!==d)){var f=c.alternate;f?(c.updateQueue=f.updateQueue,c.memoizedState=f.memoizedState,c.lanes=f.lanes):(c.updateQueue=null,c.memoizedState=null)}var p=Ou(l);if(null!==p){p.flags&=-257,Au(p,l,i,0,t),1&p.mode&&Lu(a,u,t),s=u;var h=(t=p).updateQueue;if(null===h){var m=new Set;m.add(s),t.updateQueue=m}else h.add(s);break e}if(!(1&t)){Lu(a,u,t),Ld();break e}s=Error(Ct(426))}else if(Ci&&1&i.mode){var g=Ou(l);if(null!==g){!(65536&g.flags)&&(g.flags|=256),Au(g,l,i,0,t),Li(Nu(s,i));break e}}a=s=Nu(s,i),4!==Zc&&(Zc=2),null===od?od=[a]:od.push(a),a=l;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t,is(a,Mu(0,s,t));break e;case 1:i=s;var v=a.type,b=a.stateNode;if(!(128&a.flags||"function"!=typeof v.getDerivedStateFromError&&(null===b||"function"!=typeof b.componentDidCatch||null!==dd&&dd.has(b)))){a.flags|=65536,t&=-t,a.lanes|=t,is(a,zu(a,i,t));break e}}a=a.return}while(null!==a)}$d(n)}catch(e){t=e,Yc===n&&null!==n&&(Yc=n=n.return);continue}break}}function zd(){var e=Hc.current;return Hc.current=vu,null===e?vu:e}function Ld(){0!==Zc&&3!==Zc&&2!==Zc||(Zc=4),null===Kc||!(268435455&td)&&!(268435455&nd)||_d(Kc,Xc)}function Od(e,t){var n=Qc;Qc|=2;var r=zd();for(Kc===e&&Xc===t||(sd=null,Pd(e,t));;)try{Ad();break}catch(t){Md(e,t)}if(qi(),Qc=n,Hc.current=r,null!==Yc)throw Error(Ct(261));return Kc=null,Xc=0,Zc}function Ad(){for(;null!==Yc;)Fd(Yc)}function Id(){for(;null!==Yc&&!mr();)Fd(Yc)}function Fd(e){var t=Bc(e.alternate,e,Jc);e.memoizedProps=e.pendingProps,null===t?$d(e):Yc=t,Vc.current=null}function $d(e){var t=e;do{var n=t.alternate;if(e=t.return,32768&t.flags){if(null!==(n=pc(n,t)))return n.flags&=32767,void(Yc=n);if(null===e)return Zc=6,void(Yc=null);e.flags|=32768,e.subtreeFlags=0,e.deletions=null}else if(null!==(n=fc(n,t,Jc)))return void(Yc=n);if(null!==(t=t.sibling))return void(Yc=t);Yc=t=e}while(null!==t);0===Zc&&(Zc=5)}function Ud(e,t,n){var r=$r,o=qc.transition;try{qc.transition=null,$r=1,function(e,t,n,r){do{jd()}while(null!==pd);if(6&Qc)throw Error(Ct(327));n=e.finishedWork;var o=e.finishedLanes;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(Ct(177));e.callbackNode=null,e.callbackPriority=0;var a=n.lanes|n.childLanes;if(function(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-_r(n),a=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~a}}(e,a),e===Kc&&(Yc=Kc=null,Xc=0),!(2064&n.subtreeFlags)&&!(2064&n.flags)||fd||(fd=!0,Kd(xr,function(){return jd(),null})),a=!!(15990&n.flags),!!(15990&n.subtreeFlags)||a){a=qc.transition,qc.transition=null;var l=$r;$r=1;var i=Qc;Qc|=4,Vc.current=null,function(e,t){if(wl=co,za(e=Ma())){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{var r=(n=(n=e.ownerDocument)&&n.defaultView||window).getSelection&&n.getSelection();if(r&&0!==r.rangeCount){n=r.anchorNode;var o=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch(e){n=null;break e}var l=0,i=-1,s=-1,u=0,c=0,d=e,f=null;t:for(;;){for(var p;d!==n||0!==o&&3!==d.nodeType||(i=l+o),d!==a||0!==r&&3!==d.nodeType||(s=l+r),3===d.nodeType&&(l+=d.nodeValue.length),null!==(p=d.firstChild);)f=d,d=p;for(;;){if(d===e)break t;if(f===n&&++u===o&&(i=l),f===a&&++c===r&&(s=l),null!==(p=d.nextSibling))break;f=(d=f).parentNode}d=p}n=-1===i||-1===s?null:{start:i,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(xl={focusedElem:e,selectionRange:n},co=!1,vc=t;null!==vc;)if(e=(t=vc).child,1028&t.subtreeFlags&&null!==e)e.return=t,vc=e;else for(;null!==vc;){t=vc;try{var h=t.alternate;if(1024&t.flags)switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==h){var m=h.memoizedProps,g=h.memoizedState,v=t.stateNode,b=v.getSnapshotBeforeUpdate(t.elementType===t.type?m:xu(t.type,m),g);v.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var y=t.stateNode.containerInfo;1===y.nodeType?y.textContent="":9===y.nodeType&&y.documentElement&&y.removeChild(y.documentElement);break;default:throw Error(Ct(163))}}catch(e){Wd(t,t.return,e)}if(null!==(e=t.sibling)){e.return=t.return,vc=e;break}vc=t.return}h=wc,wc=!1}(e,n),Oc(n,e),La(xl),co=!!wl,xl=wl=null,e.current=n,Ic(n),gr(),Qc=i,$r=l,qc.transition=a}else e.current=n;if(fd&&(fd=!1,pd=e,hd=o),a=e.pendingLanes,0===a&&(dd=null),function(e){if(Er&&"function"==typeof Er.onCommitFiberRoot)try{Er.onCommitFiberRoot(Cr,e,void 0,!(128&~e.current.flags))}catch(e){}}(n.stateNode),kd(e,vr()),null!==t)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(ud)throw ud=!1,e=cd,cd=null,e;!!(1&hd)&&0!==e.tag&&jd(),a=e.pendingLanes,1&a?e===gd?md++:(md=0,gd=e):md=0,si()}(e,t,n,r)}finally{qc.transition=o,$r=r}return null}function jd(){if(null!==pd){var e=Ur(hd),t=qc.transition,n=$r;try{if(qc.transition=null,$r=16>e?16:e,null===pd)var r=!1;else{if(e=pd,pd=null,hd=0,6&Qc)throw Error(Ct(331));var o=Qc;for(Qc|=4,vc=e.current;null!==vc;){var a=vc,l=a.child;if(16&vc.flags){var i=a.deletions;if(null!==i){for(var s=0;s<i.length;s++){var u=i[s];for(vc=u;null!==vc;){var c=vc;switch(c.tag){case 0:case 11:case 15:xc(8,c,a)}var d=c.child;if(null!==d)d.return=c,vc=d;else for(;null!==vc;){var f=(c=vc).sibling,p=c.return;if(Cc(c),c===u){vc=null;break}if(null!==f){f.return=p,vc=f;break}vc=p}}}var h=a.alternate;if(null!==h){var m=h.child;if(null!==m){h.child=null;do{var g=m.sibling;m.sibling=null,m=g}while(null!==m)}}vc=a}}if(2064&a.subtreeFlags&&null!==l)l.return=a,vc=l;else e:for(;null!==vc;){if(2048&(a=vc).flags)switch(a.tag){case 0:case 11:case 15:xc(9,a,a.return)}var v=a.sibling;if(null!==v){v.return=a.return,vc=v;break e}vc=a.return}}var b=e.current;for(vc=b;null!==vc;){var y=(l=vc).child;if(2064&l.subtreeFlags&&null!==y)y.return=l,vc=y;else e:for(l=b;null!==vc;){if(2048&(i=vc).flags)try{switch(i.tag){case 0:case 11:case 15:kc(9,i)}}catch(e){Wd(i,i.return,e)}if(i===l){vc=null;break e}var w=i.sibling;if(null!==w){w.return=i.return,vc=w;break e}vc=i.return}}if(Qc=o,si(),Er&&"function"==typeof Er.onPostCommitFiberRoot)try{Er.onPostCommitFiberRoot(Cr,e)}catch(e){}r=!0}return r}finally{$r=n,qc.transition=t}}return!1}function Bd(e,t,n){e=as(e,t=Mu(0,t=Nu(n,t),1),1),t=yd(),null!==e&&(Ir(e,1,t),kd(e,t))}function Wd(e,t,n){if(3===e.tag)Bd(e,e,n);else for(;null!==t;){if(3===t.tag){Bd(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===dd||!dd.has(r))){t=as(t,e=zu(t,e=Nu(n,e),1),1),e=yd(),null!==t&&(Ir(t,1,e),kd(t,e));break}}t=t.return}}function Hd(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=yd(),e.pingedLanes|=e.suspendedLanes&n,Kc===e&&(Xc&n)===n&&(4===Zc||3===Zc&&(130023424&Xc)===Xc&&500>vr()-ld?Pd(e,0):rd|=n),kd(e,t)}function Vd(e,t){0===t&&(1&e.mode?(t=Dr,!(130023424&(Dr<<=1))&&(Dr=4194304)):t=1);var n=yd();null!==(e=es(e,t))&&(Ir(e,t,n),kd(e,n))}function qd(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),Vd(e,n)}function Qd(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;null!==o&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(Ct(314))}null!==r&&r.delete(t),Vd(e,n)}function Kd(e,t){return pr(e,t)}function Yd(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xd(e,t,n,r){return new Yd(e,t,n,r)}function Jd(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Gd(e,t){var n=e.alternate;return null===n?((n=Xd(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Zd(e,t,n,r,o,a){var l=2;if(r=e,"function"==typeof e)Jd(e)&&(l=1);else if("string"==typeof e)l=5;else e:switch(e){case Bt:return ef(n.children,o,a,t);case Wt:l=8,o|=8;break;case Ht:return(e=Xd(12,n,t,2|o)).elementType=Ht,e.lanes=a,e;case Kt:return(e=Xd(13,n,t,o)).elementType=Kt,e.lanes=a,e;case Yt:return(e=Xd(19,n,t,o)).elementType=Yt,e.lanes=a,e;case Gt:return tf(n,o,a,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case Vt:l=10;break e;case qt:l=9;break e;case Qt:l=11;break e;case Xt:l=14;break e;case Jt:l=16,r=null;break e}throw Error(Ct(130,null==e?e:typeof e,""))}return(t=Xd(l,n,t,o)).elementType=e,t.type=r,t.lanes=a,t}function ef(e,t,n,r){return(e=Xd(7,e,r,t)).lanes=n,e}function tf(e,t,n,r){return(e=Xd(22,e,r,t)).elementType=Gt,e.lanes=n,e.stateNode={isHidden:!1},e}function nf(e,t,n){return(e=Xd(6,e,null,t)).lanes=n,e}function rf(e,t,n){return(t=Xd(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function of(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ar(0),this.expirationTimes=Ar(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ar(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function af(e,t,n,r,o,a,l,i,s){return e=new of(e,t,n,i,s),1===t?(t=1,!0===a&&(t|=8)):t=0,a=Xd(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ns(a),e}function lf(e){if(!e)return Ql;e:{if(sr(e=e._reactInternals)!==e||1!==e.tag)throw Error(Ct(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Gl(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(Ct(171))}if(1===e.tag){var n=e.type;if(Gl(n))return ti(e,n,t)}return t}function sf(e,t,n,r,o,a,l,i,s){return(e=af(n,r,!0,e,0,a,0,i,s)).context=lf(null),n=e.current,(a=os(r=yd(),o=wd(n))).callback=null!=t?t:null,as(n,a,o),e.current.lanes=o,Ir(e,o,r),kd(e,r),e}function uf(e,t,n,r){var o=t.current,a=yd(),l=wd(o);return n=lf(n),null===t.context?t.context=n:t.pendingContext=n,(t=os(a,l)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=as(o,t,l))&&(xd(e,o,l,a),ls(e,o,l)),l}function cf(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function df(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function ff(e,t){df(e,t),(e=e.alternate)&&df(e,t)}Bc=function(e,t,n){if(null!==e)if(e.memoizedProps!==t.pendingProps||Yl.current)Fu=!0;else{if(0===(e.lanes&n)&&!(128&t.flags))return Fu=!1,function(e,t,n){switch(t.tag){case 3:Ku(t),zi();break;case 5:vs(t);break;case 1:Gl(t.type)&&ni(t);break;case 4:ms(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;ql(Bi,r._currentValue),r._currentValue=o;break;case 13:if(null!==(r=t.memoizedState))return null!==r.dehydrated?(ql(ys,1&ys.current),t.flags|=128,null):0!==(n&t.child.childLanes)?nc(e,t,n):(ql(ys,1&ys.current),null!==(e=uc(e,t,n))?e.sibling:null);ql(ys,1&ys.current);break;case 19:if(r=0!==(n&t.childLanes),128&e.flags){if(r)return ic(e,t,n);t.flags|=128}if(null!==(o=t.memoizedState)&&(o.rendering=null,o.tail=null,o.lastEffect=null),ql(ys,ys.current),r)break;return null;case 22:case 23:return t.lanes=0,Wu(e,t,n)}return uc(e,t,n)}(e,t,n);Fu=!!(131072&e.flags)}else Fu=!1,Ci&&1048576&t.flags&&yi(t,fi,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;sc(e,t),e=t.pendingProps;var o=Jl(t,Kl.current);Yi(t,n),o=Os(null,t,r,e,o,n);var a=As();return t.flags|=1,"object"==typeof o&&null!==o&&"function"==typeof o.render&&void 0===o.$$typeof?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Gl(r)?(a=!0,ni(t)):a=!1,t.memoizedState=null!==o.state&&void 0!==o.state?o.state:null,ns(t),o.updater=Su,t.stateNode=o,o._reactInternals=t,Ru(t,r,e,n),t=Qu(null,t,r,!0,a,n)):(t.tag=0,Ci&&a&&wi(t),$u(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(sc(e,t),e=t.pendingProps,r=(o=r._init)(r._payload),t.type=r,o=t.tag=function(e){if("function"==typeof e)return Jd(e)?1:0;if(null!=e){if((e=e.$$typeof)===Qt)return 11;if(e===Xt)return 14}return 2}(r),e=xu(r,e),o){case 0:t=Vu(null,t,r,e,n);break e;case 1:t=qu(null,t,r,e,n);break e;case 11:t=Uu(null,t,r,e,n);break e;case 14:t=ju(null,t,r,xu(r.type,e),n);break e}throw Error(Ct(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,Vu(e,t,r,o=t.elementType===r?o:xu(r,o),n);case 1:return r=t.type,o=t.pendingProps,qu(e,t,r,o=t.elementType===r?o:xu(r,o),n);case 3:e:{if(Ku(t),null===e)throw Error(Ct(387));r=t.pendingProps,o=(a=t.memoizedState).element,rs(e,t),ss(t,r,null,n);var l=t.memoizedState;if(r=l.element,a.isDehydrated){if(a={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=a,t.memoizedState=a,256&t.flags){t=Yu(e,t,r,n,o=Nu(Error(Ct(423)),t));break e}if(r!==o){t=Yu(e,t,r,n,o=Nu(Error(Ct(424)),t));break e}for(Si=Tl(t.stateNode.containerInfo.firstChild),ki=t,Ci=!0,Ei=null,n=ji(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(zi(),r===o){t=uc(e,t,n);break e}$u(e,t,r,n)}t=t.child}return t;case 5:return vs(t),null===e&&Ti(t),r=t.type,o=t.pendingProps,a=null!==e?e.memoizedProps:null,l=o.children,kl(r,o)?l=null:null!==a&&kl(r,a)&&(t.flags|=32),Hu(e,t),$u(e,t,l,n),t.child;case 6:return null===e&&Ti(t),null;case 13:return nc(e,t,n);case 4:return ms(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=Ui(t,null,r,n):$u(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,Uu(e,t,r,o=t.elementType===r?o:xu(r,o),n);case 7:return $u(e,t,t.pendingProps,n),t.child;case 8:case 12:return $u(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,a=t.memoizedProps,l=o.value,ql(Bi,r._currentValue),r._currentValue=l,null!==a)if(Ra(a.value,l)){if(a.children===o.children&&!Yl.current){t=uc(e,t,n);break e}}else for(null!==(a=t.child)&&(a.return=t);null!==a;){var i=a.dependencies;if(null!==i){l=a.child;for(var s=i.firstContext;null!==s;){if(s.context===r){if(1===a.tag){(s=os(-1,n&-n)).tag=2;var u=a.updateQueue;if(null!==u){var c=(u=u.shared).pending;null===c?s.next=s:(s.next=c.next,c.next=s),u.pending=s}}a.lanes|=n,null!==(s=a.alternate)&&(s.lanes|=n),Ki(a.return,n,t),i.lanes|=n;break}s=s.next}}else if(10===a.tag)l=a.type===t.type?null:a.child;else if(18===a.tag){if(null===(l=a.return))throw Error(Ct(341));l.lanes|=n,null!==(i=l.alternate)&&(i.lanes|=n),Ki(l,n,t),l=a.sibling}else l=a.child;if(null!==l)l.return=a;else for(l=a;null!==l;){if(l===t){l=null;break}if(null!==(a=l.sibling)){a.return=l.return,l=a;break}l=l.return}a=l}$u(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Yi(t,n),r=r(o=Xi(o)),t.flags|=1,$u(e,t,r,n),t.child;case 14:return o=xu(r=t.type,t.pendingProps),ju(e,t,r,o=xu(r.type,o),n);case 15:return Bu(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:xu(r,o),sc(e,t),t.tag=1,Gl(r)?(e=!0,ni(t)):e=!1,Yi(t,n),Eu(t,r,o),Ru(t,r,o,n),Qu(null,t,r,!0,e,n);case 19:return ic(e,t,n);case 22:return Wu(e,t,n)}throw Error(Ct(156,t.tag))};var pf="function"==typeof reportError?reportError:function(e){console.error(e)};function hf(e){this._internalRoot=e}function mf(e){this._internalRoot=e}function gf(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function vf(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function bf(){}function yf(e,t,n,r,o){var a=n._reactRootContainer;if(a){var l=a;if("function"==typeof o){var i=o;o=function(){var e=cf(l);i.call(e)}}uf(t,l,e,o)}else l=function(e,t,n,r,o){if(o){if("function"==typeof r){var a=r;r=function(){var e=cf(l);a.call(e)}}var l=sf(t,r,e,0,null,!1,0,"",bf);return e._reactRootContainer=l,e[Ll]=l.current,sl(8===e.nodeType?e.parentNode:e),Td(),l}for(;o=e.lastChild;)e.removeChild(o);if("function"==typeof r){var i=r;r=function(){var e=cf(s);i.call(e)}}var s=af(e,0,!1,null,0,!1,0,"",bf);return e._reactRootContainer=s,e[Ll]=s.current,sl(8===e.nodeType?e.parentNode:e),Td(function(){uf(t,s,n,r)}),s}(n,t,e,o,r);return cf(l)}mf.prototype.render=hf.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(Ct(409));uf(e,t,null,null)},mf.prototype.unmount=hf.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;Td(function(){uf(null,e,null,null)}),t[Ll]=null}},mf.prototype.unstable_scheduleHydration=function(e){if(e){var t=Hr();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Zr.length&&0!==t&&t<Zr[n].priority;n++);Zr.splice(n,0,e),0===n&&ro(e)}},jr=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Pr(t.pendingLanes);0!==n&&(Fr(t,1|n),kd(t,vr()),!(6&Qc)&&(id=vr()+500,si()))}break;case 13:Td(function(){var t=es(e,1);if(null!==t){var n=yd();xd(t,e,1,n)}}),ff(e,1)}},Br=function(e){if(13===e.tag){var t=es(e,134217728);if(null!==t)xd(t,e,134217728,yd());ff(e,134217728)}},Wr=function(e){if(13===e.tag){var t=wd(e),n=es(e,t);if(null!==n)xd(n,e,t,yd());ff(e,t)}},Hr=function(){return $r},Vr=function(e,t){var n=$r;try{return $r=e,t()}finally{$r=n}},Bn=function(e,t,n){switch(t){case"input":if(bn(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=jl(r);if(!o)throw Error(Ct(90));pn(r),bn(r,o)}}}break;case"textarea":En(e,n);break;case"select":null!=(t=n.value)&&kn(e,!!n.multiple,t,!1)}},Kn=Nd,Yn=Td;var wf={usingClientEntryPoint:!1,Events:[$l,Ul,jl,qn,Qn,Nd]},xf={findFiberByHostInstance:Fl,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},kf={bundleType:xf.bundleType,version:xf.version,rendererPackageName:xf.rendererPackageName,rendererConfig:xf.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:$t.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=dr(e))?null:e.stateNode},findFiberByHostInstance:xf.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var Sf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Sf.isDisabled&&Sf.supportsFiber)try{Cr=Sf.inject(kf),Er=Sf}catch(Dn){}}yt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=wf,yt.createPortal=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!gf(t))throw Error(Ct(200));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:jt,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)},yt.createRoot=function(e,t){if(!gf(e))throw Error(Ct(299));var n=!1,r="",o=pf;return null!=t&&(!0===t.unstable_strictMode&&(n=!0),void 0!==t.identifierPrefix&&(r=t.identifierPrefix),void 0!==t.onRecoverableError&&(o=t.onRecoverableError)),t=af(e,1,!1,null,0,n,0,r,o),e[Ll]=t.current,sl(8===e.nodeType?e.parentNode:e),new hf(t)},yt.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(Ct(188));throw e=Object.keys(e).join(","),Error(Ct(268,e))}return e=null===(e=dr(t))?null:e.stateNode},yt.flushSync=function(e){return Td(e)},yt.hydrate=function(e,t,n){if(!vf(t))throw Error(Ct(200));return yf(null,e,t,!0,n)},yt.hydrateRoot=function(e,t,n){if(!gf(e))throw Error(Ct(405));var r=null!=n&&n.hydratedSources||null,o=!1,a="",l=pf;if(null!=n&&(!0===n.unstable_strictMode&&(o=!0),void 0!==n.identifierPrefix&&(a=n.identifierPrefix),void 0!==n.onRecoverableError&&(l=n.onRecoverableError)),t=sf(t,null,e,1,null!=n?n:null,o,0,a,l),e[Ll]=t.current,sl(e),r)for(e=0;e<r.length;e++)o=(o=(n=r[e])._getVersion)(n._source),null==t.mutableSourceEagerHydrationData?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new mf(t)},yt.render=function(e,t,n){if(!vf(t))throw Error(Ct(200));return yf(null,e,t,!1,n)},yt.unmountComponentAtNode=function(e){if(!vf(e))throw Error(Ct(40));return!!e._reactRootContainer&&(Td(function(){yf(null,null,e,!1,function(){e._reactRootContainer=null,e[Ll]=null})}),!0)},yt.unstable_batchedUpdates=Nd,yt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!vf(n))throw Error(Ct(200));if(null==e||void 0===e._reactInternals)throw Error(Ct(38));return yf(e,t,n,!1,r)},yt.version="18.3.1-next-f1338f8080-20240426",function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),bt.exports=yt;var Cf=bt.exports;const Ef="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function _f(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function Rf(e){return"nodeType"in e}function Nf(e){var t,n;return e?_f(e)?e:Rf(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function Tf(e){const{Document:t}=Nf(e);return e instanceof t}function Df(e){return!_f(e)&&e instanceof Nf(e).HTMLElement}function Pf(e){return e instanceof Nf(e).SVGElement}function Mf(e){return e?_f(e)?e.document:Rf(e)?Tf(e)?e:Df(e)||Pf(e)?e.ownerDocument:document:document:document}const zf=Ef?m.exports.useLayoutEffect:m.exports.useEffect;function Lf(e){const t=m.exports.useRef(e);return zf(()=>{t.current=e}),m.exports.useCallback(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 Of(e,t){void 0===t&&(t=[e]);const n=m.exports.useRef(e);return zf(()=>{n.current!==e&&(n.current=e)},t),n}function Af(e,t){const n=m.exports.useRef();return m.exports.useMemo(()=>{const t=e(n.current);return n.current=t,t},[...t])}function If(e){const t=Lf(e),n=m.exports.useRef(null),r=m.exports.useCallback(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,r]}function Ff(e){const t=m.exports.useRef();return m.exports.useEffect(()=>{t.current=e},[e]),t.current}let $f={};function Uf(e,t){return m.exports.useMemo(()=>{if(t)return t;const n=null==$f[e]?0:$f[e]+1;return $f[e]=n,e+"-"+n},[e,t])}function jf(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 Bf=jf(1),Wf=jf(-1);function Hf(e){if(!e)return!1;const{KeyboardEvent:t}=Nf(e.target);return t&&e instanceof t}function Vf(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=Nf(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 qf=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[qf.Translate.toString(e),qf.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Qf="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Kf(e){return e.matches(Qf)?e:e.querySelector(Qf)}const Yf={display:"none"};function Xf(e){let{id:t,value:n}=e;return J.createElement("div",{id:t,style:Yf},n)}function Jf(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;return J.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 Gf=m.exports.createContext(null);const Zf={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 "},ep={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 tp(e){let{announcements:t=ep,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=Zf}=e;const{announce:a,announcement:l}=function(){const[e,t]=m.exports.useState("");return{announce:m.exports.useCallback(e=>{null!=e&&t(e)},[]),announcement:e}}(),i=Uf("DndLiveRegion"),[s,u]=m.exports.useState(!1);if(m.exports.useEffect(()=>{u(!0)},[]),function(e){const t=m.exports.useContext(Gf);m.exports.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}(m.exports.useMemo(()=>({onDragStart(e){let{active:n}=e;a(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&a(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;a(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;a(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;a(t.onDragCancel({active:n,over:r}))}}),[a,t])),!s)return null;const c=J.createElement(J.Fragment,null,J.createElement(Xf,{id:r,value:o.draggable}),J.createElement(Jf,{id:i,announcement:l}));return n?bt.exports.createPortal(c,n):c}var np;function rp(){}!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"}(np||(np={}));const op=Object.freeze({x:0,y:0});function ap(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function lp(e,t){const n=Vf(e);if(!n)return"0 0";return(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%"}function ip(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function sp(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function up(e,t,n){return void 0===t&&(t=e.left),void 0===n&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const cp=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=up(t,t.left,t.top),a=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=ap(up(r),o);a.push({id:t,data:{droppableContainer:e,value:n}})}}return a.sort(ip)};function dp(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),a=Math.min(t.top+t.height,e.top+e.height),l=o-r,i=a-n;if(r<o&&n<a){const n=t.width*t.height,r=e.width*e.height,o=l*i;return Number((o/(n+r-o)).toFixed(4))}return 0}const fp=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const e of r){const{id:r}=e,a=n.get(r);if(a){const n=dp(a,t);n>0&&o.push({id:r,data:{droppableContainer:e,value:n}})}}return o.sort(sp)};function pp(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:op}const hp=(mp=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+mp*t.y,bottom:e.bottom+mp*t.y,left:e.left+mp*t.x,right:e.right+mp*t.x}),{...e})});var mp;function gp(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 vp={ignoreTransform:!1};function bp(e,t){void 0===t&&(t=vp);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=Nf(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=gp(t);if(!r)return e;const{scaleX:o,scaleY:a,x:l,y:i}=r,s=e.left-l-(1-o)*parseFloat(n),u=e.top-i-(1-a)*parseFloat(n.slice(n.indexOf(" ")+1)),c=o?e.width/o:e.width,d=a?e.height/a:e.height;return{width:c,height:d,top:u,right:s+c,bottom:u+d,left:s}}(n,t,r))}const{top:r,left:o,width:a,height:l,bottom:i,right:s}=n;return{top:r,left:o,width:a,height:l,bottom:i,right:s}}function yp(e){return bp(e,{ignoreTransform:!0})}function wp(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if(Tf(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Df(o)||Pf(o))return n;if(n.includes(o))return n;const a=Nf(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=Nf(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,a)&&n.push(o),function(e,t){return void 0===t&&(t=Nf(e).getComputedStyle(e)),"fixed"===t.position}(o,a)?n:r(o.parentNode)}(e):n}function xp(e){const[t]=wp(e,1);return null!=t?t:null}function kp(e){return Ef&&e?_f(e)?e:Rf(e)?Tf(e)||e===Mf(e).scrollingElement?window:Df(e)?e:null:null:null}function Sp(e){return _f(e)?e.scrollX:e.scrollLeft}function Cp(e){return _f(e)?e.scrollY:e.scrollTop}function Ep(e){return{x:Sp(e),y:Cp(e)}}var _p;function Rp(e){return!(!Ef||!e)&&e===document.scrollingElement}function Np(e){const t={x:0,y:0},n=Rp(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"}(_p||(_p={}));const Tp={x:.2,y:.2};function Dp(e,t,n,r,o){let{top:a,left:l,right:i,bottom:s}=n;void 0===r&&(r=10),void 0===o&&(o=Tp);const{isTop:u,isBottom:c,isLeft:d,isRight:f}=Np(e),p={x:0,y:0},h={x:0,y:0},m=t.height*o.y,g=t.width*o.x;return!u&&a<=t.top+m?(p.y=_p.Backward,h.y=r*Math.abs((t.top+m-a)/m)):!c&&s>=t.bottom-m&&(p.y=_p.Forward,h.y=r*Math.abs((t.bottom-m-s)/m)),!f&&i>=t.right-g?(p.x=_p.Forward,h.x=r*Math.abs((t.right-g-i)/g)):!d&&l<=t.left+g&&(p.x=_p.Backward,h.x=r*Math.abs((t.left+g-l)/g)),{direction:p,speed:h}}function Pp(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 Mp(e){return e.reduce((e,t)=>Bf(e,Ep(t)),op)}function zp(e,t){if(void 0===t&&(t=bp),!e)return;const{top:n,left:r,bottom:o,right:a}=t(e);xp(e)&&(o<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Lp=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+Sp(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+Cp(t),0)}]];class Op{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=wp(t),r=Mp(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of Lp)for(const a of t)Object.defineProperty(this,a,{get:()=>{const t=o(n),l=r[e]-t;return this.rect[a]+l},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Ap{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 Ip(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 Fp,$p;function Up(e){e.preventDefault()}function jp(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"}(Fp||(Fp={})),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"}($p||($p={}));const Bp={start:[$p.Space,$p.Enter],cancel:[$p.Esc],end:[$p.Space,$p.Enter,$p.Tab]},Wp=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case $p.Right:return{...n,x:n.x+25};case $p.Left:return{...n,x:n.x-25};case $p.Down:return{...n,y:n.y+25};case $p.Up:return{...n,y:n.y-25}}};class Hp{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 Ap(Mf(t)),this.windowListeners=new Ap(Nf(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Fp.Resize,this.handleCancel),this.windowListeners.add(Fp.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Fp.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&zp(n),t(op)}handleKeyDown(e){if(Hf(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=Bp,coordinateGetter:a=Wp,scrollBehavior:l="smooth"}=r,{code:i}=e;if(o.end.includes(i))return void this.handleEnd(e);if(o.cancel.includes(i))return void this.handleCancel(e);const{collisionRect:s}=n.current,u=s?{x:s.left,y:s.top}:op;this.referenceCoordinates||(this.referenceCoordinates=u);const c=a(e,{active:t,context:n.current,currentCoordinates:u});if(c){const t=Wf(c,u),r={x:0,y:0},{scrollableAncestors:o}=n.current;for(const n of o){const o=e.code,{isTop:a,isRight:i,isLeft:s,isBottom:u,maxScroll:d,minScroll:f}=Np(n),p=Pp(n),h={x:Math.min(o===$p.Right?p.right-p.width/2:p.right,Math.max(o===$p.Right?p.left:p.left+p.width/2,c.x)),y:Math.min(o===$p.Down?p.bottom-p.height/2:p.bottom,Math.max(o===$p.Down?p.top:p.top+p.height/2,c.y))},m=o===$p.Right&&!i||o===$p.Left&&!s,g=o===$p.Down&&!u||o===$p.Up&&!a;if(m&&h.x!==c.x){const e=n.scrollLeft+t.x,a=o===$p.Right&&e<=d.x||o===$p.Left&&e>=f.x;if(a&&!t.y)return void n.scrollTo({left:e,behavior:l});r.x=a?n.scrollLeft-e:o===$p.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:l});break}if(g&&h.y!==c.y){const e=n.scrollTop+t.y,a=o===$p.Down&&e<=d.y||o===$p.Up&&e>=f.y;if(a&&!t.x)return void n.scrollTo({top:e,behavior:l});r.y=a?n.scrollTop-e:o===$p.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:l});break}}this.handleMove(e,Bf(Wf(c,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 Vp(e){return Boolean(e&&"distance"in e)}function qp(e){return Boolean(e&&"delay"in e)}Hp.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Bp,onActivation:o}=t,{active:a}=n;const{code:l}=e.nativeEvent;if(r.start.includes(l)){const t=a.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==o||o({event:e.nativeEvent}),!0)}return!1}}];class Qp{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=Nf(e);return e instanceof t?e:Mf(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:a}=o;this.props=e,this.events=t,this.document=Mf(a),this.documentListeners=new Ap(this.document),this.listeners=new Ap(n),this.windowListeners=new Ap(Nf(a)),this.initialCoordinates=null!=(r=Vf(o))?r:op,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(Fp.Resize,this.handleCancel),this.windowListeners.add(Fp.DragStart,Up),this.windowListeners.add(Fp.VisibilityChange,this.handleCancel),this.windowListeners.add(Fp.ContextMenu,Up),this.documentListeners.add(Fp.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(qp(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(Vp(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(Fp.Click,jp,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Fp.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:o}=this,{onMove:a,options:{activationConstraint:l}}=o;if(!r)return;const i=null!=(t=Vf(e))?t:op,s=Wf(r,i);if(!n&&l){if(Vp(l)){if(null!=l.tolerance&&Ip(s,l.tolerance))return this.handleCancel();if(Ip(s,l.distance))return this.handleStart()}return qp(l)&&Ip(s,l.tolerance)?this.handleCancel():void this.handlePending(l,s)}e.cancelable&&e.preventDefault(),a(i)}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===$p.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const Kp={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Yp extends Qp{constructor(e){const{event:t}=e,n=Mf(t.target);super(e,Kp,n)}}Yp.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 Xp={move:{name:"mousemove"},end:{name:"mouseup"}};var Jp;!function(e){e[e.RightClick=2]="RightClick"}(Jp||(Jp={}));(class extends Qp{constructor(e){super(e,Xp,Mf(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==Jp.RightClick&&(null==r||r({event:n}),!0)}}];const Gp={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var Zp,eh;function th(e){let{acceleration:t,activator:n=Zp.Pointer,canScroll:r,draggingRect:o,enabled:a,interval:l=5,order:i=eh.TreeOrder,pointerCoordinates:s,scrollableAncestors:u,scrollableAncestorRects:c,delta:d,threshold:f}=e;const p=function(e){let{delta:t,disabled:n}=e;const r=Ff(t);return Af(e=>{if(n||!r||!e)return nh;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[_p.Backward]:e.x[_p.Backward]||-1===o.x,[_p.Forward]:e.x[_p.Forward]||1===o.x},y:{[_p.Backward]:e.y[_p.Backward]||-1===o.y,[_p.Forward]:e.y[_p.Forward]||1===o.y}}},[n,t,r])}({delta:d,disabled:!a}),[h,g]=function(){const e=m.exports.useRef(null);return[m.exports.useCallback((t,n)=>{e.current=setInterval(t,n)},[]),m.exports.useCallback(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}(),v=m.exports.useRef({x:0,y:0}),b=m.exports.useRef({x:0,y:0}),y=m.exports.useMemo(()=>{switch(n){case Zp.Pointer:return s?{top:s.y,bottom:s.y,left:s.x,right:s.x}:null;case Zp.DraggableRect:return o}},[n,o,s]),w=m.exports.useRef(null),x=m.exports.useCallback(()=>{const e=w.current;if(!e)return;const t=v.current.x*b.current.x,n=v.current.y*b.current.y;e.scrollBy(t,n)},[]),k=m.exports.useMemo(()=>i===eh.TreeOrder?[...u].reverse():u,[i,u]);m.exports.useEffect(()=>{if(a&&u.length&&y){for(const e of k){if(!1===(null==r?void 0:r(e)))continue;const n=u.indexOf(e),o=c[n];if(!o)continue;const{direction:a,speed:i}=Dp(e,o,y,t,f);for(const e of["x","y"])p[e][a[e]]||(i[e]=0,a[e]=0);if(i.x>0||i.y>0)return g(),w.current=e,h(x,l),v.current=i,void(b.current=a)}v.current={x:0,y:0},b.current={x:0,y:0},g()}else g()},[t,x,r,g,a,l,JSON.stringify(y),JSON.stringify(p),h,u,k,c,JSON.stringify(f)])}(class extends Qp{constructor(e){super(e,Gp)}static setup(){return window.addEventListener(Gp.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Gp.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"}(Zp||(Zp={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(eh||(eh={}));const nh={x:{[_p.Backward]:!1,[_p.Forward]:!1},y:{[_p.Backward]:!1,[_p.Forward]:!1}};var rh,oh;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(rh||(rh={})),function(e){e.Optimized="optimized"}(oh||(oh={}));const ah=new Map;function lh(e,t){return Af(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function ih(e){let{callback:t,disabled:n}=e;const r=Lf(t),o=m.exports.useMemo(()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(r)},[n]);return m.exports.useEffect(()=>()=>null==o?void 0:o.disconnect(),[o]),o}function sh(e){return new Op(bp(e),e)}function uh(e,t,n){void 0===t&&(t=sh);const[r,o]=m.exports.useState(null);function a(){o(r=>{if(!e)return null;var o;if(!1===e.isConnected)return null!=(o=null!=r?r:n)?o:null;const a=t(e);return JSON.stringify(r)===JSON.stringify(a)?r:a})}const l=function(e){let{callback:t,disabled:n}=e;const r=Lf(t),o=m.exports.useMemo(()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(r)},[r,n]);return m.exports.useEffect(()=>()=>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)){a();break}}}}),i=ih({callback:a});return zf(()=>{a(),e?(null==i||i.observe(e),null==l||l.observe(document.body,{childList:!0,subtree:!0})):(null==i||i.disconnect(),null==l||l.disconnect())},[e]),r}const ch=[];function dh(e,t){void 0===t&&(t=[]);const n=m.exports.useRef(null);return m.exports.useEffect(()=>{n.current=null},t),m.exports.useEffect(()=>{const t=e!==op;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?Wf(e,n.current):op}function fh(e){return m.exports.useMemo(()=>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 ph=[];function hh(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Df(t)?t:e}const mh=[{sensor:Yp,options:{}},{sensor:Hp,options:{}}],gh={current:{}},vh={draggable:{measure:yp},droppable:{measure:yp,strategy:rh.WhileDragging,frequency:oh.Optimized},dragOverlay:{measure:bp}};class bh 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 yh={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new bh,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:rp},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:vh,measureDroppableContainers:rp,windowRect:null,measuringScheduled:!1},wh={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:rp,draggableNodes:new Map,over:null,measureDroppableContainers:rp},xh=m.exports.createContext(wh),kh=m.exports.createContext(yh);function Sh(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new bh}}}function Ch(e,t){switch(t.type){case np.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case np.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 np.DragEnd:case np.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case np.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new bh(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case np.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;const l=new bh(e.droppable.containers);return l.set(n,{...a,disabled:o}),{...e,droppable:{...e.droppable,containers:l}}}case np.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const a=new bh(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function Eh(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=m.exports.useContext(xh),a=Ff(r),l=Ff(null==n?void 0:n.id);return m.exports.useEffect(()=>{if(!t&&!r&&a&&null!=l){if(!Hf(a))return;if(document.activeElement===a.target)return;const e=o.get(l);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=Kf(e);if(t){t.focus();break}}})}},[r,t,o,l,a]),null}function _h(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}const Rh=m.exports.createContext({...op,scaleX:1,scaleY:1});var Nh;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(Nh||(Nh={})),m.exports.memo(function(e){var t,n,r,o;let{id:a,accessibility:l,autoScroll:i=!0,children:s,sensors:u=mh,collisionDetection:c=fp,measuring:d,modifiers:f,...p}=e;const h=m.exports.useReducer(Ch,void 0,Sh),[g,v]=h,[b,y]=function(){const[e]=m.exports.useState(()=>new Set),t=m.exports.useCallback(t=>(e.add(t),()=>e.delete(t)),[e]);return[m.exports.useCallback(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]}(),[w,x]=m.exports.useState(Nh.Uninitialized),k=w===Nh.Initialized,{draggable:{active:S,nodes:C,translate:E},droppable:{containers:_}}=g,R=null!=S?C.get(S):null,N=m.exports.useRef({initial:null,translated:null}),T=m.exports.useMemo(()=>{var e;return null!=S?{id:S,data:null!=(e=null==R?void 0:R.data)?e:gh,rect:N}:null},[S,R]),D=m.exports.useRef(null),[P,M]=m.exports.useState(null),[z,L]=m.exports.useState(null),O=Of(p,Object.values(p)),A=Uf("DndDescribedBy",a),I=m.exports.useMemo(()=>_.getEnabled(),[_]),F=($=d,m.exports.useMemo(()=>({draggable:{...vh.draggable,...null==$?void 0:$.draggable},droppable:{...vh.droppable,...null==$?void 0:$.droppable},dragOverlay:{...vh.dragOverlay,...null==$?void 0:$.dragOverlay}}),[null==$?void 0:$.draggable,null==$?void 0:$.droppable,null==$?void 0:$.dragOverlay]));var $;const{droppableRects:U,measureDroppableContainers:j,measuringScheduled:B}=function(e,t){let{dragging:n,dependencies:r,config:o}=t;const[a,l]=m.exports.useState(null),{frequency:i,measure:s,strategy:u}=o,c=m.exports.useRef(e),d=function(){switch(u){case rh.Always:return!1;case rh.BeforeDragging:return n;default:return!n}}(),f=Of(d),p=m.exports.useCallback(function(e){void 0===e&&(e=[]),f.current||l(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[f]),h=m.exports.useRef(null),g=Af(t=>{if(d&&!n)return ah;if(!t||t===ah||c.current!==e||null!=a){const t=new Map;for(let n of e){if(!n)continue;if(a&&a.length>0&&!a.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,r=e?new Op(s(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,a,n,d,s]);return m.exports.useEffect(()=>{c.current=e},[e]),m.exports.useEffect(()=>{d||p()},[n,d]),m.exports.useEffect(()=>{a&&a.length>0&&l(null)},[JSON.stringify(a)]),m.exports.useEffect(()=>{d||"number"!=typeof i||null!==h.current||(h.current=setTimeout(()=>{p(),h.current=null},i))},[i,d,p,...r]),{droppableRects:g,measureDroppableContainers:p,measuringScheduled:null!=a}}(I,{dragging:k,dependencies:[E.x,E.y],config:F.droppable}),W=function(e,t){const n=null!=t?e.get(t):void 0,r=n?n.node.current:null;return Af(e=>{var n;return null==t?null:null!=(n=null!=r?r:e)?n:null},[r,t])}(C,S),H=m.exports.useMemo(()=>z?Vf(z):null,[z]),V=function(){const e=!1===(null==P?void 0:P.autoScrollEnabled),t="object"==typeof i?!1===i.enabled:!1===i,n=k&&!e&&!t;if("object"==typeof i)return{...i,enabled:n};return{enabled:n}}(),q=function(e,t){return lh(e,t)}(W,F.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const a=m.exports.useRef(!1),{x:l,y:i}="boolean"==typeof o?{x:o,y:o}:o;zf(()=>{if(!l&&!i||!t)return void(a.current=!1);if(a.current||!r)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const o=pp(n(e),r);if(l||(o.x=0),i||(o.y=0),a.current=!0,Math.abs(o.x)>0||Math.abs(o.y)>0){const t=xp(e);t&&t.scrollBy({top:o.y,left:o.x})}},[t,l,i,r,n])}({activeNode:null!=S?C.get(S):null,config:V.layoutShiftCompensation,initialRect:q,measure:F.draggable.measure});const Q=uh(W,F.draggable.measure,q),K=uh(W?W.parentElement:null),Y=m.exports.useRef({activatorEvent:null,active:null,activeNode:W,collisionRect:null,collisions:null,droppableRects:U,draggableNodes:C,draggingNode:null,draggingNodeRect:null,droppableContainers:_,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),X=_.getNodeFor(null==(t=Y.current.over)?void 0:t.id),G=function(e){let{measure:t}=e;const[n,r]=m.exports.useState(null),o=ih({callback:m.exports.useCallback(e=>{for(const{target:n}of e)if(Df(n)){r(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),a=m.exports.useCallback(e=>{const n=hh(e);null==o||o.disconnect(),n&&(null==o||o.observe(n)),r(n?t(n):null)},[t,o]),[l,i]=If(a);return m.exports.useMemo(()=>({nodeRef:l,rect:n,setRef:i}),[n,l,i])}({measure:F.dragOverlay.measure}),Z=null!=(n=G.nodeRef.current)?n:W,ee=k?null!=(r=G.rect)?r:Q:null,te=Boolean(G.nodeRef.current&&G.rect),ne=pp(re=te?null:Q,lh(re));var re;const oe=fh(Z?Nf(Z):null),ae=function(e){const t=m.exports.useRef(e),n=Af(n=>e?n&&n!==ch&&e&&t.current&&e.parentNode===t.current.parentNode?n:wp(e):ch,[e]);return m.exports.useEffect(()=>{t.current=e},[e]),n}(k?null!=X?X:W:null),le=function(e,t){void 0===t&&(t=bp);const[n]=e,r=fh(n?Nf(n):null),[o,a]=m.exports.useState(ph);function l(){a(()=>e.length?e.map(e=>Rp(e)?r:new Op(t(e),e)):ph)}const i=ih({callback:l});return zf(()=>{null==i||i.disconnect(),l(),e.forEach(e=>null==i?void 0:i.observe(e))},[e]),o}(ae),ie=_h(f,{transform:{x:E.x-ne.x,y:E.y-ne.y,scaleX:1,scaleY:1},activatorEvent:z,active:T,activeNodeRect:Q,containerNodeRect:K,draggingNodeRect:ee,over:Y.current.over,overlayNodeRect:G.rect,scrollableAncestors:ae,scrollableAncestorRects:le,windowRect:oe}),se=H?Bf(H,E):null,ue=function(e){const[t,n]=m.exports.useState(null),r=m.exports.useRef(e),o=m.exports.useCallback(e=>{const t=kp(e.target);t&&n(e=>e?(e.set(t,Ep(t)),new Map(e)):null)},[]);return m.exports.useEffect(()=>{const t=r.current;if(e!==t){a(t);const l=e.map(e=>{const t=kp(e);return t?(t.addEventListener("scroll",o,{passive:!0}),[t,Ep(t)]):null}).filter(e=>null!=e);n(l.length?new Map(l):null),r.current=e}return()=>{a(e),a(t)};function a(e){e.forEach(e=>{const t=kp(e);null==t||t.removeEventListener("scroll",o)})}},[o,e]),m.exports.useMemo(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>Bf(e,t),op):Mp(e):op,[e,t])}(ae),ce=dh(ue),de=dh(ue,[Q]),fe=Bf(ie,ce),pe=ee?hp(ee,ie):null,he=T&&pe?c({active:T,collisionRect:pe,droppableRects:U,droppableContainers:I,pointerCoordinates:se}):null,me=function(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}(he,"id"),[ge,ve]=m.exports.useState(null),be=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(te?ie:Bf(ie,de),null!=(o=null==ge?void 0:ge.rect)?o:null,Q),ye=m.exports.useRef(null),we=m.exports.useCallback((e,t)=>{let{sensor:n,options:r}=t;if(null==D.current)return;const o=C.get(D.current);if(!o)return;const a=e.nativeEvent,l=new n({active:D.current,activeNode:o,event:a,options:r,context:Y,onAbort(e){if(!C.get(e))return;const{onDragAbort:t}=O.current,n={id:e};null==t||t(n),b({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!C.get(e))return;const{onDragPending:o}=O.current,a={id:e,constraint:t,initialCoordinates:n,offset:r};null==o||o(a),b({type:"onDragPending",event:a})},onStart(e){const t=D.current;if(null==t)return;const n=C.get(t);if(!n)return;const{onDragStart:r}=O.current,o={activatorEvent:a,active:{id:t,data:n.data,rect:N}};bt.exports.unstable_batchedUpdates(()=>{null==r||r(o),x(Nh.Initializing),v({type:np.DragStart,initialCoordinates:e,active:t}),b({type:"onDragStart",event:o}),M(ye.current),L(a)})},onMove(e){v({type:np.DragMove,coordinates:e})},onEnd:i(np.DragEnd),onCancel:i(np.DragCancel)});function i(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:o}=Y.current;let l=null;if(t&&o){const{cancelDrop:i}=O.current;if(l={activatorEvent:a,active:t,collisions:n,delta:o,over:r},e===np.DragEnd&&"function"==typeof i){await Promise.resolve(i(l))&&(e=np.DragCancel)}}D.current=null,bt.exports.unstable_batchedUpdates(()=>{v({type:e}),x(Nh.Uninitialized),ve(null),M(null),L(null),ye.current=null;const t=e===np.DragEnd?"onDragEnd":"onDragCancel";if(l){const e=O.current[t];null==e||e(l),b({type:t,event:l})}})}}ye.current=l},[C]),xe=m.exports.useCallback((e,t)=>(n,r)=>{const o=n.nativeEvent,a=C.get(r);if(null!==D.current||!a||o.dndKit||o.defaultPrevented)return;const l={active:a};!0===e(n,t.options,l)&&(o.dndKit={capturedBy:t.sensor},D.current=r,we(n,t))},[C,we]),ke=function(e,t){return m.exports.useMemo(()=>e.reduce((e,n)=>{const{sensor:r}=n;return[...e,...r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}))]},[]),[e,t])}(u,xe);!function(e){m.exports.useEffect(()=>{if(!Ef)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}))}(u),zf(()=>{Q&&w===Nh.Initializing&&x(Nh.Initialized)},[Q,w]),m.exports.useEffect(()=>{const{onDragMove:e}=O.current,{active:t,activatorEvent:n,collisions:r,over:o}=Y.current;if(!t||!n)return;const a={active:t,activatorEvent:n,collisions:r,delta:{x:fe.x,y:fe.y},over:o};bt.exports.unstable_batchedUpdates(()=>{null==e||e(a),b({type:"onDragMove",event:a})})},[fe.x,fe.y]),m.exports.useEffect(()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:o}=Y.current;if(!e||null==D.current||!t||!o)return;const{onDragOver:a}=O.current,l=r.get(me),i=l&&l.rect.current?{id:l.id,rect:l.rect.current,data:l.data,disabled:l.disabled}:null,s={active:e,activatorEvent:t,collisions:n,delta:{x:o.x,y:o.y},over:i};bt.exports.unstable_batchedUpdates(()=>{ve(i),null==a||a(s),b({type:"onDragOver",event:s})})},[me]),zf(()=>{Y.current={activatorEvent:z,active:T,activeNode:W,collisionRect:pe,collisions:he,droppableRects:U,draggableNodes:C,draggingNode:Z,draggingNodeRect:ee,droppableContainers:_,over:ge,scrollableAncestors:ae,scrollAdjustedTranslate:fe},N.current={initial:ee,translated:pe}},[T,W,he,pe,C,Z,ee,U,_,ge,ae,fe]),th({...V,delta:E,draggingRect:pe,pointerCoordinates:se,scrollableAncestors:ae,scrollableAncestorRects:le});const Se=m.exports.useMemo(()=>({active:T,activeNode:W,activeNodeRect:Q,activatorEvent:z,collisions:he,containerNodeRect:K,dragOverlay:G,draggableNodes:C,droppableContainers:_,droppableRects:U,over:ge,measureDroppableContainers:j,scrollableAncestors:ae,scrollableAncestorRects:le,measuringConfiguration:F,measuringScheduled:B,windowRect:oe}),[T,W,Q,z,he,K,G,C,_,U,ge,j,ae,le,F,B,oe]),Ce=m.exports.useMemo(()=>({activatorEvent:z,activators:ke,active:T,activeNodeRect:Q,ariaDescribedById:{draggable:A},dispatch:v,draggableNodes:C,over:ge,measureDroppableContainers:j}),[z,ke,T,Q,v,A,C,ge,j]);return J.createElement(Gf.Provider,{value:y},J.createElement(xh.Provider,{value:Ce},J.createElement(kh.Provider,{value:Se},J.createElement(Rh.Provider,{value:be},s)),J.createElement(Eh,{disabled:!1===(null==l?void 0:l.restoreFocus)})),J.createElement(tp,{...l,hiddenTextDescribedById:A}))});const Th=m.exports.createContext(null),Dh="button";function Ph(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const a=Uf("Draggable"),{activators:l,activatorEvent:i,active:s,activeNodeRect:u,ariaDescribedById:c,draggableNodes:d,over:f}=m.exports.useContext(xh),{role:p=Dh,roleDescription:h="draggable",tabIndex:g=0}=null!=o?o:{},v=(null==s?void 0:s.id)===t,b=m.exports.useContext(v?Rh:Th),[y,w]=If(),[x,k]=If(),S=function(e,t){return m.exports.useMemo(()=>e.reduce((e,n)=>{let{eventName:r,handler:o}=n;return e[r]=e=>{o(e,t)},e},{}),[e,t])}(l,t),C=Of(n);zf(()=>(d.set(t,{id:t,key:a,node:y,activatorNode:x,data:C}),()=>{const e=d.get(t);e&&e.key===a&&d.delete(t)}),[d,t]);return{active:s,activatorEvent:i,activeNodeRect:u,attributes:m.exports.useMemo(()=>({role:p,tabIndex:g,"aria-disabled":r,"aria-pressed":!(!v||p!==Dh)||void 0,"aria-roledescription":h,"aria-describedby":c.draggable}),[r,p,g,v,h,c.draggable]),isDragging:v,listeners:r?void 0:S,node:y,over:f,setNodeRef:w,setActivatorNodeRef:k,transform:b}}const Mh={timeout:25};function zh(e){let{animation:t,children:n}=e;const[r,o]=m.exports.useState(null),[a,l]=m.exports.useState(null),i=Ff(n);return n||r||!i||o(i),zf(()=>{if(!a)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,a)).then(()=>{o(null)}):o(null)},[t,r,a]),J.createElement(J.Fragment,null,n,r?m.exports.cloneElement(r,{ref:l}):null)}const Lh={x:0,y:0,scaleX:1,scaleY:1};function Oh(e){let{children:t}=e;return J.createElement(xh.Provider,{value:wh},J.createElement(Rh.Provider,{value:Lh},t))}const Ah={position:"fixed",touchAction:"none"},Ih=e=>Hf(e)?"transform 250ms ease":void 0,Fh=m.exports.forwardRef((e,t)=>{let{as:n,activatorEvent:r,adjustScale:o,children:a,className:l,rect:i,style:s,transform:u,transition:c=Ih}=e;if(!i)return null;const d=o?u:{...u,scaleX:1,scaleY:1},f={...Ah,width:i.width,height:i.height,top:i.top,left:i.left,transform:qf.Transform.toString(d),transformOrigin:o&&r?lp(r,i):void 0,transition:"function"==typeof c?c(r):c,...s};return J.createElement(n,{className:l,style:f,ref:t},a)}),$h={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:qf.Transform.toString(t)},{transform:qf.Transform.toString(n)}]},sideEffects:(Uh={styles:{active:{opacity:"0"}}},e=>{let{active:t,dragOverlay:n}=e;const r={},{styles:o,className:a}=Uh;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!=a&&a.active&&t.node.classList.add(a.active),null!=a&&a.dragOverlay&&n.node.classList.add(a.dragOverlay),function(){for(const[e,n]of Object.entries(r))t.node.style.setProperty(e,n);null!=a&&a.active&&t.node.classList.remove(a.active)}})};var Uh;function jh(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return Lf((e,a)=>{if(null===t)return;const l=n.get(e);if(!l)return;const i=l.node.current;if(!i)return;const s=hh(a);if(!s)return;const{transform:u}=Nf(a).getComputedStyle(a),c=gp(u);if(!c)return;const d="function"==typeof t?t:function(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...$h,...e};return e=>{let{active:a,dragOverlay:l,transform:i,...s}=e;if(!t)return;const u={x:l.rect.left-a.rect.left,y:l.rect.top-a.rect.top},c={scaleX:1!==i.scaleX?a.rect.width*i.scaleX/l.rect.width:1,scaleY:1!==i.scaleY?a.rect.height*i.scaleY/l.rect.height:1},d={x:i.x-u.x,y:i.y-u.y,...c},f=o({...s,active:a,dragOverlay:l,transform:{initial:i,final:d}}),[p]=f,h=f[f.length-1];if(JSON.stringify(p)===JSON.stringify(h))return;const m=null==r?void 0:r({active:a,dragOverlay:l,...s}),g=l.node.animate(f,{duration:t,easing:n,fill:"forwards"});return new Promise(e=>{g.onfinish=()=>{null==m||m(),e()}})}}(t);return zp(i,o.draggable.measure),d({active:{id:e,data:l.data,node:i,rect:o.draggable.measure(i)},draggableNodes:n,dragOverlay:{node:a,rect:o.dragOverlay.measure(s)},droppableContainers:r,measuringConfiguration:o,transform:c})})}let Bh=0;function Wh(e){return m.exports.useMemo(()=>{if(null!=e)return Bh++,Bh},[e])}const Hh=J.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:o,transition:a,modifiers:l,wrapperElement:i="div",className:s,zIndex:u=999}=e;const{activatorEvent:c,active:d,activeNodeRect:f,containerNodeRect:p,draggableNodes:h,droppableContainers:g,dragOverlay:v,over:b,measuringConfiguration:y,scrollableAncestors:w,scrollableAncestorRects:x,windowRect:k}=m.exports.useContext(kh),S=m.exports.useContext(Rh),C=Wh(null==d?void 0:d.id),E=_h(l,{activatorEvent:c,active:d,activeNodeRect:f,containerNodeRect:p,draggingNodeRect:v.rect,over:b,overlayNodeRect:v.rect,scrollableAncestors:w,scrollableAncestorRects:x,transform:S,windowRect:k}),_=lh(f),R=jh({config:r,draggableNodes:h,droppableContainers:g,measuringConfiguration:y}),N=_?v.setRef:void 0;return J.createElement(Oh,null,J.createElement(zh,{animation:R},d&&C?J.createElement(Fh,{key:C,id:d.id,ref:N,as:i,activatorEvent:c,adjustScale:t,className:s,transition:a,rect:_,style:{zIndex:u,...o},transform:E},n):null))}),Vh=n,{styled:qh}=r,{Chip:Qh}=l,{color:Kh}=i,{renderMath:Yh}=p;function Xh(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],a=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=a(n)):"call"!==o&&"optionalCall"!==o||(n=a((...e)=>n.call(t,...e)),t=void 0)}return n}const Jh=qh("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&&{}})),Gh=qh(Qh)(()=>({backgroundColor:Kh.white(),border:`1px solid ${Kh.text()}`,color:Kh.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}})),Zh=qh("span")(()=>({whiteSpace:"normal","& img":{display:"block",padding:"2px 0"},"& mjx-frac":{fontSize:"120% !important"}}));function em({choice:e,disabled:t,instanceId:n}){const r=m.exports.useRef(null),{attributes:o,listeners:a,setNodeRef:l,isDragging:i}=Ph({id:`choice-${e.id}`,data:{choice:e,instanceId:n,fromChoice:!0,type:"MaskBlank"},disabled:t});return m.exports.useEffect(()=>{Yh(r.current)},[e.value]),J.createElement(Jh,{ref:l,style:i?{width:Xh([r,"access",e=>e.current,"optionalAccess",e=>e.offsetWidth]),height:Xh([r,"access",e=>e.current,"optionalAccess",e=>e.offsetHeight])}:{},disabled:t,...a,...o},J.createElement(Gh,{clickable:!1,disabled:t,ref:r,label:J.createElement(Zh,{dangerouslySetInnerHTML:{__html:e.value}})}))}em.propTypes={choice:Vh.object.isRequired,disabled:Vh.bool,instanceId:Vh.oneOfType([Vh.string,Vh.number])};const tm=n,{findKey:nm}=o,{DragDroppablePlaceholder:rm}=h;class om extends J.Component{constructor(...e){super(...e),om.prototype.__init.call(this)}static __initStatic(){this.propTypes={disabled:tm.bool,duplicates:tm.bool,choices:tm.arrayOf(tm.shape({label:tm.string,value:tm.string})),value:tm.object,choicePosition:tm.string.isRequired,instanceId:tm.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,a=n.filter(e=>{if(!0===t)return!0;const n=nm(r,t=>t===e.id);return void 0===n}),l={...this.getStyleForWrapper(),minWidth:"100px"};return J.createElement("div",{style:l},J.createElement(rm,{disabled:e,instanceId:o},a.map((t,n)=>J.createElement(em,{key:`${t.value}-${n}`,disabled:e,choice:t,instanceId:o}))))}}om.__initStatic();var am={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"};const lm=n,im=t,{styled:sm}=r,{Chip:um}=l,cm=s,{color:dm}=i,{renderMath:fm}=p;function pm(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],a=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=a(n)):"call"!==o&&"optionalCall"!==o||(n=a((...e)=>n.call(t,...e)),t=void 0)}return n}im("pie-lib:mask-markup:blank");const hm=sm("span")(({dragged:e,over:t})=>({border:`solid 0px ${dm.primary()}`,minWidth:"200px",touchAction:"none",overflow:"hidden",whiteSpace:"nowrap",opacity:1,...t&&{whiteSpace:"nowrap",overflow:"hidden"},...e&&{opacity:.5}})),mm=sm(um)(()=>({backgroundColor:dm.background(),border:`2px dashed ${dm.text()}`,color:dm.text(),fontSize:"inherit",maxWidth:"374px",position:"relative",borderRadius:"3px","&.over":{whiteSpace:"nowrap",overflow:"hidden"},"&.parentOver":{border:`1px solid ${am[500]}`,backgroundColor:`${am[300]}`},"&.correct":{border:`solid 1px ${dm.correct()}`},"&.incorrect":{border:`solid 1px ${dm.incorrect()}`},"&.Mui-disabled":{opacity:1}})),gm=sm("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"}}));function vm({disabled:e,choice:t,isOver:n,isDragging:r,dragItem:o,correct:a,emptyResponseAreaWidth:l,emptyResponseAreaHeight:i}){const s=m.exports.useRef(null),u=m.exports.useRef(null),c=m.exports.useRef(null),[d,f]=m.exports.useState({height:0,width:0}),p=()=>{g()},h=()=>{const e=pm([u,"access",e=>e.current,"optionalAccess",e=>e.querySelector,"call",e=>e("img")]);e?e.onload=p:setTimeout(()=>{g()},300)},g=()=>{if(u.current&&s.current){s.current.style.width="auto";const e=(u.current.offsetWidth||0)+24,t=(u.current.offsetHeight||0)+24,n=parseFloat(l)||0,r=parseFloat(i)||0,o=e<=n?n:e,a=t<=r?r:t;f(e=>({width:o>n?o:e.width,height:a>r?a:e.height})),s.current.style.width=`${o}px`,s.current.style.height=`${a}px`}};m.exports.useEffect(()=>{h()},[]),m.exports.useEffect(()=>{s.current&&fm(s.current)},[n,pm([o,"optionalAccess",e=>e.choice,"optionalAccess",e=>e.value])]),m.exports.useEffect(()=>{t?h():f({height:0,width:0})},[t]),m.exports.useEffect(()=>{n||r||(c.current={width:s.current.offsetWidth,height:s.current.offsetHeight})},[t,n,r]);const v=o&&n&&o.choice&&o.choice.value,b=t&&t.value,y=n||r?{width:pm([c,"access",e=>e.current,"optionalAccess",e=>e.width]),height:pm([c,"access",e=>e.current,"optionalAccess",e=>e.height])}:(()=>{const e=isNaN(parseFloat(l))?0:parseFloat(l),t=isNaN(parseFloat(i))?0:parseFloat(i);return{...{height:d.height||t,width:d.width||e},...e?{}:{minWidth:90},...t?{}:{minHeight:32}}})();return J.createElement(mm,{clickable:!1,disabled:e,ref:s,component:"span",label:J.createElement(J.Fragment,null,J.createElement(gm,{ref:u,draggable:!0,className:cm({over:n,hidden:v}),dangerouslySetInnerHTML:{__html:b||""}}),v&&J.createElement(gm,{draggable:!0,className:cm({over:n,dragged:!0}),dangerouslySetInnerHTML:{__html:v||""}})),className:cm({over:n,parentOver:n,correct:void 0!==a&&a,incorrect:void 0!==a&&!a}),variant:e?"outlined":void 0,style:y})}function bm({id:e,disabled:t,duplicates:n,choice:r,correct:o,onChange:a,emptyResponseAreaWidth:l,emptyResponseAreaHeight:i,instanceId:s}){const{attributes:u,listeners:c,setNodeRef:d,transform:f,isDragging:p}=Ph({id:`mask-blank-drag-${e}`,disabled:t||!r,data:{id:e,choice:r,instanceId:s,fromChoice:!1,type:"MaskBlank"}}),{setNodeRef:h,isOver:g,active:v}=function(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const a=Uf("Droppable"),{active:l,dispatch:i,over:s,measureDroppableContainers:u}=m.exports.useContext(xh),c=m.exports.useRef({disabled:n}),d=m.exports.useRef(!1),f=m.exports.useRef(null),p=m.exports.useRef(null),{disabled:h,updateMeasurementsFor:g,timeout:v}={...Mh,...o},b=Of(null!=g?g:r),y=ih({callback:m.exports.useCallback(()=>{d.current?(null!=p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{u(Array.isArray(b.current)?b.current:[b.current]),p.current=null},v)):d.current=!0},[v]),disabled:h||!l}),w=m.exports.useCallback((e,t)=>{y&&(t&&(y.unobserve(t),d.current=!1),e&&y.observe(e))},[y]),[x,k]=If(w),S=Of(t);return m.exports.useEffect(()=>{y&&x.current&&(y.disconnect(),d.current=!1,y.observe(x.current))},[x,y]),m.exports.useEffect(()=>(i({type:np.RegisterDroppable,element:{id:r,key:a,disabled:n,node:x,rect:f,data:S}}),()=>i({type:np.UnregisterDroppable,key:a,id:r})),[r]),m.exports.useEffect(()=>{n!==c.current.disabled&&(i({type:np.SetDroppableDisabled,id:r,key:a,disabled:n}),c.current.disabled=n)},[r,a,n,i]),{active:l,rect:f,isOver:(null==s?void 0:s.id)===r,node:x,over:s,setNodeRef:k}}({id:`mask-blank-drop-${e}`,data:{id:e,accepts:["MaskBlank"],instanceId:s}}),b={transform:qf.Translate.toString(f)};return J.createElement(hm,{ref:e=>{d(e),h(e)},style:b,dragged:p,over:g,...u,...c},J.createElement(vm,{id:e,disabled:t,duplicates:n,choice:r,isOver:g,dragItem:pm([v,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current]),correct:o,onChange:a,emptyResponseAreaWidth:l,emptyResponseAreaHeight:i,instanceId:s}))}vm.defaultProps={emptyResponseAreaWidth:0,emptyResponseAreaHeight:0},vm.propTypes={id:lm.oneOfType([lm.string,lm.number]),disabled:lm.bool,duplicates:lm.bool,choice:lm.object,isOver:lm.bool,dragItem:lm.object,correct:lm.bool,onChange:lm.func,emptyResponseAreaWidth:lm.oneOfType([lm.string,lm.number]),emptyResponseAreaHeight:lm.oneOfType([lm.string,lm.number]),instanceId:lm.string},bm.defaultProps={emptyResponseAreaWidth:0,emptyResponseAreaHeight:0},bm.propTypes={id:lm.oneOfType([lm.string,lm.number]),disabled:lm.bool,duplicates:lm.bool,choice:lm.object,correct:lm.bool,onChange:lm.func,emptyResponseAreaWidth:lm.oneOfType([lm.string,lm.number]),emptyResponseAreaHeight:lm.oneOfType([lm.string,lm.number]),instanceId:lm.string};const ym=n,{DragProvider:wm}=h;function xm(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],a=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=a(n)):"call"!==o&&"optionalCall"!==o||(n=a((...e)=>n.call(t,...e)),t=void 0)}return n}const km=vt("blank",e=>(t,n,r)=>{const o=xm([t,"access",e=>e.data,"optionalAccess",e=>e.dataset])||{};if("blank"===o.component){const{disabled:a,duplicates:l,correctResponse:i,feedback:s,showCorrectAnswer:u,emptyResponseAreaWidth:c,emptyResponseAreaHeight:d,instanceId:f,isDragging:p}=e,h=u?i[o.id]:n[o.id],m=h&&e.choices.find(e=>e.id===h);return J.createElement(bm,{key:`${t.type}-${o.id}`,correct:u||s&&s[o.id],disabled:a,duplicates:l,choice:m,id:o.id,emptyResponseAreaWidth:c,emptyResponseAreaHeight:d,onChange:(e,t)=>{const o={...n};void 0===t?delete o[e]:o[e]=t,r(o)},instanceId:f,isDragging:p})}});class Sm extends J.Component{constructor(e){super(e),Sm.prototype.__init.call(this),Sm.prototype.__init2.call(this),Sm.prototype.__init3.call(this),Sm.prototype.__init4.call(this),this.state={activeDragItem:null}}static __initStatic(){this.propTypes={markup:ym.string,layout:ym.object,choicesPosition:ym.string,choices:ym.array,value:ym.object,onChange:ym.func,duplicates:ym.bool,disabled:ym.bool,feedback:ym.object,correctResponse:ym.object,showCorrectAnswer:ym.bool,emptyResponseAreaWidth:ym.oneOfType([ym.string,ym.number]),emptyResponseAreaHeight:ym.oneOfType([ym.string,ym.number]),instanceId:ym.string}}static __initStatic2(){this.defaultProps={instanceId:"drag-in-the-blank"}}__init(){this.handleDragStart=e=>{const{active:t}=e;xm([t,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current])&&this.setState({activeDragItem:t.data.current})}}__init2(){this.renderDragOverlay=()=>{const{activeDragItem:e}=this.state;return e&&"MaskBlank"===e.type?J.createElement(em,{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;if(this.setState({activeDragItem:null}),!n||!t||!r)return;const a=t.data.current,l=n.data.current;if("MaskBlank"===xm([a,"optionalAccess",e=>e.type])&&xm([l,"optionalAccess",e=>e.accepts,"optionalAccess",e=>e.includes,"call",e=>e("MaskBlank")])){const e=a,t=l.id;if(!0===l.toChoiceBoard){if(!e.fromChoice&&e.id){const t={...o};delete t[e.id],r(t)}}else if(!0===e.fromChoice){if(t&&"drag-in-the-blank-droppable"!==t){const n={...o};n[t]=e.choice.id,r(n)}}else if(e.id&&e.id!==t){const n={...o};n[t]=e.choice.id,delete n[e.id],r(n)}}}}__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:a,correctResponse:l,disabled:i,feedback:s,showCorrectAnswer:u,emptyResponseAreaWidth:c,emptyResponseAreaHeight:d,layout:f,instanceId:p}=this.props,h=o||"below",m={display:"flex",minWidth:"100px",...this.getPositionDirection(h)};return J.createElement(wm,{onDragStart:this.handleDragStart,onDragEnd:this.handleDragEnd,collisionDetection:cp},J.createElement("div",{ref:e=>this.rootRef=e,style:m},J.createElement(om,{choicePosition:h,choices:a,value:n,duplicates:t,disabled:i,instanceId:p}),J.createElement(km,{elementType:"drag-in-the-blank",markup:e,layout:f,value:n,choices:a,onChange:r,disabled:i,duplicates:t,feedback:s,correctResponse:l,showCorrectAnswer:u,emptyResponseAreaWidth:c,emptyResponseAreaHeight:d,instanceId:p,isDragging:!!this.state.activeDragItem}),J.createElement(Hh,{style:{pointerEvents:"none"}},this.renderDragOverlay())))}}Sm.__initStatic(),Sm.__initStatic2();const{styled:Cm}=r,Em=s,{color:_m}=i;function Rm(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],a=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=a(n)):"call"!==o&&"optionalCall"!==o||(n=a((...e)=>n.call(t,...e)),t=void 0)}return n}let Nm,Tm;"undefined"!=typeof window&&(Nm=require("@pie-lib/editable-html-tip-tap").default,Tm=Cm(Nm)(()=>({display:"inline-block",verticalAlign:"middle",margin:"4px",borderRadius:"4px",border:`1px solid ${_m.black()}`,"&.correct":{border:`1px solid ${_m.correct()}`},"&.incorrect":{border:`1px solid ${_m.incorrect()}`}})));vt("input",e=>(t,n)=>{const{adjustedLimit:r,disabled:o,feedback:a,showCorrectAnswer:l,maxLength:i,spellCheck:s,pluginProps:u,onChange:c}=e,d=Rm([t,"access",e=>e.data,"optionalAccess",e=>e.dataset])||{};if("input"===d.component){const f=(e.choices&&d&&e.choices[d.id]||[])[0],p=l?f&&f.label:n[d.id]||"",h=i&&i[d.id],m=a&&a[d.id],g=l||"correct"===m,v=!l&&"incorrect"===m,b=e=>{const t={...n,[d.id]:e};c(t)},y=e=>{if("Enter"===e.key||13===e.keyCode)return!0};return J.createElement(Tm,{id:d.id,key:`${t.type}-input-${d.id}`,disabled:l||o,disableUnderline:!0,onChange:b,markup:p||"",charactersLimit:r?h:25,activePlugins:["languageCharacters"],pluginProps:u,languageCharactersProps:[{language:"spanish"}],spellCheck:s,width:`calc(${h}em + 32px)`,onKeyDown:y,autoWidthToolbar:!0,toolbarOpts:{minWidth:"auto",noBorder:!0,isHidden:!!Rm([u,"optionalAccess",e=>e.characters,"optionalAccess",e=>e.disabled])},className:Em({correct:g,incorrect:v})})}});var Dm=vt("input",e=>(t,n,r)=>{const o=t.data&&t.data.dataset||{};if("input"===o.component)return e.customMarkMarkupComponent(o.id)});const Pm=n,{Button:Mm}=l,{InputLabel:zm}=l,{Menu:Lm}=l,{MenuItem:Om}=l,{ArrowDropDown:Am}=u,{ArrowDropUp:Im}=u,{Close:Fm}=u,{Check:$m}=u,{styled:Um}=r,{color:jm}=i,{renderMath:Bm}=p,Wm=Um(Mm)(()=>({color:jm.text(),border:`1px solid ${jm.borderGray()}`,borderRadius:"4px",justifyContent:"space-between",backgroundColor:jm.background(),position:"relative",height:"45px",width:"fit-content",margin:"2px",textTransform:"none","& span":{paddingRight:"5px"},"& svg":{position:"absolute",right:0,top:"calc(50% - 12px)",pointerEvents:"none",color:jm.text(),marginLeft:"5px"},"&.Mui-focused":{outline:`3px solid ${jm.tertiary()}`,outlineOffset:"2px",borderWidth:"3px"},"&.disabledCorrect":{borderWidth:"2px",borderColor:jm.correct(),color:`${jm.text()} !important`},"&.disabledIncorrect":{borderWidth:"2px",borderColor:jm.incorrectWithIcon(),color:`${jm.text()} !important`}})),Hm=Um(Lm)(()=>({backgroundColor:jm.background(),border:`1px solid ${jm.correct()} !important`,"&:hover":{border:`1px solid ${jm.text()} `,borderColor:"initial"},"&:focus":{border:`1px solid ${jm.text()}`,borderColor:"initial"},"& .MuiList-root":{padding:0}})),Vm=Um(Om)(()=>({color:jm.text(),backgroundColor:jm.background(),"&.Mui-focused":{outline:`3px solid ${jm.tertiary()}`,outlineOffset:"-1px",color:jm.text(),backgroundColor:jm.background()},"&:hover":{color:jm.text(),backgroundColor:jm.dropdownBackground()},boxSizing:"border-box",padding:"25px",borderRadius:"4px","&.selected":{color:`${jm.text()} !important`,backgroundColor:`${jm.background()} !important`,"&:hover":{color:jm.text(),backgroundColor:`${jm.dropdownBackground()} !important`}}})),qm=Um("span")(()=>({fontSize:"max(1rem, 14px)"})),Qm=Um("span")(()=>({fontSize:"max(1rem, 14px)",position:"absolute",right:"10px"})),Km=Um(zm)(()=>({position:"absolute",left:"-10000px",top:"auto",width:"1px",height:"1px",overflow:"hidden"})),Ym=Um($m)(()=>({color:`${jm.white()} !important`,position:"absolute",top:"-8px !important",left:"-8px",marginLeft:"0 !important",borderRadius:"50%",fontSize:"16px",padding:"2px","&.correct":{backgroundColor:jm.correct()},"&.incorrect":{backgroundColor:jm.incorrectWithIcon()}})),Xm=Um(Fm)(()=>({color:`${jm.white()} !important`,position:"absolute",top:"-8px !important",left:"-8px",marginLeft:"0 !important",borderRadius:"50%",fontSize:"16px",padding:"2px","&.correct":{backgroundColor:jm.correct()},"&.incorrect":{backgroundColor:jm.incorrectWithIcon()}}));class Jm extends J.Component{static __initStatic(){this.propTypes={id:Pm.string,value:Pm.string,disabled:Pm.bool,onChange:Pm.func,correct:Pm.bool,choices:Pm.arrayOf(Pm.shape({value:Pm.string,label:Pm.string})),showCorrectAnswer:Pm.bool,singleQuery:Pm.bool,correctValue:Pm.string}}constructor(e){super(e),Jm.prototype.__init.call(this),Jm.prototype.__init2.call(this),Jm.prototype.__init3.call(this),Jm.prototype.__init4.call(this),Jm.prototype.__init5.call(this),this.state={anchorEl:null,highlightedOptionId:null,menuWidth:null,previewValue:null},this.hiddenRef=J.createRef(),this.buttonRef=J.createRef(),this.previewRef=J.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||Bm(e)}),n){const e=n.clientWidth;e!==this.state.menuWidth&&(this.elementRefs.forEach(e=>{e&&Bm(e)}),Bm(n),this.setState({menuWidth:e}))}}__init(){this.handleClick=e=>this.setState({anchorEl:e.currentTarget})}__init2(){this.handleClose=()=>{const{value:e}=this.props;this.setState({anchorEl:null,previewValue:null,highlightedOptionId:null}),!e&&this.previewRef.current&&(this.previewRef.current.innerHTML="")}}__init3(){this.handleHighlight=e=>{const t={highlightedOptionId:`dropdown-option-${this.props.id}-${e}`};this.props.value||(t.previewValue=this.props.choices[e].value),this.setState(t)}}__init4(){this.handleSelect=(e,t)=>{this.props.onChange(this.props.id,e),this.handleHighlight(t),this.handleClose()}}__init5(){this.handleHover=e=>{if(this.props.value)return;const t=`dropdown-option-${this.props.id}-${e}`,n=this.state.previewValue;this.setState({highlightedOptionId:t,previewValue:n},()=>{const t=this.elementRefs[e],n=this.previewRef.current;t&&n&&(n.innerHTML=t.innerHTML)})}}getLabel(e,t){const n=(e||[]).find(e=>e.value===t);return n?n.label.trim():void 0}render(){const{id:e,correct:t,disabled:n,value:r,choices:o,showCorrectAnswer:a,singleQuery:l,correctValue:i}=this.props,{anchorEl:s}=this.state,u=Boolean(s),c=`dropdown-button-${e}`,d=`dropdown-menu-${e}`,f=`dropdown-value-${e}`;let p;this.elementRefs=[],n&&void 0!==t&&(p=t||a?"disabledCorrect":"disabledIncorrect");const h=parseInt(e,10)+1,m=l?"Query-label":`Query-label-${h}`,g=l?"Query":`Query ${h}`;let v=null;return n&&void 0!==t&&(v=t||a?J.createElement(Ym,{className:"correct"}):J.createElement(Xm,{className:"incorrect"})),J.createElement(J.Fragment,null,J.createElement("div",{ref:this.hiddenRef,style:{position:"absolute",visibility:"hidden",top:0,left:0},tabIndex:-1,"aria-hidden":"true"},(o||[]).map((e,t)=>J.createElement(Vm,{key:t,tabIndex:-1,"aria-hidden":"true"},J.createElement(qm,{dangerouslySetInnerHTML:{__html:e.label}})))),J.createElement(Km,{id:m,tabIndex:-1,"aria-hidden":"true"},g),J.createElement(Wm,{ref:this.buttonRef,style:{...this.state.menuWidth&&{minWidth:`calc(${this.state.menuWidth}px + 8px)`},borderWidth:u?"2px":"1px",transition:"border-width 0.2s ease-in-out"},"aria-controls":u?d:void 0,"aria-haspopup":"listbox","aria-expanded":u?"true":void 0,"aria-activedescendant":this.state.highlightedOptionId,onClick:this.handleClick,className:p,disabled:n,id:c,role:"combobox","aria-label":`Select an option for ${g}`,"aria-labelledby":f},v,J.createElement(qm,{id:f,ref:this.previewRef,dangerouslySetInnerHTML:{__html:i||(u&&this.state.previewValue?this.getLabel(o,this.state.previewValue):this.getLabel(o,r)||"")}}),u?J.createElement(Im,null):J.createElement(Am,null)),J.createElement(Hm,{id:d,anchorEl:s,keepMounted:!0,open:u,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":c,role:"listbox",disablePadding:!0}}},(o||[]).map((t,n)=>{const o=`dropdown-option-${e}-${n}`;return J.createElement(Vm,{id:o,className:t.value===r?"selected":"",key:`${t.label}-${n}`,value:t.value,onClick:()=>this.handleSelect(t.value,n),role:"option","aria-selected":this.state.highlightedOptionId===o?"true":void 0,onMouseOver:()=>this.handleHover(n)},J.createElement(qm,{ref:e=>this.elementRefs[n]=e,dangerouslySetInnerHTML:{__html:t.label}}),J.createElement(Qm,{dangerouslySetInnerHTML:{__html:t.value===r?" ✓":""}}))})))}}Jm.__initStatic(),vt("dropdown",e=>(t,n,r)=>{const o=t.data&&t.data.dataset||{};if("dropdown"===o.component){const{choices:a,disabled:l,feedback:i,showCorrectAnswer:s}=e,u=a&&a[o.id]&&a[o.id].find(e=>e.correct),c=s?u&&u.value:n[o.id];return J.createElement(Jm,{key:`${t.type}-dropdown-${o.id}`,correct:i&&i[o.id]&&"correct"===i[o.id],disabled:l||s,value:c,correctValue:s?u&&u.label:void 0,id:o.id,onChange:r,choices:a[o.id],showCorrectAnswer:s,singleQuery:1==Object.keys(a).length})}});const Gm=n,{isEqual:Zm}=o,{isEmpty:eg}=o,{styled:tg}=r,{Tooltip:ng}=l,{color:rg}=i,{Collapsible:og}=i,{Readable:ag}=i,{hasText:lg}=i,{hasMedia:ig}=i,{PreviewPrompt:sg}=i,{UiLayout:ug}=i,cg=c,{mq:dg}=d,{HorizontalKeypad:fg}=d,{updateSpans:pg}=d,hg=f,{renderMath:mg}=p;function gg(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],a=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=a(n)):"call"!==o&&"optionalCall"!==o||(n=a((...e)=>n.call(t,...e)),t=void 0)}return n}const vg=tg(ug)({color:rg.text(),backgroundColor:rg.background(),display:"inline-block"}),bg=tg("div")({width:"100%",position:"relative",backgroundColor:rg.background(),color:rg.text()}),yg=tg("div")(({theme:e})=>({marginBottom:e.spacing(2)})),wg=tg("div")(({theme:e})=>({marginBottom:e.spacing(2)})),xg=tg("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}}),kg=tg("div")(({theme:e,$incorrect:t,$correct:n,$showCorrectness:r,$correctAnswerShown:o})=>({maxWidth:"fit-content",...t&&{borderColor:`${rg.incorrect()} !important`},...n&&{borderColor:`${rg.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}}})),Sg=tg(dg.Static)({"& > .mq-root-block":{"& > .mq-editable-field":{borderColor:rg.text()}}}),Cg=tg("div")(({theme:e})=>({zIndex:10,minWidth:"400px",marginTop:e.spacing(2)})),Eg=tg("div")(({theme:e})=>({marginBottom:e.spacing(1),pointerEvents:"none"})),_g=tg("h2")({position:"absolute",left:"-10000px",top:"auto",width:"1px",height:"1px",overflow:"hidden"}),Rg=tg("div")(({theme:e})=>({marginBottom:e.spacing(2)})),Ng=tg(cg)(({theme:e})=>({color:rg.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: ${rg.text()};\n background-color: ${rg.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: ${rg.correct()} !important;\n }\n .incorrect {\n border-color: ${rg.incorrect()} !important;\n }\n `,document.head.appendChild(t)}}let Tg=!1;const Dg=/(\{\{\d+\}\})/gm,Pg=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);function Mg(e=[],t){return 30*Math.floor(e.length/5)+("miscellaneous"===t?600:500)}function zg(e,t){const{responses:n,disabled:r,markup:o,printMode:a,alwaysShowCorrect:l}=e||{};if(o){if(t.showCorrect)return Object.keys(n||{}).reduce((e,t)=>(e[t]=gg([n,"optionalAccess",e=>e[t],"optionalAccess",e=>e.answer]),e),{});return o.split(Dg).filter(e=>e).reduce((e,n)=>{if(n.match(Dg)){const o=Lg.getResponseKey(n),i=t.session.answers[`r${o}`];if(a&&!l){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}]{${i&&i.value||""}}`}}return e},{})}}class Lg extends J.Component{static __initStatic(){this.getResponseKey=e=>(e||"").replaceAll("{{","").replaceAll("}}","")}static __initStatic2(){this.propTypes={session:Gm.object.isRequired,onSessionChange:Gm.func,model:Gm.object.isRequired}}constructor(e){super(e),Lg.prototype.__init.call(this),Lg.prototype.__init2.call(this),Lg.prototype.__init3.call(this),Lg.prototype.__init4.call(this),Lg.prototype.__init5.call(this),Lg.prototype.__init6.call(this),Lg.prototype.__init7.call(this),Lg.prototype.__init8.call(this),Lg.prototype.__init9.call(this),Lg.prototype.__init10.call(this),Lg.prototype.__init11.call(this),Lg.prototype.__init12.call(this),Lg.prototype.__init13.call(this);const t={},{model:n,session:r}=e||{},{markup:o,alwaysShowCorrect:a}=n||{},{answers:l}=r||{};o&&(o||"").replace(Dg,e=>{const n=Lg.getResponseKey(e),r=l&&l[`r${n}`];t[`r${n}`]={value:gg([r,"optionalAccess",e=>e.value])||""}}),this.state={session:{...e.session,answers:t},activeAnswerBlock:"",showCorrect:a||!1,tooltipContainerRef:J.createRef()}}UNSAFE_componentWillMount(){if("undefined"!=typeof window){let e=hg.getInterface(2);Tg||(e.registerEmbed("answerBlock",e=>({htmlString:`<div class="block-container">\n <div class="block-response" id="${e}Index">R</div>\n <div class="block-math">\n <span id="${e}"></span>\n </div>\n </div>`,text:()=>"text",latex:()=>`\\embed{answerBlock}[${e}]`})),Tg=!0)}}__init(){this.handleAnswerBlockDomUpdate=()=>{const{model:e}=this.props,{session:t,showCorrect:n}=this.state,r=t.answers;this.root&&e.disabled&&!n&&Object.keys(r).forEach(t=>{const n=this.root.querySelector(`#${t}`),o=this.root.querySelector(`#${t}Index`);if(n){let a=hg.getInterface(2);const l=r[t];n.textContent=l&&l.value||"",e.view&&(n.parentElement.parentElement.classList.remove("correct"),n.parentElement.parentElement.classList.remove("incorrect")),a.StaticMath(n),o.textContent="R"}}),mg(this.root)}}UNSAFE_componentWillReceiveProps(e){const{model:t}=this.props,{model:n={}}=e||{},{markup:r="",env:o={}}=t||{},{markup:a="",env:l={},alwaysShowCorrect:i=!1}=n,s=e=>e&&"evaluate"===e.mode;s(o)&&s(l)||this.setState(e=>({...e.session,showCorrect:!1})),i&&this.setState({showCorrect:!0});const u=r.match(Dg),c=a.match(Dg);if(!Zm(u,c)){const e={},t=this.state.session.answers;(c||[]).forEach(n=>{const r=Lg.getResponseKey(n),o=t&&t[`r${r}`];e[`r${r}`]={value:gg([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=Zm(this.props.model,e.model),r=Zm(this.state,t);return!n||!r}componentDidMount(){this.handleAnswerBlockDomUpdate(),setTimeout(()=>mg(this.root),100)}componentDidUpdate(){this.handleAnswerBlockDomUpdate()}__init2(){this.onSubFieldFocus=e=>{this.setState({activeAnswerBlock:e})}}__init3(){this.toNodeData=e=>{if(!e)return;const{type:t,value:n}=e;return"command"===t||"cursor"===t?e:"answer"===t?{type:"answer",...e}:"clear"===n?{type:"clear"}:{type:"write",value:n}}}__init4(){this.setInput=e=>{this.input=e}}__init5(){this.onClick=e=>{const t=this.toNodeData(e);"clear"===t.type?this.input.clear():"command"===t.type?Array.isArray(t.value)?t.value.forEach(e=>{this.input.cmd(e)}):this.input.cmd(t.value):"cursor"===t.type?this.input.keystroke(t.value):this.input.write(t.value),this.input.focus()}}__init6(){this.callOnSessionChange=()=>{const{onSessionChange:e}=this.props;e&&e(this.state.session)}}__init7(){this.toggleShowCorrect=e=>{this.setState({showCorrect:e},this.handleAnswerBlockDomUpdate)}}__init8(){this.subFieldChanged=(e,t)=>{pg(),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=gg([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&&gg([o,"optionalAccess",e=>e.attributes,"access",e=>e["data-keypad"]])||this.setState({activeAnswerBlock:""})}}setTooltipRef(e){setTimeout(()=>{if(e&&Pg){const e=document.querySelector("[role='tooltip']");if(e){e.firstChild.setAttribute("tabindex","-1")}}},1)}__init11(){this.renderTeacherInstructions=()=>{const{model:e}=this.props,{teacherInstructions:t,animationsDisabled:n}=e||{},r=t&&(lg(t)||ig(t)),o=J.createElement(sg,{defaultClassName:"teacher-instructions",prompt:t});return r&&J.createElement(wg,null,n?o:J.createElement(og,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},o))}}__init12(){this.renderRationale=()=>{const{model:e}=this.props,{rationale:t,animationsDisabled:n}=e||{},r=J.createElement(sg,{prompt:t});return t&&(lg(t)||ig(t))&&J.createElement(wg,null,n?r:J.createElement(og,{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:a,disabled:l,view:i,responses:s,equationEditor:u,customKeys:c,feedback:d,env:{mode:f}={},printMode:p,alwaysShowCorrect:h}=e||{},m=eg(s),g=function(e=[]){return e.map(e=>({name:e,latex:e,write:e,label:e}))}(c),v=zg(e,this.state)||"",b=p&&!h;return J.createElement(xg,null,J.createElement(Dm,{disabled:l,markup:e.markup,value:{},customMarkMarkupComponent:e=>{const s="evaluate"===f&&d&&d[e],c=J.createElement(Sg,{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 J.createElement(kg,{ref:o,$incorrect:!m&&!s&&!n,$correct:!m&&(s||n),$showCorrectness:!m&&l&&a&&!i,$correctAnswerShown:n},J.createElement(ng,{ref:e=>this.setTooltipRef(e),enterTouchDelay:0,interactive:!0,open:t===`r${e}`,slotProps:{popper:{container:gg([o,"optionalAccess",e=>e.current])||void 0,placement:"bottom-end",sx:{backgroundColor:"transparent",width:"650px",opacity:1,"& .MuiTooltip-arrow":{display:"none"}},modifiers:{preventOverflow:{enabled:!0,boundariesElement:"body"},flip:{enabled:!1}}},tooltip:{sx:{fontSize:"initial",backgroundColor:"transparent",width:"600px",marginTop:0,paddingTop:0,boxShadow:"none"}}},title:Object.keys(r.answers).map(e=>e===t&&!(n||l)&&J.createElement(Cg,{"data-keypad":!0,key:e,style:{width:Mg(g,u)}},J.createElement(fg,{additionalKeys:g,mode:u||6,onClick:this.onClick}))||null)},b?J.createElement(Eg,null,c):J.createElement("div",null,c)))}}))}}render(){const{model:e}=this.props,{showCorrect:t}=this.state,{prompt:n,env:{mode:r,role:o}={},extraCSSRules:a,correctness:l,responses:i,language:s,showNote:u,note:c}=e||{},d=!eg(i)&&l&&"correct"!==l.correctness,f=(t||"view"===r&&"instructor"===o)&&u&&c;return J.createElement(vg,{extraCSSRules:a,ref:e=>{const t=Cf.findDOMNode(e);this.root=t||this.root}},J.createElement(bg,null,"gather"===r&&J.createElement(_g,null,"Math Equation Response Question"),J.createElement(bg,null,d&&J.createElement(Ng,{language:s,show:!0,toggled:t,onToggle:this.toggleShowCorrect})),this.renderTeacherInstructions(),n&&J.createElement(yg,null,J.createElement(sg,{prompt:n})),J.createElement(ag,{false:!0},this.renderPlayerContent()),f&&J.createElement(Rg,{className:"note",dangerouslySetInnerHTML:{__html:c}}),this.renderRationale()))}}Lg.__initStatic(),Lg.__initStatic2();const Og=o;class Ag extends HTMLElement{constructor(){super(),this._root=null,this.sessionChangedEventCaller=Og.debounce(()=>{this.dispatchEvent(new ie(this.tagName.toLowerCase(),!0))},1e3)}set model(e){this._model=e,this.render(),this.dispatchEvent(new ne(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=J.createElement(Lg,{model:this._model,session:this._session,onSessionChange:this.onSessionChange.bind(this)});this._root||(this._root=G(this)),this._root.render(e)}}disconnectedCallback(){this._root&&this._root.unmount()}}export{Ag as default};
|
|
1
|
+
import{_dll_react_dom as e,_dll_debug as t,_dll_react as n,_dll_prop_types as r,_dll_mui__material_styles as o,_dll_lodash as i,_dll_mui__material as a,_dll_pie_lib__render_ui as s,_dll_classnames as l,_dll_mui__icons_material as c,_dll_pie_lib__correct_answer_toggle as d}from"../../../@pie-lib/shared-module@^3.0.5/module/index.js";import{_dll_pie_lib__math_input as u,_dll_pie_framework__mathquill as p}from"../../../@pie-lib/math-edit-module@^3.0.5/module/index.js";import{_dll_pie_lib__math_rendering as h}from"../../../@pie-lib/math-rendering-module@^4.0.5/module/index.js";import{_dll_pie_lib__drag as g}from"../../../@pie-lib/drag-module@^3.0.5/module/index.js";var f,m=e;f=m.createRoot,m.hydrateRoot;var v={};Object.defineProperty(v,"__esModule",{value:!0});class b extends CustomEvent{constructor(e,t,n){super(b.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e,hasModel:n}}),this.component=e,this.complete=t}}b.TYPE="model-set";var y=v.ModelSetEvent=b;class w extends CustomEvent{constructor(e,t){super(w.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e}}),this.component=e,this.complete=t}}w.TYPE="session-changed";var x,C,E,k=v.SessionChangedEvent=w,S={"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},R={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},A=function(e){return e.length?e.charAt(0).toUpperCase()+e.substring(1):e},_=A,D=/^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/,T="undefined"==typeof document?{}:document.documentElement.style,M=(x=function(){for(var e in T)if(D.test(e))return e.match(D)[0];return"WebkitOpacity"in T?"Webkit":"KhtmlOpacity"in T?"Khtml":""}(),C=x.toLowerCase(),{style:x,css:"-"+C+"-",dom:{Webkit:"WebKit",ms:"MS",o:"WebKit"}[x]||_(x)}),O=function(e,t){return t?t.toUpperCase():""},N=/[-\s]+(.)?/g,I=function(e){return e?e.replace(N,O):""},$=/::/g,L=/([A-Z]+)([A-Z][a-z])/g,j=/([a-z\d])([A-Z])/g,W=/_/g,P=function(e,t){return e?e.replace($,"/").replace(L,"$1_$2").replace(j,"$1_$2").replace(W,t||"-"):""},B=function(e){return P(e).toLowerCase()},H=I,z=B,F=function(e){return e.length?e.charAt(0).toLowerCase()+e.substring(1):e},q=A,U=M,K=S,Y="undefined"==typeof document?{}:document.documentElement.style,V=function(e,t){t=t||{};var n=F(H(e)),r=z(e),o=E?n:r,i=U.style?E?U.style:U.css:"";if(n in Y)return t.asString?o:[o];var a=o,s=K[r],l=[];if(E&&(a=q(o)),"function"==typeof s){var c=s(o,i)||[];c&&!Array.isArray(c)&&(c=[c]),c.length&&(c=c.map(function(e){return E?F(H(e)):z(e)})),l=l.concat(c)}return i&&l.push(i+a),l.push(o),t.asString||1==l.length?l[0]:l},X=Object.prototype.hasOwnProperty,J=function(e,t){return X.call(e,t)},Q=Object.prototype.toString,Z=Object.prototype.toString,G=V,ee=B,te=I,ne=J,re=function(e){return!!e&&"[object Object]"===Q.call(e)},oe=function(e){return"[object Function]"===Z.apply(e)},ie=function(e,t,n,r){G(t).forEach(function(t){e[r?r(t):t]=n})},ae={cssUnitless:R},se=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||ae).cssUnitless=t.cssUnitless||ae.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,g=(null!=t.cssUnitless?t.cssUnitless:p?p.cssUnitless:null)||{},f=(t.cssUnit||p?p.cssUnit:null)||"px",m=t.prefixProperties||(p?p.prefixProperties:null)||{},v=t.camelize?te:ee;for(a in e)if(ne(e,a)){if(s=e[a],i=ee(n?n+a:a),o=!1,u=!1,oe(s)&&(d=s.call(p||e,s,a,i,e),re(d)&&null!=d.value?(s=d.value,u=d.prefix,i=d.name?ee(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 g)?s+f: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?ie(r,e,s,v):r[v(e)]=s});continue}u?ie(r,i,s,v):r[v(i)]=s}else se(s,t,i+"-",r)}return r},le=se,ce=J,de={prefixProperties:S,cssUnitless:R,object:se,string:function(e,t){e=le(e,t);var n,r=[];for(n in e)ce(e,n)&&r.push(n+": "+e[n]);return r.join("; ")}};const ue=t("@pie-lib:mask-markup:serialization"),pe=["span"],he=["em","strong","u"],ge=(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),de.object(r,{camelize:!0,addUnits:!1});var r},fe=["border","class","style"],me={b:"bold",em:"italic",u:"underline",s:"strikethrough",code:"code",strong:"strong"},ve=(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=me[r];if(o){ue("[deserialize] mark: ",o);return{_flatten:!0,nodes:be(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=fe.reduce((n=e,(e,t)=>{if(!n.getAttribute)return e;if(n.getAttribute(t))switch(t){case"style":e.style=ge(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=>pe.includes(e)?"inline":he.includes(e)?"mark":"block")(r),l=be(e.childNodes,t);return{object:s,type:r,data:{dataset:{...e.dataset},attributes:{...a}},nodes:l}}var n;return null},be=(e,t=[])=>{const n=[];for(let r=0;r<e.length;r++){const o=ve(e[r],t);null!==o&&(o._flatten&&o.nodes?n.push(...o.nodes):n.push(o))}return n},ye=n,we=r,{get:xe}=i,{styled:Ce}=o,{renderMath:Ee}=h;function ke(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 Se=Ce("div")(({theme:e})=>({paddingTop:e.spacing(2),paddingBottom:e.spacing(2)})),Re=Ce("span")(()=>({display:"inline-block",width:".75em"})),Ae=["tbody","tr"],_e=(e,t,n,r,o,i)=>{if(!t)return null;const a=[];return(e.nodes||[]).forEach((e,s)=>{const l=e.type?`${e.type}-${s}`:`${s}`;if(e.isMath)return a.push(ye.createElement("span",{dangerouslySetInnerHTML:{__html:`<math displaystyle="true">${e.nodes[0].innerHTML}</math>`}})),a;if(r){const l=r(e,t,n);if(l)return a.push(l),void("td"!==ke([o,"optionalAccess",e=>e.type])&&"drag-in-the-blank"===i&&a.push(ye.createElement(Re,{key:`spacer-${s}`})))}if("text"===e.object){const t=e.leaves.reduce((e,t)=>{const n=t.text,r=((e,t)=>{const n=""===t.trim(),r=e&&e.type;return n&&Ae.includes(r)?void 0:t})(o,n);return r?e+r:e},""),n=(e=>{const t=e.leaves.find(e=>xe(e,"marks",[]).length);return t?t.marks[0]:null})(e);if(n){let e;for(e in me)if(me[e]===n.type){const n=e;a.push(ye.createElement(n,{key:l},t));break}}else t.length>0&&(a.push(t),"td"!==ke([o,"optionalAccess",e=>e.type])&&"drag-in-the-blank"===i&&a.push(ye.createElement(Re,{key:`spacer-${s}`})))}else{const o=_e(e,t,n,r,e,i);if("p"===e.type||"paragraph"===e.type)a.push(ye.createElement(Se,{key:l},o));else{const t=e.type;e.nodes&&e.nodes.length>0?a.push(ye.createElement(t,{key:l,...e.data.attributes},o)):a.push(ye.createElement(t,{key:l,...e.data.attributes}))}}}),a},De=Ce("div")(()=>({display:"initial","&:not(.MathJax) table":{borderCollapse:"collapse"},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:"8px 12px",textAlign:"left"}}));class Te extends ye.Component{constructor(e){super(e),Te.prototype.__init.call(this),this.internalContainerRef=ye.createRef()}static __initStatic(){this.propTypes={renderChildren:we.func,layout:we.object,value:we.object,onChange:we.func,elementType:we.string,containerRef:we.oneOfType([we.func,we.shape({current:we.instanceOf(Element)})])}}componentDidMount(){const e=this.props.containerRef||this.internalContainerRef;e.current&&"function"==typeof Ee&&Ee(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=_e(t,e,this.handleChange,this.props.renderChildren,null,n),i=r||this.internalContainerRef;return ye.createElement(De,{ref:i},o)}}Te.__initStatic();const Me=/\{\{(\d+)\}\}/g;const Oe=n,Ne=r;var Ie;const $e=(e,t)=>{const{markup:n}=(o=t,(r=e)?{markup:r.replace(Me,(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=be(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},Le=(e,t)=>((Ie=class extends Oe.Component{static __initStatic(){this.propTypes={markup:Ne.string,layout:Ne.object,value:Ne.object,onChange:Ne.func,customMarkMarkupComponent:Ne.func,elementType:Ne.string}}constructor(e){super(e),this.containerRef=Oe.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||$e(n,e);return Oe.createElement(Te,{containerRef:this.containerRef,elementType:a,layout:s,value:o,onChange:i,renderChildren:t(this.props)})}}).__initStatic(),Ie),{useMemo:je}=n,{useLayoutEffect:We}=n,{useEffect:Pe}=n,{useRef:Be}=n,{useCallback:He}=n,ze="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function Fe(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function qe(e){return"nodeType"in e}function Ue(e){var t,n;return e?Fe(e)?e:qe(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function Ke(e){const{Document:t}=Ue(e);return e instanceof t}function Ye(e){return!Fe(e)&&e instanceof Ue(e).HTMLElement}function Ve(e){return e instanceof Ue(e).SVGElement}function Xe(e){return e?Fe(e)?e.document:qe(e)?Ke(e)?e:Ye(e)||Ve(e)?e.ownerDocument:document:document:document}const Je=ze?We:Pe;function Qe(e){const t=Be(e);return Je(()=>{t.current=e}),He(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 Ze(e,t){void 0===t&&(t=[e]);const n=Be(e);return Je(()=>{n.current!==e&&(n.current=e)},t),n}function Ge(e,t){const n=Be();return je(()=>{const t=e(n.current);return n.current=t,t},[...t])}function et(e){const t=Qe(e),n=Be(null),r=He(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,r]}function tt(e){const t=Be();return Pe(()=>{t.current=e},[e]),t.current}let nt={};function rt(e,t){return je(()=>{if(t)return t;const n=null==nt[e]?0:nt[e]+1;return nt[e]=n,e+"-"+n},[e,t])}function ot(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 it=ot(1),at=ot(-1);function st(e){if(!e)return!1;const{KeyboardEvent:t}=Ue(e.target);return t&&e instanceof t}function lt(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=Ue(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 ct=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[ct.Translate.toString(e),ct.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),dt="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function ut(e){return e.matches(dt)?e:e.querySelector(dt)}const pt=n,{useState:ht}=n,{useCallback:gt}=n,ft={display:"none"};function mt(e){let{id:t,value:n}=e;return pt.createElement("div",{id:t,style:ft},n)}function vt(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;return pt.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 bt=n,{createContext:yt}=n,{useContext:wt}=n,{useEffect:xt}=n,{useState:Ct}=n,{useCallback:Et}=n,{useMemo:kt}=n,{useRef:St}=n,{memo:Rt}=n,{useReducer:At}=n,{cloneElement:_t}=n,{forwardRef:Dt}=n,{createPortal:Tt}=e,{unstable_batchedUpdates:Mt}=e,Ot=yt(null);const Nt={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 "},It={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 $t(e){let{announcements:t=It,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=Nt}=e;const{announce:i,announcement:a}=function(){const[e,t]=ht("");return{announce:gt(e=>{null!=e&&t(e)},[]),announcement:e}}(),s=rt("DndLiveRegion"),[l,c]=Ct(!1);if(xt(()=>{c(!0)},[]),function(e){const t=wt(Ot);xt(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}(kt(()=>({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=bt.createElement(bt.Fragment,null,bt.createElement(mt,{id:r,value:o.draggable}),bt.createElement(vt,{id:s,announcement:a}));return n?Tt(d,n):d}var Lt;function jt(){}!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"}(Lt||(Lt={}));const Wt=Object.freeze({x:0,y:0});function Pt(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Bt(e,t){const n=lt(e);if(!n)return"0 0";return(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%"}function Ht(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function zt(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Ft(e,t,n){return void 0===t&&(t=e.left),void 0===n&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const qt=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=Ft(t,t.left,t.top),i=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=Pt(Ft(r),o);i.push({id:t,data:{droppableContainer:e,value:n}})}}return i.sort(Ht)};function Ut(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 Kt=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=Ut(i,t);n>0&&o.push({id:r,data:{droppableContainer:e,value:n}})}}return o.sort(zt)};function Yt(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Wt}const Vt=(Xt=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+Xt*t.y,bottom:e.bottom+Xt*t.y,left:e.left+Xt*t.x,right:e.right+Xt*t.x}),{...e})});var Xt;function Jt(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 Qt={ignoreTransform:!1};function Zt(e,t){void 0===t&&(t=Qt);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=Ue(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=Jt(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 Gt(e){return Zt(e,{ignoreTransform:!0})}function en(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if(Ke(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Ye(o)||Ve(o))return n;if(n.includes(o))return n;const i=Ue(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=Ue(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=Ue(e).getComputedStyle(e)),"fixed"===t.position}(o,i)?n:r(o.parentNode)}(e):n}function tn(e){const[t]=en(e,1);return null!=t?t:null}function nn(e){return ze&&e?Fe(e)?e:qe(e)?Ke(e)||e===Xe(e).scrollingElement?window:Ye(e)?e:null:null:null}function rn(e){return Fe(e)?e.scrollX:e.scrollLeft}function on(e){return Fe(e)?e.scrollY:e.scrollTop}function an(e){return{x:rn(e),y:on(e)}}var sn;function ln(e){return!(!ze||!e)&&e===document.scrollingElement}function cn(e){const t={x:0,y:0},n=ln(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"}(sn||(sn={}));const dn={x:.2,y:.2};function un(e,t,n,r,o){let{top:i,left:a,right:s,bottom:l}=n;void 0===r&&(r=10),void 0===o&&(o=dn);const{isTop:c,isBottom:d,isLeft:u,isRight:p}=cn(e),h={x:0,y:0},g={x:0,y:0},f=t.height*o.y,m=t.width*o.x;return!c&&i<=t.top+f?(h.y=sn.Backward,g.y=r*Math.abs((t.top+f-i)/f)):!d&&l>=t.bottom-f&&(h.y=sn.Forward,g.y=r*Math.abs((t.bottom-f-l)/f)),!p&&s>=t.right-m?(h.x=sn.Forward,g.x=r*Math.abs((t.right-m-s)/m)):!u&&a<=t.left+m&&(h.x=sn.Backward,g.x=r*Math.abs((t.left+m-a)/m)),{direction:h,speed:g}}function pn(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 hn(e){return e.reduce((e,t)=>it(e,an(t)),Wt)}function gn(e,t){if(void 0===t&&(t=Zt),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);tn(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const fn=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+rn(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+on(t),0)}]];class mn{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=en(t),r=hn(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of fn)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 vn{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 bn(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 yn,wn;function xn(e){e.preventDefault()}function Cn(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"}(yn||(yn={})),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"}(wn||(wn={}));const En={start:[wn.Space,wn.Enter],cancel:[wn.Esc],end:[wn.Space,wn.Enter,wn.Tab]},kn=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case wn.Right:return{...n,x:n.x+25};case wn.Left:return{...n,x:n.x-25};case wn.Down:return{...n,y:n.y+25};case wn.Up:return{...n,y:n.y-25}}};class Sn{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 vn(Xe(t)),this.windowListeners=new vn(Ue(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(yn.Resize,this.handleCancel),this.windowListeners.add(yn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(yn.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&gn(n),t(Wt)}handleKeyDown(e){if(st(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=En,coordinateGetter:i=kn,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}:Wt;this.referenceCoordinates||(this.referenceCoordinates=c);const d=i(e,{active:t,context:n.current,currentCoordinates:c});if(d){const t=at(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}=cn(n),h=pn(n),g={x:Math.min(o===wn.Right?h.right-h.width/2:h.right,Math.max(o===wn.Right?h.left:h.left+h.width/2,d.x)),y:Math.min(o===wn.Down?h.bottom-h.height/2:h.bottom,Math.max(o===wn.Down?h.top:h.top+h.height/2,d.y))},f=o===wn.Right&&!s||o===wn.Left&&!l,m=o===wn.Down&&!c||o===wn.Up&&!i;if(f&&g.x!==d.x){const e=n.scrollLeft+t.x,i=o===wn.Right&&e<=u.x||o===wn.Left&&e>=p.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:a});r.x=i?n.scrollLeft-e:o===wn.Right?n.scrollLeft-u.x:n.scrollLeft-p.x,r.x&&n.scrollBy({left:-r.x,behavior:a});break}if(m&&g.y!==d.y){const e=n.scrollTop+t.y,i=o===wn.Down&&e<=u.y||o===wn.Up&&e>=p.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:a});r.y=i?n.scrollTop-e:o===wn.Down?n.scrollTop-u.y:n.scrollTop-p.y,r.y&&n.scrollBy({top:-r.y,behavior:a});break}}this.handleMove(e,it(at(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 Rn(e){return Boolean(e&&"distance"in e)}function An(e){return Boolean(e&&"delay"in e)}Sn.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=En,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 _n{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=Ue(e);return e instanceof t?e:Xe(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=Xe(i),this.documentListeners=new vn(this.document),this.listeners=new vn(n),this.windowListeners=new vn(Ue(i)),this.initialCoordinates=null!=(r=lt(o))?r:Wt,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(yn.Resize,this.handleCancel),this.windowListeners.add(yn.DragStart,xn),this.windowListeners.add(yn.VisibilityChange,this.handleCancel),this.windowListeners.add(yn.ContextMenu,xn),this.documentListeners.add(yn.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(An(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(Rn(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(yn.Click,Cn,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(yn.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=lt(e))?t:Wt,l=at(r,s);if(!n&&a){if(Rn(a)){if(null!=a.tolerance&&bn(l,a.tolerance))return this.handleCancel();if(bn(l,a.distance))return this.handleStart()}return An(a)&&bn(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===wn.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const Dn={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Tn extends _n{constructor(e){const{event:t}=e,n=Xe(t.target);super(e,Dn,n)}}Tn.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 Mn={move:{name:"mousemove"},end:{name:"mouseup"}};var On;!function(e){e[e.RightClick=2]="RightClick"}(On||(On={}));(class extends _n{constructor(e){super(e,Mn,Xe(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==On.RightClick&&(null==r||r({event:n}),!0)}}];const Nn={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var In,$n;function Ln(e){let{acceleration:t,activator:n=In.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:a=5,order:s=$n.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:d,delta:u,threshold:p}=e;const h=function(e){let{delta:t,disabled:n}=e;const r=tt(t);return Ge(e=>{if(n||!r||!e)return jn;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[sn.Backward]:e.x[sn.Backward]||-1===o.x,[sn.Forward]:e.x[sn.Forward]||1===o.x},y:{[sn.Backward]:e.y[sn.Backward]||-1===o.y,[sn.Forward]:e.y[sn.Forward]||1===o.y}}},[n,t,r])}({delta:u,disabled:!i}),[g,f]=function(){const e=Be(null);return[He((t,n)=>{e.current=setInterval(t,n)},[]),He(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}(),m=St({x:0,y:0}),v=St({x:0,y:0}),b=kt(()=>{switch(n){case In.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case In.DraggableRect:return o}},[n,o,l]),y=St(null),w=Et(()=>{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=kt(()=>s===$n.TreeOrder?[...c].reverse():c,[s,c]);xt(()=>{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}=un(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 f(),y.current=e,g(w,a),m.current=s,void(v.current=i)}m.current={x:0,y:0},v.current={x:0,y:0},f()}else f()},[t,w,r,f,i,a,JSON.stringify(b),JSON.stringify(h),g,c,x,d,JSON.stringify(p)])}(class extends _n{constructor(e){super(e,Nn)}static setup(){return window.addEventListener(Nn.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Nn.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"}(In||(In={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}($n||($n={}));const jn={x:{[sn.Backward]:!1,[sn.Forward]:!1},y:{[sn.Backward]:!1,[sn.Forward]:!1}};var Wn,Pn;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(Wn||(Wn={})),function(e){e.Optimized="optimized"}(Pn||(Pn={}));const Bn=new Map;function Hn(e,t){return Ge(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function zn(e){let{callback:t,disabled:n}=e;const r=Qe(t),o=kt(()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(r)},[n]);return xt(()=>()=>null==o?void 0:o.disconnect(),[o]),o}function Fn(e){return new mn(Zt(e),e)}function qn(e,t,n){void 0===t&&(t=Fn);const[r,o]=Ct(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=Qe(t),o=kt(()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(r)},[r,n]);return xt(()=>()=>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=zn({callback:i});return Je(()=>{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 Un=[];function Kn(e,t){void 0===t&&(t=[]);const n=St(null);return xt(()=>{n.current=null},t),xt(()=>{const t=e!==Wt;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?at(e,n.current):Wt}function Yn(e){return kt(()=>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 Vn=[];function Xn(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Ye(t)?t:e}const Jn=[{sensor:Tn,options:{}},{sensor:Sn,options:{}}],Qn={current:{}},Zn={draggable:{measure:Gt},droppable:{measure:Gt,strategy:Wn.WhileDragging,frequency:Pn.Optimized},dragOverlay:{measure:Zt}};class Gn 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 er={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Gn,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:jt},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Zn,measureDroppableContainers:jt,windowRect:null,measuringScheduled:!1},tr={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:jt,draggableNodes:new Map,over:null,measureDroppableContainers:jt},nr=yt(tr),rr=yt(er);function or(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Gn}}}function ir(e,t){switch(t.type){case Lt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Lt.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 Lt.DragEnd:case Lt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Lt.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Gn(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case Lt.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 Gn(e.droppable.containers);return a.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case Lt.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new Gn(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function ar(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=wt(nr),i=tt(r),a=tt(null==n?void 0:n.id);return xt(()=>{if(!t&&!r&&i&&null!=a){if(!st(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=ut(e);if(t){t.focus();break}}})}},[r,t,o,a,i]),null}function sr(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}const lr=yt({...Wt,scaleX:1,scaleY:1});var cr;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(cr||(cr={})),Rt(function(e){var t,n,r,o;let{id:i,accessibility:a,autoScroll:s=!0,children:l,sensors:c=Jn,collisionDetection:d=Kt,measuring:u,modifiers:p,...h}=e;const g=At(ir,void 0,or),[f,m]=g,[v,b]=function(){const[e]=Ct(()=>new Set),t=Et(t=>(e.add(t),()=>e.delete(t)),[e]);return[Et(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]=Ct(cr.Uninitialized),x=y===cr.Initialized,{draggable:{active:C,nodes:E,translate:k},droppable:{containers:S}}=f,R=null!=C?E.get(C):null,A=St({initial:null,translated:null}),_=kt(()=>{var e;return null!=C?{id:C,data:null!=(e=null==R?void 0:R.data)?e:Qn,rect:A}:null},[C,R]),D=St(null),[T,M]=Ct(null),[O,N]=Ct(null),I=Ze(h,Object.values(h)),$=rt("DndDescribedBy",i),L=kt(()=>S.getEnabled(),[S]),j=kt(()=>({draggable:{...Zn.draggable,...null==W?void 0:W.draggable},droppable:{...Zn.droppable,...null==W?void 0:W.droppable},dragOverlay:{...Zn.dragOverlay,...null==W?void 0:W.dragOverlay}}),[null==(W=u)?void 0:W.draggable,null==W?void 0:W.droppable,null==W?void 0:W.dragOverlay]);var W;const{droppableRects:P,measureDroppableContainers:B,measuringScheduled:H}=function(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,a]=Ct(null),{frequency:s,measure:l,strategy:c}=o,d=St(e),u=function(){switch(c){case Wn.Always:return!1;case Wn.BeforeDragging:return n;default:return!n}}(),p=Ze(u),h=Et(function(e){void 0===e&&(e=[]),p.current||a(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[p]),g=St(null),f=Ge(t=>{if(u&&!n)return Bn;if(!t||t===Bn||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 mn(l(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,i,n,u,l]);return xt(()=>{d.current=e},[e]),xt(()=>{u||h()},[n,u]),xt(()=>{i&&i.length>0&&a(null)},[JSON.stringify(i)]),xt(()=>{u||"number"!=typeof s||null!==g.current||(g.current=setTimeout(()=>{h(),g.current=null},s))},[s,u,h,...r]),{droppableRects:f,measureDroppableContainers:h,measuringScheduled:null!=i}}(L,{dragging:x,dependencies:[k.x,k.y],config:j.droppable}),z=function(e,t){const n=null!=t?e.get(t):void 0,r=n?n.node.current:null;return Ge(e=>{var n;return null==t?null:null!=(n=null!=r?r:e)?n:null},[r,t])}(E,C),F=kt(()=>O?lt(O):null,[O]),q=function(){const e=!1===(null==T?void 0:T.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 Hn(e,t)}(z,j.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=St(!1),{x:a,y:s}="boolean"==typeof o?{x:o,y:o}:o;Je(()=>{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=Yt(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=tn(e);t&&t.scrollBy({top:o.y,left:o.x})}},[t,a,s,r,n])}({activeNode:null!=C?E.get(C):null,config:q.layoutShiftCompensation,initialRect:U,measure:j.draggable.measure});const K=qn(z,j.draggable.measure,U),Y=qn(z?z.parentElement:null),V=St({activatorEvent:null,active:null,activeNode:z,collisionRect:null,collisions:null,droppableRects:P,draggableNodes:E,draggingNode:null,draggingNodeRect:null,droppableContainers:S,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),X=S.getNodeFor(null==(t=V.current.over)?void 0:t.id),J=function(e){let{measure:t}=e;const[n,r]=Ct(null),o=zn({callback:Et(e=>{for(const{target:n}of e)if(Ye(n)){r(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),i=Et(e=>{const n=Xn(e);null==o||o.disconnect(),n&&(null==o||o.observe(n)),r(n?t(n):null)},[t,o]),[a,s]=et(i);return kt(()=>({nodeRef:a,rect:n,setRef:s}),[n,a,s])}({measure:j.dragOverlay.measure}),Q=null!=(n=J.nodeRef.current)?n:z,Z=x?null!=(r=J.rect)?r:K:null,G=Boolean(J.nodeRef.current&&J.rect),ee=Yt(te=G?null:K,Hn(te));var te;const ne=Yn(Q?Ue(Q):null),re=function(e){const t=St(e),n=Ge(n=>e?n&&n!==Un&&e&&t.current&&e.parentNode===t.current.parentNode?n:en(e):Un,[e]);return xt(()=>{t.current=e},[e]),n}(x?null!=X?X:z:null),oe=function(e,t){void 0===t&&(t=Zt);const[n]=e,r=Yn(n?Ue(n):null),[o,i]=Ct(Vn);function a(){i(()=>e.length?e.map(e=>ln(e)?r:new mn(t(e),e)):Vn)}const s=zn({callback:a});return Je(()=>{null==s||s.disconnect(),a(),e.forEach(e=>null==s?void 0:s.observe(e))},[e]),o}(re),ie=sr(p,{transform:{x:k.x-ee.x,y:k.y-ee.y,scaleX:1,scaleY:1},activatorEvent:O,active:_,activeNodeRect:K,containerNodeRect:Y,draggingNodeRect:Z,over:V.current.over,overlayNodeRect:J.rect,scrollableAncestors:re,scrollableAncestorRects:oe,windowRect:ne}),ae=F?it(F,k):null,se=function(e){const[t,n]=Ct(null),r=St(e),o=Et(e=>{const t=nn(e.target);t&&n(e=>e?(e.set(t,an(t)),new Map(e)):null)},[]);return xt(()=>{const t=r.current;if(e!==t){i(t);const a=e.map(e=>{const t=nn(e);return t?(t.addEventListener("scroll",o,{passive:!0}),[t,an(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=nn(e);null==t||t.removeEventListener("scroll",o)})}},[o,e]),kt(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>it(e,t),Wt):hn(e):Wt,[e,t])}(re),le=Kn(se),ce=Kn(se,[K]),de=it(ie,le),ue=Z?Vt(Z,ie):null,pe=_&&ue?d({active:_,collisionRect:ue,droppableRects:P,droppableContainers:L,pointerCoordinates:ae}):null,he=function(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}(pe,"id"),[ge,fe]=Ct(null),me=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(G?ie:it(ie,ce),null!=(o=null==ge?void 0:ge.rect)?o:null,K),ve=St(null),be=Et((e,t)=>{let{sensor:n,options:r}=t;if(null==D.current)return;const o=E.get(D.current);if(!o)return;const i=e.nativeEvent,a=new n({active:D.current,activeNode:o,event:i,options:r,context:V,onAbort(e){if(!E.get(e))return;const{onDragAbort:t}=I.current,n={id:e};null==t||t(n),v({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!E.get(e))return;const{onDragPending:o}=I.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=E.get(t);if(!n)return;const{onDragStart:r}=I.current,o={activatorEvent:i,active:{id:t,data:n.data,rect:A}};Mt(()=>{null==r||r(o),w(cr.Initializing),m({type:Lt.DragStart,initialCoordinates:e,active:t}),v({type:"onDragStart",event:o}),M(ve.current),N(i)})},onMove(e){m({type:Lt.DragMove,coordinates:e})},onEnd:s(Lt.DragEnd),onCancel:s(Lt.DragCancel)});function s(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:o}=V.current;let a=null;if(t&&o){const{cancelDrop:s}=I.current;if(a={activatorEvent:i,active:t,collisions:n,delta:o,over:r},e===Lt.DragEnd&&"function"==typeof s){await Promise.resolve(s(a))&&(e=Lt.DragCancel)}}D.current=null,Mt(()=>{m({type:e}),w(cr.Uninitialized),fe(null),M(null),N(null),ve.current=null;const t=e===Lt.DragEnd?"onDragEnd":"onDragCancel";if(a){const e=I.current[t];null==e||e(a),v({type:t,event:a})}})}}ve.current=a},[E]),ye=Et((e,t)=>(n,r)=>{const o=n.nativeEvent,i=E.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))},[E,be]),we=function(e,t){return kt(()=>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){xt(()=>{if(!ze)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),Je(()=>{K&&y===cr.Initializing&&w(cr.Initialized)},[K,y]),xt(()=>{const{onDragMove:e}=I.current,{active:t,activatorEvent:n,collisions:r,over:o}=V.current;if(!t||!n)return;const i={active:t,activatorEvent:n,collisions:r,delta:{x:de.x,y:de.y},over:o};Mt(()=>{null==e||e(i),v({type:"onDragMove",event:i})})},[de.x,de.y]),xt(()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:o}=V.current;if(!e||null==D.current||!t||!o)return;const{onDragOver:i}=I.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};Mt(()=>{fe(s),null==i||i(l),v({type:"onDragOver",event:l})})},[he]),Je(()=>{V.current={activatorEvent:O,active:_,activeNode:z,collisionRect:ue,collisions:pe,droppableRects:P,draggableNodes:E,draggingNode:Q,draggingNodeRect:Z,droppableContainers:S,over:ge,scrollableAncestors:re,scrollAdjustedTranslate:de},A.current={initial:Z,translated:ue}},[_,z,pe,ue,E,Q,Z,P,S,ge,re,de]),Ln({...q,delta:k,draggingRect:ue,pointerCoordinates:ae,scrollableAncestors:re,scrollableAncestorRects:oe});const xe=kt(()=>({active:_,activeNode:z,activeNodeRect:K,activatorEvent:O,collisions:pe,containerNodeRect:Y,dragOverlay:J,draggableNodes:E,droppableContainers:S,droppableRects:P,over:ge,measureDroppableContainers:B,scrollableAncestors:re,scrollableAncestorRects:oe,measuringConfiguration:j,measuringScheduled:H,windowRect:ne}),[_,z,K,O,pe,Y,J,E,S,P,ge,B,re,oe,j,H,ne]),Ce=kt(()=>({activatorEvent:O,activators:we,active:_,activeNodeRect:K,ariaDescribedById:{draggable:$},dispatch:m,draggableNodes:E,over:ge,measureDroppableContainers:B}),[O,we,_,K,m,$,E,ge,B]);return bt.createElement(Ot.Provider,{value:b},bt.createElement(nr.Provider,{value:Ce},bt.createElement(rr.Provider,{value:xe},bt.createElement(lr.Provider,{value:me},l)),bt.createElement(ar,{disabled:!1===(null==a?void 0:a.restoreFocus)})),bt.createElement($t,{...a,hiddenTextDescribedById:$}))});const dr=yt(null),ur="button";function pr(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=rt("Draggable"),{activators:a,activatorEvent:s,active:l,activeNodeRect:c,ariaDescribedById:d,draggableNodes:u,over:p}=wt(nr),{role:h=ur,roleDescription:g="draggable",tabIndex:f=0}=null!=o?o:{},m=(null==l?void 0:l.id)===t,v=wt(m?lr:dr),[b,y]=et(),[w,x]=et(),C=function(e,t){return kt(()=>e.reduce((e,n)=>{let{eventName:r,handler:o}=n;return e[r]=e=>{o(e,t)},e},{}),[e,t])}(a,t),E=Ze(n);Je(()=>(u.set(t,{id:t,key:i,node:b,activatorNode:w,data:E}),()=>{const e=u.get(t);e&&e.key===i&&u.delete(t)}),[u,t]);return{active:l,activatorEvent:s,activeNodeRect:c,attributes:kt(()=>({role:h,tabIndex:f,"aria-disabled":r,"aria-pressed":!(!m||h!==ur)||void 0,"aria-roledescription":g,"aria-describedby":d.draggable}),[r,h,f,m,g,d.draggable]),isDragging:m,listeners:r?void 0:C,node:b,over:p,setNodeRef:y,setActivatorNodeRef:x,transform:v}}const hr={timeout:25};function gr(e){let{animation:t,children:n}=e;const[r,o]=Ct(null),[i,a]=Ct(null),s=tt(n);return n||r||!s||o(s),Je(()=>{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]),bt.createElement(bt.Fragment,null,n,r?_t(r,{ref:a}):null)}const fr={x:0,y:0,scaleX:1,scaleY:1};function mr(e){let{children:t}=e;return bt.createElement(nr.Provider,{value:tr},bt.createElement(lr.Provider,{value:fr},t))}const vr={position:"fixed",touchAction:"none"},br=e=>st(e)?"transform 250ms ease":void 0,yr=Dt((e,t)=>{let{as:n,activatorEvent:r,adjustScale:o,children:i,className:a,rect:s,style:l,transform:c,transition:d=br}=e;if(!s)return null;const u=o?c:{...c,scaleX:1,scaleY:1},p={...vr,width:s.width,height:s.height,top:s.top,left:s.left,transform:ct.Transform.toString(u),transformOrigin:o&&r?Bt(r,s):void 0,transition:"function"==typeof d?d(r):d,...l};return bt.createElement(n,{className:a,style:p,ref:t},i)}),wr={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:ct.Transform.toString(t)},{transform:ct.Transform.toString(n)}]},sideEffects:(xr={styles:{active:{opacity:"0"}}},e=>{let{active:t,dragOverlay:n}=e;const r={},{styles:o,className:i}=xr;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 xr;function Cr(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return Qe((e,i)=>{if(null===t)return;const a=n.get(e);if(!a)return;const s=a.node.current;if(!s)return;const l=Xn(i);if(!l)return;const{transform:c}=Ue(i).getComputedStyle(i),d=Jt(c);if(!d)return;const u="function"==typeof t?t:function(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...wr,...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,g=p[p.length-1];if(JSON.stringify(h)===JSON.stringify(g))return;const f=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==f||f(),e()}})}}(t);return gn(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 Er=0;function kr(e){return kt(()=>{if(null!=e)return Er++,Er},[e])}const Sr=bt.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:g,droppableContainers:f,dragOverlay:m,over:v,measuringConfiguration:b,scrollableAncestors:y,scrollableAncestorRects:w,windowRect:x}=wt(rr),C=wt(lr),E=kr(null==u?void 0:u.id),k=sr(a,{activatorEvent:d,active:u,activeNodeRect:p,containerNodeRect:h,draggingNodeRect:m.rect,over:v,overlayNodeRect:m.rect,scrollableAncestors:y,scrollableAncestorRects:w,transform:C,windowRect:x}),S=Hn(p),R=Cr({config:r,draggableNodes:g,droppableContainers:f,measuringConfiguration:b}),A=S?m.setRef:void 0;return bt.createElement(mr,null,bt.createElement(gr,{animation:R},u&&E?bt.createElement(yr,{key:E,id:u.id,ref:A,as:s,activatorEvent:d,adjustScale:t,className:l,transition:i,rect:S,style:{zIndex:c,...o},transform:k},n):null))}),Rr=n,{useEffect:Ar}=n,{useRef:_r}=n,Dr=r,{styled:Tr}=o,{Chip:Mr}=a,{color:Or}=s,{renderMath:Nr}=h;function Ir(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],i=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=i(n)):"call"!==o&&"optionalCall"!==o||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}const $r=Tr("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&&{}})),Lr=Tr(Mr)(()=>({backgroundColor:Or.white(),border:`1px solid ${Or.text()}`,color:Or.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}})),jr=Tr("span")(()=>({whiteSpace:"normal","& img":{display:"block",padding:"2px 0"},"& mjx-frac":{fontSize:"120% !important"}}));function Wr({choice:e,disabled:t,instanceId:n}){const r=_r(null),{attributes:o,listeners:i,setNodeRef:a,isDragging:s}=pr({id:`choice-${e.id}`,data:{choice:e,instanceId:n,fromChoice:!0,type:"MaskBlank"},disabled:t});return Ar(()=>{Nr(r.current)},[e.value]),Rr.createElement($r,{ref:a,style:s?{width:Ir([r,"access",e=>e.current,"optionalAccess",e=>e.offsetWidth]),height:Ir([r,"access",e=>e.current,"optionalAccess",e=>e.offsetHeight])}:{},disabled:t,...i,...o},Rr.createElement(Lr,{clickable:!1,disabled:t,ref:r,label:Rr.createElement(jr,{dangerouslySetInnerHTML:{__html:e.value}})}))}Wr.propTypes={choice:Dr.object.isRequired,disabled:Dr.bool,instanceId:Dr.oneOfType([Dr.string,Dr.number])};const Pr=n,Br=r,{findKey:Hr}=i,{DragDroppablePlaceholder:zr}=g;class Fr extends Pr.Component{constructor(...e){super(...e),Fr.prototype.__init.call(this)}static __initStatic(){this.propTypes={disabled:Br.bool,duplicates:Br.bool,choices:Br.arrayOf(Br.shape({label:Br.string,value:Br.string})),value:Br.object,choicePosition:Br.string.isRequired,instanceId:Br.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;return void 0===Hr(r,t=>t===e.id)}),a={...this.getStyleForWrapper(),minWidth:"100px"};return Pr.createElement("div",{style:a},Pr.createElement(zr,{disabled:e,instanceId:o},i.map((t,n)=>Pr.createElement(Wr,{key:`${t.value}-${n}`,disabled:e,choice:t,instanceId:o}))))}}Fr.__initStatic();var qr={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"};const Ur=n,{useRef:Kr}=n,{useState:Yr}=n,{useEffect:Vr}=n,Xr=r,Jr=t,{styled:Qr}=o,{Chip:Zr}=a,Gr=l,{color:eo}=s,{renderMath:to}=h;function no(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}Jr("pie-lib:mask-markup:blank");const ro=Qr("span")(({dragged:e,over:t})=>({border:`solid 0px ${eo.primary()}`,minWidth:"200px",touchAction:"none",overflow:"hidden",whiteSpace:"nowrap",opacity:1,...t&&{whiteSpace:"nowrap",overflow:"hidden"},...e&&{opacity:.5}})),oo=Qr(Zr)(()=>({backgroundColor:eo.background(),border:`2px dashed ${eo.text()}`,color:eo.text(),fontSize:"inherit",maxWidth:"374px",position:"relative",borderRadius:"3px","&.over":{whiteSpace:"nowrap",overflow:"hidden"},"&.parentOver":{border:`1px solid ${qr[500]}`,backgroundColor:`${qr[300]}`},"&.correct":{border:`solid 1px ${eo.correct()}`},"&.incorrect":{border:`solid 1px ${eo.incorrect()}`},"&.Mui-disabled":{opacity:1}})),io=Qr("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"}}));function ao({disabled:e,choice:t,isOver:n,isDragging:r,dragItem:o,correct:i,emptyResponseAreaWidth:a,emptyResponseAreaHeight:s}){const l=Kr(null),c=Kr(null),d=Kr(null),[u,p]=Yr({height:0,width:0}),h=()=>{f()},g=()=>{const e=no([c,"access",e=>e.current,"optionalAccess",e=>e.querySelector,"call",e=>e("img")]);e?e.onload=h:setTimeout(()=>{f()},300)},f=()=>{if(c.current&&l.current){l.current.style.width="auto";const e=(c.current.offsetWidth||0)+24,t=(c.current.offsetHeight||0)+24,n=parseFloat(a)||0,r=parseFloat(s)||0,o=e<=n?n:e,i=t<=r?r:t;p(e=>({width:o>n?o:e.width,height:i>r?i:e.height})),l.current.style.width=`${o}px`,l.current.style.height=`${i}px`}};Vr(()=>{g()},[]),Vr(()=>{l.current&&to(l.current)},[n,no([o,"optionalAccess",e=>e.choice,"optionalAccess",e=>e.value])]),Vr(()=>{t?g():p({height:0,width:0})},[t]),Vr(()=>{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:no([d,"access",e=>e.current,"optionalAccess",e=>e.width]),height:no([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 Ur.createElement(oo,{clickable:!1,disabled:e,ref:l,component:"span",label:Ur.createElement(Ur.Fragment,null,Ur.createElement(io,{ref:c,draggable:!0,className:Gr({over:n,hidden:m}),dangerouslySetInnerHTML:{__html:v||""}}),m&&Ur.createElement(io,{draggable:!0,className:Gr({over:n,dragged:!0}),dangerouslySetInnerHTML:{__html:m||""}})),className:Gr({over:n,parentOver:n,correct:void 0!==i&&i,incorrect:void 0!==i&&!i}),variant:e?"outlined":void 0,style:b})}function so({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}=pr({id:`mask-blank-drag-${e}`,disabled:t||!r,data:{id:e,choice:r,instanceId:l,fromChoice:!1,type:"MaskBlank"}}),{setNodeRef:g,isOver:f,active:m}=function(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=rt("Droppable"),{active:a,dispatch:s,over:l,measureDroppableContainers:c}=wt(nr),d=St({disabled:n}),u=St(!1),p=St(null),h=St(null),{disabled:g,updateMeasurementsFor:f,timeout:m}={...hr,...o},v=Ze(null!=f?f:r),b=zn({callback:Et(()=>{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:g||!a}),y=Et((e,t)=>{b&&(t&&(b.unobserve(t),u.current=!1),e&&b.observe(e))},[b]),[w,x]=et(y),C=Ze(t);return xt(()=>{b&&w.current&&(b.disconnect(),u.current=!1,b.observe(w.current))},[w,b]),xt(()=>(s({type:Lt.RegisterDroppable,element:{id:r,key:i,disabled:n,node:w,rect:p,data:C}}),()=>s({type:Lt.UnregisterDroppable,key:i,id:r})),[r]),xt(()=>{n!==d.current.disabled&&(s({type:Lt.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:ct.Translate.toString(p)};return Ur.createElement(ro,{ref:e=>{u(e),g(e)},style:v,dragged:h,over:f,...c,...d},Ur.createElement(ao,{id:e,disabled:t,duplicates:n,choice:r,isOver:f,dragItem:no([m,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current]),correct:o,onChange:i,emptyResponseAreaWidth:a,emptyResponseAreaHeight:s,instanceId:l}))}ao.defaultProps={emptyResponseAreaWidth:0,emptyResponseAreaHeight:0},ao.propTypes={id:Xr.oneOfType([Xr.string,Xr.number]),disabled:Xr.bool,duplicates:Xr.bool,choice:Xr.object,isOver:Xr.bool,dragItem:Xr.object,correct:Xr.bool,onChange:Xr.func,emptyResponseAreaWidth:Xr.oneOfType([Xr.string,Xr.number]),emptyResponseAreaHeight:Xr.oneOfType([Xr.string,Xr.number]),instanceId:Xr.string},so.defaultProps={emptyResponseAreaWidth:0,emptyResponseAreaHeight:0},so.propTypes={id:Xr.oneOfType([Xr.string,Xr.number]),disabled:Xr.bool,duplicates:Xr.bool,choice:Xr.object,correct:Xr.bool,onChange:Xr.func,emptyResponseAreaWidth:Xr.oneOfType([Xr.string,Xr.number]),emptyResponseAreaHeight:Xr.oneOfType([Xr.string,Xr.number]),instanceId:Xr.string};const lo=n,co=r,{DragProvider:uo}=g;function po(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 ho=Le("blank",e=>(t,n,r)=>{const o=po([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,g=c?s[o.id]:n[o.id],f=g&&e.choices.find(e=>e.id===g);return lo.createElement(so,{key:`${t.type}-${o.id}`,correct:c||l&&l[o.id],disabled:i,duplicates:a,choice:f,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 go extends lo.Component{constructor(e){super(e),go.prototype.__init.call(this),go.prototype.__init2.call(this),go.prototype.__init3.call(this),go.prototype.__init4.call(this),this.state={activeDragItem:null}}static __initStatic(){this.propTypes={markup:co.string,layout:co.object,choicesPosition:co.string,choices:co.array,value:co.object,onChange:co.func,duplicates:co.bool,disabled:co.bool,feedback:co.object,correctResponse:co.object,showCorrectAnswer:co.bool,emptyResponseAreaWidth:co.oneOfType([co.string,co.number]),emptyResponseAreaHeight:co.oneOfType([co.string,co.number]),instanceId:co.string}}static __initStatic2(){this.defaultProps={instanceId:"drag-in-the-blank"}}__init(){this.handleDragStart=e=>{const{active:t}=e;po([t,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current])&&this.setState({activeDragItem:t.data.current})}}__init2(){this.renderDragOverlay=()=>{const{activeDragItem:e}=this.state;return e&&"MaskBlank"===e.type?lo.createElement(Wr,{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;if(this.setState({activeDragItem:null}),!n||!t||!r)return;const i=t.data.current,a=n.data.current;if("MaskBlank"===po([i,"optionalAccess",e=>e.type])&&po([a,"optionalAccess",e=>e.accepts,"optionalAccess",e=>e.includes,"call",e=>e("MaskBlank")])){const e=i,t=a.id;if(!0===a.toChoiceBoard){if(!e.fromChoice&&e.id){const t={...o};delete t[e.id],r(t)}}else if(!0===e.fromChoice){if(t&&"drag-in-the-blank-droppable"!==t){const n={...o};n[t]=e.choice.id,r(n)}}else if(e.id&&e.id!==t){const n={...o};n[t]=e.choice.id,delete n[e.id],r(n)}}}}__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,g=o||"below",f={display:"flex",minWidth:"100px",...this.getPositionDirection(g)};return lo.createElement(uo,{onDragStart:this.handleDragStart,onDragEnd:this.handleDragEnd,collisionDetection:qt},lo.createElement("div",{ref:e=>this.rootRef=e,style:f},lo.createElement(Fr,{choicePosition:g,choices:i,value:n,duplicates:t,disabled:s,instanceId:h}),lo.createElement(ho,{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}),lo.createElement(Sr,{style:{pointerEvents:"none"}},this.renderDragOverlay())))}}go.__initStatic(),go.__initStatic2();const fo=n,{styled:mo}=o,vo=l,{color:bo}=s;function yo(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 wo,xo;"undefined"!=typeof window&&(wo=require("@pie-lib/editable-html-tip-tap").default,xo=mo(wo)(()=>({display:"inline-block",verticalAlign:"middle",margin:"4px",borderRadius:"4px",border:`1px solid ${bo.black()}`,"&.correct":{border:`1px solid ${bo.correct()}`},"&.incorrect":{border:`1px solid ${bo.incorrect()}`}})));Le("input",e=>(t,n)=>{const{adjustedLimit:r,disabled:o,feedback:i,showCorrectAnswer:a,maxLength:s,spellCheck:l,pluginProps:c,onChange:d}=e,u=yo([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]||"",g=s&&s[u.id],f=i&&i[u.id],m=a||"correct"===f,v=!a&&"incorrect"===f,b=e=>{const t={...n,[u.id]:e};d(t)},y=e=>{if("Enter"===e.key||13===e.keyCode)return!0};return fo.createElement(xo,{id:u.id,key:`${t.type}-input-${u.id}`,disabled:a||o,disableUnderline:!0,onChange:b,markup:h||"",charactersLimit:r?g:25,activePlugins:["languageCharacters"],pluginProps:c,languageCharactersProps:[{language:"spanish"}],spellCheck:l,width:`calc(${g}em + 32px)`,onKeyDown:y,autoWidthToolbar:!0,toolbarOpts:{minWidth:"auto",noBorder:!0,isHidden:!!yo([c,"optionalAccess",e=>e.characters,"optionalAccess",e=>e.disabled])},className:vo({correct:m,incorrect:v})})}});var Co=Le("input",e=>(t,n,r)=>{const o=t.data&&t.data.dataset||{};if("input"===o.component)return e.customMarkMarkupComponent(o.id)});const Eo=n,ko=r,{Button:So}=a,{InputLabel:Ro}=a,{Menu:Ao}=a,{MenuItem:_o}=a,{ArrowDropDown:Do}=c,{ArrowDropUp:To}=c,{Close:Mo}=c,{Check:Oo}=c,{styled:No}=o,{color:Io}=s,{renderMath:$o}=h,Lo=No(So)(()=>({color:Io.text(),border:`1px solid ${Io.borderGray()}`,borderRadius:"4px",justifyContent:"space-between",backgroundColor:Io.background(),position:"relative",height:"45px",width:"fit-content",margin:"2px",textTransform:"none","& span":{paddingRight:"5px"},"& svg":{position:"absolute",right:0,top:"calc(50% - 12px)",pointerEvents:"none",color:Io.text(),marginLeft:"5px"},"&.Mui-focused":{outline:`3px solid ${Io.tertiary()}`,outlineOffset:"2px",borderWidth:"3px"},"&.disabledCorrect":{borderWidth:"2px",borderColor:Io.correct(),color:`${Io.text()} !important`},"&.disabledIncorrect":{borderWidth:"2px",borderColor:Io.incorrectWithIcon(),color:`${Io.text()} !important`}})),jo=No(Ao)(()=>({backgroundColor:Io.background(),border:`1px solid ${Io.correct()} !important`,"&:hover":{border:`1px solid ${Io.text()} `,borderColor:"initial"},"&:focus":{border:`1px solid ${Io.text()}`,borderColor:"initial"},"& .MuiList-root":{padding:0}})),Wo=No(_o)(()=>({color:Io.text(),backgroundColor:Io.background(),"&.Mui-focused":{outline:`3px solid ${Io.tertiary()}`,outlineOffset:"-1px",color:Io.text(),backgroundColor:Io.background()},"&:hover":{color:Io.text(),backgroundColor:Io.dropdownBackground()},boxSizing:"border-box",padding:"25px",borderRadius:"4px","&.selected":{color:`${Io.text()} !important`,backgroundColor:`${Io.background()} !important`,"&:hover":{color:Io.text(),backgroundColor:`${Io.dropdownBackground()} !important`}}})),Po=No("span")(()=>({fontSize:"max(1rem, 14px)"})),Bo=No("span")(()=>({fontSize:"max(1rem, 14px)",position:"absolute",right:"10px"})),Ho=No(Ro)(()=>({position:"absolute",left:"-10000px",top:"auto",width:"1px",height:"1px",overflow:"hidden"})),zo=No(Oo)(()=>({color:`${Io.white()} !important`,position:"absolute",top:"-8px !important",left:"-8px",marginLeft:"0 !important",borderRadius:"50%",fontSize:"16px",padding:"2px","&.correct":{backgroundColor:Io.correct()},"&.incorrect":{backgroundColor:Io.incorrectWithIcon()}})),Fo=No(Mo)(()=>({color:`${Io.white()} !important`,position:"absolute",top:"-8px !important",left:"-8px",marginLeft:"0 !important",borderRadius:"50%",fontSize:"16px",padding:"2px","&.correct":{backgroundColor:Io.correct()},"&.incorrect":{backgroundColor:Io.incorrectWithIcon()}}));class qo extends Eo.Component{static __initStatic(){this.propTypes={id:ko.string,value:ko.string,disabled:ko.bool,onChange:ko.func,correct:ko.bool,choices:ko.arrayOf(ko.shape({value:ko.string,label:ko.string})),showCorrectAnswer:ko.bool,singleQuery:ko.bool,correctValue:ko.string}}constructor(e){super(e),qo.prototype.__init.call(this),qo.prototype.__init2.call(this),qo.prototype.__init3.call(this),qo.prototype.__init4.call(this),qo.prototype.__init5.call(this),this.state={anchorEl:null,highlightedOptionId:null,menuWidth:null,previewValue:null},this.hiddenRef=Eo.createRef(),this.buttonRef=Eo.createRef(),this.previewRef=Eo.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||$o(e)}),n){const e=n.clientWidth;e!==this.state.menuWidth&&(this.elementRefs.forEach(e=>{e&&$o(e)}),$o(n),this.setState({menuWidth:e}))}}__init(){this.handleClick=e=>this.setState({anchorEl:e.currentTarget})}__init2(){this.handleClose=()=>{const{value:e}=this.props;this.setState({anchorEl:null,previewValue:null,highlightedOptionId:null}),!e&&this.previewRef.current&&(this.previewRef.current.innerHTML="")}}__init3(){this.handleHighlight=e=>{const t={highlightedOptionId:`dropdown-option-${this.props.id}-${e}`};this.props.value||(t.previewValue=this.props.choices[e].value),this.setState(t)}}__init4(){this.handleSelect=(e,t)=>{this.props.onChange(this.props.id,e),this.handleHighlight(t),this.handleClose()}}__init5(){this.handleHover=e=>{if(this.props.value)return;const t=`dropdown-option-${this.props.id}-${e}`,n=this.state.previewValue;this.setState({highlightedOptionId:t,previewValue:n},()=>{const t=this.elementRefs[e],n=this.previewRef.current;t&&n&&(n.innerHTML=t.innerHTML)})}}getLabel(e,t){const n=(e||[]).find(e=>e.value===t);return n?n.label.trim():void 0}render(){const{id:e,correct:t,disabled:n,value:r,choices:o,showCorrectAnswer:i,singleQuery:a,correctValue:s}=this.props,{anchorEl:l}=this.state,c=Boolean(l),d=`dropdown-button-${e}`,u=`dropdown-menu-${e}`,p=`dropdown-value-${e}`;let h;this.elementRefs=[],n&&void 0!==t&&(h=t||i?"disabledCorrect":"disabledIncorrect");const g=parseInt(e,10)+1,f=a?"Query-label":`Query-label-${g}`,m=a?"Query":`Query ${g}`;let v=null;return n&&void 0!==t&&(v=t||i?Eo.createElement(zo,{className:"correct"}):Eo.createElement(Fo,{className:"incorrect"})),Eo.createElement(Eo.Fragment,null,Eo.createElement("div",{ref:this.hiddenRef,style:{position:"absolute",visibility:"hidden",top:0,left:0},tabIndex:-1,"aria-hidden":"true"},(o||[]).map((e,t)=>Eo.createElement(Wo,{key:t,tabIndex:-1,"aria-hidden":"true"},Eo.createElement(Po,{dangerouslySetInnerHTML:{__html:e.label}})))),Eo.createElement(Ho,{id:f,tabIndex:-1,"aria-hidden":"true"},m),Eo.createElement(Lo,{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,Eo.createElement(Po,{id:p,ref:this.previewRef,dangerouslySetInnerHTML:{__html:s||(c&&this.state.previewValue?this.getLabel(o,this.state.previewValue):this.getLabel(o,r)||"")}}),c?Eo.createElement(To,null):Eo.createElement(Do,null)),Eo.createElement(jo,{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 Eo.createElement(Wo,{id:o,className:t.value===r?"selected":"",key:`${t.label}-${n}`,value:t.value,onClick:()=>this.handleSelect(t.value,n),role:"option","aria-selected":this.state.highlightedOptionId===o?"true":void 0,onMouseOver:()=>this.handleHover(n)},Eo.createElement(Po,{ref:e=>this.elementRefs[n]=e,dangerouslySetInnerHTML:{__html:t.label}}),Eo.createElement(Bo,{dangerouslySetInnerHTML:{__html:t.value===r?" ✓":""}}))})))}}qo.__initStatic();const Uo=n;Le("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 Uo.createElement(qo,{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 Ko=n,Yo=r,{isEqual:Vo}=i,{isEmpty:Xo}=i,{styled:Jo}=o,{Tooltip:Qo}=a,{color:Zo}=s,{Collapsible:Go}=s,{Readable:ei}=s,{hasText:ti}=s,{hasMedia:ni}=s,{PreviewPrompt:ri}=s,{UiLayout:oi}=s,ii=d,ai=e,{mq:si}=u,{HorizontalKeypad:li}=u,{updateSpans:ci}=u,di=p,{renderMath:ui}=h;function pi(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 hi=Jo(oi)({color:Zo.text(),backgroundColor:Zo.background(),display:"inline-block"}),gi=Jo("div")({width:"100%",position:"relative",backgroundColor:Zo.background(),color:Zo.text()}),fi=Jo("div")(({theme:e})=>({marginBottom:e.spacing(2)})),mi=Jo("div")(({theme:e})=>({marginBottom:e.spacing(2)})),vi=Jo("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}}),bi=Jo("div")(({theme:e,$incorrect:t,$correct:n,$showCorrectness:r,$correctAnswerShown:o})=>({maxWidth:"fit-content",...t&&{borderColor:`${Zo.incorrect()} !important`},...n&&{borderColor:`${Zo.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}}})),yi=Jo(si.Static)({"& > .mq-root-block":{"& > .mq-editable-field":{borderColor:Zo.text()}}}),wi=Jo("div")(({theme:e})=>({zIndex:10,minWidth:"400px",marginTop:e.spacing(2)})),xi=Jo("div")(({theme:e})=>({marginBottom:e.spacing(1),pointerEvents:"none"})),Ci=Jo("h2")({position:"absolute",left:"-10000px",top:"auto",width:"1px",height:"1px",overflow:"hidden"}),Ei=Jo("div")(({theme:e})=>({marginBottom:e.spacing(2)})),ki=Jo(ii)(({theme:e})=>({color:Zo.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: ${Zo.text()};\n background-color: ${Zo.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: ${Zo.correct()} !important;\n }\n .incorrect {\n border-color: ${Zo.incorrect()} !important;\n }\n `,document.head.appendChild(t)}}let Si=!1;const Ri=/(\{\{\d+\}\})/gm,Ai=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);function _i(e=[],t){return 30*Math.floor(e.length/5)+("miscellaneous"===t?600:500)}function Di(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]=pi([n,"optionalAccess",e=>e[t],"optionalAccess",e=>e.answer]),e),{});return o.split(Ri).filter(e=>e).reduce((e,n)=>{if(n.match(Ri)){const o=Ti.getResponseKey(n),s=t.session.answers[`r${o}`];if(i&&!a){const t="\\ \\ ".repeat(30)+"\\embed{newLine}[] ";return{...e,[o]:`\\MathQuillMathField[r${o}]{${t.repeat(3)}}`}}return r?{...e,[o]:`\\embed{answerBlock}[r${o}]`}:{...e,[o]:`\\MathQuillMathField[r${o}]{${s&&s.value||""}}`}}return e},{})}}class Ti extends Ko.Component{static __initStatic(){this.getResponseKey=e=>(e||"").replaceAll("{{","").replaceAll("}}","")}static __initStatic2(){this.propTypes={session:Yo.object.isRequired,onSessionChange:Yo.func,model:Yo.object.isRequired}}constructor(e){super(e),Ti.prototype.__init.call(this),Ti.prototype.__init2.call(this),Ti.prototype.__init3.call(this),Ti.prototype.__init4.call(this),Ti.prototype.__init5.call(this),Ti.prototype.__init6.call(this),Ti.prototype.__init7.call(this),Ti.prototype.__init8.call(this),Ti.prototype.__init9.call(this),Ti.prototype.__init10.call(this),Ti.prototype.__init11.call(this),Ti.prototype.__init12.call(this),Ti.prototype.__init13.call(this);const t={},{model:n,session:r}=e||{},{markup:o,alwaysShowCorrect:i}=n||{},{answers:a}=r||{};o&&(o||"").replace(Ri,e=>{const n=Ti.getResponseKey(e),r=a&&a[`r${n}`];t[`r${n}`]={value:pi([r,"optionalAccess",e=>e.value])||""}}),this.state={session:{...e.session,answers:t},activeAnswerBlock:"",showCorrect:i||!1,tooltipContainerRef:Ko.createRef()}}UNSAFE_componentWillMount(){if("undefined"!=typeof window){let e=di.getInterface(2);Si||(e.registerEmbed("answerBlock",e=>({htmlString:`<div class="block-container">\n <div class="block-response" id="${e}Index">R</div>\n <div class="block-math">\n <span id="${e}"></span>\n </div>\n </div>`,text:()=>"text",latex:()=>`\\embed{answerBlock}[${e}]`})),Si=!0)}}__init(){this.handleAnswerBlockDomUpdate=()=>{const{model:e}=this.props,{session:t,showCorrect:n}=this.state,r=t.answers;this.root&&e.disabled&&!n&&Object.keys(r).forEach(t=>{const n=this.root.querySelector(`#${t}`),o=this.root.querySelector(`#${t}Index`);if(n){let i=di.getInterface(2);const a=r[t];n.textContent=a&&a.value||"",e.view&&(n.parentElement.parentElement.classList.remove("correct"),n.parentElement.parentElement.classList.remove("incorrect")),i.StaticMath(n),o.textContent="R"}}),ui(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(Ri),d=i.match(Ri);if(!Vo(c,d)){const e={},t=this.state.session.answers;(d||[]).forEach(n=>{const r=Ti.getResponseKey(n),o=t&&t[`r${r}`];e[`r${r}`]={value:pi([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=Vo(this.props.model,e.model),r=Vo(this.state,t);return!n||!r}componentDidMount(){this.handleAnswerBlockDomUpdate(),setTimeout(()=>ui(this.root),100)}componentDidUpdate(){this.handleAnswerBlockDomUpdate()}__init2(){this.onSubFieldFocus=e=>{this.setState({activeAnswerBlock:e})}}__init3(){this.toNodeData=e=>{if(!e)return;const{type:t,value:n}=e;return"command"===t||"cursor"===t?e:"answer"===t?{type:"answer",...e}:"clear"===n?{type:"clear"}:{type:"write",value:n}}}__init4(){this.setInput=e=>{this.input=e}}__init5(){this.onClick=e=>{const t=this.toNodeData(e);"clear"===t.type?this.input.clear():"command"===t.type?Array.isArray(t.value)?t.value.forEach(e=>{this.input.cmd(e)}):this.input.cmd(t.value):"cursor"===t.type?this.input.keystroke(t.value):this.input.write(t.value),this.input.focus()}}__init6(){this.callOnSessionChange=()=>{const{onSessionChange:e}=this.props;e&&e(this.state.session)}}__init7(){this.toggleShowCorrect=e=>{this.setState({showCorrect:e},this.handleAnswerBlockDomUpdate)}}__init8(){this.subFieldChanged=(e,t)=>{ci(),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=pi([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&&pi([o,"optionalAccess",e=>e.attributes,"access",e=>e["data-keypad"]])||this.setState({activeAnswerBlock:""})}}setTooltipRef(e){setTimeout(()=>{if(e&&Ai){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&&(ti(t)||ni(t)),o=Ko.createElement(ri,{defaultClassName:"teacher-instructions",prompt:t});return r&&Ko.createElement(mi,null,n?o:Ko.createElement(Go,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},o))}}__init12(){this.renderRationale=()=>{const{model:e}=this.props,{rationale:t,animationsDisabled:n}=e||{},r=Ko.createElement(ri,{prompt:t});return t&&(ti(t)||ni(t))&&Ko.createElement(mi,null,n?r:Ko.createElement(Go,{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:g}=e||{},f=Xo(l),m=function(e=[]){return e.map(e=>({name:e,latex:e,write:e,label:e}))}(d),v=Di(e,this.state)||"",b=h&&!g;return Ko.createElement(vi,null,Ko.createElement(Co,{disabled:a,markup:e.markup,value:{},customMarkMarkupComponent:e=>{const l="evaluate"===p&&u&&u[e],d=Ko.createElement(yi,{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 Ko.createElement(bi,{ref:o,$incorrect:!f&&!l&&!n,$correct:!f&&(l||n),$showCorrectness:!f&&a&&i&&!s,$correctAnswerShown:n},Ko.createElement(Qo,{ref:e=>this.setTooltipRef(e),enterTouchDelay:0,interactive:!0,open:t===`r${e}`,slotProps:{popper:{container:pi([o,"optionalAccess",e=>e.current])||void 0,placement:"bottom-end",sx:{backgroundColor:"transparent",width:"650px",opacity:1,"& .MuiTooltip-arrow":{display:"none"}},modifiers:{preventOverflow:{enabled:!0,boundariesElement:"body"},flip:{enabled:!1}}},tooltip:{sx:{fontSize:"initial",backgroundColor:"transparent",width:"600px",marginTop:0,paddingTop:0,boxShadow:"none"}}},title:Object.keys(r.answers).map(e=>e===t&&!(n||a)&&Ko.createElement(wi,{"data-keypad":!0,key:e,style:{width:_i(m,c)}},Ko.createElement(li,{additionalKeys:m,mode:c||6,onClick:this.onClick}))||null)},b?Ko.createElement(xi,null,d):Ko.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=!Xo(s)&&a&&"correct"!==a.correctness,p=(t||"view"===r&&"instructor"===o)&&c&&d;return Ko.createElement(hi,{extraCSSRules:i,ref:e=>{const t=ai.findDOMNode(e);this.root=t||this.root}},Ko.createElement(gi,null,"gather"===r&&Ko.createElement(Ci,null,"Math Equation Response Question"),Ko.createElement(gi,null,u&&Ko.createElement(ki,{language:l,show:!0,toggled:t,onToggle:this.toggleShowCorrect})),this.renderTeacherInstructions(),n&&Ko.createElement(fi,null,Ko.createElement(ri,{prompt:n})),Ko.createElement(ei,{false:!0},this.renderPlayerContent()),p&&Ko.createElement(Ei,{className:"note",dangerouslySetInnerHTML:{__html:d}}),this.renderRationale()))}}Ti.__initStatic(),Ti.__initStatic2();const Mi=n,Oi=i;class Ni extends HTMLElement{constructor(){super(),this._root=null,this.sessionChangedEventCaller=Oi.debounce(()=>{this.dispatchEvent(new k(this.tagName.toLowerCase(),!0))},1e3)}set model(e){this._model=e,this.render(),this.dispatchEvent(new y(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=Mi.createElement(Ti,{model:this._model,session:this._session,onSessionChange:this.onSessionChange.bind(this)});this._root||(this._root=f(this)),this._root.render(e)}}disconnectedCallback(){this._root&&this._root.unmount()}}export{Ni as default};
|
package/module/manifest.json
CHANGED
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
"name": "@pie-lib/shared-module",
|
|
7
7
|
"version": "^3.0.5"
|
|
8
8
|
},
|
|
9
|
-
{
|
|
10
|
-
"name": "@pie-lib/math-edit-module",
|
|
11
|
-
"version": "^3.0.5"
|
|
12
|
-
},
|
|
13
9
|
{
|
|
14
10
|
"name": "@pie-lib/math-rendering-module",
|
|
15
11
|
"version": "^4.0.5"
|
|
16
12
|
},
|
|
13
|
+
{
|
|
14
|
+
"name": "@pie-lib/math-edit-module",
|
|
15
|
+
"version": "^3.0.5"
|
|
16
|
+
},
|
|
17
17
|
{
|
|
18
18
|
"name": "@pie-lib/drag-module",
|
|
19
19
|
"version": "^3.0.5"
|
package/module/print.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_dll_react_dom as e,_dll_debug as t,_dll_react as n,_dll_prop_types as r,_dll_mui__material_styles as o,_dll_lodash as i,_dll_mui__material as a,_dll_pie_lib__render_ui as s,_dll_classnames as l,_dll_mui__icons_material as c,_dll_pie_lib__correct_answer_toggle as d}from"../../../@pie-lib/shared-module@^3.0.5/module/index.js";import{_dll_pie_lib__math_rendering as u}from"../../../@pie-lib/math-rendering-module@^4.0.5/module/index.js";import{_dll_pie_lib__math_input as p,_dll_pie_framework__mathquill as h}from"../../../@pie-lib/math-edit-module@^3.0.5/module/index.js";import{_dll_pie_lib__drag as g}from"../../../@pie-lib/drag-module@^3.0.5/module/index.js";var f,m=e;f=m.createRoot,m.hydrateRoot;var v,b,y,w={"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},x={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},C=function(e){return e.length?e.charAt(0).toUpperCase()+e.substring(1):e},k=C,E=/^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/,S="undefined"==typeof document?{}:document.documentElement.style,R=(v=function(){for(var e in S)if(E.test(e))return e.match(E)[0];return"WebkitOpacity"in S?"Webkit":"KhtmlOpacity"in S?"Khtml":""}(),b=v.toLowerCase(),{style:v,css:"-"+b+"-",dom:{Webkit:"WebKit",ms:"MS",o:"WebKit"}[v]||k(v)}),A=function(e,t){return t?t.toUpperCase():""},D=/[-\s]+(.)?/g,_=function(e){return e?e.replace(D,A):""},T=/::/g,M=/([A-Z]+)([A-Z][a-z])/g,O=/([a-z\d])([A-Z])/g,N=/_/g,I=function(e,t){return e?e.replace(T,"/").replace(M,"$1_$2").replace(O,"$1_$2").replace(N,t||"-"):""},$=function(e){return I(e).toLowerCase()},L=_,j=$,W=function(e){return e.length?e.charAt(0).toLowerCase()+e.substring(1):e},B=C,P=R,H=w,z="undefined"==typeof document?{}:document.documentElement.style,F=function(e,t){t=t||{};var n=W(L(e)),r=j(e),o=y?n:r,i=P.style?y?P.style:P.css:"";if(n in z)return t.asString?o:[o];var a=o,s=H[r],l=[];if(y&&(a=B(o)),"function"==typeof s){var c=s(o,i)||[];c&&!Array.isArray(c)&&(c=[c]),c.length&&(c=c.map(function(e){return y?W(L(e)):j(e)})),l=l.concat(c)}return i&&l.push(i+a),l.push(o),t.asString||1==l.length?l[0]:l},q=Object.prototype.hasOwnProperty,U=function(e,t){return q.call(e,t)},K=Object.prototype.toString,V=Object.prototype.toString,X=F,Y=$,J=_,Q=U,Z=function(e){return!!e&&"[object Object]"===K.call(e)},G=function(e){return"[object Function]"===V.apply(e)},ee=function(e,t,n,r){X(t).forEach(function(t){e[r?r(t):t]=n})},te={cssUnitless:x},ne=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||te).cssUnitless=t.cssUnitless||te.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,g=(null!=t.cssUnitless?t.cssUnitless:p?p.cssUnitless:null)||{},f=(t.cssUnit||p?p.cssUnit:null)||"px",m=t.prefixProperties||(p?p.prefixProperties:null)||{},v=t.camelize?J:Y;for(a in e)if(Q(e,a)){if(s=e[a],i=Y(n?n+a:a),o=!1,u=!1,G(s)&&(d=s.call(p||e,s,a,i,e),Z(d)&&null!=d.value?(s=d.value,u=d.prefix,i=d.name?Y(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 g)?s+f: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?ee(r,e,s,v):r[v(e)]=s});continue}u?ee(r,i,s,v):r[v(i)]=s}else ne(s,t,i+"-",r)}return r},re=ne,oe=U,ie={prefixProperties:w,cssUnitless:x,object:ne,string:function(e,t){e=re(e,t);var n,r=[];for(n in e)oe(e,n)&&r.push(n+": "+e[n]);return r.join("; ")}};const ae=t("@pie-lib:mask-markup:serialization"),se=["span"],le=["em","strong","u"],ce=(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),ie.object(r,{camelize:!0,addUnits:!1});var r},de=["border","class","style"],ue={b:"bold",em:"italic",u:"underline",s:"strikethrough",code:"code",strong:"strong"},pe=(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=ue[r];if(o){ae("[deserialize] mark: ",o);return{_flatten:!0,nodes:he(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=de.reduce((n=e,(e,t)=>{if(!n.getAttribute)return e;if(n.getAttribute(t))switch(t){case"style":e.style=ce(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=>se.includes(e)?"inline":le.includes(e)?"mark":"block")(r),l=he(e.childNodes,t);return{object:s,type:r,data:{dataset:{...e.dataset},attributes:{...a}},nodes:l}}var n;return null},he=(e,t=[])=>{const n=[];for(let r=0;r<e.length;r++){const o=pe(e[r],t);null!==o&&(o._flatten&&o.nodes?n.push(...o.nodes):n.push(o))}return n},ge=n,fe=r,{get:me}=i,{styled:ve}=o,{renderMath:be}=u;function ye(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 we=ve("div")(({theme:e})=>({paddingTop:e.spacing(2),paddingBottom:e.spacing(2)})),xe=ve("span")(()=>({display:"inline-block",width:".75em"})),Ce=["tbody","tr"],ke=(e,t,n,r,o,i)=>{if(!t)return null;const a=[];return(e.nodes||[]).forEach((e,s)=>{const l=e.type?`${e.type}-${s}`:`${s}`;if(e.isMath)return a.push(ge.createElement("span",{dangerouslySetInnerHTML:{__html:`<math displaystyle="true">${e.nodes[0].innerHTML}</math>`}})),a;if(r){const l=r(e,t,n);if(l)return a.push(l),void("td"!==ye([o,"optionalAccess",e=>e.type])&&"drag-in-the-blank"===i&&a.push(ge.createElement(xe,{key:`spacer-${s}`})))}if("text"===e.object){const t=e.leaves.reduce((e,t)=>{const n=t.text,r=((e,t)=>{const n=""===t.trim(),r=e&&e.type;return n&&Ce.includes(r)?void 0:t})(o,n);return r?e+r:e},""),n=(e=>{const t=e.leaves.find(e=>me(e,"marks",[]).length);return t?t.marks[0]:null})(e);if(n){let e;for(e in ue)if(ue[e]===n.type){const n=e;a.push(ge.createElement(n,{key:l},t));break}}else t.length>0&&(a.push(t),"td"!==ye([o,"optionalAccess",e=>e.type])&&"drag-in-the-blank"===i&&a.push(ge.createElement(xe,{key:`spacer-${s}`})))}else{const o=ke(e,t,n,r,e,i);if("p"===e.type||"paragraph"===e.type)a.push(ge.createElement(we,{key:l},o));else{const t=e.type;e.nodes&&e.nodes.length>0?a.push(ge.createElement(t,{key:l,...e.data.attributes},o)):a.push(ge.createElement(t,{key:l,...e.data.attributes}))}}}),a},Ee=ve("div")(()=>({display:"initial","&:not(.MathJax) table":{borderCollapse:"collapse"},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:"8px 12px",textAlign:"left"}}));class Se extends ge.Component{constructor(e){super(e),Se.prototype.__init.call(this),this.internalContainerRef=ge.createRef()}static __initStatic(){this.propTypes={renderChildren:fe.func,layout:fe.object,value:fe.object,onChange:fe.func,elementType:fe.string,containerRef:fe.oneOfType([fe.func,fe.shape({current:fe.instanceOf(Element)})])}}componentDidMount(){const e=this.props.containerRef||this.internalContainerRef;e.current&&"function"==typeof be&&be(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=ke(t,e,this.handleChange,this.props.renderChildren,null,n),i=r||this.internalContainerRef;return ge.createElement(Ee,{ref:i},o)}}Se.__initStatic();const Re=/\{\{(\d+)\}\}/g;const Ae=n,De=r;var _e;const Te=(e,t)=>{const{markup:n}=(o=t,(r=e)?{markup:r.replace(Re,(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=he(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},Me=(e,t)=>((_e=class extends Ae.Component{static __initStatic(){this.propTypes={markup:De.string,layout:De.object,value:De.object,onChange:De.func,customMarkMarkupComponent:De.func,elementType:De.string}}constructor(e){super(e),this.containerRef=Ae.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||Te(n,e);return Ae.createElement(Se,{containerRef:this.containerRef,elementType:a,layout:s,value:o,onChange:i,renderChildren:t(this.props)})}}).__initStatic(),_e),{useMemo:Oe}=n,{useLayoutEffect:Ne}=n,{useEffect:Ie}=n,{useRef:$e}=n,{useCallback:Le}=n,je="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function We(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function Be(e){return"nodeType"in e}function Pe(e){var t,n;return e?We(e)?e:Be(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function He(e){const{Document:t}=Pe(e);return e instanceof t}function ze(e){return!We(e)&&e instanceof Pe(e).HTMLElement}function Fe(e){return e instanceof Pe(e).SVGElement}function qe(e){return e?We(e)?e.document:Be(e)?He(e)?e:ze(e)||Fe(e)?e.ownerDocument:document:document:document}const Ue=je?Ne:Ie;function Ke(e){const t=$e(e);return Ue(()=>{t.current=e}),Le(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 Ve(e,t){void 0===t&&(t=[e]);const n=$e(e);return Ue(()=>{n.current!==e&&(n.current=e)},t),n}function Xe(e,t){const n=$e();return Oe(()=>{const t=e(n.current);return n.current=t,t},[...t])}function Ye(e){const t=Ke(e),n=$e(null),r=Le(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,r]}function Je(e){const t=$e();return Ie(()=>{t.current=e},[e]),t.current}let Qe={};function Ze(e,t){return Oe(()=>{if(t)return t;const n=null==Qe[e]?0:Qe[e]+1;return Qe[e]=n,e+"-"+n},[e,t])}function Ge(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 et=Ge(1),tt=Ge(-1);function nt(e){if(!e)return!1;const{KeyboardEvent:t}=Pe(e.target);return t&&e instanceof t}function rt(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=Pe(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 ot=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[ot.Translate.toString(e),ot.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),it="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function at(e){return e.matches(it)?e:e.querySelector(it)}const st=n,{useState:lt}=n,{useCallback:ct}=n,dt={display:"none"};function ut(e){let{id:t,value:n}=e;return st.createElement("div",{id:t,style:dt},n)}function pt(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;return st.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 ht=n,{createContext:gt}=n,{useContext:ft}=n,{useEffect:mt}=n,{useState:vt}=n,{useCallback:bt}=n,{useMemo:yt}=n,{useRef:wt}=n,{memo:xt}=n,{useReducer:Ct}=n,{cloneElement:kt}=n,{forwardRef:Et}=n,{createPortal:St}=e,{unstable_batchedUpdates:Rt}=e,At=gt(null);const Dt={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 "},_t={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 Tt(e){let{announcements:t=_t,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=Dt}=e;const{announce:i,announcement:a}=function(){const[e,t]=lt("");return{announce:ct(e=>{null!=e&&t(e)},[]),announcement:e}}(),s=Ze("DndLiveRegion"),[l,c]=vt(!1);if(mt(()=>{c(!0)},[]),function(e){const t=ft(At);mt(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}(yt(()=>({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=ht.createElement(ht.Fragment,null,ht.createElement(ut,{id:r,value:o.draggable}),ht.createElement(pt,{id:s,announcement:a}));return n?St(d,n):d}var Mt;function Ot(){}!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"}(Mt||(Mt={}));const Nt=Object.freeze({x:0,y:0});function It(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function $t(e,t){const n=rt(e);if(!n)return"0 0";return(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%"}function Lt(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function jt(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Wt(e,t,n){return void 0===t&&(t=e.left),void 0===n&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const Bt=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=Wt(t,t.left,t.top),i=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=It(Wt(r),o);i.push({id:t,data:{droppableContainer:e,value:n}})}}return i.sort(Lt)};function Pt(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 Ht=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=Pt(i,t);n>0&&o.push({id:r,data:{droppableContainer:e,value:n}})}}return o.sort(jt)};function zt(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Nt}const Ft=(qt=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+qt*t.y,bottom:e.bottom+qt*t.y,left:e.left+qt*t.x,right:e.right+qt*t.x}),{...e})});var qt;function Ut(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 Kt={ignoreTransform:!1};function Vt(e,t){void 0===t&&(t=Kt);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=Pe(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=Ut(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 Xt(e){return Vt(e,{ignoreTransform:!0})}function Yt(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if(He(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!ze(o)||Fe(o))return n;if(n.includes(o))return n;const i=Pe(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=Pe(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=Pe(e).getComputedStyle(e)),"fixed"===t.position}(o,i)?n:r(o.parentNode)}(e):n}function Jt(e){const[t]=Yt(e,1);return null!=t?t:null}function Qt(e){return je&&e?We(e)?e:Be(e)?He(e)||e===qe(e).scrollingElement?window:ze(e)?e:null:null:null}function Zt(e){return We(e)?e.scrollX:e.scrollLeft}function Gt(e){return We(e)?e.scrollY:e.scrollTop}function en(e){return{x:Zt(e),y:Gt(e)}}var tn;function nn(e){return!(!je||!e)&&e===document.scrollingElement}function rn(e){const t={x:0,y:0},n=nn(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"}(tn||(tn={}));const on={x:.2,y:.2};function an(e,t,n,r,o){let{top:i,left:a,right:s,bottom:l}=n;void 0===r&&(r=10),void 0===o&&(o=on);const{isTop:c,isBottom:d,isLeft:u,isRight:p}=rn(e),h={x:0,y:0},g={x:0,y:0},f=t.height*o.y,m=t.width*o.x;return!c&&i<=t.top+f?(h.y=tn.Backward,g.y=r*Math.abs((t.top+f-i)/f)):!d&&l>=t.bottom-f&&(h.y=tn.Forward,g.y=r*Math.abs((t.bottom-f-l)/f)),!p&&s>=t.right-m?(h.x=tn.Forward,g.x=r*Math.abs((t.right-m-s)/m)):!u&&a<=t.left+m&&(h.x=tn.Backward,g.x=r*Math.abs((t.left+m-a)/m)),{direction:h,speed:g}}function sn(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 ln(e){return e.reduce((e,t)=>et(e,en(t)),Nt)}function cn(e,t){if(void 0===t&&(t=Vt),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);Jt(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const dn=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+Zt(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+Gt(t),0)}]];class un{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=Yt(t),r=ln(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of dn)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 pn{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 hn(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 gn,fn;function mn(e){e.preventDefault()}function vn(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"}(gn||(gn={})),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"}(fn||(fn={}));const bn={start:[fn.Space,fn.Enter],cancel:[fn.Esc],end:[fn.Space,fn.Enter,fn.Tab]},yn=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case fn.Right:return{...n,x:n.x+25};case fn.Left:return{...n,x:n.x-25};case fn.Down:return{...n,y:n.y+25};case fn.Up:return{...n,y:n.y-25}}};class wn{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 pn(qe(t)),this.windowListeners=new pn(Pe(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(gn.Resize,this.handleCancel),this.windowListeners.add(gn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(gn.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&cn(n),t(Nt)}handleKeyDown(e){if(nt(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=bn,coordinateGetter:i=yn,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}:Nt;this.referenceCoordinates||(this.referenceCoordinates=c);const d=i(e,{active:t,context:n.current,currentCoordinates:c});if(d){const t=tt(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}=rn(n),h=sn(n),g={x:Math.min(o===fn.Right?h.right-h.width/2:h.right,Math.max(o===fn.Right?h.left:h.left+h.width/2,d.x)),y:Math.min(o===fn.Down?h.bottom-h.height/2:h.bottom,Math.max(o===fn.Down?h.top:h.top+h.height/2,d.y))},f=o===fn.Right&&!s||o===fn.Left&&!l,m=o===fn.Down&&!c||o===fn.Up&&!i;if(f&&g.x!==d.x){const e=n.scrollLeft+t.x,i=o===fn.Right&&e<=u.x||o===fn.Left&&e>=p.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:a});r.x=i?n.scrollLeft-e:o===fn.Right?n.scrollLeft-u.x:n.scrollLeft-p.x,r.x&&n.scrollBy({left:-r.x,behavior:a});break}if(m&&g.y!==d.y){const e=n.scrollTop+t.y,i=o===fn.Down&&e<=u.y||o===fn.Up&&e>=p.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:a});r.y=i?n.scrollTop-e:o===fn.Down?n.scrollTop-u.y:n.scrollTop-p.y,r.y&&n.scrollBy({top:-r.y,behavior:a});break}}this.handleMove(e,et(tt(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 xn(e){return Boolean(e&&"distance"in e)}function Cn(e){return Boolean(e&&"delay"in e)}wn.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=bn,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 kn{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=Pe(e);return e instanceof t?e:qe(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=qe(i),this.documentListeners=new pn(this.document),this.listeners=new pn(n),this.windowListeners=new pn(Pe(i)),this.initialCoordinates=null!=(r=rt(o))?r:Nt,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(gn.Resize,this.handleCancel),this.windowListeners.add(gn.DragStart,mn),this.windowListeners.add(gn.VisibilityChange,this.handleCancel),this.windowListeners.add(gn.ContextMenu,mn),this.documentListeners.add(gn.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Cn(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(xn(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(gn.Click,vn,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(gn.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=rt(e))?t:Nt,l=tt(r,s);if(!n&&a){if(xn(a)){if(null!=a.tolerance&&hn(l,a.tolerance))return this.handleCancel();if(hn(l,a.distance))return this.handleStart()}return Cn(a)&&hn(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===fn.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const En={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Sn extends kn{constructor(e){const{event:t}=e,n=qe(t.target);super(e,En,n)}}Sn.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 Rn={move:{name:"mousemove"},end:{name:"mouseup"}};var An;!function(e){e[e.RightClick=2]="RightClick"}(An||(An={}));(class extends kn{constructor(e){super(e,Rn,qe(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==An.RightClick&&(null==r||r({event:n}),!0)}}];const Dn={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var _n,Tn;function Mn(e){let{acceleration:t,activator:n=_n.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:a=5,order:s=Tn.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:d,delta:u,threshold:p}=e;const h=function(e){let{delta:t,disabled:n}=e;const r=Je(t);return Xe(e=>{if(n||!r||!e)return On;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[tn.Backward]:e.x[tn.Backward]||-1===o.x,[tn.Forward]:e.x[tn.Forward]||1===o.x},y:{[tn.Backward]:e.y[tn.Backward]||-1===o.y,[tn.Forward]:e.y[tn.Forward]||1===o.y}}},[n,t,r])}({delta:u,disabled:!i}),[g,f]=function(){const e=$e(null);return[Le((t,n)=>{e.current=setInterval(t,n)},[]),Le(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}(),m=wt({x:0,y:0}),v=wt({x:0,y:0}),b=yt(()=>{switch(n){case _n.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case _n.DraggableRect:return o}},[n,o,l]),y=wt(null),w=bt(()=>{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=yt(()=>s===Tn.TreeOrder?[...c].reverse():c,[s,c]);mt(()=>{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}=an(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 f(),y.current=e,g(w,a),m.current=s,void(v.current=i)}m.current={x:0,y:0},v.current={x:0,y:0},f()}else f()},[t,w,r,f,i,a,JSON.stringify(b),JSON.stringify(h),g,c,x,d,JSON.stringify(p)])}(class extends kn{constructor(e){super(e,Dn)}static setup(){return window.addEventListener(Dn.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Dn.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"}(_n||(_n={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(Tn||(Tn={}));const On={x:{[tn.Backward]:!1,[tn.Forward]:!1},y:{[tn.Backward]:!1,[tn.Forward]:!1}};var Nn,In;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(Nn||(Nn={})),function(e){e.Optimized="optimized"}(In||(In={}));const $n=new Map;function Ln(e,t){return Xe(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function jn(e){let{callback:t,disabled:n}=e;const r=Ke(t),o=yt(()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(r)},[n]);return mt(()=>()=>null==o?void 0:o.disconnect(),[o]),o}function Wn(e){return new un(Vt(e),e)}function Bn(e,t,n){void 0===t&&(t=Wn);const[r,o]=vt(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=Ke(t),o=yt(()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(r)},[r,n]);return mt(()=>()=>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=jn({callback:i});return Ue(()=>{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 Pn=[];function Hn(e,t){void 0===t&&(t=[]);const n=wt(null);return mt(()=>{n.current=null},t),mt(()=>{const t=e!==Nt;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?tt(e,n.current):Nt}function zn(e){return yt(()=>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 Fn=[];function qn(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return ze(t)?t:e}const Un=[{sensor:Sn,options:{}},{sensor:wn,options:{}}],Kn={current:{}},Vn={draggable:{measure:Xt},droppable:{measure:Xt,strategy:Nn.WhileDragging,frequency:In.Optimized},dragOverlay:{measure:Vt}};class Xn 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 Yn={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Xn,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ot},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Vn,measureDroppableContainers:Ot,windowRect:null,measuringScheduled:!1},Jn={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ot,draggableNodes:new Map,over:null,measureDroppableContainers:Ot},Qn=gt(Jn),Zn=gt(Yn);function Gn(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Xn}}}function er(e,t){switch(t.type){case Mt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Mt.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 Mt.DragEnd:case Mt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Mt.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Xn(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case Mt.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 Xn(e.droppable.containers);return a.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case Mt.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new Xn(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function tr(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=ft(Qn),i=Je(r),a=Je(null==n?void 0:n.id);return mt(()=>{if(!t&&!r&&i&&null!=a){if(!nt(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=at(e);if(t){t.focus();break}}})}},[r,t,o,a,i]),null}function nr(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}const rr=gt({...Nt,scaleX:1,scaleY:1});var or;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(or||(or={})),xt(function(e){var t,n,r,o;let{id:i,accessibility:a,autoScroll:s=!0,children:l,sensors:c=Un,collisionDetection:d=Ht,measuring:u,modifiers:p,...h}=e;const g=Ct(er,void 0,Gn),[f,m]=g,[v,b]=function(){const[e]=vt(()=>new Set),t=bt(t=>(e.add(t),()=>e.delete(t)),[e]);return[bt(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]=vt(or.Uninitialized),x=y===or.Initialized,{draggable:{active:C,nodes:k,translate:E},droppable:{containers:S}}=f,R=null!=C?k.get(C):null,A=wt({initial:null,translated:null}),D=yt(()=>{var e;return null!=C?{id:C,data:null!=(e=null==R?void 0:R.data)?e:Kn,rect:A}:null},[C,R]),_=wt(null),[T,M]=vt(null),[O,N]=vt(null),I=Ve(h,Object.values(h)),$=Ze("DndDescribedBy",i),L=yt(()=>S.getEnabled(),[S]),j=yt(()=>({draggable:{...Vn.draggable,...null==W?void 0:W.draggable},droppable:{...Vn.droppable,...null==W?void 0:W.droppable},dragOverlay:{...Vn.dragOverlay,...null==W?void 0:W.dragOverlay}}),[null==(W=u)?void 0:W.draggable,null==W?void 0:W.droppable,null==W?void 0:W.dragOverlay]);var W;const{droppableRects:B,measureDroppableContainers:P,measuringScheduled:H}=function(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,a]=vt(null),{frequency:s,measure:l,strategy:c}=o,d=wt(e),u=function(){switch(c){case Nn.Always:return!1;case Nn.BeforeDragging:return n;default:return!n}}(),p=Ve(u),h=bt(function(e){void 0===e&&(e=[]),p.current||a(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[p]),g=wt(null),f=Xe(t=>{if(u&&!n)return $n;if(!t||t===$n||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 un(l(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,i,n,u,l]);return mt(()=>{d.current=e},[e]),mt(()=>{u||h()},[n,u]),mt(()=>{i&&i.length>0&&a(null)},[JSON.stringify(i)]),mt(()=>{u||"number"!=typeof s||null!==g.current||(g.current=setTimeout(()=>{h(),g.current=null},s))},[s,u,h,...r]),{droppableRects:f,measureDroppableContainers:h,measuringScheduled:null!=i}}(L,{dragging:x,dependencies:[E.x,E.y],config:j.droppable}),z=function(e,t){const n=null!=t?e.get(t):void 0,r=n?n.node.current:null;return Xe(e=>{var n;return null==t?null:null!=(n=null!=r?r:e)?n:null},[r,t])}(k,C),F=yt(()=>O?rt(O):null,[O]),q=function(){const e=!1===(null==T?void 0:T.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 Ln(e,t)}(z,j.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=wt(!1),{x:a,y:s}="boolean"==typeof o?{x:o,y:o}:o;Ue(()=>{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=zt(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=Jt(e);t&&t.scrollBy({top:o.y,left:o.x})}},[t,a,s,r,n])}({activeNode:null!=C?k.get(C):null,config:q.layoutShiftCompensation,initialRect:U,measure:j.draggable.measure});const K=Bn(z,j.draggable.measure,U),V=Bn(z?z.parentElement:null),X=wt({activatorEvent:null,active:null,activeNode:z,collisionRect:null,collisions:null,droppableRects:B,draggableNodes:k,draggingNode:null,draggingNodeRect:null,droppableContainers:S,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Y=S.getNodeFor(null==(t=X.current.over)?void 0:t.id),J=function(e){let{measure:t}=e;const[n,r]=vt(null),o=jn({callback:bt(e=>{for(const{target:n}of e)if(ze(n)){r(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),i=bt(e=>{const n=qn(e);null==o||o.disconnect(),n&&(null==o||o.observe(n)),r(n?t(n):null)},[t,o]),[a,s]=Ye(i);return yt(()=>({nodeRef:a,rect:n,setRef:s}),[n,a,s])}({measure:j.dragOverlay.measure}),Q=null!=(n=J.nodeRef.current)?n:z,Z=x?null!=(r=J.rect)?r:K:null,G=Boolean(J.nodeRef.current&&J.rect),ee=zt(te=G?null:K,Ln(te));var te;const ne=zn(Q?Pe(Q):null),re=function(e){const t=wt(e),n=Xe(n=>e?n&&n!==Pn&&e&&t.current&&e.parentNode===t.current.parentNode?n:Yt(e):Pn,[e]);return mt(()=>{t.current=e},[e]),n}(x?null!=Y?Y:z:null),oe=function(e,t){void 0===t&&(t=Vt);const[n]=e,r=zn(n?Pe(n):null),[o,i]=vt(Fn);function a(){i(()=>e.length?e.map(e=>nn(e)?r:new un(t(e),e)):Fn)}const s=jn({callback:a});return Ue(()=>{null==s||s.disconnect(),a(),e.forEach(e=>null==s?void 0:s.observe(e))},[e]),o}(re),ie=nr(p,{transform:{x:E.x-ee.x,y:E.y-ee.y,scaleX:1,scaleY:1},activatorEvent:O,active:D,activeNodeRect:K,containerNodeRect:V,draggingNodeRect:Z,over:X.current.over,overlayNodeRect:J.rect,scrollableAncestors:re,scrollableAncestorRects:oe,windowRect:ne}),ae=F?et(F,E):null,se=function(e){const[t,n]=vt(null),r=wt(e),o=bt(e=>{const t=Qt(e.target);t&&n(e=>e?(e.set(t,en(t)),new Map(e)):null)},[]);return mt(()=>{const t=r.current;if(e!==t){i(t);const a=e.map(e=>{const t=Qt(e);return t?(t.addEventListener("scroll",o,{passive:!0}),[t,en(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=Qt(e);null==t||t.removeEventListener("scroll",o)})}},[o,e]),yt(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>et(e,t),Nt):ln(e):Nt,[e,t])}(re),le=Hn(se),ce=Hn(se,[K]),de=et(ie,le),ue=Z?Ft(Z,ie):null,pe=D&&ue?d({active:D,collisionRect:ue,droppableRects:B,droppableContainers:L,pointerCoordinates:ae}):null,he=function(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}(pe,"id"),[ge,fe]=vt(null),me=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(G?ie:et(ie,ce),null!=(o=null==ge?void 0:ge.rect)?o:null,K),ve=wt(null),be=bt((e,t)=>{let{sensor:n,options:r}=t;if(null==_.current)return;const o=k.get(_.current);if(!o)return;const i=e.nativeEvent,a=new n({active:_.current,activeNode:o,event:i,options:r,context:X,onAbort(e){if(!k.get(e))return;const{onDragAbort:t}=I.current,n={id:e};null==t||t(n),v({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!k.get(e))return;const{onDragPending:o}=I.current,i={id:e,constraint:t,initialCoordinates:n,offset:r};null==o||o(i),v({type:"onDragPending",event:i})},onStart(e){const t=_.current;if(null==t)return;const n=k.get(t);if(!n)return;const{onDragStart:r}=I.current,o={activatorEvent:i,active:{id:t,data:n.data,rect:A}};Rt(()=>{null==r||r(o),w(or.Initializing),m({type:Mt.DragStart,initialCoordinates:e,active:t}),v({type:"onDragStart",event:o}),M(ve.current),N(i)})},onMove(e){m({type:Mt.DragMove,coordinates:e})},onEnd:s(Mt.DragEnd),onCancel:s(Mt.DragCancel)});function s(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:o}=X.current;let a=null;if(t&&o){const{cancelDrop:s}=I.current;if(a={activatorEvent:i,active:t,collisions:n,delta:o,over:r},e===Mt.DragEnd&&"function"==typeof s){await Promise.resolve(s(a))&&(e=Mt.DragCancel)}}_.current=null,Rt(()=>{m({type:e}),w(or.Uninitialized),fe(null),M(null),N(null),ve.current=null;const t=e===Mt.DragEnd?"onDragEnd":"onDragCancel";if(a){const e=I.current[t];null==e||e(a),v({type:t,event:a})}})}}ve.current=a},[k]),ye=bt((e,t)=>(n,r)=>{const o=n.nativeEvent,i=k.get(r);if(null!==_.current||!i||o.dndKit||o.defaultPrevented)return;const a={active:i};!0===e(n,t.options,a)&&(o.dndKit={capturedBy:t.sensor},_.current=r,be(n,t))},[k,be]),we=function(e,t){return yt(()=>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){mt(()=>{if(!je)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),Ue(()=>{K&&y===or.Initializing&&w(or.Initialized)},[K,y]),mt(()=>{const{onDragMove:e}=I.current,{active:t,activatorEvent:n,collisions:r,over:o}=X.current;if(!t||!n)return;const i={active:t,activatorEvent:n,collisions:r,delta:{x:de.x,y:de.y},over:o};Rt(()=>{null==e||e(i),v({type:"onDragMove",event:i})})},[de.x,de.y]),mt(()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:o}=X.current;if(!e||null==_.current||!t||!o)return;const{onDragOver:i}=I.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};Rt(()=>{fe(s),null==i||i(l),v({type:"onDragOver",event:l})})},[he]),Ue(()=>{X.current={activatorEvent:O,active:D,activeNode:z,collisionRect:ue,collisions:pe,droppableRects:B,draggableNodes:k,draggingNode:Q,draggingNodeRect:Z,droppableContainers:S,over:ge,scrollableAncestors:re,scrollAdjustedTranslate:de},A.current={initial:Z,translated:ue}},[D,z,pe,ue,k,Q,Z,B,S,ge,re,de]),Mn({...q,delta:E,draggingRect:ue,pointerCoordinates:ae,scrollableAncestors:re,scrollableAncestorRects:oe});const xe=yt(()=>({active:D,activeNode:z,activeNodeRect:K,activatorEvent:O,collisions:pe,containerNodeRect:V,dragOverlay:J,draggableNodes:k,droppableContainers:S,droppableRects:B,over:ge,measureDroppableContainers:P,scrollableAncestors:re,scrollableAncestorRects:oe,measuringConfiguration:j,measuringScheduled:H,windowRect:ne}),[D,z,K,O,pe,V,J,k,S,B,ge,P,re,oe,j,H,ne]),Ce=yt(()=>({activatorEvent:O,activators:we,active:D,activeNodeRect:K,ariaDescribedById:{draggable:$},dispatch:m,draggableNodes:k,over:ge,measureDroppableContainers:P}),[O,we,D,K,m,$,k,ge,P]);return ht.createElement(At.Provider,{value:b},ht.createElement(Qn.Provider,{value:Ce},ht.createElement(Zn.Provider,{value:xe},ht.createElement(rr.Provider,{value:me},l)),ht.createElement(tr,{disabled:!1===(null==a?void 0:a.restoreFocus)})),ht.createElement(Tt,{...a,hiddenTextDescribedById:$}))});const ir=gt(null),ar="button";function sr(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=Ze("Draggable"),{activators:a,activatorEvent:s,active:l,activeNodeRect:c,ariaDescribedById:d,draggableNodes:u,over:p}=ft(Qn),{role:h=ar,roleDescription:g="draggable",tabIndex:f=0}=null!=o?o:{},m=(null==l?void 0:l.id)===t,v=ft(m?rr:ir),[b,y]=Ye(),[w,x]=Ye(),C=function(e,t){return yt(()=>e.reduce((e,n)=>{let{eventName:r,handler:o}=n;return e[r]=e=>{o(e,t)},e},{}),[e,t])}(a,t),k=Ve(n);Ue(()=>(u.set(t,{id:t,key:i,node:b,activatorNode:w,data:k}),()=>{const e=u.get(t);e&&e.key===i&&u.delete(t)}),[u,t]);return{active:l,activatorEvent:s,activeNodeRect:c,attributes:yt(()=>({role:h,tabIndex:f,"aria-disabled":r,"aria-pressed":!(!m||h!==ar)||void 0,"aria-roledescription":g,"aria-describedby":d.draggable}),[r,h,f,m,g,d.draggable]),isDragging:m,listeners:r?void 0:C,node:b,over:p,setNodeRef:y,setActivatorNodeRef:x,transform:v}}const lr={timeout:25};function cr(e){let{animation:t,children:n}=e;const[r,o]=vt(null),[i,a]=vt(null),s=Je(n);return n||r||!s||o(s),Ue(()=>{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]),ht.createElement(ht.Fragment,null,n,r?kt(r,{ref:a}):null)}const dr={x:0,y:0,scaleX:1,scaleY:1};function ur(e){let{children:t}=e;return ht.createElement(Qn.Provider,{value:Jn},ht.createElement(rr.Provider,{value:dr},t))}const pr={position:"fixed",touchAction:"none"},hr=e=>nt(e)?"transform 250ms ease":void 0,gr=Et((e,t)=>{let{as:n,activatorEvent:r,adjustScale:o,children:i,className:a,rect:s,style:l,transform:c,transition:d=hr}=e;if(!s)return null;const u=o?c:{...c,scaleX:1,scaleY:1},p={...pr,width:s.width,height:s.height,top:s.top,left:s.left,transform:ot.Transform.toString(u),transformOrigin:o&&r?$t(r,s):void 0,transition:"function"==typeof d?d(r):d,...l};return ht.createElement(n,{className:a,style:p,ref:t},i)}),fr={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:ot.Transform.toString(t)},{transform:ot.Transform.toString(n)}]},sideEffects:(mr={styles:{active:{opacity:"0"}}},e=>{let{active:t,dragOverlay:n}=e;const r={},{styles:o,className:i}=mr;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 mr;function vr(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return Ke((e,i)=>{if(null===t)return;const a=n.get(e);if(!a)return;const s=a.node.current;if(!s)return;const l=qn(i);if(!l)return;const{transform:c}=Pe(i).getComputedStyle(i),d=Ut(c);if(!d)return;const u="function"==typeof t?t:function(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...fr,...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,g=p[p.length-1];if(JSON.stringify(h)===JSON.stringify(g))return;const f=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==f||f(),e()}})}}(t);return cn(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 br=0;function yr(e){return yt(()=>{if(null!=e)return br++,br},[e])}const wr=ht.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:g,droppableContainers:f,dragOverlay:m,over:v,measuringConfiguration:b,scrollableAncestors:y,scrollableAncestorRects:w,windowRect:x}=ft(Zn),C=ft(rr),k=yr(null==u?void 0:u.id),E=nr(a,{activatorEvent:d,active:u,activeNodeRect:p,containerNodeRect:h,draggingNodeRect:m.rect,over:v,overlayNodeRect:m.rect,scrollableAncestors:y,scrollableAncestorRects:w,transform:C,windowRect:x}),S=Ln(p),R=vr({config:r,draggableNodes:g,droppableContainers:f,measuringConfiguration:b}),A=S?m.setRef:void 0;return ht.createElement(ur,null,ht.createElement(cr,{animation:R},u&&k?ht.createElement(gr,{key:k,id:u.id,ref:A,as:s,activatorEvent:d,adjustScale:t,className:l,transition:i,rect:S,style:{zIndex:c,...o},transform:E},n):null))}),xr=n,{useEffect:Cr}=n,{useRef:kr}=n,Er=r,{styled:Sr}=o,{Chip:Rr}=a,{color:Ar}=s,{renderMath:Dr}=u;function _r(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 Tr=Sr("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&&{}})),Mr=Sr(Rr)(()=>({backgroundColor:Ar.white(),border:`1px solid ${Ar.text()}`,color:Ar.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}})),Or=Sr("span")(()=>({whiteSpace:"normal","& img":{display:"block",padding:"2px 0"},"& mjx-frac":{fontSize:"120% !important"}}));function Nr({choice:e,disabled:t,instanceId:n}){const r=kr(null),{attributes:o,listeners:i,setNodeRef:a,isDragging:s}=sr({id:`choice-${e.id}`,data:{choice:e,instanceId:n,fromChoice:!0,type:"MaskBlank"},disabled:t});return Cr(()=>{Dr(r.current)},[e.value]),xr.createElement(Tr,{ref:a,style:s?{width:_r([r,"access",e=>e.current,"optionalAccess",e=>e.offsetWidth]),height:_r([r,"access",e=>e.current,"optionalAccess",e=>e.offsetHeight])}:{},disabled:t,...i,...o},xr.createElement(Mr,{clickable:!1,disabled:t,ref:r,label:xr.createElement(Or,{dangerouslySetInnerHTML:{__html:e.value}})}))}Nr.propTypes={choice:Er.object.isRequired,disabled:Er.bool,instanceId:Er.oneOfType([Er.string,Er.number])};const Ir=n,$r=r,{findKey:Lr}=i,{DragDroppablePlaceholder:jr}=g;class Wr extends Ir.Component{constructor(...e){super(...e),Wr.prototype.__init.call(this)}static __initStatic(){this.propTypes={disabled:$r.bool,duplicates:$r.bool,choices:$r.arrayOf($r.shape({label:$r.string,value:$r.string})),value:$r.object,choicePosition:$r.string.isRequired,instanceId:$r.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;return void 0===Lr(r,t=>t===e.id)}),a={...this.getStyleForWrapper(),minWidth:"100px"};return Ir.createElement("div",{style:a},Ir.createElement(jr,{disabled:e,instanceId:o},i.map((t,n)=>Ir.createElement(Nr,{key:`${t.value}-${n}`,disabled:e,choice:t,instanceId:o}))))}}Wr.__initStatic();var Br={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"};const Pr=n,{useRef:Hr}=n,{useState:zr}=n,{useEffect:Fr}=n,qr=r,Ur=t,{styled:Kr}=o,{Chip:Vr}=a,Xr=l,{color:Yr}=s,{renderMath:Jr}=u;function Qr(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}Ur("pie-lib:mask-markup:blank");const Zr=Kr("span")(({dragged:e,over:t})=>({border:`solid 0px ${Yr.primary()}`,minWidth:"200px",touchAction:"none",overflow:"hidden",whiteSpace:"nowrap",opacity:1,...t&&{whiteSpace:"nowrap",overflow:"hidden"},...e&&{opacity:.5}})),Gr=Kr(Vr)(()=>({backgroundColor:Yr.background(),border:`2px dashed ${Yr.text()}`,color:Yr.text(),fontSize:"inherit",maxWidth:"374px",position:"relative",borderRadius:"3px","&.over":{whiteSpace:"nowrap",overflow:"hidden"},"&.parentOver":{border:`1px solid ${Br[500]}`,backgroundColor:`${Br[300]}`},"&.correct":{border:`solid 1px ${Yr.correct()}`},"&.incorrect":{border:`solid 1px ${Yr.incorrect()}`},"&.Mui-disabled":{opacity:1}})),eo=Kr("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"}}));function to({disabled:e,choice:t,isOver:n,isDragging:r,dragItem:o,correct:i,emptyResponseAreaWidth:a,emptyResponseAreaHeight:s}){const l=Hr(null),c=Hr(null),d=Hr(null),[u,p]=zr({height:0,width:0}),h=()=>{f()},g=()=>{const e=Qr([c,"access",e=>e.current,"optionalAccess",e=>e.querySelector,"call",e=>e("img")]);e?e.onload=h:setTimeout(()=>{f()},300)},f=()=>{if(c.current&&l.current){l.current.style.width="auto";const e=(c.current.offsetWidth||0)+24,t=(c.current.offsetHeight||0)+24,n=parseFloat(a)||0,r=parseFloat(s)||0,o=e<=n?n:e,i=t<=r?r:t;p(e=>({width:o>n?o:e.width,height:i>r?i:e.height})),l.current.style.width=`${o}px`,l.current.style.height=`${i}px`}};Fr(()=>{g()},[]),Fr(()=>{l.current&&Jr(l.current)},[n,Qr([o,"optionalAccess",e=>e.choice,"optionalAccess",e=>e.value])]),Fr(()=>{t?g():p({height:0,width:0})},[t]),Fr(()=>{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:Qr([d,"access",e=>e.current,"optionalAccess",e=>e.width]),height:Qr([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 Pr.createElement(Gr,{clickable:!1,disabled:e,ref:l,component:"span",label:Pr.createElement(Pr.Fragment,null,Pr.createElement(eo,{ref:c,draggable:!0,className:Xr({over:n,hidden:m}),dangerouslySetInnerHTML:{__html:v||""}}),m&&Pr.createElement(eo,{draggable:!0,className:Xr({over:n,dragged:!0}),dangerouslySetInnerHTML:{__html:m||""}})),className:Xr({over:n,parentOver:n,correct:void 0!==i&&i,incorrect:void 0!==i&&!i}),variant:e?"outlined":void 0,style:b})}function no({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}=sr({id:`mask-blank-drag-${e}`,disabled:t||!r,data:{id:e,choice:r,instanceId:l,fromChoice:!1,type:"MaskBlank"}}),{setNodeRef:g,isOver:f,active:m}=function(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=Ze("Droppable"),{active:a,dispatch:s,over:l,measureDroppableContainers:c}=ft(Qn),d=wt({disabled:n}),u=wt(!1),p=wt(null),h=wt(null),{disabled:g,updateMeasurementsFor:f,timeout:m}={...lr,...o},v=Ve(null!=f?f:r),b=jn({callback:bt(()=>{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:g||!a}),y=bt((e,t)=>{b&&(t&&(b.unobserve(t),u.current=!1),e&&b.observe(e))},[b]),[w,x]=Ye(y),C=Ve(t);return mt(()=>{b&&w.current&&(b.disconnect(),u.current=!1,b.observe(w.current))},[w,b]),mt(()=>(s({type:Mt.RegisterDroppable,element:{id:r,key:i,disabled:n,node:w,rect:p,data:C}}),()=>s({type:Mt.UnregisterDroppable,key:i,id:r})),[r]),mt(()=>{n!==d.current.disabled&&(s({type:Mt.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:ot.Translate.toString(p)};return Pr.createElement(Zr,{ref:e=>{u(e),g(e)},style:v,dragged:h,over:f,...c,...d},Pr.createElement(to,{id:e,disabled:t,duplicates:n,choice:r,isOver:f,dragItem:Qr([m,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current]),correct:o,onChange:i,emptyResponseAreaWidth:a,emptyResponseAreaHeight:s,instanceId:l}))}to.defaultProps={emptyResponseAreaWidth:0,emptyResponseAreaHeight:0},to.propTypes={id:qr.oneOfType([qr.string,qr.number]),disabled:qr.bool,duplicates:qr.bool,choice:qr.object,isOver:qr.bool,dragItem:qr.object,correct:qr.bool,onChange:qr.func,emptyResponseAreaWidth:qr.oneOfType([qr.string,qr.number]),emptyResponseAreaHeight:qr.oneOfType([qr.string,qr.number]),instanceId:qr.string},no.defaultProps={emptyResponseAreaWidth:0,emptyResponseAreaHeight:0},no.propTypes={id:qr.oneOfType([qr.string,qr.number]),disabled:qr.bool,duplicates:qr.bool,choice:qr.object,correct:qr.bool,onChange:qr.func,emptyResponseAreaWidth:qr.oneOfType([qr.string,qr.number]),emptyResponseAreaHeight:qr.oneOfType([qr.string,qr.number]),instanceId:qr.string};const ro=n,oo=r,{DragProvider:io}=g;function ao(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 so=Me("blank",e=>(t,n,r)=>{const o=ao([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,g=c?s[o.id]:n[o.id],f=g&&e.choices.find(e=>e.id===g);return ro.createElement(no,{key:`${t.type}-${o.id}`,correct:c||l&&l[o.id],disabled:i,duplicates:a,choice:f,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 lo extends ro.Component{constructor(e){super(e),lo.prototype.__init.call(this),lo.prototype.__init2.call(this),lo.prototype.__init3.call(this),lo.prototype.__init4.call(this),this.state={activeDragItem:null}}static __initStatic(){this.propTypes={markup:oo.string,layout:oo.object,choicesPosition:oo.string,choices:oo.array,value:oo.object,onChange:oo.func,duplicates:oo.bool,disabled:oo.bool,feedback:oo.object,correctResponse:oo.object,showCorrectAnswer:oo.bool,emptyResponseAreaWidth:oo.oneOfType([oo.string,oo.number]),emptyResponseAreaHeight:oo.oneOfType([oo.string,oo.number]),instanceId:oo.string}}static __initStatic2(){this.defaultProps={instanceId:"drag-in-the-blank"}}__init(){this.handleDragStart=e=>{const{active:t}=e;ao([t,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current])&&this.setState({activeDragItem:t.data.current})}}__init2(){this.renderDragOverlay=()=>{const{activeDragItem:e}=this.state;return e&&"MaskBlank"===e.type?ro.createElement(Nr,{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;if(this.setState({activeDragItem:null}),!n||!t||!r)return;const i=t.data.current,a=n.data.current;if("MaskBlank"===ao([i,"optionalAccess",e=>e.type])&&ao([a,"optionalAccess",e=>e.accepts,"optionalAccess",e=>e.includes,"call",e=>e("MaskBlank")])){const e=i,t=a.id;if(!0===a.toChoiceBoard){if(!e.fromChoice&&e.id){const t={...o};delete t[e.id],r(t)}}else if(!0===e.fromChoice){if(t&&"drag-in-the-blank-droppable"!==t){const n={...o};n[t]=e.choice.id,r(n)}}else if(e.id&&e.id!==t){const n={...o};n[t]=e.choice.id,delete n[e.id],r(n)}}}}__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,g=o||"below",f={display:"flex",minWidth:"100px",...this.getPositionDirection(g)};return ro.createElement(io,{onDragStart:this.handleDragStart,onDragEnd:this.handleDragEnd,collisionDetection:Bt},ro.createElement("div",{ref:e=>this.rootRef=e,style:f},ro.createElement(Wr,{choicePosition:g,choices:i,value:n,duplicates:t,disabled:s,instanceId:h}),ro.createElement(so,{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}),ro.createElement(wr,{style:{pointerEvents:"none"}},this.renderDragOverlay())))}}lo.__initStatic(),lo.__initStatic2();const co=n,{styled:uo}=o,po=l,{color:ho}=s;function go(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 fo,mo;"undefined"!=typeof window&&(fo=require("@pie-lib/editable-html-tip-tap").default,mo=uo(fo)(()=>({display:"inline-block",verticalAlign:"middle",margin:"4px",borderRadius:"4px",border:`1px solid ${ho.black()}`,"&.correct":{border:`1px solid ${ho.correct()}`},"&.incorrect":{border:`1px solid ${ho.incorrect()}`}})));Me("input",e=>(t,n)=>{const{adjustedLimit:r,disabled:o,feedback:i,showCorrectAnswer:a,maxLength:s,spellCheck:l,pluginProps:c,onChange:d}=e,u=go([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]||"",g=s&&s[u.id],f=i&&i[u.id],m=a||"correct"===f,v=!a&&"incorrect"===f,b=e=>{const t={...n,[u.id]:e};d(t)},y=e=>{if("Enter"===e.key||13===e.keyCode)return!0};return co.createElement(mo,{id:u.id,key:`${t.type}-input-${u.id}`,disabled:a||o,disableUnderline:!0,onChange:b,markup:h||"",charactersLimit:r?g:25,activePlugins:["languageCharacters"],pluginProps:c,languageCharactersProps:[{language:"spanish"}],spellCheck:l,width:`calc(${g}em + 32px)`,onKeyDown:y,autoWidthToolbar:!0,toolbarOpts:{minWidth:"auto",noBorder:!0,isHidden:!!go([c,"optionalAccess",e=>e.characters,"optionalAccess",e=>e.disabled])},className:po({correct:m,incorrect:v})})}});var vo=Me("input",e=>(t,n,r)=>{const o=t.data&&t.data.dataset||{};if("input"===o.component)return e.customMarkMarkupComponent(o.id)});const bo=n,yo=r,{Button:wo}=a,{InputLabel:xo}=a,{Menu:Co}=a,{MenuItem:ko}=a,{ArrowDropDown:Eo}=c,{ArrowDropUp:So}=c,{Close:Ro}=c,{Check:Ao}=c,{styled:Do}=o,{color:_o}=s,{renderMath:To}=u,Mo=Do(wo)(()=>({color:_o.text(),border:`1px solid ${_o.borderGray()}`,borderRadius:"4px",justifyContent:"space-between",backgroundColor:_o.background(),position:"relative",height:"45px",width:"fit-content",margin:"2px",textTransform:"none","& span":{paddingRight:"5px"},"& svg":{position:"absolute",right:0,top:"calc(50% - 12px)",pointerEvents:"none",color:_o.text(),marginLeft:"5px"},"&.Mui-focused":{outline:`3px solid ${_o.tertiary()}`,outlineOffset:"2px",borderWidth:"3px"},"&.disabledCorrect":{borderWidth:"2px",borderColor:_o.correct(),color:`${_o.text()} !important`},"&.disabledIncorrect":{borderWidth:"2px",borderColor:_o.incorrectWithIcon(),color:`${_o.text()} !important`}})),Oo=Do(Co)(()=>({backgroundColor:_o.background(),border:`1px solid ${_o.correct()} !important`,"&:hover":{border:`1px solid ${_o.text()} `,borderColor:"initial"},"&:focus":{border:`1px solid ${_o.text()}`,borderColor:"initial"},"& .MuiList-root":{padding:0}})),No=Do(ko)(()=>({color:_o.text(),backgroundColor:_o.background(),"&.Mui-focused":{outline:`3px solid ${_o.tertiary()}`,outlineOffset:"-1px",color:_o.text(),backgroundColor:_o.background()},"&:hover":{color:_o.text(),backgroundColor:_o.dropdownBackground()},boxSizing:"border-box",padding:"25px",borderRadius:"4px","&.selected":{color:`${_o.text()} !important`,backgroundColor:`${_o.background()} !important`,"&:hover":{color:_o.text(),backgroundColor:`${_o.dropdownBackground()} !important`}}})),Io=Do("span")(()=>({fontSize:"max(1rem, 14px)"})),$o=Do("span")(()=>({fontSize:"max(1rem, 14px)",position:"absolute",right:"10px"})),Lo=Do(xo)(()=>({position:"absolute",left:"-10000px",top:"auto",width:"1px",height:"1px",overflow:"hidden"})),jo=Do(Ao)(()=>({color:`${_o.white()} !important`,position:"absolute",top:"-8px !important",left:"-8px",marginLeft:"0 !important",borderRadius:"50%",fontSize:"16px",padding:"2px","&.correct":{backgroundColor:_o.correct()},"&.incorrect":{backgroundColor:_o.incorrectWithIcon()}})),Wo=Do(Ro)(()=>({color:`${_o.white()} !important`,position:"absolute",top:"-8px !important",left:"-8px",marginLeft:"0 !important",borderRadius:"50%",fontSize:"16px",padding:"2px","&.correct":{backgroundColor:_o.correct()},"&.incorrect":{backgroundColor:_o.incorrectWithIcon()}}));class Bo extends bo.Component{static __initStatic(){this.propTypes={id:yo.string,value:yo.string,disabled:yo.bool,onChange:yo.func,correct:yo.bool,choices:yo.arrayOf(yo.shape({value:yo.string,label:yo.string})),showCorrectAnswer:yo.bool,singleQuery:yo.bool,correctValue:yo.string}}constructor(e){super(e),Bo.prototype.__init.call(this),Bo.prototype.__init2.call(this),Bo.prototype.__init3.call(this),Bo.prototype.__init4.call(this),Bo.prototype.__init5.call(this),this.state={anchorEl:null,highlightedOptionId:null,menuWidth:null,previewValue:null},this.hiddenRef=bo.createRef(),this.buttonRef=bo.createRef(),this.previewRef=bo.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||To(e)}),n){const e=n.clientWidth;e!==this.state.menuWidth&&(this.elementRefs.forEach(e=>{e&&To(e)}),To(n),this.setState({menuWidth:e}))}}__init(){this.handleClick=e=>this.setState({anchorEl:e.currentTarget})}__init2(){this.handleClose=()=>{const{value:e}=this.props;this.setState({anchorEl:null,previewValue:null,highlightedOptionId:null}),!e&&this.previewRef.current&&(this.previewRef.current.innerHTML="")}}__init3(){this.handleHighlight=e=>{const t={highlightedOptionId:`dropdown-option-${this.props.id}-${e}`};this.props.value||(t.previewValue=this.props.choices[e].value),this.setState(t)}}__init4(){this.handleSelect=(e,t)=>{this.props.onChange(this.props.id,e),this.handleHighlight(t),this.handleClose()}}__init5(){this.handleHover=e=>{if(this.props.value)return;const t=`dropdown-option-${this.props.id}-${e}`,n=this.state.previewValue;this.setState({highlightedOptionId:t,previewValue:n},()=>{const t=this.elementRefs[e],n=this.previewRef.current;t&&n&&(n.innerHTML=t.innerHTML)})}}getLabel(e,t){const n=(e||[]).find(e=>e.value===t);return n?n.label.trim():void 0}render(){const{id:e,correct:t,disabled:n,value:r,choices:o,showCorrectAnswer:i,singleQuery:a,correctValue:s}=this.props,{anchorEl:l}=this.state,c=Boolean(l),d=`dropdown-button-${e}`,u=`dropdown-menu-${e}`,p=`dropdown-value-${e}`;let h;this.elementRefs=[],n&&void 0!==t&&(h=t||i?"disabledCorrect":"disabledIncorrect");const g=parseInt(e,10)+1,f=a?"Query-label":`Query-label-${g}`,m=a?"Query":`Query ${g}`;let v=null;return n&&void 0!==t&&(v=t||i?bo.createElement(jo,{className:"correct"}):bo.createElement(Wo,{className:"incorrect"})),bo.createElement(bo.Fragment,null,bo.createElement("div",{ref:this.hiddenRef,style:{position:"absolute",visibility:"hidden",top:0,left:0},tabIndex:-1,"aria-hidden":"true"},(o||[]).map((e,t)=>bo.createElement(No,{key:t,tabIndex:-1,"aria-hidden":"true"},bo.createElement(Io,{dangerouslySetInnerHTML:{__html:e.label}})))),bo.createElement(Lo,{id:f,tabIndex:-1,"aria-hidden":"true"},m),bo.createElement(Mo,{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,bo.createElement(Io,{id:p,ref:this.previewRef,dangerouslySetInnerHTML:{__html:s||(c&&this.state.previewValue?this.getLabel(o,this.state.previewValue):this.getLabel(o,r)||"")}}),c?bo.createElement(So,null):bo.createElement(Eo,null)),bo.createElement(Oo,{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 bo.createElement(No,{id:o,className:t.value===r?"selected":"",key:`${t.label}-${n}`,value:t.value,onClick:()=>this.handleSelect(t.value,n),role:"option","aria-selected":this.state.highlightedOptionId===o?"true":void 0,onMouseOver:()=>this.handleHover(n)},bo.createElement(Io,{ref:e=>this.elementRefs[n]=e,dangerouslySetInnerHTML:{__html:t.label}}),bo.createElement($o,{dangerouslySetInnerHTML:{__html:t.value===r?" ✓":""}}))})))}}Bo.__initStatic();const Po=n;Me("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 Po.createElement(Bo,{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 Ho=n,zo=r,{isEqual:Fo}=i,{isEmpty:qo}=i,{styled:Uo}=o,{Tooltip:Ko}=a,{color:Vo}=s,{Collapsible:Xo}=s,{Readable:Yo}=s,{hasText:Jo}=s,{hasMedia:Qo}=s,{PreviewPrompt:Zo}=s,{UiLayout:Go}=s,ei=d,ti=e,{mq:ni}=p,{HorizontalKeypad:ri}=p,{updateSpans:oi}=p,ii=h,{renderMath:ai}=u;function si(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 li=Uo(Go)({color:Vo.text(),backgroundColor:Vo.background(),display:"inline-block"}),ci=Uo("div")({width:"100%",position:"relative",backgroundColor:Vo.background(),color:Vo.text()}),di=Uo("div")(({theme:e})=>({marginBottom:e.spacing(2)})),ui=Uo("div")(({theme:e})=>({marginBottom:e.spacing(2)})),pi=Uo("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}}),hi=Uo("div")(({theme:e,$incorrect:t,$correct:n,$showCorrectness:r,$correctAnswerShown:o})=>({maxWidth:"fit-content",...t&&{borderColor:`${Vo.incorrect()} !important`},...n&&{borderColor:`${Vo.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}}})),gi=Uo(ni.Static)({"& > .mq-root-block":{"& > .mq-editable-field":{borderColor:Vo.text()}}}),fi=Uo("div")(({theme:e})=>({zIndex:10,minWidth:"400px",marginTop:e.spacing(2)})),mi=Uo("div")(({theme:e})=>({marginBottom:e.spacing(1),pointerEvents:"none"})),vi=Uo("h2")({position:"absolute",left:"-10000px",top:"auto",width:"1px",height:"1px",overflow:"hidden"}),bi=Uo("div")(({theme:e})=>({marginBottom:e.spacing(2)})),yi=Uo(ei)(({theme:e})=>({color:Vo.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: ${Vo.text()};\n background-color: ${Vo.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: ${Vo.correct()} !important;\n }\n .incorrect {\n border-color: ${Vo.incorrect()} !important;\n }\n `,document.head.appendChild(t)}}let wi=!1;const xi=/(\{\{\d+\}\})/gm,Ci=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);function ki(e=[],t){return 30*Math.floor(e.length/5)+("miscellaneous"===t?600:500)}function Ei(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]=si([n,"optionalAccess",e=>e[t],"optionalAccess",e=>e.answer]),e),{});return o.split(xi).filter(e=>e).reduce((e,n)=>{if(n.match(xi)){const o=Si.getResponseKey(n),s=t.session.answers[`r${o}`];if(i&&!a){const t="\\ \\ ".repeat(30)+"\\embed{newLine}[] ";return{...e,[o]:`\\MathQuillMathField[r${o}]{${t.repeat(3)}}`}}return r?{...e,[o]:`\\embed{answerBlock}[r${o}]`}:{...e,[o]:`\\MathQuillMathField[r${o}]{${s&&s.value||""}}`}}return e},{})}}class Si extends Ho.Component{static __initStatic(){this.getResponseKey=e=>(e||"").replaceAll("{{","").replaceAll("}}","")}static __initStatic2(){this.propTypes={session:zo.object.isRequired,onSessionChange:zo.func,model:zo.object.isRequired}}constructor(e){super(e),Si.prototype.__init.call(this),Si.prototype.__init2.call(this),Si.prototype.__init3.call(this),Si.prototype.__init4.call(this),Si.prototype.__init5.call(this),Si.prototype.__init6.call(this),Si.prototype.__init7.call(this),Si.prototype.__init8.call(this),Si.prototype.__init9.call(this),Si.prototype.__init10.call(this),Si.prototype.__init11.call(this),Si.prototype.__init12.call(this),Si.prototype.__init13.call(this);const t={},{model:n,session:r}=e||{},{markup:o,alwaysShowCorrect:i}=n||{},{answers:a}=r||{};o&&(o||"").replace(xi,e=>{const n=Si.getResponseKey(e),r=a&&a[`r${n}`];t[`r${n}`]={value:si([r,"optionalAccess",e=>e.value])||""}}),this.state={session:{...e.session,answers:t},activeAnswerBlock:"",showCorrect:i||!1,tooltipContainerRef:Ho.createRef()}}UNSAFE_componentWillMount(){if("undefined"!=typeof window){let e=ii.getInterface(2);wi||(e.registerEmbed("answerBlock",e=>({htmlString:`<div class="block-container">\n <div class="block-response" id="${e}Index">R</div>\n <div class="block-math">\n <span id="${e}"></span>\n </div>\n </div>`,text:()=>"text",latex:()=>`\\embed{answerBlock}[${e}]`})),wi=!0)}}__init(){this.handleAnswerBlockDomUpdate=()=>{const{model:e}=this.props,{session:t,showCorrect:n}=this.state,r=t.answers;this.root&&e.disabled&&!n&&Object.keys(r).forEach(t=>{const n=this.root.querySelector(`#${t}`),o=this.root.querySelector(`#${t}Index`);if(n){let i=ii.getInterface(2);const a=r[t];n.textContent=a&&a.value||"",e.view&&(n.parentElement.parentElement.classList.remove("correct"),n.parentElement.parentElement.classList.remove("incorrect")),i.StaticMath(n),o.textContent="R"}}),ai(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(xi),d=i.match(xi);if(!Fo(c,d)){const e={},t=this.state.session.answers;(d||[]).forEach(n=>{const r=Si.getResponseKey(n),o=t&&t[`r${r}`];e[`r${r}`]={value:si([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=Fo(this.props.model,e.model),r=Fo(this.state,t);return!n||!r}componentDidMount(){this.handleAnswerBlockDomUpdate(),setTimeout(()=>ai(this.root),100)}componentDidUpdate(){this.handleAnswerBlockDomUpdate()}__init2(){this.onSubFieldFocus=e=>{this.setState({activeAnswerBlock:e})}}__init3(){this.toNodeData=e=>{if(!e)return;const{type:t,value:n}=e;return"command"===t||"cursor"===t?e:"answer"===t?{type:"answer",...e}:"clear"===n?{type:"clear"}:{type:"write",value:n}}}__init4(){this.setInput=e=>{this.input=e}}__init5(){this.onClick=e=>{const t=this.toNodeData(e);"clear"===t.type?this.input.clear():"command"===t.type?Array.isArray(t.value)?t.value.forEach(e=>{this.input.cmd(e)}):this.input.cmd(t.value):"cursor"===t.type?this.input.keystroke(t.value):this.input.write(t.value),this.input.focus()}}__init6(){this.callOnSessionChange=()=>{const{onSessionChange:e}=this.props;e&&e(this.state.session)}}__init7(){this.toggleShowCorrect=e=>{this.setState({showCorrect:e},this.handleAnswerBlockDomUpdate)}}__init8(){this.subFieldChanged=(e,t)=>{oi(),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=si([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&&si([o,"optionalAccess",e=>e.attributes,"access",e=>e["data-keypad"]])||this.setState({activeAnswerBlock:""})}}setTooltipRef(e){setTimeout(()=>{if(e&&Ci){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&&(Jo(t)||Qo(t)),o=Ho.createElement(Zo,{defaultClassName:"teacher-instructions",prompt:t});return r&&Ho.createElement(ui,null,n?o:Ho.createElement(Xo,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},o))}}__init12(){this.renderRationale=()=>{const{model:e}=this.props,{rationale:t,animationsDisabled:n}=e||{},r=Ho.createElement(Zo,{prompt:t});return t&&(Jo(t)||Qo(t))&&Ho.createElement(ui,null,n?r:Ho.createElement(Xo,{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:g}=e||{},f=qo(l),m=function(e=[]){return e.map(e=>({name:e,latex:e,write:e,label:e}))}(d),v=Ei(e,this.state)||"",b=h&&!g;return Ho.createElement(pi,null,Ho.createElement(vo,{disabled:a,markup:e.markup,value:{},customMarkMarkupComponent:e=>{const l="evaluate"===p&&u&&u[e],d=Ho.createElement(gi,{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 Ho.createElement(hi,{ref:o,$incorrect:!f&&!l&&!n,$correct:!f&&(l||n),$showCorrectness:!f&&a&&i&&!s,$correctAnswerShown:n},Ho.createElement(Ko,{ref:e=>this.setTooltipRef(e),enterTouchDelay:0,interactive:!0,open:t===`r${e}`,slotProps:{popper:{container:si([o,"optionalAccess",e=>e.current])||void 0,placement:"bottom-end",sx:{backgroundColor:"transparent",width:"650px",opacity:1,"& .MuiTooltip-arrow":{display:"none"}},modifiers:{preventOverflow:{enabled:!0,boundariesElement:"body"},flip:{enabled:!1}}},tooltip:{sx:{fontSize:"initial",backgroundColor:"transparent",width:"600px",marginTop:0,paddingTop:0,boxShadow:"none"}}},title:Object.keys(r.answers).map(e=>e===t&&!(n||a)&&Ho.createElement(fi,{"data-keypad":!0,key:e,style:{width:ki(m,c)}},Ho.createElement(ri,{additionalKeys:m,mode:c||6,onClick:this.onClick}))||null)},b?Ho.createElement(mi,null,d):Ho.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=!qo(s)&&a&&"correct"!==a.correctness,p=(t||"view"===r&&"instructor"===o)&&c&&d;return Ho.createElement(li,{extraCSSRules:i,ref:e=>{const t=ti.findDOMNode(e);this.root=t||this.root}},Ho.createElement(ci,null,"gather"===r&&Ho.createElement(vi,null,"Math Equation Response Question"),Ho.createElement(ci,null,u&&Ho.createElement(yi,{language:l,show:!0,toggled:t,onToggle:this.toggleShowCorrect})),this.renderTeacherInstructions(),n&&Ho.createElement(di,null,Ho.createElement(Zo,{prompt:n})),Ho.createElement(Yo,{false:!0},this.renderPlayerContent()),p&&Ho.createElement(bi,{className:"note",dangerouslySetInnerHTML:{__html:d}}),this.renderRationale()))}}Si.__initStatic(),Si.__initStatic2();const Ri=n,{debounce:Ai}=i,Di=t,{renderMath:_i}=u,Ti=Di("pie-element:math-templated:print");class Mi extends HTMLElement{constructor(){super(),this._options=null,this._model=null,this._session=[],this._root=null,this._rerender=Ai(()=>{if(this._model&&this._session){const e=((e,t)=>{const n="instructor"===t.role;return e.prompt=!1!==e.promptEnabled?e.prompt:void 0,e.teacherInstructions=n&&!1!==e.teacherInstructionsEnabled?e.teacherInstructions:void 0,e.rationale=n&&!1!==e.rationaleEnabled?e.rationale:void 0,e.showTeacherInstructions=n,e.alwaysShowCorrect=n,e.printMode=!0,e.feedback=void 0,e.markup=e.markup||"{{0}}",{...e,disabled:!0,env:{mode:n?"evaluate":e.mode,role:t.role}}})(this._model,this._options),t=this._options&&Ri.createElement(Si,{model:e,session:{}});this._root||(this._root=f(this)),this._root.render(t),queueMicrotask(()=>{Ti("render complete - render math"),_i(this)})}else Ti("skip")},50,{leading:!1,trailing:!0})}set options(e){this._options=e}set model(e){this._model=e,this._rerender()}connectedCallback(){}disconnectedCallback(){this._root&&this._root.unmount()}}export{Mi as default};
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
6
|
"repository": "pie-framework/pie-elements",
|
|
7
|
-
"version": "6.0.0-next.
|
|
7
|
+
"version": "6.0.0-next.43+4249fa78f",
|
|
8
8
|
"description": "",
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@emotion/react": "^11.14.0",
|
|
@@ -18,15 +18,19 @@
|
|
|
18
18
|
"@pie-lib/math-rendering": "4.1.1-next.0",
|
|
19
19
|
"@pie-lib/render-ui": "5.1.1-next.0",
|
|
20
20
|
"prop-types": "^15.8.1",
|
|
21
|
-
"react": "18.
|
|
22
|
-
"react-dom": "18.
|
|
21
|
+
"react": "18.3.1",
|
|
22
|
+
"react-dom": "18.3.1"
|
|
23
23
|
},
|
|
24
24
|
"author": "",
|
|
25
25
|
"license": "ISC",
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "4249fa78fc423ef0a8c89002b8f937c42b3478ea",
|
|
27
27
|
"scripts": {
|
|
28
28
|
"postpublish": "../../scripts/postpublish"
|
|
29
29
|
},
|
|
30
30
|
"main": "lib/index.js",
|
|
31
|
-
"module": "src/index.js"
|
|
31
|
+
"module": "src/index.js",
|
|
32
|
+
"exports": {
|
|
33
|
+
".": "./src/index.js",
|
|
34
|
+
"./print": "./src/print.js"
|
|
35
|
+
}
|
|
32
36
|
}
|