@pie-element/explicit-constructed-response 10.0.0-beta.1 → 10.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/configure/package.json +3 -3
- package/controller/package.json +3 -3
- package/module/configure.js +1 -0
- package/module/controller.js +8320 -0
- package/module/demo.js +45 -0
- package/module/element.js +1 -0
- package/module/index.html +21 -0
- package/module/manifest.json +18 -0
- package/module/print-demo.js +83 -0
- package/module/print.html +18 -0
- package/module/print.js +1 -0
- package/package.json +14 -10
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 s,_dll_pie_lib__render_ui as a,_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__drag as p}from"../../../@pie-lib/drag-module@^3.0.5/module/index.js";var h,g=e;h=g.createRoot,g.hydrateRoot;var f,m,b,v={"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},y={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},x=function(e){return e.length?e.charAt(0).toUpperCase()+e.substring(1):e},w=x,C=/^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/,S="undefined"==typeof document?{}:document.documentElement.style,k=(f=function(){for(var e in S)if(C.test(e))return e.match(C)[0];return"WebkitOpacity"in S?"Webkit":"KhtmlOpacity"in S?"Khtml":""}(),m=f.toLowerCase(),{style:f,css:"-"+m+"-",dom:{Webkit:"WebKit",ms:"MS",o:"WebKit"}[f]||w(f)}),R=function(e,t){return t?t.toUpperCase():""},A=/[-\s]+(.)?/g,E=function(e){return e?e.replace(A,R):""},O=/::/g,L=/([A-Z]+)([A-Z][a-z])/g,D=/([a-z\d])([A-Z])/g,N=/_/g,P=function(e,t){return e?e.replace(O,"/").replace(L,"$1_$2").replace(D,"$1_$2").replace(N,t||"-"):""},$=function(e){return P(e).toLowerCase()},T=E,_=$,j=function(e){return e.length?e.charAt(0).toLowerCase()+e.substring(1):e},I=x,M=k,F=v,z="undefined"==typeof document?{}:document.documentElement.style,W=function(e,t){t=t||{};var n=j(T(e)),r=_(e),o=b?n:r,i=M.style?b?M.style:M.css:"";if(n in z)return t.asString?o:[o];var s=o,a=F[r],l=[];if(b&&(s=I(o)),"function"==typeof a){var c=a(o,i)||[];c&&!Array.isArray(c)&&(c=[c]),c.length&&(c=c.map(function(e){return b?j(T(e)):_(e)})),l=l.concat(c)}return i&&l.push(i+s),l.push(o),t.asString||1==l.length?l[0]:l},H=Object.prototype.hasOwnProperty,B=function(e,t){return H.call(e,t)},V=Object.prototype.toString,U=Object.prototype.toString,K=W,q=$,Y=E,J=B,X=function(e){return!!e&&"[object Object]"===V.call(e)},Q=function(e){return"[object Function]"===U.apply(e)},G=function(e,t,n,r){K(t).forEach(function(t){e[r?r(t):t]=n})},Z={cssUnitless:y},ee=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||Z).cssUnitless=t.cssUnitless||Z.cssUnitless,r=r||{};var o,i,s,a,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)||{},b=t.camelize?Y:q;for(s in e)if(J(e,s)){if(a=e[s],i=q(n?n+s:s),o=!1,u=!1,Q(a)&&(d=a.call(p||e,a,s,i,e),X(d)&&null!=d.value?(a=d.value,u=d.prefix,i=d.name?q(d.name):i):a=d),c="number"==(l=typeof a)||"string"==l&&""!=a&&1*a==a,null==a||null==i||""===i)continue;if((c||"string"==l)&&(o=!0),!o&&null!=a.value&&a.prefix&&(o=!0,u=a.prefix,a=a.value),o){if(u=u||!!m[i],c&&(a=h&&!(i in g)?a+f:a+""),"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?G(r,e,a,b):r[b(e)]=a});continue}u?G(r,i,a,b):r[b(i)]=a}else ee(a,t,i+"-",r)}return r},te=ee,ne=B,re={prefixProperties:v,cssUnitless:y,object:ee,string:function(e,t){e=te(e,t);var n,r=[];for(n in e)ne(e,n)&&r.push(n+": "+e[n]);return r.join("; ")}};const oe=t("@pie-lib:mask-markup:serialization"),ie=["span"],se=["em","strong","u"],ae=(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),re.object(r,{camelize:!0,addUnits:!1});var r},le=["border","class","style"],ce={b:"bold",em:"italic",u:"underline",s:"strikethrough",code:"code",strong:"strong"},de=(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=ce[r];if(o){oe("[deserialize] mark: ",o);return{_flatten:!0,nodes:ue(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 s=le.reduce((n=e,(e,t)=>{if(!n.getAttribute)return e;if(n.getAttribute(t))switch(t){case"style":e.style=ae(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}),a=(e=>ie.includes(e)?"inline":se.includes(e)?"mark":"block")(r),l=ue(e.childNodes,t);return{object:a,type:r,data:{dataset:{...e.dataset},attributes:{...s}},nodes:l}}var n;return null},ue=(e,t=[])=>{const n=[];for(let r=0;r<e.length;r++){const o=de(e[r],t);null!==o&&(o._flatten&&o.nodes?n.push(...o.nodes):n.push(o))}return n},pe=n,he=r,{get:ge}=i,{styled:fe}=o,{renderMath:me}=u;function be(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 ve=fe("div")(({theme:e})=>({paddingTop:e.spacing(2),paddingBottom:e.spacing(2)})),ye=fe("span")(()=>({display:"inline-block",width:".75em"})),xe=["tbody","tr"],we=(e,t,n,r,o,i)=>{if(!t)return null;const s=[];return(e.nodes||[]).forEach((e,a)=>{const l=e.type?`${e.type}-${a}`:`${a}`;if(e.isMath)return s.push(pe.createElement("span",{dangerouslySetInnerHTML:{__html:`<math displaystyle="true">${e.nodes[0].innerHTML}</math>`}})),s;if(r){const l=r(e,t,n);if(l)return s.push(l),void("td"!==be([o,"optionalAccess",e=>e.type])&&"drag-in-the-blank"===i&&s.push(pe.createElement(ye,{key:`spacer-${a}`})))}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&&xe.includes(r)?void 0:t})(o,n);return r?e+r:e},""),n=(e=>{const t=e.leaves.find(e=>ge(e,"marks",[]).length);return t?t.marks[0]:null})(e);if(n){let e;for(e in ce)if(ce[e]===n.type){const n=e;s.push(pe.createElement(n,{key:l},t));break}}else t.length>0&&(s.push(t),"td"!==be([o,"optionalAccess",e=>e.type])&&"drag-in-the-blank"===i&&s.push(pe.createElement(ye,{key:`spacer-${a}`})))}else{const o=we(e,t,n,r,e,i);if("p"===e.type||"paragraph"===e.type)s.push(pe.createElement(ve,{key:l},o));else{const t=e.type;e.nodes&&e.nodes.length>0?s.push(pe.createElement(t,{key:l,...e.data.attributes},o)):s.push(pe.createElement(t,{key:l,...e.data.attributes}))}}}),s},Ce=fe("div")(()=>({display:"initial","&:not(.MathJax) table":{borderCollapse:"collapse"},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:"8px 12px",textAlign:"left"}}));class Se extends pe.Component{constructor(e){super(e),Se.prototype.__init.call(this),this.internalContainerRef=pe.createRef()}static __initStatic(){this.propTypes={renderChildren:he.func,layout:he.object,value:he.object,onChange:he.func,elementType:he.string,containerRef:he.oneOfType([he.func,he.shape({current:he.instanceOf(Element)})])}}componentDidMount(){const e=this.props.containerRef||this.internalContainerRef;e.current&&"function"==typeof me&&me(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=we(t,e,this.handleChange,this.props.renderChildren,null,n),i=r||this.internalContainerRef;return pe.createElement(Ce,{ref:i},o)}}Se.__initStatic();const ke=/\{\{(\d+)\}\}/g;const Re=n,Ae=r;var Ee;const Oe=(e,t)=>{const{markup:n}=(o=t,(r=e)?{markup:r.replace(ke,(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=ue(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)=>((Ee=class extends Re.Component{static __initStatic(){this.propTypes={markup:Ae.string,layout:Ae.object,value:Ae.object,onChange:Ae.func,customMarkMarkupComponent:Ae.func,elementType:Ae.string}}constructor(e){super(e),this.containerRef=Re.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:s}=this.props,a=r||Oe(n,e);return Re.createElement(Se,{containerRef:this.containerRef,elementType:s,layout:a,value:o,onChange:i,renderChildren:t(this.props)})}}).__initStatic(),Ee),{useMemo:De}=n,{useLayoutEffect:Ne}=n,{useEffect:Pe}=n,{useRef:$e}=n,{useCallback:Te}=n,_e="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function je(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function Ie(e){return"nodeType"in e}function Me(e){var t,n;return e?je(e)?e:Ie(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function Fe(e){const{Document:t}=Me(e);return e instanceof t}function ze(e){return!je(e)&&e instanceof Me(e).HTMLElement}function We(e){return e instanceof Me(e).SVGElement}function He(e){return e?je(e)?e.document:Ie(e)?Fe(e)?e:ze(e)||We(e)?e.ownerDocument:document:document:document}const Be=_e?Ne:Pe;function Ve(e){const t=$e(e);return Be(()=>{t.current=e}),Te(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 Ue(e,t){void 0===t&&(t=[e]);const n=$e(e);return Be(()=>{n.current!==e&&(n.current=e)},t),n}function Ke(e,t){const n=$e();return De(()=>{const t=e(n.current);return n.current=t,t},[...t])}function qe(e){const t=Ve(e),n=$e(null),r=Te(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,r]}function Ye(e){const t=$e();return Pe(()=>{t.current=e},[e]),t.current}let Je={};function Xe(e,t){return De(()=>{if(t)return t;const n=null==Je[e]?0:Je[e]+1;return Je[e]=n,e+"-"+n},[e,t])}function Qe(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 Ge=Qe(1),Ze=Qe(-1);function et(e){if(!e)return!1;const{KeyboardEvent:t}=Me(e.target);return t&&e instanceof t}function tt(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=Me(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 nt=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[nt.Translate.toString(e),nt.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),rt="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function ot(e){return e.matches(rt)?e:e.querySelector(rt)}const it=n,{useState:st}=n,{useCallback:at}=n,lt={display:"none"};function ct(e){let{id:t,value:n}=e;return it.createElement("div",{id:t,style:lt},n)}function dt(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;return it.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 ut=n,{createContext:pt}=n,{useContext:ht}=n,{useEffect:gt}=n,{useState:ft}=n,{useCallback:mt}=n,{useMemo:bt}=n,{useRef:vt}=n,{memo:yt}=n,{useReducer:xt}=n,{cloneElement:wt}=n,{forwardRef:Ct}=n,{createPortal:St}=e,{unstable_batchedUpdates:kt}=e,Rt=pt(null);const At={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 "},Et={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 Ot(e){let{announcements:t=Et,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=At}=e;const{announce:i,announcement:s}=function(){const[e,t]=st("");return{announce:at(e=>{null!=e&&t(e)},[]),announcement:e}}(),a=Xe("DndLiveRegion"),[l,c]=ft(!1);if(gt(()=>{c(!0)},[]),function(e){const t=ht(Rt);gt(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}(bt(()=>({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=ut.createElement(ut.Fragment,null,ut.createElement(ct,{id:r,value:o.draggable}),ut.createElement(dt,{id:a,announcement:s}));return n?St(d,n):d}var Lt;function Dt(){}!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 Nt=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 $t(e,t){const n=tt(e);if(!n)return"0 0";return(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%"}function Tt(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function _t(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function jt(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 It=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=jt(t,t.left,t.top),i=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=Pt(jt(r),o);i.push({id:t,data:{droppableContainer:e,value:n}})}}return i.sort(Tt)};function Mt(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),s=o-r,a=i-n;if(r<o&&n<i){const n=t.width*t.height,r=e.width*e.height,o=s*a;return Number((o/(n+r-o)).toFixed(4))}return 0}const Ft=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=Mt(i,t);n>0&&o.push({id:r,data:{droppableContainer:e,value:n}})}}return o.sort(_t)};function zt(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Nt}const Wt=(Ht=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+Ht*t.y,bottom:e.bottom+Ht*t.y,left:e.left+Ht*t.x,right:e.right+Ht*t.x}),{...e})});var Ht;function Bt(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 Vt={ignoreTransform:!1};function Ut(e,t){void 0===t&&(t=Vt);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=Me(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=Bt(t);if(!r)return e;const{scaleX:o,scaleY:i,x:s,y:a}=r,l=e.left-s-(1-o)*parseFloat(n),c=e.top-a-(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:s,bottom:a,right:l}=n;return{top:r,left:o,width:i,height:s,bottom:a,right:l}}function Kt(e){return Ut(e,{ignoreTransform:!0})}function qt(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if(Fe(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!ze(o)||We(o))return n;if(n.includes(o))return n;const i=Me(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=Me(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=Me(e).getComputedStyle(e)),"fixed"===t.position}(o,i)?n:r(o.parentNode)}(e):n}function Yt(e){const[t]=qt(e,1);return null!=t?t:null}function Jt(e){return _e&&e?je(e)?e:Ie(e)?Fe(e)||e===He(e).scrollingElement?window:ze(e)?e:null:null:null}function Xt(e){return je(e)?e.scrollX:e.scrollLeft}function Qt(e){return je(e)?e.scrollY:e.scrollTop}function Gt(e){return{x:Xt(e),y:Qt(e)}}var Zt;function en(e){return!(!_e||!e)&&e===document.scrollingElement}function tn(e){const t={x:0,y:0},n=en(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"}(Zt||(Zt={}));const nn={x:.2,y:.2};function rn(e,t,n,r,o){let{top:i,left:s,right:a,bottom:l}=n;void 0===r&&(r=10),void 0===o&&(o=nn);const{isTop:c,isBottom:d,isLeft:u,isRight:p}=tn(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=Zt.Backward,g.y=r*Math.abs((t.top+f-i)/f)):!d&&l>=t.bottom-f&&(h.y=Zt.Forward,g.y=r*Math.abs((t.bottom-f-l)/f)),!p&&a>=t.right-m?(h.x=Zt.Forward,g.x=r*Math.abs((t.right-m-a)/m)):!u&&s<=t.left+m&&(h.x=Zt.Backward,g.x=r*Math.abs((t.left+m-s)/m)),{direction:h,speed:g}}function on(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 sn(e){return e.reduce((e,t)=>Ge(e,Gt(t)),Nt)}function an(e,t){if(void 0===t&&(t=Ut),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);Yt(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const ln=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+Xt(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+Qt(t),0)}]];class cn{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=qt(t),r=sn(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of ln)for(const i of t)Object.defineProperty(this,i,{get:()=>{const t=o(n),s=r[e]-t;return this.rect[i]+s},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class dn{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 un(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 pn,hn;function gn(e){e.preventDefault()}function fn(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"}(pn||(pn={})),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"}(hn||(hn={}));const mn={start:[hn.Space,hn.Enter],cancel:[hn.Esc],end:[hn.Space,hn.Enter,hn.Tab]},bn=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case hn.Right:return{...n,x:n.x+25};case hn.Left:return{...n,x:n.x-25};case hn.Down:return{...n,y:n.y+25};case hn.Up:return{...n,y:n.y-25}}};class vn{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 dn(He(t)),this.windowListeners=new dn(Me(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(pn.Resize,this.handleCancel),this.windowListeners.add(pn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(pn.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&an(n),t(Nt)}handleKeyDown(e){if(et(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=mn,coordinateGetter:i=bn,scrollBehavior:s="smooth"}=r,{code:a}=e;if(o.end.includes(a))return void this.handleEnd(e);if(o.cancel.includes(a))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=Ze(d,c),r={x:0,y:0},{scrollableAncestors:o}=n.current;for(const n of o){const o=e.code,{isTop:i,isRight:a,isLeft:l,isBottom:c,maxScroll:u,minScroll:p}=tn(n),h=on(n),g={x:Math.min(o===hn.Right?h.right-h.width/2:h.right,Math.max(o===hn.Right?h.left:h.left+h.width/2,d.x)),y:Math.min(o===hn.Down?h.bottom-h.height/2:h.bottom,Math.max(o===hn.Down?h.top:h.top+h.height/2,d.y))},f=o===hn.Right&&!a||o===hn.Left&&!l,m=o===hn.Down&&!c||o===hn.Up&&!i;if(f&&g.x!==d.x){const e=n.scrollLeft+t.x,i=o===hn.Right&&e<=u.x||o===hn.Left&&e>=p.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:s});r.x=i?n.scrollLeft-e:o===hn.Right?n.scrollLeft-u.x:n.scrollLeft-p.x,r.x&&n.scrollBy({left:-r.x,behavior:s});break}if(m&&g.y!==d.y){const e=n.scrollTop+t.y,i=o===hn.Down&&e<=u.y||o===hn.Up&&e>=p.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:s});r.y=i?n.scrollTop-e:o===hn.Down?n.scrollTop-u.y:n.scrollTop-p.y,r.y&&n.scrollBy({top:-r.y,behavior:s});break}}this.handleMove(e,Ge(Ze(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 yn(e){return Boolean(e&&"distance"in e)}function xn(e){return Boolean(e&&"delay"in e)}vn.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=mn,onActivation:o}=t,{active:i}=n;const{code:s}=e.nativeEvent;if(r.start.includes(s)){const t=i.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==o||o({event:e.nativeEvent}),!0)}return!1}}];class wn{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=Me(e);return e instanceof t?e:He(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=He(i),this.documentListeners=new dn(this.document),this.listeners=new dn(n),this.windowListeners=new dn(Me(i)),this.initialCoordinates=null!=(r=tt(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(pn.Resize,this.handleCancel),this.windowListeners.add(pn.DragStart,gn),this.windowListeners.add(pn.VisibilityChange,this.handleCancel),this.windowListeners.add(pn.ContextMenu,gn),this.documentListeners.add(pn.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(xn(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(yn(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(pn.Click,fn,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(pn.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:o}=this,{onMove:i,options:{activationConstraint:s}}=o;if(!r)return;const a=null!=(t=tt(e))?t:Nt,l=Ze(r,a);if(!n&&s){if(yn(s)){if(null!=s.tolerance&&un(l,s.tolerance))return this.handleCancel();if(un(l,s.distance))return this.handleStart()}return xn(s)&&un(l,s.tolerance)?this.handleCancel():void this.handlePending(s,l)}e.cancelable&&e.preventDefault(),i(a)}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===hn.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const Cn={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Sn extends wn{constructor(e){const{event:t}=e,n=He(t.target);super(e,Cn,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 kn={move:{name:"mousemove"},end:{name:"mouseup"}};var Rn;!function(e){e[e.RightClick=2]="RightClick"}(Rn||(Rn={}));(class extends wn{constructor(e){super(e,kn,He(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==Rn.RightClick&&(null==r||r({event:n}),!0)}}];const An={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var En,On;function Ln(e){let{acceleration:t,activator:n=En.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:s=5,order:a=On.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:d,delta:u,threshold:p}=e;const h=function(e){let{delta:t,disabled:n}=e;const r=Ye(t);return Ke(e=>{if(n||!r||!e)return Dn;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Zt.Backward]:e.x[Zt.Backward]||-1===o.x,[Zt.Forward]:e.x[Zt.Forward]||1===o.x},y:{[Zt.Backward]:e.y[Zt.Backward]||-1===o.y,[Zt.Forward]:e.y[Zt.Forward]||1===o.y}}},[n,t,r])}({delta:u,disabled:!i}),[g,f]=function(){const e=$e(null);return[Te((t,n)=>{e.current=setInterval(t,n)},[]),Te(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}(),m=vt({x:0,y:0}),b=vt({x:0,y:0}),v=bt(()=>{switch(n){case En.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case En.DraggableRect:return o}},[n,o,l]),y=vt(null),x=mt(()=>{const e=y.current;if(!e)return;const t=m.current.x*b.current.x,n=m.current.y*b.current.y;e.scrollBy(t,n)},[]),w=bt(()=>a===On.TreeOrder?[...c].reverse():c,[a,c]);gt(()=>{if(i&&c.length&&v){for(const e of w){if(!1===(null==r?void 0:r(e)))continue;const n=c.indexOf(e),o=d[n];if(!o)continue;const{direction:i,speed:a}=rn(e,o,v,t,p);for(const e of["x","y"])h[e][i[e]]||(a[e]=0,i[e]=0);if(a.x>0||a.y>0)return f(),y.current=e,g(x,s),m.current=a,void(b.current=i)}m.current={x:0,y:0},b.current={x:0,y:0},f()}else f()},[t,x,r,f,i,s,JSON.stringify(v),JSON.stringify(h),g,c,w,d,JSON.stringify(p)])}(class extends wn{constructor(e){super(e,An)}static setup(){return window.addEventListener(An.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(An.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"}(En||(En={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(On||(On={}));const Dn={x:{[Zt.Backward]:!1,[Zt.Forward]:!1},y:{[Zt.Backward]:!1,[Zt.Forward]:!1}};var Nn,Pn;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(Nn||(Nn={})),function(e){e.Optimized="optimized"}(Pn||(Pn={}));const $n=new Map;function Tn(e,t){return Ke(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function _n(e){let{callback:t,disabled:n}=e;const r=Ve(t),o=bt(()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(r)},[n]);return gt(()=>()=>null==o?void 0:o.disconnect(),[o]),o}function jn(e){return new cn(Ut(e),e)}function In(e,t,n){void 0===t&&(t=jn);const[r,o]=ft(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 s=function(e){let{callback:t,disabled:n}=e;const r=Ve(t),o=bt(()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(r)},[r,n]);return gt(()=>()=>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}}}}),a=_n({callback:i});return Be(()=>{i(),e?(null==a||a.observe(e),null==s||s.observe(document.body,{childList:!0,subtree:!0})):(null==a||a.disconnect(),null==s||s.disconnect())},[e]),r}const Mn=[];function Fn(e,t){void 0===t&&(t=[]);const n=vt(null);return gt(()=>{n.current=null},t),gt(()=>{const t=e!==Nt;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?Ze(e,n.current):Nt}function zn(e){return bt(()=>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 Wn=[];function Hn(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return ze(t)?t:e}const Bn=[{sensor:Sn,options:{}},{sensor:vn,options:{}}],Vn={current:{}},Un={draggable:{measure:Kt},droppable:{measure:Kt,strategy:Nn.WhileDragging,frequency:Pn.Optimized},dragOverlay:{measure:Ut}};class Kn 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 qn={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Kn,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Dt},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Un,measureDroppableContainers:Dt,windowRect:null,measuringScheduled:!1},Yn={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Dt,draggableNodes:new Map,over:null,measureDroppableContainers:Dt},Jn=pt(Yn),Xn=pt(qn);function Qn(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Kn}}}function Gn(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 Kn(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 s=new Kn(e.droppable.containers);return s.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:s}}}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 Kn(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function Zn(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=ht(Jn),i=Ye(r),s=Ye(null==n?void 0:n.id);return gt(()=>{if(!t&&!r&&i&&null!=s){if(!et(i))return;if(document.activeElement===i.target)return;const e=o.get(s);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=ot(e);if(t){t.focus();break}}})}},[r,t,o,s,i]),null}function er(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}const tr=pt({...Nt,scaleX:1,scaleY:1});var nr;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(nr||(nr={})),yt(function(e){var t,n,r,o;let{id:i,accessibility:s,autoScroll:a=!0,children:l,sensors:c=Bn,collisionDetection:d=Ft,measuring:u,modifiers:p,...h}=e;const g=xt(Gn,void 0,Qn),[f,m]=g,[b,v]=function(){const[e]=ft(()=>new Set),t=mt(t=>(e.add(t),()=>e.delete(t)),[e]);return[mt(t=>{let{type:n,event:r}=t;e.forEach(e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)})},[e]),t]}(),[y,x]=ft(nr.Uninitialized),w=y===nr.Initialized,{draggable:{active:C,nodes:S,translate:k},droppable:{containers:R}}=f,A=null!=C?S.get(C):null,E=vt({initial:null,translated:null}),O=bt(()=>{var e;return null!=C?{id:C,data:null!=(e=null==A?void 0:A.data)?e:Vn,rect:E}:null},[C,A]),L=vt(null),[D,N]=ft(null),[P,$]=ft(null),T=Ue(h,Object.values(h)),_=Xe("DndDescribedBy",i),j=bt(()=>R.getEnabled(),[R]),I=bt(()=>({draggable:{...Un.draggable,...null==M?void 0:M.draggable},droppable:{...Un.droppable,...null==M?void 0:M.droppable},dragOverlay:{...Un.dragOverlay,...null==M?void 0:M.dragOverlay}}),[null==(M=u)?void 0:M.draggable,null==M?void 0:M.droppable,null==M?void 0:M.dragOverlay]);var M;const{droppableRects:F,measureDroppableContainers:z,measuringScheduled:W}=function(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,s]=ft(null),{frequency:a,measure:l,strategy:c}=o,d=vt(e),u=function(){switch(c){case Nn.Always:return!1;case Nn.BeforeDragging:return n;default:return!n}}(),p=Ue(u),h=mt(function(e){void 0===e&&(e=[]),p.current||s(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[p]),g=vt(null),f=Ke(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 cn(l(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,i,n,u,l]);return gt(()=>{d.current=e},[e]),gt(()=>{u||h()},[n,u]),gt(()=>{i&&i.length>0&&s(null)},[JSON.stringify(i)]),gt(()=>{u||"number"!=typeof a||null!==g.current||(g.current=setTimeout(()=>{h(),g.current=null},a))},[a,u,h,...r]),{droppableRects:f,measureDroppableContainers:h,measuringScheduled:null!=i}}(j,{dragging:w,dependencies:[k.x,k.y],config:I.droppable}),H=function(e,t){const n=null!=t?e.get(t):void 0,r=n?n.node.current:null;return Ke(e=>{var n;return null==t?null:null!=(n=null!=r?r:e)?n:null},[r,t])}(S,C),B=bt(()=>P?tt(P):null,[P]),V=function(){const e=!1===(null==D?void 0:D.autoScrollEnabled),t="object"==typeof a?!1===a.enabled:!1===a,n=w&&!e&&!t;if("object"==typeof a)return{...a,enabled:n};return{enabled:n}}(),U=function(e,t){return Tn(e,t)}(H,I.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=vt(!1),{x:s,y:a}="boolean"==typeof o?{x:o,y:o}:o;Be(()=>{if(!s&&!a||!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(s||(o.x=0),a||(o.y=0),i.current=!0,Math.abs(o.x)>0||Math.abs(o.y)>0){const t=Yt(e);t&&t.scrollBy({top:o.y,left:o.x})}},[t,s,a,r,n])}({activeNode:null!=C?S.get(C):null,config:V.layoutShiftCompensation,initialRect:U,measure:I.draggable.measure});const K=In(H,I.draggable.measure,U),q=In(H?H.parentElement:null),Y=vt({activatorEvent:null,active:null,activeNode:H,collisionRect:null,collisions:null,droppableRects:F,draggableNodes:S,draggingNode:null,draggingNodeRect:null,droppableContainers:R,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),J=R.getNodeFor(null==(t=Y.current.over)?void 0:t.id),X=function(e){let{measure:t}=e;const[n,r]=ft(null),o=_n({callback:mt(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=mt(e=>{const n=Hn(e);null==o||o.disconnect(),n&&(null==o||o.observe(n)),r(n?t(n):null)},[t,o]),[s,a]=qe(i);return bt(()=>({nodeRef:s,rect:n,setRef:a}),[n,s,a])}({measure:I.dragOverlay.measure}),Q=null!=(n=X.nodeRef.current)?n:H,G=w?null!=(r=X.rect)?r:K:null,Z=Boolean(X.nodeRef.current&&X.rect),ee=zt(te=Z?null:K,Tn(te));var te;const ne=zn(Q?Me(Q):null),re=function(e){const t=vt(e),n=Ke(n=>e?n&&n!==Mn&&e&&t.current&&e.parentNode===t.current.parentNode?n:qt(e):Mn,[e]);return gt(()=>{t.current=e},[e]),n}(w?null!=J?J:H:null),oe=function(e,t){void 0===t&&(t=Ut);const[n]=e,r=zn(n?Me(n):null),[o,i]=ft(Wn);function s(){i(()=>e.length?e.map(e=>en(e)?r:new cn(t(e),e)):Wn)}const a=_n({callback:s});return Be(()=>{null==a||a.disconnect(),s(),e.forEach(e=>null==a?void 0:a.observe(e))},[e]),o}(re),ie=er(p,{transform:{x:k.x-ee.x,y:k.y-ee.y,scaleX:1,scaleY:1},activatorEvent:P,active:O,activeNodeRect:K,containerNodeRect:q,draggingNodeRect:G,over:Y.current.over,overlayNodeRect:X.rect,scrollableAncestors:re,scrollableAncestorRects:oe,windowRect:ne}),se=B?Ge(B,k):null,ae=function(e){const[t,n]=ft(null),r=vt(e),o=mt(e=>{const t=Jt(e.target);t&&n(e=>e?(e.set(t,Gt(t)),new Map(e)):null)},[]);return gt(()=>{const t=r.current;if(e!==t){i(t);const s=e.map(e=>{const t=Jt(e);return t?(t.addEventListener("scroll",o,{passive:!0}),[t,Gt(t)]):null}).filter(e=>null!=e);n(s.length?new Map(s):null),r.current=e}return()=>{i(e),i(t)};function i(e){e.forEach(e=>{const t=Jt(e);null==t||t.removeEventListener("scroll",o)})}},[o,e]),bt(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>Ge(e,t),Nt):sn(e):Nt,[e,t])}(re),le=Fn(ae),ce=Fn(ae,[K]),de=Ge(ie,le),ue=G?Wt(G,ie):null,pe=O&&ue?d({active:O,collisionRect:ue,droppableRects:F,droppableContainers:j,pointerCoordinates:se}):null,he=function(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}(pe,"id"),[ge,fe]=ft(null),me=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(Z?ie:Ge(ie,ce),null!=(o=null==ge?void 0:ge.rect)?o:null,K),be=vt(null),ve=mt((e,t)=>{let{sensor:n,options:r}=t;if(null==L.current)return;const o=S.get(L.current);if(!o)return;const i=e.nativeEvent,s=new n({active:L.current,activeNode:o,event:i,options:r,context:Y,onAbort(e){if(!S.get(e))return;const{onDragAbort:t}=T.current,n={id:e};null==t||t(n),b({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!S.get(e))return;const{onDragPending:o}=T.current,i={id:e,constraint:t,initialCoordinates:n,offset:r};null==o||o(i),b({type:"onDragPending",event:i})},onStart(e){const t=L.current;if(null==t)return;const n=S.get(t);if(!n)return;const{onDragStart:r}=T.current,o={activatorEvent:i,active:{id:t,data:n.data,rect:E}};kt(()=>{null==r||r(o),x(nr.Initializing),m({type:Lt.DragStart,initialCoordinates:e,active:t}),b({type:"onDragStart",event:o}),N(be.current),$(i)})},onMove(e){m({type:Lt.DragMove,coordinates:e})},onEnd:a(Lt.DragEnd),onCancel:a(Lt.DragCancel)});function a(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:o}=Y.current;let s=null;if(t&&o){const{cancelDrop:a}=T.current;if(s={activatorEvent:i,active:t,collisions:n,delta:o,over:r},e===Lt.DragEnd&&"function"==typeof a){await Promise.resolve(a(s))&&(e=Lt.DragCancel)}}L.current=null,kt(()=>{m({type:e}),x(nr.Uninitialized),fe(null),N(null),$(null),be.current=null;const t=e===Lt.DragEnd?"onDragEnd":"onDragCancel";if(s){const e=T.current[t];null==e||e(s),b({type:t,event:s})}})}}be.current=s},[S]),ye=mt((e,t)=>(n,r)=>{const o=n.nativeEvent,i=S.get(r);if(null!==L.current||!i||o.dndKit||o.defaultPrevented)return;const s={active:i};!0===e(n,t.options,s)&&(o.dndKit={capturedBy:t.sensor},L.current=r,ve(n,t))},[S,ve]),xe=function(e,t){return bt(()=>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){gt(()=>{if(!_e)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),Be(()=>{K&&y===nr.Initializing&&x(nr.Initialized)},[K,y]),gt(()=>{const{onDragMove:e}=T.current,{active:t,activatorEvent:n,collisions:r,over:o}=Y.current;if(!t||!n)return;const i={active:t,activatorEvent:n,collisions:r,delta:{x:de.x,y:de.y},over:o};kt(()=>{null==e||e(i),b({type:"onDragMove",event:i})})},[de.x,de.y]),gt(()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:o}=Y.current;if(!e||null==L.current||!t||!o)return;const{onDragOver:i}=T.current,s=r.get(he),a=s&&s.rect.current?{id:s.id,rect:s.rect.current,data:s.data,disabled:s.disabled}:null,l={active:e,activatorEvent:t,collisions:n,delta:{x:o.x,y:o.y},over:a};kt(()=>{fe(a),null==i||i(l),b({type:"onDragOver",event:l})})},[he]),Be(()=>{Y.current={activatorEvent:P,active:O,activeNode:H,collisionRect:ue,collisions:pe,droppableRects:F,draggableNodes:S,draggingNode:Q,draggingNodeRect:G,droppableContainers:R,over:ge,scrollableAncestors:re,scrollAdjustedTranslate:de},E.current={initial:G,translated:ue}},[O,H,pe,ue,S,Q,G,F,R,ge,re,de]),Ln({...V,delta:k,draggingRect:ue,pointerCoordinates:se,scrollableAncestors:re,scrollableAncestorRects:oe});const we=bt(()=>({active:O,activeNode:H,activeNodeRect:K,activatorEvent:P,collisions:pe,containerNodeRect:q,dragOverlay:X,draggableNodes:S,droppableContainers:R,droppableRects:F,over:ge,measureDroppableContainers:z,scrollableAncestors:re,scrollableAncestorRects:oe,measuringConfiguration:I,measuringScheduled:W,windowRect:ne}),[O,H,K,P,pe,q,X,S,R,F,ge,z,re,oe,I,W,ne]),Ce=bt(()=>({activatorEvent:P,activators:xe,active:O,activeNodeRect:K,ariaDescribedById:{draggable:_},dispatch:m,draggableNodes:S,over:ge,measureDroppableContainers:z}),[P,xe,O,K,m,_,S,ge,z]);return ut.createElement(Rt.Provider,{value:v},ut.createElement(Jn.Provider,{value:Ce},ut.createElement(Xn.Provider,{value:we},ut.createElement(tr.Provider,{value:me},l)),ut.createElement(Zn,{disabled:!1===(null==s?void 0:s.restoreFocus)})),ut.createElement(Ot,{...s,hiddenTextDescribedById:_}))});const rr=pt(null),or="button";function ir(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=Xe("Draggable"),{activators:s,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:d,draggableNodes:u,over:p}=ht(Jn),{role:h=or,roleDescription:g="draggable",tabIndex:f=0}=null!=o?o:{},m=(null==l?void 0:l.id)===t,b=ht(m?tr:rr),[v,y]=qe(),[x,w]=qe(),C=function(e,t){return bt(()=>e.reduce((e,n)=>{let{eventName:r,handler:o}=n;return e[r]=e=>{o(e,t)},e},{}),[e,t])}(s,t),S=Ue(n);Be(()=>(u.set(t,{id:t,key:i,node:v,activatorNode:x,data:S}),()=>{const e=u.get(t);e&&e.key===i&&u.delete(t)}),[u,t]);return{active:l,activatorEvent:a,activeNodeRect:c,attributes:bt(()=>({role:h,tabIndex:f,"aria-disabled":r,"aria-pressed":!(!m||h!==or)||void 0,"aria-roledescription":g,"aria-describedby":d.draggable}),[r,h,f,m,g,d.draggable]),isDragging:m,listeners:r?void 0:C,node:v,over:p,setNodeRef:y,setActivatorNodeRef:w,transform:b}}const sr={timeout:25};function ar(e){let{animation:t,children:n}=e;const[r,o]=ft(null),[i,s]=ft(null),a=Ye(n);return n||r||!a||o(a),Be(()=>{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]),ut.createElement(ut.Fragment,null,n,r?wt(r,{ref:s}):null)}const lr={x:0,y:0,scaleX:1,scaleY:1};function cr(e){let{children:t}=e;return ut.createElement(Jn.Provider,{value:Yn},ut.createElement(tr.Provider,{value:lr},t))}const dr={position:"fixed",touchAction:"none"},ur=e=>et(e)?"transform 250ms ease":void 0,pr=Ct((e,t)=>{let{as:n,activatorEvent:r,adjustScale:o,children:i,className:s,rect:a,style:l,transform:c,transition:d=ur}=e;if(!a)return null;const u=o?c:{...c,scaleX:1,scaleY:1},p={...dr,width:a.width,height:a.height,top:a.top,left:a.left,transform:nt.Transform.toString(u),transformOrigin:o&&r?$t(r,a):void 0,transition:"function"==typeof d?d(r):d,...l};return ut.createElement(n,{className:s,style:p,ref:t},i)}),hr={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:nt.Transform.toString(t)},{transform:nt.Transform.toString(n)}]},sideEffects:(gr={styles:{active:{opacity:"0"}}},e=>{let{active:t,dragOverlay:n}=e;const r={},{styles:o,className:i}=gr;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 gr;function fr(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return Ve((e,i)=>{if(null===t)return;const s=n.get(e);if(!s)return;const a=s.node.current;if(!a)return;const l=Hn(i);if(!l)return;const{transform:c}=Me(i).getComputedStyle(i),d=Bt(c);if(!d)return;const u="function"==typeof t?t:function(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...hr,...e};return e=>{let{active:i,dragOverlay:s,transform:a,...l}=e;if(!t)return;const c={x:s.rect.left-i.rect.left,y:s.rect.top-i.rect.top},d={scaleX:1!==a.scaleX?i.rect.width*a.scaleX/s.rect.width:1,scaleY:1!==a.scaleY?i.rect.height*a.scaleY/s.rect.height:1},u={x:a.x-c.x,y:a.y-c.y,...d},p=o({...l,active:i,dragOverlay:s,transform:{initial:a,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:s,...l}),m=s.node.animate(p,{duration:t,easing:n,fill:"forwards"});return new Promise(e=>{m.onfinish=()=>{null==f||f(),e()}})}}(t);return an(a,o.draggable.measure),u({active:{id:e,data:s.data,node:a,rect:o.draggable.measure(a)},draggableNodes:n,dragOverlay:{node:i,rect:o.dragOverlay.measure(l)},droppableContainers:r,measuringConfiguration:o,transform:d})})}let mr=0;function br(e){return bt(()=>{if(null!=e)return mr++,mr},[e])}const vr=ut.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:o,transition:i,modifiers:s,wrapperElement:a="div",className:l,zIndex:c=999}=e;const{activatorEvent:d,active:u,activeNodeRect:p,containerNodeRect:h,draggableNodes:g,droppableContainers:f,dragOverlay:m,over:b,measuringConfiguration:v,scrollableAncestors:y,scrollableAncestorRects:x,windowRect:w}=ht(Xn),C=ht(tr),S=br(null==u?void 0:u.id),k=er(s,{activatorEvent:d,active:u,activeNodeRect:p,containerNodeRect:h,draggingNodeRect:m.rect,over:b,overlayNodeRect:m.rect,scrollableAncestors:y,scrollableAncestorRects:x,transform:C,windowRect:w}),R=Tn(p),A=fr({config:r,draggableNodes:g,droppableContainers:f,measuringConfiguration:v}),E=R?m.setRef:void 0;return ut.createElement(cr,null,ut.createElement(ar,{animation:A},u&&S?ut.createElement(pr,{key:S,id:u.id,ref:E,as:a,activatorEvent:d,adjustScale:t,className:l,transition:i,rect:R,style:{zIndex:c,...o},transform:k},n):null))}),yr=n,{useEffect:xr}=n,{useRef:wr}=n,Cr=r,{styled:Sr}=o,{Chip:kr}=s,{color:Rr}=a,{renderMath:Ar}=u;function Er(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 Or=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&&{}})),Lr=Sr(kr)(()=>({backgroundColor:Rr.white(),border:`1px solid ${Rr.text()}`,color:Rr.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}})),Dr=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=wr(null),{attributes:o,listeners:i,setNodeRef:s,isDragging:a}=ir({id:`choice-${e.id}`,data:{choice:e,instanceId:n,fromChoice:!0,type:"MaskBlank"},disabled:t});return xr(()=>{Ar(r.current)},[e.value]),yr.createElement(Or,{ref:s,style:a?{width:Er([r,"access",e=>e.current,"optionalAccess",e=>e.offsetWidth]),height:Er([r,"access",e=>e.current,"optionalAccess",e=>e.offsetHeight])}:{},disabled:t,...i,...o},yr.createElement(Lr,{clickable:!1,disabled:t,ref:r,label:yr.createElement(Dr,{dangerouslySetInnerHTML:{__html:e.value}})}))}Nr.propTypes={choice:Cr.object.isRequired,disabled:Cr.bool,instanceId:Cr.oneOfType([Cr.string,Cr.number])};const Pr=n,$r=r,{findKey:Tr}=i,{DragDroppablePlaceholder:_r}=p;class jr extends Pr.Component{constructor(...e){super(...e),jr.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===Tr(r,t=>t===e.id)}),s={...this.getStyleForWrapper(),minWidth:"100px"};return Pr.createElement("div",{style:s},Pr.createElement(_r,{disabled:e,instanceId:o},i.map((t,n)=>Pr.createElement(Nr,{key:`${t.value}-${n}`,disabled:e,choice:t,instanceId:o}))))}}jr.__initStatic();var Ir={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 Mr=n,{useRef:Fr}=n,{useState:zr}=n,{useEffect:Wr}=n,Hr=r,Br=t,{styled:Vr}=o,{Chip:Ur}=s,Kr=l,{color:qr}=a,{renderMath:Yr}=u;function Jr(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}Br("pie-lib:mask-markup:blank");const Xr=Vr("span")(({dragged:e,over:t})=>({border:`solid 0px ${qr.primary()}`,minWidth:"200px",touchAction:"none",overflow:"hidden",whiteSpace:"nowrap",opacity:1,...t&&{whiteSpace:"nowrap",overflow:"hidden"},...e&&{opacity:.5}})),Qr=Vr(Ur)(()=>({backgroundColor:qr.background(),border:`2px dashed ${qr.text()}`,color:qr.text(),fontSize:"inherit",maxWidth:"374px",position:"relative",borderRadius:"3px","&.over":{whiteSpace:"nowrap",overflow:"hidden"},"&.parentOver":{border:`1px solid ${Ir[500]}`,backgroundColor:`${Ir[300]}`},"&.correct":{border:`solid 1px ${qr.correct()}`},"&.incorrect":{border:`solid 1px ${qr.incorrect()}`},"&.Mui-disabled":{opacity:1}})),Gr=Vr("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 Zr({disabled:e,choice:t,isOver:n,isDragging:r,dragItem:o,correct:i,emptyResponseAreaWidth:s,emptyResponseAreaHeight:a}){const l=Fr(null),c=Fr(null),d=Fr(null),[u,p]=zr({height:0,width:0}),h=()=>{f()},g=()=>{const e=Jr([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(s)||0,r=parseFloat(a)||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`}};Wr(()=>{g()},[]),Wr(()=>{l.current&&Yr(l.current)},[n,Jr([o,"optionalAccess",e=>e.choice,"optionalAccess",e=>e.value])]),Wr(()=>{t?g():p({height:0,width:0})},[t]),Wr(()=>{n||r||(d.current={width:l.current.offsetWidth,height:l.current.offsetHeight})},[t,n,r]);const m=o&&n&&o.choice&&o.choice.value,b=t&&t.value,v=n||r?{width:Jr([d,"access",e=>e.current,"optionalAccess",e=>e.width]),height:Jr([d,"access",e=>e.current,"optionalAccess",e=>e.height])}:(()=>{const e=isNaN(parseFloat(s))?0:parseFloat(s),t=isNaN(parseFloat(a))?0:parseFloat(a);return{...{height:u.height||t,width:u.width||e},...e?{}:{minWidth:90},...t?{}:{minHeight:32}}})();return Mr.createElement(Qr,{clickable:!1,disabled:e,ref:l,component:"span",label:Mr.createElement(Mr.Fragment,null,Mr.createElement(Gr,{ref:c,draggable:!0,className:Kr({over:n,hidden:m}),dangerouslySetInnerHTML:{__html:b||""}}),m&&Mr.createElement(Gr,{draggable:!0,className:Kr({over:n,dragged:!0}),dangerouslySetInnerHTML:{__html:m||""}})),className:Kr({over:n,parentOver:n,correct:void 0!==i&&i,incorrect:void 0!==i&&!i}),variant:e?"outlined":void 0,style:v})}function eo({id:e,disabled:t,duplicates:n,choice:r,correct:o,onChange:i,emptyResponseAreaWidth:s,emptyResponseAreaHeight:a,instanceId:l}){const{attributes:c,listeners:d,setNodeRef:u,transform:p,isDragging:h}=ir({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=Xe("Droppable"),{active:s,dispatch:a,over:l,measureDroppableContainers:c}=ht(Jn),d=vt({disabled:n}),u=vt(!1),p=vt(null),h=vt(null),{disabled:g,updateMeasurementsFor:f,timeout:m}={...sr,...o},b=Ue(null!=f?f:r),v=_n({callback:mt(()=>{u.current?(null!=h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{c(Array.isArray(b.current)?b.current:[b.current]),h.current=null},m)):u.current=!0},[m]),disabled:g||!s}),y=mt((e,t)=>{v&&(t&&(v.unobserve(t),u.current=!1),e&&v.observe(e))},[v]),[x,w]=qe(y),C=Ue(t);return gt(()=>{v&&x.current&&(v.disconnect(),u.current=!1,v.observe(x.current))},[x,v]),gt(()=>(a({type:Lt.RegisterDroppable,element:{id:r,key:i,disabled:n,node:x,rect:p,data:C}}),()=>a({type:Lt.UnregisterDroppable,key:i,id:r})),[r]),gt(()=>{n!==d.current.disabled&&(a({type:Lt.SetDroppableDisabled,id:r,key:i,disabled:n}),d.current.disabled=n)},[r,i,n,a]),{active:s,rect:p,isOver:(null==l?void 0:l.id)===r,node:x,over:l,setNodeRef:w}}({id:`mask-blank-drop-${e}`,data:{id:e,accepts:["MaskBlank"],instanceId:l}}),b={transform:nt.Translate.toString(p)};return Mr.createElement(Xr,{ref:e=>{u(e),g(e)},style:b,dragged:h,over:f,...c,...d},Mr.createElement(Zr,{id:e,disabled:t,duplicates:n,choice:r,isOver:f,dragItem:Jr([m,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current]),correct:o,onChange:i,emptyResponseAreaWidth:s,emptyResponseAreaHeight:a,instanceId:l}))}Zr.defaultProps={emptyResponseAreaWidth:0,emptyResponseAreaHeight:0},Zr.propTypes={id:Hr.oneOfType([Hr.string,Hr.number]),disabled:Hr.bool,duplicates:Hr.bool,choice:Hr.object,isOver:Hr.bool,dragItem:Hr.object,correct:Hr.bool,onChange:Hr.func,emptyResponseAreaWidth:Hr.oneOfType([Hr.string,Hr.number]),emptyResponseAreaHeight:Hr.oneOfType([Hr.string,Hr.number]),instanceId:Hr.string},eo.defaultProps={emptyResponseAreaWidth:0,emptyResponseAreaHeight:0},eo.propTypes={id:Hr.oneOfType([Hr.string,Hr.number]),disabled:Hr.bool,duplicates:Hr.bool,choice:Hr.object,correct:Hr.bool,onChange:Hr.func,emptyResponseAreaWidth:Hr.oneOfType([Hr.string,Hr.number]),emptyResponseAreaHeight:Hr.oneOfType([Hr.string,Hr.number]),instanceId:Hr.string};const to=n,no=r,{DragProvider:ro}=p;function oo(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 io=Le("blank",e=>(t,n,r)=>{const o=oo([t,"access",e=>e.data,"optionalAccess",e=>e.dataset])||{};if("blank"===o.component){const{disabled:i,duplicates:s,correctResponse:a,feedback:l,showCorrectAnswer:c,emptyResponseAreaWidth:d,emptyResponseAreaHeight:u,instanceId:p,isDragging:h}=e,g=c?a[o.id]:n[o.id],f=g&&e.choices.find(e=>e.id===g);return to.createElement(eo,{key:`${t.type}-${o.id}`,correct:c||l&&l[o.id],disabled:i,duplicates:s,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 so extends to.Component{constructor(e){super(e),so.prototype.__init.call(this),so.prototype.__init2.call(this),so.prototype.__init3.call(this),so.prototype.__init4.call(this),this.state={activeDragItem:null}}static __initStatic(){this.propTypes={markup:no.string,layout:no.object,choicesPosition:no.string,choices:no.array,value:no.object,onChange:no.func,duplicates:no.bool,disabled:no.bool,feedback:no.object,correctResponse:no.object,showCorrectAnswer:no.bool,emptyResponseAreaWidth:no.oneOfType([no.string,no.number]),emptyResponseAreaHeight:no.oneOfType([no.string,no.number]),instanceId:no.string}}static __initStatic2(){this.defaultProps={instanceId:"drag-in-the-blank"}}__init(){this.handleDragStart=e=>{const{active:t}=e;oo([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?to.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,s=n.data.current;if("MaskBlank"===oo([i,"optionalAccess",e=>e.type])&&oo([s,"optionalAccess",e=>e.accepts,"optionalAccess",e=>e.includes,"call",e=>e("MaskBlank")])){const e=i,t=s.id;if(!0===s.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:s,disabled:a,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 to.createElement(ro,{onDragStart:this.handleDragStart,onDragEnd:this.handleDragEnd,collisionDetection:It},to.createElement("div",{ref:e=>this.rootRef=e,style:f},to.createElement(jr,{choicePosition:g,choices:i,value:n,duplicates:t,disabled:a,instanceId:h}),to.createElement(io,{elementType:"drag-in-the-blank",markup:e,layout:p,value:n,choices:i,onChange:r,disabled:a,duplicates:t,feedback:l,correctResponse:s,showCorrectAnswer:c,emptyResponseAreaWidth:d,emptyResponseAreaHeight:u,instanceId:h,isDragging:!!this.state.activeDragItem}),to.createElement(vr,{style:{pointerEvents:"none"}},this.renderDragOverlay())))}}so.__initStatic(),so.__initStatic2();const ao=n,{styled:lo}=o,co=l,{color:uo}=a;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}let ho,go;"undefined"!=typeof window&&(ho=require("@pie-lib/editable-html-tip-tap").default,go=lo(ho)(()=>({display:"inline-block",verticalAlign:"middle",margin:"4px",borderRadius:"4px",border:`1px solid ${uo.black()}`,"&.correct":{border:`1px solid ${uo.correct()}`},"&.incorrect":{border:`1px solid ${uo.incorrect()}`}})));var fo=Le("input",e=>(t,n)=>{const{adjustedLimit:r,disabled:o,feedback:i,showCorrectAnswer:s,maxLength:a,spellCheck:l,pluginProps:c,onChange:d}=e,u=po([t,"access",e=>e.data,"optionalAccess",e=>e.dataset])||{};if("input"===u.component){const p=(e.choices&&u&&e.choices[u.id]||[])[0],h=s?p&&p.label:n[u.id]||"",g=a&&a[u.id],f=i&&i[u.id],m=s||"correct"===f,b=!s&&"incorrect"===f,v=e=>{const t={...n,[u.id]:e};d(t)},y=e=>{if("Enter"===e.key||13===e.keyCode)return!0};return ao.createElement(go,{id:u.id,key:`${t.type}-input-${u.id}`,disabled:s||o,disableUnderline:!0,onChange:v,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:!!po([c,"optionalAccess",e=>e.characters,"optionalAccess",e=>e.disabled])},className:co({correct:m,incorrect:b})})}});Le("input",e=>(t,n,r)=>{const o=t.data&&t.data.dataset||{};if("input"===o.component)return e.customMarkMarkupComponent(o.id)});const mo=n,bo=r,{Button:vo}=s,{InputLabel:yo}=s,{Menu:xo}=s,{MenuItem:wo}=s,{ArrowDropDown:Co}=c,{ArrowDropUp:So}=c,{Close:ko}=c,{Check:Ro}=c,{styled:Ao}=o,{color:Eo}=a,{renderMath:Oo}=u,Lo=Ao(vo)(()=>({color:Eo.text(),border:`1px solid ${Eo.borderGray()}`,borderRadius:"4px",justifyContent:"space-between",backgroundColor:Eo.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:Eo.text(),marginLeft:"5px"},"&.Mui-focused":{outline:`3px solid ${Eo.tertiary()}`,outlineOffset:"2px",borderWidth:"3px"},"&.disabledCorrect":{borderWidth:"2px",borderColor:Eo.correct(),color:`${Eo.text()} !important`},"&.disabledIncorrect":{borderWidth:"2px",borderColor:Eo.incorrectWithIcon(),color:`${Eo.text()} !important`}})),Do=Ao(xo)(()=>({backgroundColor:Eo.background(),border:`1px solid ${Eo.correct()} !important`,"&:hover":{border:`1px solid ${Eo.text()} `,borderColor:"initial"},"&:focus":{border:`1px solid ${Eo.text()}`,borderColor:"initial"},"& .MuiList-root":{padding:0}})),No=Ao(wo)(()=>({color:Eo.text(),backgroundColor:Eo.background(),"&.Mui-focused":{outline:`3px solid ${Eo.tertiary()}`,outlineOffset:"-1px",color:Eo.text(),backgroundColor:Eo.background()},"&:hover":{color:Eo.text(),backgroundColor:Eo.dropdownBackground()},boxSizing:"border-box",padding:"25px",borderRadius:"4px","&.selected":{color:`${Eo.text()} !important`,backgroundColor:`${Eo.background()} !important`,"&:hover":{color:Eo.text(),backgroundColor:`${Eo.dropdownBackground()} !important`}}})),Po=Ao("span")(()=>({fontSize:"max(1rem, 14px)"})),$o=Ao("span")(()=>({fontSize:"max(1rem, 14px)",position:"absolute",right:"10px"})),To=Ao(yo)(()=>({position:"absolute",left:"-10000px",top:"auto",width:"1px",height:"1px",overflow:"hidden"})),_o=Ao(Ro)(()=>({color:`${Eo.white()} !important`,position:"absolute",top:"-8px !important",left:"-8px",marginLeft:"0 !important",borderRadius:"50%",fontSize:"16px",padding:"2px","&.correct":{backgroundColor:Eo.correct()},"&.incorrect":{backgroundColor:Eo.incorrectWithIcon()}})),jo=Ao(ko)(()=>({color:`${Eo.white()} !important`,position:"absolute",top:"-8px !important",left:"-8px",marginLeft:"0 !important",borderRadius:"50%",fontSize:"16px",padding:"2px","&.correct":{backgroundColor:Eo.correct()},"&.incorrect":{backgroundColor:Eo.incorrectWithIcon()}}));class Io extends mo.Component{static __initStatic(){this.propTypes={id:bo.string,value:bo.string,disabled:bo.bool,onChange:bo.func,correct:bo.bool,choices:bo.arrayOf(bo.shape({value:bo.string,label:bo.string})),showCorrectAnswer:bo.bool,singleQuery:bo.bool,correctValue:bo.string}}constructor(e){super(e),Io.prototype.__init.call(this),Io.prototype.__init2.call(this),Io.prototype.__init3.call(this),Io.prototype.__init4.call(this),Io.prototype.__init5.call(this),this.state={anchorEl:null,highlightedOptionId:null,menuWidth:null,previewValue:null},this.hiddenRef=mo.createRef(),this.buttonRef=mo.createRef(),this.previewRef=mo.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||Oo(e)}),n){const e=n.clientWidth;e!==this.state.menuWidth&&(this.elementRefs.forEach(e=>{e&&Oo(e)}),Oo(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:s,correctValue:a}=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=s?"Query-label":`Query-label-${g}`,m=s?"Query":`Query ${g}`;let b=null;return n&&void 0!==t&&(b=t||i?mo.createElement(_o,{className:"correct"}):mo.createElement(jo,{className:"incorrect"})),mo.createElement(mo.Fragment,null,mo.createElement("div",{ref:this.hiddenRef,style:{position:"absolute",visibility:"hidden",top:0,left:0},tabIndex:-1,"aria-hidden":"true"},(o||[]).map((e,t)=>mo.createElement(No,{key:t,tabIndex:-1,"aria-hidden":"true"},mo.createElement(Po,{dangerouslySetInnerHTML:{__html:e.label}})))),mo.createElement(To,{id:f,tabIndex:-1,"aria-hidden":"true"},m),mo.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},b,mo.createElement(Po,{id:p,ref:this.previewRef,dangerouslySetInnerHTML:{__html:a||(c&&this.state.previewValue?this.getLabel(o,this.state.previewValue):this.getLabel(o,r)||"")}}),c?mo.createElement(So,null):mo.createElement(Co,null)),mo.createElement(Do,{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 mo.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)},mo.createElement(Po,{ref:e=>this.elementRefs[n]=e,dangerouslySetInnerHTML:{__html:t.label}}),mo.createElement($o,{dangerouslySetInnerHTML:{__html:t.value===r?" ✓":""}}))})))}}Io.__initStatic();const Mo=n;function Fo(e,t){return null!=e?e:t()}function zo(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}Le("dropdown",e=>(t,n,r)=>{const o=t.data&&t.data.dataset||{};if("dropdown"===o.component){const{choices:i,disabled:s,feedback:a,showCorrectAnswer:l}=e,c=i&&i[o.id]&&i[o.id].find(e=>e.correct),d=l?c&&c.value:n[o.id];return Mo.createElement(Io,{key:`${t.type}-dropdown-${o.id}`,correct:a&&a[o.id]&&"correct"===a[o.id],disabled:s||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 Wo=e=>"string"==typeof e,Ho=()=>{let e,t;const n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},Bo=e=>null==e?"":""+e,Vo=/###/g,Uo=e=>e&&e.indexOf("###")>-1?e.replace(Vo,"."):e,Ko=e=>!e||Wo(e),qo=(e,t,n)=>{const r=Wo(t)?t.split("."):t;let o=0;for(;o<r.length-1;){if(Ko(e))return{};const t=Uo(r[o]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++o}return Ko(e)?{}:{obj:e,k:Uo(r[o])}},Yo=(e,t,n)=>{const{obj:r,k:o}=qo(e,t,Object);if(void 0!==r||1===t.length)return void(r[o]=n);let i=t[t.length-1],s=t.slice(0,t.length-1),a=qo(e,s,Object);for(;void 0===a.obj&&s.length;)i=`${s[s.length-1]}.${i}`,s=s.slice(0,s.length-1),a=qo(e,s,Object),zo([a,"optionalAccess",e=>e.obj])&&void 0!==a.obj[`${a.k}.${i}`]&&(a.obj=void 0);a.obj[`${a.k}.${i}`]=n},Jo=(e,t)=>{const{obj:n,k:r}=qo(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},Xo=(e,t,n)=>{for(const r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?Wo(e[r])||e[r]instanceof String||Wo(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):Xo(e[r],t[r],n):e[r]=t[r]);return e},Qo=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Go={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const Zo=e=>Wo(e)?e.replace(/[&<>"'\/]/g,e=>Go[e]):e;const ei=[" ",",","?","!",";"],ti=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}(20),ni=(e,t,n=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}const r=t.split(n);let o=e;for(let e=0;e<r.length;){if(!o||"object"!=typeof o)return;let t,i="";for(let s=e;s<r.length;++s)if(s!==e&&(i+=n),i+=r[s],t=o[i],void 0!==t){if(["string","number","boolean"].indexOf(typeof t)>-1&&s<r.length-1)continue;e+=s-e+1;break}o=t}return o},ri=e=>zo([e,"optionalAccess",e=>e.replace,"call",e=>e("_","-")]),oi={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){zo([console,"optionalAccess",t=>t[e],"optionalAccess",e=>e.apply,"optionalCall",e=>e(console,t)])}};class ii{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||oi,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,r){return r&&!this.debug?null:(Wo(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new ii(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new ii(this.logger,e)}}var si=new ii;class ai{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);const n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}emit(e,...t){if(this.observers[e]){Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)})}if(this.observers["*"]){Array.from(this.observers["*"].entries()).forEach(([n,r])=>{for(let o=0;o<r;o++)n.apply(n,[e,...t])})}}}class li extends ai{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){const o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,i=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let s;e.indexOf(".")>-1?s=e.split("."):(s=[e,t],n&&(Array.isArray(n)?s.push(...n):Wo(n)&&o?s.push(...n.split(o)):s.push(n)));const a=Jo(this.data,s);return!a&&!t&&!n&&e.indexOf(".")>-1&&(e=s[0],t=s[1],n=s.slice(2).join(".")),!a&&i&&Wo(n)?ni(zo([this,"access",e=>e.data,"optionalAccess",t=>t[e],"optionalAccess",e=>e[t]]),n,o):a}addResource(e,t,n,r,o={silent:!1}){const i=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator;let s=[e,t];n&&(s=s.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(s=e.split("."),r=t,t=s[1]),this.addNamespaces(t),Yo(this.data,s,r),o.silent||this.emit("added",e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(const r in n)(Wo(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,r,o,i={silent:!1,skipCopy:!1}){let s=[e,t];e.indexOf(".")>-1&&(s=e.split("."),r=n,n=t,t=s[1]),this.addNamespaces(t);let a=Jo(this.data,s)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?Xo(a,n,o):a={...a,...n},Yo(this.data,s,a),i.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}}var ci={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,o){return e.forEach(e=>{t=Fo(zo([this,"access",e=>e.processors,"access",t=>t[e],"optionalAccess",e=>e.process,"call",e=>e(t,n,r,o)]),()=>t)}),t}};const di=Symbol("i18next/PATH_KEY");function ui(e,t){const{[di]:n}=e(function(){const e=[],t=Object.create(null);let n;return t.get=(r,o)=>(zo([n,"optionalAccess",e=>e.revoke,"optionalCall",e=>e()]),o===di?e:(e.push(o),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}());return n.join(Fo(zo([t,"optionalAccess",e=>e.keySeparator]),()=>"."))}const pi={},hi=e=>!Wo(e)&&"boolean"!=typeof e&&"number"!=typeof e;class gi extends ai{constructor(e,t={}){var n,r;super(),n=e,r=this,["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach(e=>{n[e]&&(r[e]=n[e])}),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=si.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const n={...t};if(null==e)return!1;const r=this.resolve(e,n);if(void 0===zo([r,"optionalAccess",e=>e.res]))return!1;const o=hi(r.res);return!1!==n.returnObjects||!o}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let o=t.ns||this.options.defaultNS||[];const i=n&&e.indexOf(n)>-1,s=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,n)=>{t=t||"",n=n||"";const r=ei.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(0===r.length)return!0;const o=ti.getRegExp(`(${r.map(e=>"?"===e?"\\?":e).join("|")})`);let i=!o.test(e);if(!i){const t=e.indexOf(n);t>0&&!o.test(e.substring(0,t))&&(i=!0)}return i})(e,n,r));if(i&&!s){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:Wo(o)?[o]:o};const i=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(i[0])>-1)&&(o=i.shift()),e=i.join(r)}return{key:e,namespaces:Wo(o)?[o]:o}}translate(e,t,n){let r="object"==typeof t?{...t}:t;if("object"!=typeof r&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof r&&(r={...r}),r||(r={}),null==e)return"";"function"==typeof e&&(e=ui(e,{...this.options,...r})),Array.isArray(e)||(e=[String(e)]);const o=void 0!==r.returnDetails?r.returnDetails:this.options.returnDetails,i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,{key:s,namespaces:a}=this.extractFromKey(e[e.length-1],r),l=a[a.length-1];let c=void 0!==r.nsSeparator?r.nsSeparator:this.options.nsSeparator;void 0===c&&(c=":");const d=r.lng||this.language,u=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===zo([d,"optionalAccess",e=>e.toLowerCase,"call",e=>e()]))return u?o?{res:`${l}${c}${s}`,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:`${l}${c}${s}`:o?{res:s,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:s;const p=this.resolve(e,r);let h=zo([p,"optionalAccess",e=>e.res]);const g=zo([p,"optionalAccess",e=>e.usedKey])||s,f=zo([p,"optionalAccess",e=>e.exactUsedKey])||s,m=void 0!==r.joinArrays?r.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,v=void 0!==r.count&&!Wo(r.count),y=gi.hasDefaultValue(r),x=v?this.pluralResolver.getSuffix(d,r.count,r):"",w=r.ordinal&&v?this.pluralResolver.getSuffix(d,r.count,{ordinal:!1}):"",C=v&&!r.ordinal&&0===r.count,S=C&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${x}`]||r[`defaultValue${w}`]||r.defaultValue;let k=h;b&&!h&&y&&(k=S);const R=hi(k),A=Object.prototype.toString.apply(k);if(!(b&&k&&R&&["[object Number]","[object Function]","[object RegExp]"].indexOf(A)<0)||Wo(m)&&Array.isArray(k))if(b&&Wo(m)&&Array.isArray(h))h=h.join(m),h&&(h=this.extendTranslation(h,e,r,n));else{let t=!1,o=!1;!this.isValidLookup(h)&&y&&(t=!0,h=S),this.isValidLookup(h)||(o=!0,h=s);const a=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&o?void 0:h,u=y&&S!==h&&this.options.updateMissing;if(o||t||u){if(this.logger.log(u?"updateKey":"missingKey",d,l,s,u?S:h),i){const e=this.resolve(s,{...r,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(r.lng||this.language):e.push(r.lng||this.language);const n=(e,t,n)=>{const o=y&&n!==h?n:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,o,u,r):zo([this,"access",e=>e.backendConnector,"optionalAccess",e=>e.saveMissing])&&this.backendConnector.saveMissing(e,l,t,o,u,r),this.emit("missingKey",e,l,t,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&v?e.forEach(e=>{const t=this.pluralResolver.getSuffixes(e,r);C&&r[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],s+t,r[`defaultValue${t}`]||S)})}):n(e,s,S))}h=this.extendTranslation(h,e,r,p,n),o&&h===s&&this.options.appendNamespaceToMissingKey&&(h=`${l}${c}${s}`),(o||t)&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${c}${s}`:s,t?h:void 0,r))}else{if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,k,{...r,ns:a}):`key '${s} (${this.language})' returned an object instead of string.`;return o?(p.res=e,p.usedParams=this.getUsedParamsDetails(r),p):e}if(i){const e=Array.isArray(k),t=e?[]:{},n=e?f:g;for(const e in k)if(Object.prototype.hasOwnProperty.call(k,e)){const o=`${n}${i}${e}`;t[e]=y&&!h?this.translate(o,{...r,defaultValue:hi(S)?S[e]:void 0,joinArrays:!1,ns:a}):this.translate(o,{...r,joinArrays:!1,ns:a}),t[e]===o&&(t[e]=k[e])}h=t}}return o?(p.res=h,p.usedParams=this.getUsedParamsDetails(r),p):h}extendTranslation(e,t,n,r,o){if(zo([this,"access",e=>e.i18nFormat,"optionalAccess",e=>e.parse]))e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const i=Wo(e)&&(void 0!==zo([n,"optionalAccess",e=>e.interpolation,"optionalAccess",e=>e.skipOnVariables])?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let s;if(i){const t=e.match(this.interpolator.nestingRegexp);s=t&&t.length}let a=n.replace&&!Wo(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),e=this.interpolator.interpolate(e,a,n.lng||this.language||r.usedLng,n),i){const t=e.match(this.interpolator.nestingRegexp);s<(t&&t.length)&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,(...e)=>zo([o,"optionalAccess",e=>e[0]])!==e[0]||n.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null),n)),n.interpolation&&this.interpolator.reset()}const i=n.postProcess||this.options.postProcess,s=Wo(i)?[i]:i;return null!=e&&zo([s,"optionalAccess",e=>e.length])&&!1!==n.applyPostProcessor&&(e=ci.handle(s,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,o,i,s;return Wo(e)&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(n))return;const a=this.extractFromKey(e,t),l=a.key;r=l;let c=a.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const d=void 0!==t.count&&!Wo(t.count),u=d&&!t.ordinal&&0===t.count,p=void 0!==t.context&&(Wo(t.context)||"number"==typeof t.context)&&""!==t.context,h=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);c.forEach(e=>{this.isValidLookup(n)||(s=e,pi[`${h[0]}-${e}`]||!zo([this,"access",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace])||zo([this,"access",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace,"call",e=>e(s)])||(pi[`${h[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${h.join(", ")}" won't get resolved as namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),h.forEach(r=>{if(this.isValidLookup(n))return;i=r;const s=[l];if(zo([this,"access",e=>e.i18nFormat,"optionalAccess",e=>e.addLookupKeys]))this.i18nFormat.addLookupKeys(s,l,r,e,t);else{let e;d&&(e=this.pluralResolver.getSuffix(r,t.count,t));const n=`${this.options.pluralSeparator}zero`,o=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(t.ordinal&&0===e.indexOf(o)&&s.push(l+e.replace(o,this.options.pluralSeparator)),s.push(l+e),u&&s.push(l+n)),p){const r=`${l}${this.options.contextSeparator||"_"}${t.context}`;s.push(r),d&&(t.ordinal&&0===e.indexOf(o)&&s.push(r+e.replace(o,this.options.pluralSeparator)),s.push(r+e),u&&s.push(r+n))}}let a;for(;a=s.pop();)this.isValidLookup(n)||(o=a,n=this.getResource(r,e,a,t))}))})}),{res:n,usedKey:r,exactUsedKey:o,usedLng:i,usedNS:s}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,n,r={}){return zo([this,"access",e=>e.i18nFormat,"optionalAccess",e=>e.getResource])?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!Wo(e.replace);let r=n?e.replace:e;if(n&&void 0!==e.count&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(const e of t)delete r[e]}return r}static hasDefaultValue(e){const t="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,12)&&void 0!==e[n])return!0;return!1}}class fi{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=si.create("languageUtils")}getScriptPartFromCode(e){if(!(e=ri(e))||e.indexOf("-")<0)return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=ri(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(Wo(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(e){}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;const n=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(n)||(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;const n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;const r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>e===r?e:e.indexOf("-")<0&&r.indexOf("-")<0?void 0:e.indexOf("-")>0&&r.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===r||0===e.indexOf(r)&&r.length>1?e:void 0)}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),Wo(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes((!1===t?[]:t)||this.options.fallbackLng||[],e),r=[],o=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return Wo(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):Wo(e)&&o(this.formatLanguageCode(e)),n.forEach(e=>{r.indexOf(e)<0&&o(this.formatLanguageCode(e))}),r}}const mi={zero:0,one:1,two:2,few:3,many:4,other:5},bi={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class vi{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=si.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const n=ri("dev"===e?"en":e),r=t.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:n,type:r});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let i;try{i=new Intl.PluralRules(n,{type:r})}catch(n){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),bi;if(!e.match(/-|_/))return bi;const r=this.languageUtils.getLanguagePartFromCode(e);i=this.getRule(r,t)}return this.pluralRulesCache[o]=i,i}needsPlural(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),zo([n,"optionalAccess",e=>e.resolvedOptions,"call",e=>e(),"access",e=>e.pluralCategories,"access",e=>e.length])>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?n.resolvedOptions().pluralCategories.sort((e,t)=>mi[e]-mi[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):[]}getSuffix(e,t,n={}){const r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}const yi=(e,t,n,r=".",o=!0)=>{let i=((e,t,n)=>{const r=Jo(e,n);return void 0!==r?r:Jo(t,n)})(e,t,n);return!i&&o&&Wo(n)&&(i=ni(e,n,r),void 0===i&&(i=ni(t,n,r))),i},xi=e=>e.replace(/\$/g,"$$$$");class wi{constructor(e={}){this.logger=si.create("interpolator"),this.options=e,this.format=zo([e,"optionalAccess",e=>e.interpolation,"optionalAccess",e=>e.format])||(e=>e),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:o,prefixEscaped:i,suffix:s,suffixEscaped:a,formatSeparator:l,unescapeSuffix:c,unescapePrefix:d,nestingPrefix:u,nestingPrefixEscaped:p,nestingSuffix:h,nestingSuffixEscaped:g,nestingOptionsSeparator:f,maxReplaces:m,alwaysFormat:b}=e.interpolation;this.escape=void 0!==t?t:Zo,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==r&&r,this.prefix=o?Qo(o):i||"{{",this.suffix=s?Qo(s):a||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":d||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=u?Qo(u):p||Qo("$t("),this.nestingSuffix=h?Qo(h):g||Qo(")"),this.nestingOptionsSeparator=f||",",this.maxReplaces=m||1e3,this.alwaysFormat=void 0!==b&&b,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>zo([e,"optionalAccess",e=>e.source])===t?(e.lastIndex=0,e):new RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let o,i,s;const a=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=e=>{if(e.indexOf(this.formatSeparator)<0){const o=yi(t,a,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(o,void 0,n,{...r,...t,interpolationkey:e}):o}const o=e.split(this.formatSeparator),i=o.shift().trim(),s=o.join(this.formatSeparator).trim();return this.format(yi(t,a,i,this.options.keySeparator,this.options.ignoreJSONStructure),s,n,{...r,...t,interpolationkey:i})};this.resetRegExp();const c=zo([r,"optionalAccess",e=>e.missingInterpolationHandler])||this.options.missingInterpolationHandler,d=void 0!==zo([r,"optionalAccess",e=>e.interpolation,"optionalAccess",e=>e.skipOnVariables])?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>xi(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?xi(this.escape(e)):xi(e)}].forEach(t=>{for(s=0;o=t.regex.exec(e);){const n=o[1].trim();if(i=l(n),void 0===i)if("function"==typeof c){const t=c(e,o,r);i=Wo(t)?t:""}else if(r&&Object.prototype.hasOwnProperty.call(r,n))i="";else{if(d){i=o[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),i=""}else Wo(i)||this.useRawValueToEscape||(i=Bo(i));const a=t.safeValue(i);if(e=e.replace(o[0],a),d?(t.regex.lastIndex+=i.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,o,i;const s=(e,t)=>{const n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;const r=e.split(new RegExp(`${n}[ ]*{`));let o=`{${r[1]}`;e=r[0],o=this.interpolate(o,i);const s=o.match(/'/g),a=o.match(/"/g);(Fo(zo([s,"optionalAccess",e=>e.length]),()=>0)%2==0&&!a||a.length%2!=0)&&(o=o.replace(/'/g,'"'));try{i=JSON.parse(o),t&&(i={...t,...i})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${o}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let a=[];i={...n},i=i.replace&&!Wo(i.replace)?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;const l=/{.*}/.test(r[1])?r[1].lastIndexOf("}")+1:r[1].indexOf(this.formatSeparator);if(-1!==l&&(a=r[1].slice(l).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,l)),o=t(s.call(this,r[1].trim(),i),i),o&&r[0]===e&&!Wo(o))return o;Wo(o)||(o=Bo(o)),o||(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),o=""),a.length&&(o=a.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),o.trim())),e=e.replace(r[0],o),this.regexp.lastIndex=0}return e}}const Ci=e=>{const t={};return(n,r,o)=>{let i=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(i={...i,[o.interpolationkey]:void 0});const s=r+JSON.stringify(i);let a=t[s];return a||(a=e(ri(r),o),t[s]=a),a(n)}},Si=e=>(t,n,r)=>e(ri(n),r)(t);class ki{constructor(e={}){this.logger=si.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const n=t.cacheInBuiltFormats?Ci:Si;this.formats={number:n((e,t)=>{const n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{const n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)}),datetime:n((e,t)=>{const n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{const n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")}),list:n((e,t)=>{const n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=Ci(t)}format(e,t,n,r={}){const o=t.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(e=>e.indexOf(")")>-1)){const e=o.findIndex(e=>e.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,e)].join(this.formatSeparator)}const i=o.reduce((e,t)=>{const{formatName:o,formatOptions:i}=(e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const o=r[1].substring(0,r[1].length-1);"currency"===t&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):"relativetime"===t&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach(e=>{if(e){const[t,...r]=e.split(":"),o=r.join(":").trim().replace(/^'+|'+$/g,""),i=t.trim();n[i]||(n[i]=o),"false"===o&&(n[i]=!1),"true"===o&&(n[i]=!0),isNaN(o)||(n[i]=parseInt(o,10))}})}return{formatName:t,formatOptions:n}})(t);if(this.formats[o]){let t=e;try{const s=zo([r,"optionalAccess",e=>e.formatParams,"optionalAccess",e=>e[r.interpolationkey]])||{},a=s.locale||s.lng||r.locale||r.lng||n;t=this.formats[o](e,a,{...i,...r,...s})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${o}`),e},e);return i}}class Ri extends ai{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=si.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],zo([this,"access",e=>e.backend,"optionalAccess",e=>e.init,"optionalCall",e=>e(n,r.backend,r)])}queueLoad(e,t,n,r){const o={},i={},s={},a={};return e.forEach(e=>{let r=!0;t.forEach(t=>{const s=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[s]=2:this.state[s]<0||(1===this.state[s]?void 0===i[s]&&(i[s]=!0):(this.state[s]=1,r=!1,void 0===i[s]&&(i[s]=!0),void 0===o[s]&&(o[s]=!0),void 0===a[t]&&(a[t]=!0)))}),r||(s[e]=!0)}),(Object.keys(o).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(o),pending:Object.keys(i),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(a)}}loaded(e,t,n){const r=e.split("|"),o=r[0],i=r[1];t&&this.emit("failedLoading",o,i,t),!t&&n&&this.store.addResourceBundle(o,i,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const s={};this.queue.forEach(n=>{((e,t,n)=>{const{obj:r,k:o}=qo(e,t,Object);r[o]=r[o]||[],r[o].push(n)})(n.loaded,[o],i),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach(e=>{s[e]||(s[e]={});const t=n.loaded[e];t.length&&t.forEach(t=>{void 0===s[e][t]&&(s[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,o=this.retryTimeout,i){if(!e.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:o,callback:i});this.readingCalls++;const s=(s,a)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}s&&a&&r<this.maxRetries?setTimeout(()=>{this.read.call(this,e,t,n,r+1,2*o,i)},o):i(s,a)},a=this.backend[n].bind(this.backend);if(2!==a.length)return a(e,t,s);try{const n=a(e,t);n&&"function"==typeof n.then?n.then(e=>s(null,e)).catch(s):s(null,n)}catch(e){s(e)}}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();Wo(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Wo(t)&&(t=[t]);const o=this.queueLoad(e,t,n,r);if(!o.toLoad.length)return o.pending.length||r(),null;o.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=""){const n=e.split("|"),r=n[0],o=n[1];this.read(r,o,"read",void 0,void 0,(n,i)=>{n&&this.logger.warn(`${t}loading namespace ${o} for language ${r} failed`,n),!n&&i&&this.logger.log(`${t}loaded namespace ${o} for language ${r}`,i),this.loaded(e,n,i)})}saveMissing(e,t,n,r,o,i={},s=()=>{}){if(!zo([this,"access",e=>e.services,"optionalAccess",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace])||zo([this,"access",e=>e.services,"optionalAccess",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace,"call",e=>e(t)])){if(null!=n&&""!==n){if(zo([this,"access",e=>e.backend,"optionalAccess",e=>e.create])){const a={...i,isUpdate:o},l=this.backend.create.bind(this.backend);if(l.length<6)try{let o;o=5===l.length?l(e,t,n,r,a):l(e,t,n,r),o&&"function"==typeof o.then?o.then(e=>s(null,e)).catch(s):s(null,o)}catch(e){s(e)}else l(e,t,n,r,s,a)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}else this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")}}const Ai=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),Wo(e[1])&&(t.defaultValue=e[1]),Wo(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Ei=e=>(Wo(e.ns)&&(e.ns=[e.ns]),Wo(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Wo(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),zo([e,"access",e=>e.supportedLngs,"optionalAccess",e=>e.indexOf,"optionalCall",e=>e("cimode")])<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),"boolean"==typeof e.initImmediate&&(e.initAsync=e.initImmediate),e),Oi=()=>{};class Li extends ai{constructor(e={},t){var n;if(super(),this.options=Ei(e),this.services={},this.logger=si,this.modules={external:[]},n=this,Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(e=>{"function"==typeof n[e]&&(n[e]=n[e].bind(n))}),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,"function"==typeof e&&(t=e,e={}),null==e.defaultNS&&e.ns&&(Wo(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const n=Ai();var r;this.options={...n,...this.options,...Ei(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator),"function"!=typeof this.options.overloadTranslationOptionHandler&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler),!1===this.options.showSupportNotice||(zo([r=this,"optionalAccess",e=>e.modules,"optionalAccess",e=>e.backend,"optionalAccess",e=>e.name,"optionalAccess",e=>e.indexOf,"call",e=>e("Locize")])>0||zo([r,"optionalAccess",e=>e.modules,"optionalAccess",e=>e.backend,"optionalAccess",e=>e.constructor,"optionalAccess",e=>e.name,"optionalAccess",e=>e.indexOf,"call",e=>e("Locize")])>0||zo([r,"optionalAccess",e=>e.options,"optionalAccess",e=>e.backend,"optionalAccess",e=>e.backends])&&r.options.backend.backends.some(e=>zo([e,"optionalAccess",e=>e.name,"access",e=>e.indexOf,"call",e=>e("Locize")])>0||zo([e,"optionalAccess",e=>e.constructor,"optionalAccess",e=>e.name,"access",e=>e.indexOf,"call",e=>e("Locize")])>0))||"undefined"!=typeof console&&void 0!==console.info&&console.info("🌐 i18next is maintained with support from locize.com — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙");const o=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?si.init(o(this.modules.logger),this.options):si.init(null,this.options),e=this.modules.formatter?this.modules.formatter:ki;const t=new fi(this.options);this.store=new li(this.options.resources,this.options);const r=this.services;r.logger=si,r.resourceStore=this.store,r.languageUtils=t,r.pluralResolver=new vi(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix});this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),!e||this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format||(r.formatter=o(e),r.formatter.init&&r.formatter.init(r,this.options),this.options.interpolation.format=r.formatter.format.bind(r.formatter)),r.interpolator=new wi(this.options),r.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},r.backendConnector=new Ri(o(this.modules.backend),r.resourceStore,r,this.options),r.backendConnector.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(r.languageDetector=o(this.modules.languageDetector),r.languageDetector.init&&r.languageDetector.init(r,this.options.detection,this.options)),this.modules.i18nFormat&&(r.i18nFormat=o(this.modules.i18nFormat),r.i18nFormat.init&&r.i18nFormat.init(this)),this.translator=new gi(this.services,this.options),this.translator.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||(t=Oi),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(e=>{this[e]=(...t)=>this.store[e](...t)});["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});const i=Ho(),s=()=>{const e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),i.resolve(n),t(e,n)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?s():setTimeout(s,0),i}loadResources(e,t=Oi){let n=t;const r=Wo(e)?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===zo([r,"optionalAccess",e=>e.toLowerCase,"call",e=>e()])&&(!this.options.preload||0===this.options.preload.length))return n();const e=[],t=t=>{if(!t)return;if("cimode"===t)return;this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)})};if(r)t(r);else{this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e))}zo([this,"access",e=>e.options,"access",e=>e.preload,"optionalAccess",e=>e.forEach,"optionalCall",e=>e(e=>t(e))]),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){const r=Ho();return"function"==typeof e&&(n=e,e=void 0),"function"==typeof t&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=Oi),this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&ci.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1)){for(let e=0;e<this.languages.length;e++){const t=this.languages[e];if(!(["cimode","dev"].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const n=Ho();this.emit("languageChanging",e);const r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},o=(o,i)=>{i?this.isLanguageChangingTo===e&&(r(i),this.translator.changeLanguage(i),this.isLanguageChangingTo=void 0,this.emit("languageChanged",i),this.logger.log("languageChanged",i)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(o,(...e)=>this.t(...e))},i=t=>{e||t||!this.services.languageDetector||(t=[]);const n=Wo(t)?t:t&&t[0],i=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(Wo(t)?[t]:t);i&&(this.language||r(i),this.translator.language||this.translator.changeLanguage(i),zo([this,"access",e=>e.services,"access",e=>e.languageDetector,"optionalAccess",e=>e.cacheUserLanguage,"optionalCall",e=>e(i)])),this.loadResources(i,e=>{o(e,i)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(i):this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),n}getFixedT(e,t,n){const r=(e,t,...o)=>{let i;i="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(o)):{...t},i.lng=i.lng||r.lng,i.lngs=i.lngs||r.lngs,i.ns=i.ns||r.ns,""!==i.keyPrefix&&(i.keyPrefix=i.keyPrefix||n||r.keyPrefix);const s=this.options.keySeparator||".";let a;return i.keyPrefix&&Array.isArray(e)?a=e.map(e=>("function"==typeof e&&(e=ui(e,{...this.options,...t})),`${i.keyPrefix}${s}${e}`)):("function"==typeof e&&(e=ui(e,{...this.options,...t})),a=i.keyPrefix?`${i.keyPrefix}${s}${e}`:e),this.t(a,i)};return Wo(e)?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=n,r}t(...e){return zo([this,"access",e=>e.translator,"optionalAccess",e=>e.translate,"call",t=>t(...e)])}exists(...e){return zo([this,"access",e=>e.translator,"optionalAccess",e=>e.exists,"call",t=>t(...e)])}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=t.lng||this.resolvedLanguage||this.languages[0],r=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;const i=(e,t)=>{const n=this.services.backendConnector.state[`${e}|${t}`];return-1===n||0===n||2===n};if(t.precheck){const e=t.precheck(this,i);if(void 0!==e)return e}return!!this.hasResourceBundle(n,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!i(n,e)||r&&!i(o,e)))}loadNamespaces(e,t){const n=Ho();return this.options.ns?(Wo(e)&&(e=[e]),e.forEach(e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=Ho();Wo(e)&&(e=[e]);const r=this.options.preload||[],o=e.filter(e=>r.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return o.length?(this.options.preload=r.concat(o),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(zo([this,"access",e=>e.languages,"optionalAccess",e=>e.length])>0?this.languages[0]:this.language)),!e)return"rtl";try{const t=new Intl.Locale(e);if(t&&t.getTextInfo){const e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch(e){}const t=zo([this,"access",e=>e.services,"optionalAccess",e=>e.languageUtils])||new fi(Ai());return e.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){const n=new Li(e,t);return n.createInstance=Li.createInstance,n}cloneInstance(e={},t=Oi){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const r={...this.options,...e,isClone:!0},o=new Li(r);void 0===e.debug&&void 0===e.prefix||(o.logger=o.logger.clone(e));if(["store","services","language"].forEach(e=>{o[e]=this[e]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},n){const e=Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{});o.store=new li(e,r),o.services.resourceStore=o.store}if(e.interpolation){const t={...Ai().interpolation,...this.options.interpolation,...e.interpolation},n={...r,interpolation:t};o.services.interpolator=new wi(n)}return o.translator=new gi(o.services,r),o.translator.on("*",(e,...t)=>{o.emit(e,...t)}),o.init(r,t),o.translator.options=r,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Di=Li.createInstance();Di.createInstance,Di.dir,Di.init,Di.loadResources,Di.reloadResources,Di.use,Di.changeLanguage,Di.getFixedT,Di.t,Di.exists,Di.setDefaultNamespace,Di.hasLoadedNamespace,Di.loadNamespaces,Di.loadLanguages;Di.init({fallbackLng:"en",lng:"en",debug:!0,resources:{en:{translation:{categorize:{limitMaxChoicesPerCategory:"You've reached the limit of {{maxChoicesPerCategory}} responses per area. To add another response, one must first be removed.",maxChoicesPerCategoryRestriction:"To change this value to {{maxChoicesPerCategory}}, each category must have {{maxChoicesPerCategory}} or fewer answer choice[s]."},ebsr:{part:"Part {{index}}"},numberLine:{addElementLimit_one:"You can only add {{count}} element",addElementLimit_other:"You can only add {{count}} elements",clearAll:"Clear all"},imageClozeAssociation:{reachedLimit_one:"You’ve reached the limit of {{count}} response per area. To add another response, one must first be removed.",reachedLimit_other:"Full"},drawingResponse:{fillColor:"Fill color",outlineColor:"Outline color",noFill:"No fill",lightblue:"Light blue",lightyellow:"Light yellow",red:"Red",orange:"Orange",yellow:"Yellow",violet:"Violet",blue:"Blue",green:"Green",white:"White",black:"Black",onDoubleClick:"Double click to edit this text. Press Enter to submit."},charting:{addCategory:"Add category",actions:"Actions",add:"Add",delete:"Delete",newLabel:"New label",reachedLimit_other:"There can't be more than {{count}} categories.",keyLegend:{incorrectAnswer:"Student incorrect answer",correctAnswer:"Student correct answer",correctKeyAnswer:"Answer key correct"}},graphing:{point:"Point",circle:"Circle",line:"Line",parabola:"Parabola",absolute:"Absolute Value",exponential:"Exponential",polygon:"Polygon",ray:"Ray",segment:"Segment",sine:"Sine",vector:"Vector",label:"Label",redo:"Redo",reset:"Reset"},mathInline:{primaryCorrectWithAlternates:"Note: The answer shown above is the primary correct answer specified by the author for this item, but other answers may also be recognized as correct."},multipleChoice:{minSelections:"Select at least {{minSelections}}.",maxSelections_one:"Only {{maxSelections}} answer is allowed.",maxSelections_other:"Only {{maxSelections}} answers are allowed.",minmaxSelections_equal:"Select {{minSelections}}.",minmaxSelections_range:"Select between {{minSelections}} and {{maxSelections}}."},selectText:{correctAnswerSelected:"Correct",correctAnswerNotSelected:"Correct Answer Not Selected",incorrectSelection:"Incorrect Selection",key:"Key"}},common:{undo:"Undo",clearAll:"Clear all",correct:"Correct",incorrect:"Incorrect",showCorrectAnswer:"Show correct answer",hideCorrectAnswer:"Hide correct answer",commonCorrectAnswerWithAlternates:"Note: The answer shown above is the most common correct answer for this item. One or more additional correct answers are also defined, and will also be recognized as correct.",warning:"Warning",showNote:"Show Note",hideNote:"Hide Note",cancel:"Cancel"}},es:{translation:{categorize:{limitMaxChoicesPerCategory:"Has alcanzado el límite de {{maxChoicesPerCategory}} respuestas por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.",maxChoicesPerCategoryRestriction:"Para cambiar este valor a {{maxChoicesPerCategory}}, cada categoría debe tener {{maxChoicesPerCategory}} o menos opciones de respuesta"},ebsr:{part:"Parte {{index}}"},numberLine:{addElementLimit_one:"Solo puedes agregar {{count}} elemento",addElementLimit_other:"Solo puedes agregar {{count}} elementos",clearAll:"Borrar todo"},imageClozeAssociation:{reachedLimit_one:"Has alcanzado el límite de {{count}} respuesta por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.",reachedLimit_other:"Lleno"},drawingResponse:{fillColor:"Color de relleno",outlineColor:"Color del contorno",noFill:"Sin relleno",lightblue:"Azul claro",lightyellow:"Amarillo claro",red:"Rojo",orange:"Naranja",yellow:"Amarillo",violet:"Violeta",blue:"Azul",green:"Verde",white:"Blanco",black:"Negro",onDoubleClick:"Haz doble clic para revisar este texto. Presiona el botón de ingreso para enviar"},charting:{addCategory:"Añadir categoría",actions:"Acciones",add:"Añadir",delete:"Eliminar",newLabel:"Nueva etiqueta",reachedLimit_other:"No puede haber más de {{count}} categorías.",keyLegend:{incorrectAnswer:"Respuesta incorrecta del estudiante",correctAnswer:"Respuesta correcta del estudiante",correctKeyAnswer:"Clave de respuesta correcta"}},graphing:{point:"Punto",circle:"Circulo",line:"Línea",parabola:"Parábola",absolute:"Valor absoluto",exponential:"Exponencial",polygon:"Polígono",ray:"Semirrecta",segment:"Segmento ",sine:"Seno",vector:"Vector",label:"Etiqueta",redo:"Rehacer",reset:"Reiniciar"},mathInline:{primaryCorrectWithAlternates:"Nota: La respuesta que se muestra arriba es la respuesta correcta principal especificada por el autor para esta pregunta, pero también se pueden reconocer otras respuestas como correctas."},multipleChoice:{minSelections:"Seleccione al menos {{minSelections}}.",maxSelections_one:"Sólo se permite {{maxSelections}} respuesta.",maxSelections_other:"Sólo se permiten {{maxSelections}} respuestas.",minmaxSelections_equal:"Seleccione {{minSelections}}.",minmaxSelections_range:"Seleccione entre {{minSelections}} y {{maxSelections}}."},selectText:{correctAnswerSelected:"Respuesta Correcta",correctAnswerNotSelected:"Respuesta Correcta No Seleccionada",incorrectSelection:"Selección Incorrecta",key:"Clave"}},common:{undo:"Deshacer",clearAll:"Borrar todo",correct:"Correct",incorrect:"Incorrect",showCorrectAnswer:"Mostrar respuesta correcta",hideCorrectAnswer:"Ocultar respuesta correcta",commonCorrectAnswerWithAlternates:"Nota: La respuesta que se muestra arriba es la respuesta correcta más común para esta pregunta. También se definen una o más respuestas correctas adicionales, y también se reconocerán como correctas.",warning:"Advertencia",showNote:"Mostrar Nota",hideNote:"Ocultar Nota",cancel:"Cancelar"}}}});var Ni={translator:{...Di,t:(e,t)=>{const{lng:n}=t;switch(n){case"en_US":case"en-US":t.lng="en";break;case"es_ES":case"es-ES":case"es_MX":case"es-MX":t.lng="es"}return Di.t(e,{lng:n,...t})}},languageOptions:[{value:"en_US",label:"English (US)"},{value:"es_ES",label:"Spanish"}]};const Pi=n,$i=r,{debounce:Ti}=i,{isEmpty:_i}=i,{isEqual:ji}=i,Ii=d,{color:Mi}=a,{Collapsible:Fi}=a,{hasText:zi}=a,{hasMedia:Wi}=a,{PreviewPrompt:Hi}=a,{UiLayout:Bi}=a,{styled:Vi}=o,{translator:Ui}=Ni,Ki=Vi(Bi)(({alwaysShowCorrect:e})=>({color:Mi.text(),backgroundColor:Mi.background(),...e&&{"& *":{borderColor:`${Mi.text()} !important`}}})),qi=Vi("div")(({theme:e})=>({marginBottom:e.spacing(2)})),Yi=Vi("div")(({theme:e})=>({marginBottom:e.spacing(2)})),Ji=Vi("h2")({position:"absolute",left:"-10000px",top:"auto",width:"1px",height:"1px",overflow:"hidden"});class Xi extends Pi.Component{constructor(...e){super(...e),Xi.prototype.__init.call(this),Xi.prototype.__init2.call(this),Xi.prototype.__init3.call(this),Xi.prototype.__init4.call(this),Xi.prototype.__init5.call(this)}static __initStatic(){this.propTypes={alwaysShowCorrect:$i.bool,animationsDisabled:$i.bool,disabled:$i.bool,displayType:$i.string,feedback:$i.object,language:$i.string,markup:$i.string,maxLengthPerChoice:$i.array,maxLengthPerChoiceEnabled:$i.bool,mode:$i.string,note:$i.string,onChange:$i.func,playerSpellCheckEnabled:$i.bool,prompt:$i.string,rationale:$i.string,role:$i.string,showNote:$i.bool,teacherInstructions:$i.string,value:$i.object,responseAreaInputConfiguration:$i.object,model:$i.object.isRequired}}static __initStatic2(){this.defaultProps={value:{}}}__init(){this.state={showCorrectAnswer:this.props.alwaysShowCorrect||!1}}__init2(){this.getChangeSession=e=>e&&e.every((e,t,n)=>e===n[0]&&1===e)?this.props.onChange:Ti(this.props.onChange,200,{maxWait:200})}UNSAFE_componentWillReceiveProps(e){const{maxLengthPerChoice:t,language:n}=this.props;let{note:r}=this.props;_i(e.feedback)&&this.setState({showCorrectAnswer:!1}),e.alwaysShowCorrect&&this.setState({showCorrectAnswer:!0}),t&&!ji(t,e.maxLengthPerChoice)&&(this.changeSession=this.getChangeSession(e.maxLengthPerChoice)),r&&n&&n!==e.language&&r===Ui.t("common:commonCorrectAnswerWithAlternates",{lng:n})&&(r=Ui.t("common:commonCorrectAnswerWithAlternates",{lng:e.language}))}__init3(){this.toggleShowCorrect=()=>{this.setState({showCorrectAnswer:!this.state.showCorrectAnswer})}}__init4(){this.changeSession=this.getChangeSession(this.props.maxLengthPerChoice)}__init5(){this.onChange=e=>{this.changeSession(e)}}render(){const{showCorrectAnswer:e}=this.state,{alwaysShowCorrect:t,animationsDisabled:n,mode:r,displayType:o,role:i,language:s,maxLengthPerChoice:a,maxLengthPerChoiceEnabled:l,note:c,playerSpellCheckEnabled:d,prompt:u,rationale:p,showNote:h,teacherInstructions:g,responseAreaInputConfiguration:f,model:m,value:b}=this.props,{extraCSSRules:v}=m||{},y=(e||"view"===r&&"instructor"===i)&&h&&c,x=Pi.createElement(Hi,{defaultClassName:"teacher-instructions",prompt:g}),w=Pi.createElement(Hi,{prompt:p}),C=p&&(zi(p)||Wi(p)),S=g&&(zi(g)||Wi(g));return Pi.createElement(Ki,{extraCSSRules:v,alwaysShowCorrect:t,style:{display:`${o}`}},"gather"===r&&Pi.createElement(Ji,null,"Fill in the Blank Question"),S&&Pi.createElement(Yi,null,n?x:Pi.createElement(Fi,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},x)),u&&Pi.createElement(Hi,{prompt:u}),!t&&Pi.createElement(Ii,{show:"evaluate"===r,toggled:e,onToggle:this.toggleShowCorrect,language:s}),Pi.createElement(fo,{...this.props,onChange:this.onChange,showCorrectAnswer:e,value:b,maxLength:a,adjustedLimit:l,spellCheck:d,pluginProps:f}),y&&Pi.createElement(qi,{dangerouslySetInnerHTML:{__html:c}}),C&&Pi.createElement(Yi,null,n?w:Pi.createElement(Fi,{labels:{hidden:"Show Rationale",visible:"Hide Rationale"}},w)))}}Xi.__initStatic(),Xi.__initStatic2();const Qi=n,{debounce:Gi}=i,Zi=t,{renderMath:es}=u,ts=Zi("pie-element:explicit-constructed-response:print");class ns extends HTMLElement{constructor(){super(),this._options=null,this._model=null,this._session=[],this._root=null,this._rerender=Gi(()=>{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.alwaysShowCorrect=n,e.mode=n?"evaluate":e.mode,e.disabled=!0,e.animationsDisabled=!0,e})(this._model,this._options),t=this._options&&Qi.createElement(Xi,{...e,onChange:()=>{}});this._root||(this._root=h(this)),this._root.render(t),queueMicrotask(()=>{ts("render complete - render math"),es(this)})}else ts("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{ns 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": "10.0.0-
|
|
7
|
+
"version": "10.0.0-next.43+4249fa78f",
|
|
8
8
|
"description": "",
|
|
9
9
|
"scripts": {
|
|
10
10
|
"postpublish": "../../scripts/postpublish"
|
|
@@ -15,21 +15,25 @@
|
|
|
15
15
|
"@mui/icons-material": "^7.3.4",
|
|
16
16
|
"@mui/material": "^7.3.4",
|
|
17
17
|
"@pie-framework/pie-player-events": "^0.1.0",
|
|
18
|
-
"@pie-lib/correct-answer-toggle": "3.1.
|
|
19
|
-
"@pie-lib/mask-markup": "2.1.
|
|
20
|
-
"@pie-lib/math-rendering": "4.1.
|
|
21
|
-
"@pie-lib/render-ui": "5.1.
|
|
22
|
-
"@pie-lib/translator": "3.1.
|
|
18
|
+
"@pie-lib/correct-answer-toggle": "3.1.1-next.0",
|
|
19
|
+
"@pie-lib/mask-markup": "2.1.1-next.0",
|
|
20
|
+
"@pie-lib/math-rendering": "4.1.1-next.0",
|
|
21
|
+
"@pie-lib/render-ui": "5.1.1-next.0",
|
|
22
|
+
"@pie-lib/translator": "3.1.1-next.0",
|
|
23
23
|
"classnames": "^2.2.5",
|
|
24
24
|
"he": "^1.2.0",
|
|
25
25
|
"lodash": "^4.17.10",
|
|
26
26
|
"prop-types": "^15.6.1",
|
|
27
|
-
"react": "18.
|
|
28
|
-
"react-dom": "18.
|
|
27
|
+
"react": "18.3.1",
|
|
28
|
+
"react-dom": "18.3.1"
|
|
29
29
|
},
|
|
30
30
|
"author": "",
|
|
31
31
|
"license": "ISC",
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "4249fa78fc423ef0a8c89002b8f937c42b3478ea",
|
|
33
33
|
"main": "lib/index.js",
|
|
34
|
-
"module": "src/index.js"
|
|
34
|
+
"module": "src/index.js",
|
|
35
|
+
"exports": {
|
|
36
|
+
".": "./src/index.js",
|
|
37
|
+
"./print": "./src/print.js"
|
|
38
|
+
}
|
|
35
39
|
}
|