@pie-element/charting 12.1.2-next.13 → 12.1.2-next.14
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/dist/index.iife.js
CHANGED
|
@@ -356,4 +356,4 @@ mid `,`∤`),Z.intercal=Z[`⊺`]=q($,`\\intercal `,`⊺`),Z.veebar=Z[`
|
|
|
356
356
|
`,Mq=e=>{let{classes:t,variant:n,color:r}=e;return ca({root:[`root`,`color${B(r)}`,n],dashed:[`dashed`,`dashedColor${B(r)}`],bar1:[`bar`,`bar1`,`barColor${B(r)}`,(n===`indeterminate`||n===`query`)&&`bar1Indeterminate`,n===`determinate`&&`bar1Determinate`,n===`buffer`&&`bar1Buffer`],bar2:[`bar`,`bar2`,n!==`buffer`&&`barColor${B(r)}`,n===`buffer`&&`color${B(r)}`,(n===`indeterminate`||n===`query`)&&`bar2Indeterminate`,n===`buffer`&&`bar2Buffer`]},wq,t)},Nq=(e,t)=>e.vars?e.vars.palette.LinearProgress[`${t}Bg`]:e.palette.mode===`light`?e.lighten(e.palette[t].main,.62):e.darken(e.palette[t].main,.5),Pq=R(`span`,{name:`MuiLinearProgress`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[`color${B(n.color)}`],t[n.variant]]}})(Nc(({theme:e})=>({position:`relative`,overflow:`hidden`,display:`block`,height:4,zIndex:0,"@media print":{colorAdjust:`exact`},variants:[...Object.entries(e.palette).filter(Vd()).map(([t])=>({props:{color:t},style:{backgroundColor:Nq(e,t)}})),{props:({ownerState:e})=>e.color===`inherit`&&e.variant!==`buffer`,style:{"&::before":{content:`""`,position:`absolute`,left:0,top:0,right:0,bottom:0,backgroundColor:`currentColor`,opacity:.3}}},{props:{variant:`buffer`},style:{backgroundColor:`transparent`}},{props:{variant:`query`},style:{transform:`rotate(180deg)`}}]}))),Fq=R(`span`,{name:`MuiLinearProgress`,slot:`Dashed`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.dashed,t[`dashedColor${B(n.color)}`]]}})(Nc(({theme:e})=>({position:`absolute`,marginTop:0,height:`100%`,width:`100%`,backgroundSize:`10px 10px`,backgroundPosition:`0 -23px`,variants:[{props:{color:`inherit`},style:{opacity:.3,backgroundImage:`radial-gradient(currentColor 0%, currentColor 16%, transparent 42%)`}},...Object.entries(e.palette).filter(Vd()).map(([t])=>{let n=Nq(e,t);return{props:{color:t},style:{backgroundImage:`radial-gradient(${n} 0%, ${n} 16%, transparent 42%)`}}})]})),jq||{animation:`${Aq} 3s infinite linear`}),Iq=R(`span`,{name:`MuiLinearProgress`,slot:`Bar1`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.bar,t.bar1,t[`barColor${B(n.color)}`],(n.variant===`indeterminate`||n.variant===`query`)&&t.bar1Indeterminate,n.variant===`determinate`&&t.bar1Determinate,n.variant===`buffer`&&t.bar1Buffer]}})(Nc(({theme:e})=>({width:`100%`,position:`absolute`,left:0,bottom:0,top:0,transition:`transform 0.2s linear`,transformOrigin:`left`,variants:[{props:{color:`inherit`},style:{backgroundColor:`currentColor`}},...Object.entries(e.palette).filter(Vd()).map(([t])=>({props:{color:t},style:{backgroundColor:(e.vars||e).palette[t].main}})),{props:{variant:`determinate`},style:{transition:`transform .${Tq}s linear`}},{props:{variant:`buffer`},style:{zIndex:1,transition:`transform .${Tq}s linear`}},{props:({ownerState:e})=>e.variant===`indeterminate`||e.variant===`query`,style:{width:`auto`}},{props:({ownerState:e})=>e.variant===`indeterminate`||e.variant===`query`,style:Dq||{animation:`${Eq} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite`}}]}))),Lq=R(`span`,{name:`MuiLinearProgress`,slot:`Bar2`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.bar,t.bar2,t[`barColor${B(n.color)}`],(n.variant===`indeterminate`||n.variant===`query`)&&t.bar2Indeterminate,n.variant===`buffer`&&t.bar2Buffer]}})(Nc(({theme:e})=>({width:`100%`,position:`absolute`,left:0,bottom:0,top:0,transition:`transform 0.2s linear`,transformOrigin:`left`,variants:[...Object.entries(e.palette).filter(Vd()).map(([t])=>({props:{color:t},style:{"--LinearProgressBar2-barColor":(e.vars||e).palette[t].main}})),{props:({ownerState:e})=>e.variant!==`buffer`&&e.color!==`inherit`,style:{backgroundColor:`var(--LinearProgressBar2-barColor, currentColor)`}},{props:({ownerState:e})=>e.variant!==`buffer`&&e.color===`inherit`,style:{backgroundColor:`currentColor`}},{props:{color:`inherit`},style:{opacity:.3}},...Object.entries(e.palette).filter(Vd()).map(([t])=>({props:{color:t,variant:`buffer`},style:{backgroundColor:Nq(e,t),transition:`transform .${Tq}s linear`}})),{props:({ownerState:e})=>e.variant===`indeterminate`||e.variant===`query`,style:{width:`auto`}},{props:({ownerState:e})=>e.variant===`indeterminate`||e.variant===`query`,style:kq||{animation:`${Oq} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite`}}]}))),Rq=P.forwardRef(function(e,t){let n=cs({props:e,name:`MuiLinearProgress`}),{className:r,color:i=`primary`,value:a,valueBuffer:o,variant:s=`indeterminate`,...c}=n,l={...n,color:i,variant:s},u=Mq(l),d=Di(),f={},p={bar1:{},bar2:{}};if((s===`determinate`||s===`buffer`)&&a!==void 0){f[`aria-valuenow`]=Math.round(a),f[`aria-valuemin`]=0,f[`aria-valuemax`]=100;let e=a-100;d&&(e=-e),p.bar1.transform=`translateX(${e}%)`}if(s===`buffer`&&o!==void 0){let e=(o||0)-100;d&&(e=-e),p.bar2.transform=`translateX(${e}%)`}return(0,F.jsxs)(Pq,{className:I(u.root,r),ownerState:l,role:`progressbar`,...f,ref:t,...c,children:[s===`buffer`?(0,F.jsx)(Fq,{className:u.dashed,ownerState:l}):null,(0,F.jsx)(Iq,{className:u.bar1,ownerState:l,style:p.bar1}),s===`determinate`?null:(0,F.jsx)(Lq,{className:u.bar2,ownerState:l,style:p.bar2})]})}),zq=(e,t)=>{if(!e||!t)return null;let n=null;return e.state.doc.descendants((e,r)=>{if(n!==null)return!1;if(e.type.name===`imageUploadNode`&&e.attrs.nodeKey===t)return n=[e,r],!1}),n},Bq=()=>`img-${Date.now()}-${Math.random().toString(36).slice(2)}`,Vq=Uu(`@pie-lib:editable-html:image:insert-image-handler`),Hq=class{constructor(e,t,n,r=!1){this.editor=e,this.nodeInfo=t,this.node=t[0],this.nodePos=t[1],this.onFinish=n,this.isPasted=r,this.chosenFile=null,this.nodeKey=this.node?.attrs?.nodeKey||null}resolveNodePos(){let e=zq(this.editor,this.nodeKey);return e?e[1]:this.nodeKey?null:this.nodePos}cancel(){Vq(`insert cancelled`);try{this.deleteNode(),this.onFinish(!1)}catch{}finally{this.editor._insertingImage=!1}}updateNode(e){let t=this.resolveNodePos();if(t===null){Vq(`[updateNode] node is gone, dropping update: `,e);return}let{state:n,view:r}=this.editor,{tr:i}=n,a=n.doc.nodeAt(t);if(a){let n=i.setNodeMarkup(t,void 0,{...a.attrs,...e});r.dispatch(n)}}deleteNode(){let e=this.resolveNodePos();if(e===null)return;let{state:t,view:n}=this.editor,{tr:r}=t,i=t.doc.nodeAt(e)||this.node,a=r.delete(e,e+i.nodeSize);n.dispatch(a)}done(e,t){Vq(`done: err:`,e),e?(console.log(e),this.onFinish(!1)):(this.updateNode({loaded:!0,src:t,percent:100}),this.onFinish(!0)),this.editor._insertingImage=!1}fileChosen(e){if(!e)return;this.chosenFile=e,this.editor._insertingImage=!1,Vq(`[fileChosen] file: `,e);let t=new FileReader;t.onload=()=>{let e=t.result;this.updateNode({src:e})},t.readAsDataURL(e)}progress(e,t,n){Vq(`progress: `,e,t,n),this.updateNode({percent:e})}getChosenFile(){return this.chosenFile}};function Uq(e){return Br(`MuiDialogContent`,e)}Vr(`MuiDialogContent`,[`root`,`dividers`]);function Wq(e){return Br(`MuiDialogTitle`,e)}var Gq=Vr(`MuiDialogTitle`,[`root`]),Kq=e=>{let{classes:t,dividers:n}=e;return ca({root:[`root`,n&&`dividers`]},Uq,t)},qq=R(`div`,{name:`MuiDialogContent`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.dividers&&t.dividers]}})(Nc(({theme:e})=>({flex:`1 1 auto`,WebkitOverflowScrolling:`touch`,overflowY:`auto`,padding:`20px 24px`,variants:[{props:({ownerState:e})=>e.dividers,style:{padding:`16px 24px`,borderTop:`1px solid ${(e.vars||e).palette.divider}`,borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:e})=>!e.dividers,style:{[`.${Gq.root} + &`]:{paddingTop:0}}}]}))),Jq=P.forwardRef(function(e,t){let n=cs({props:e,name:`MuiDialogContent`}),{className:r,dividers:i=!1,...a}=n,o={...n,dividers:i},s=Kq(o);return(0,F.jsx)(qq,{className:I(s.root,r),ownerState:o,ref:t,...a})}),Yq=ml((0,F.jsx)(`path`,{d:`M11.67 3.87 9.9 2.1 0 12l9.9 9.9 1.77-1.77L3.54 12z`}),`ArrowBackIos`);function Xq(e){return Br(`MuiFormHelperText`,e)}var Zq=Vr(`MuiFormHelperText`,[`root`,`error`,`disabled`,`sizeSmall`,`sizeMedium`,`contained`,`focused`,`filled`,`required`]),Qq,$q=e=>{let{classes:t,contained:n,size:r,disabled:i,error:a,filled:o,focused:s,required:c}=e;return ca({root:[`root`,i&&`disabled`,a&&`error`,r&&`size${B(r)}`,n&&`contained`,s&&`focused`,o&&`filled`,c&&`required`]},Xq,t)},eJ=R(`p`,{name:`MuiFormHelperText`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.size&&t[`size${B(n.size)}`],n.contained&&t.contained,n.filled&&t.filled]}})(Nc(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.caption,textAlign:`left`,marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${Zq.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${Zq.error}`]:{color:(e.vars||e).palette.error.main},variants:[{props:{size:`small`},style:{marginTop:4}},{props:({ownerState:e})=>e.contained,style:{marginLeft:14,marginRight:14}}]}))),tJ=P.forwardRef(function(e,t){let n=cs({props:e,name:`MuiFormHelperText`}),{children:r,className:i,component:a=`p`,disabled:o,error:s,filled:c,focused:l,margin:u,required:d,variant:f,...p}=n,m=Ef({props:n,muiFormControl:Of(),states:[`variant`,`size`,`disabled`,`error`,`filled`,`focused`,`required`]}),h={...n,component:a,contained:m.variant===`filled`||m.variant===`outlined`,variant:m.variant,size:m.size,disabled:m.disabled,error:m.error,filled:m.filled,focused:m.focused,required:m.required};delete h.ownerState;let g=$q(h);return(0,F.jsx)(eJ,{as:a,className:I(g.root,i),ref:t,...p,ownerState:h,children:r===` `?Qq||=(0,F.jsx)(`span`,{className:`notranslate`,"aria-hidden":!0,children:``}):r})});function nJ(e){return Br(`MuiTextField`,e)}Vr(`MuiTextField`,[`root`]);var rJ={standard:dK,filled:_K,outlined:OK},iJ=e=>{let{classes:t}=e;return ca({root:[`root`]},nJ,t)},aJ=R(Gf,{name:`MuiTextField`,slot:`Root`})({}),oJ=P.forwardRef(function(e,t){let n=cs({props:e,name:`MuiTextField`}),{autoComplete:r,autoFocus:i=!1,children:a,className:o,color:s=`primary`,defaultValue:c,disabled:l=!1,error:u=!1,FormHelperTextProps:d,fullWidth:f=!1,helperText:p,id:m,InputLabelProps:h,inputProps:g,InputProps:_,inputRef:v,label:y,maxRows:b,minRows:x,multiline:S=!1,name:C,onBlur:w,onChange:T,onFocus:E,placeholder:D,required:O=!1,rows:k,select:A=!1,SelectProps:j,slots:M={},slotProps:ee={},type:N,value:te,variant:ne=`outlined`,...re}=n,ie={...n,autoFocus:i,color:s,disabled:l,error:u,fullWidth:f,multiline:S,required:O,select:A,variant:ne},ae=iJ(ie),oe=Fi(m),se=p&&oe?`${oe}-helper-text`:void 0,ce=y&&oe?`${oe}-label`:void 0,le=rJ[ne],ue={slots:M,slotProps:{input:_,inputLabel:h,htmlInput:g,formHelperText:d,select:j,...ee}},de={},fe=ue.slotProps.inputLabel;ne===`outlined`&&(fe&&fe.shrink!==void 0&&(de.notched=fe.shrink),de.label=y),A&&((!j||!j.native)&&(de.id=void 0),de[`aria-describedby`]=void 0);let[pe,me]=zc(`root`,{elementType:aJ,shouldForwardComponentProp:!0,externalForwardedProps:{...ue,...re},ownerState:ie,className:I(ae.root,o),ref:t,additionalProps:{disabled:l,error:u,fullWidth:f,required:O,color:s,variant:ne}}),[he,ge]=zc(`input`,{elementType:le,externalForwardedProps:ue,additionalProps:de,ownerState:ie}),[_e,ve]=zc(`inputLabel`,{elementType:Rf,externalForwardedProps:ue,ownerState:ie}),[ye,be]=zc(`htmlInput`,{elementType:`input`,externalForwardedProps:ue,ownerState:ie}),[xe,Se]=zc(`formHelperText`,{elementType:tJ,externalForwardedProps:ue,ownerState:ie}),[Ce,we]=zc(`select`,{elementType:PK,externalForwardedProps:ue,ownerState:ie}),Te=(0,F.jsx)(he,{"aria-describedby":se,autoComplete:r,autoFocus:i,defaultValue:c,fullWidth:f,multiline:S,name:C,rows:k,maxRows:b,minRows:x,type:N,value:te,id:oe,inputRef:v,onBlur:w,onChange:T,onFocus:E,placeholder:D,inputProps:be,slots:{input:M.htmlInput?ye:void 0},...ge});return(0,F.jsxs)(pe,{...me,children:[y!=null&&y!==``&&(0,F.jsx)(_e,{htmlFor:oe,id:ce,...ve,children:y}),A?(0,F.jsx)(Ce,{"aria-describedby":se,id:oe,labelId:ce,value:te,input:Te,...we,children:a}):Te,p&&(0,F.jsx)(xe,{id:se,...Se,children:p})]})});function sJ(e){return Br(`MuiDialogActions`,e)}Vr(`MuiDialogActions`,[`root`,`spacing`]);var cJ=e=>{let{classes:t,disableSpacing:n}=e;return ca({root:[`root`,!n&&`spacing`]},sJ,t)},lJ=R(`div`,{name:`MuiDialogActions`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,!n.disableSpacing&&t.spacing]}})({display:`flex`,alignItems:`center`,padding:8,justifyContent:`flex-end`,flex:`0 0 auto`,variants:[{props:({ownerState:e})=>!e.disableSpacing,style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),uJ=P.forwardRef(function(e,t){let n=cs({props:e,name:`MuiDialogActions`}),{className:r,disableSpacing:i=!1,...a}=n,o={...n,disableSpacing:i},s=cJ(o);return(0,F.jsx)(lJ,{className:I(s.root,r),ownerState:o,ref:t,...a})});function dJ(e){return Br(`MuiDialog`,e)}var fJ=Vr(`MuiDialog`,[`root`,`backdrop`,`scrollPaper`,`scrollBody`,`container`,`paper`,`paperScrollPaper`,`paperScrollBody`,`paperWidthFalse`,`paperWidthXs`,`paperWidthSm`,`paperWidthMd`,`paperWidthLg`,`paperWidthXl`,`paperFullWidth`,`paperFullScreen`]),pJ=P.createContext({}),mJ=R(Kc,{name:`MuiDialog`,slot:`Backdrop`})({zIndex:-1}),hJ=e=>{let{classes:t,scroll:n,maxWidth:r,fullWidth:i,fullScreen:a}=e;return ca({root:[`root`],backdrop:[`backdrop`],container:[`container`,`scroll${B(n)}`],paper:[`paper`,`paperScroll${B(n)}`,`paperWidth${B(String(r))}`,i&&`paperFullWidth`,a&&`paperFullScreen`]},dJ,t)},gJ=R(il,{name:`MuiDialog`,slot:`Root`})({"@media print":{position:`absolute !important`}}),_J=R(`div`,{name:`MuiDialog`,slot:`Container`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.container,t[`scroll${B(n.scroll)}`]]}})({height:`100%`,"@media print":{height:`auto`},outline:0,variants:[{props:{scroll:`paper`},style:{display:`flex`,justifyContent:`center`,alignItems:`center`}},{props:{scroll:`body`},style:{overflowY:`auto`,overflowX:`hidden`,textAlign:`center`,"&::after":{content:`""`,display:`inline-block`,verticalAlign:`middle`,height:`100%`,width:`0`}}}]}),vJ=R(cl,{name:`MuiDialog`,slot:`Paper`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.paper,t[`scrollPaper${B(n.scroll)}`],t[`paperWidth${B(String(n.maxWidth))}`],n.fullWidth&&t.paperFullWidth,n.fullScreen&&t.paperFullScreen]}})(Nc(({theme:e})=>({margin:32,position:`relative`,overflowY:`auto`,"@media print":{overflowY:`visible`,boxShadow:`none`},variants:[{props:{scroll:`paper`},style:{display:`flex`,flexDirection:`column`,maxHeight:`calc(100% - 64px)`}},{props:{scroll:`body`},style:{display:`inline-block`,verticalAlign:`middle`,textAlign:`initial`}},{props:({ownerState:e})=>!e.maxWidth,style:{maxWidth:`calc(100% - 64px)`}},{props:{maxWidth:`xs`},style:{maxWidth:e.breakpoints.unit===`px`?Math.max(e.breakpoints.values.xs,444):`max(${e.breakpoints.values.xs}${e.breakpoints.unit}, 444px)`,[`&.${fJ.paperScrollBody}`]:{[e.breakpoints.down(Math.max(e.breakpoints.values.xs,444)+64)]:{maxWidth:`calc(100% - 64px)`}}}},...Object.keys(e.breakpoints.values).filter(e=>e!==`xs`).map(t=>({props:{maxWidth:t},style:{maxWidth:`${e.breakpoints.values[t]}${e.breakpoints.unit}`,[`&.${fJ.paperScrollBody}`]:{[e.breakpoints.down(e.breakpoints.values[t]+64)]:{maxWidth:`calc(100% - 64px)`}}}})),{props:({ownerState:e})=>e.fullWidth,style:{width:`calc(100% - 64px)`}},{props:({ownerState:e})=>e.fullScreen,style:{margin:0,width:`100%`,maxWidth:`100%`,height:`100%`,maxHeight:`none`,borderRadius:0,[`&.${fJ.paperScrollBody}`]:{margin:0,maxWidth:`100%`}}}]}))),yJ=P.forwardRef(function(e,t){let n=cs({props:e,name:`MuiDialog`}),r=xo(),i={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{"aria-describedby":a,"aria-labelledby":o,"aria-modal":s=!0,BackdropComponent:c,BackdropProps:l,children:u,className:d,disableEscapeKeyDown:f=!1,fullScreen:p=!1,fullWidth:m=!1,maxWidth:h=`sm`,onClick:g,onClose:_,open:v,PaperComponent:y=cl,PaperProps:b={},role:x=`dialog`,scroll:S=`paper`,slots:C={},slotProps:w={},TransitionComponent:T=Hc,transitionDuration:E=i,TransitionProps:D,...O}=n,k={...n,disableEscapeKeyDown:f,fullScreen:p,fullWidth:m,maxWidth:h,scroll:S},A=hJ(k),j=P.useRef(),M=e=>{j.current=e.target===e.currentTarget},ee=e=>{g&&g(e),j.current&&(j.current=null,_&&_(e,`backdropClick`))},N=Fi(o),te=P.useMemo(()=>({titleId:N}),[N]),ne={slots:{transition:T,...C},slotProps:{transition:D,paper:b,backdrop:l,...w}},[re,ie]=zc(`root`,{elementType:gJ,shouldForwardComponentProp:!0,externalForwardedProps:ne,ownerState:k,className:I(A.root,d),ref:t}),[ae,oe]=zc(`backdrop`,{elementType:mJ,shouldForwardComponentProp:!0,externalForwardedProps:ne,ownerState:k,className:A.backdrop}),[se,ce]=zc(`paper`,{elementType:vJ,shouldForwardComponentProp:!0,externalForwardedProps:ne,ownerState:k,className:A.paper,additionalProps:{elevation:24,role:x,"aria-describedby":a,"aria-labelledby":N,"aria-modal":s,tabIndex:-1,[Sc]:``}}),[le,ue]=zc(`container`,{elementType:_J,externalForwardedProps:ne,ownerState:k,className:A.container}),[de,fe]=zc(`transition`,{elementType:Hc,externalForwardedProps:ne,ownerState:k,additionalProps:{appear:!0,in:v,timeout:E,role:`presentation`}});return(0,F.jsx)(re,{closeAfterTransition:!0,slots:{backdrop:ae},slotProps:{backdrop:{transitionDuration:E,as:c,...oe}},disableEscapeKeyDown:f,onClose:_,open:v,onClick:ee,...ie,...O,children:(0,F.jsx)(de,{...fe,children:(0,F.jsx)(le,{onMouseDown:M,...ue,children:(0,F.jsx)(se,{as:y,...ce,children:(0,F.jsx)(pJ.Provider,{value:te,children:u})})})})})}),bJ=class extends P.Component{static propTypes={onDone:v.func.isRequired,alt:v.string};constructor(e){super(e);let{alt:t}=e;this.state={value:t}}closeDialog=()=>{document.querySelectorAll(`#text-dialog`).forEach(function(e){return e.remove()})};onDone=()=>{let{onDone:e}=this.props,{value:t}=this.state;e(t),this.closeDialog()};handleOverflow=()=>{document.body.style.removeProperty(`overflow`)};render(){let{value:e}=this.state;return(0,F.jsxs)(yJ,{open:!0,disablePortal:!0,onClose:this.closeDialog,id:`text-dialog`,hideBackdrop:!0,disableScrollLock:!0,onEntered:this.handleOverflow,children:[(0,F.jsx)(Jq,{children:(0,F.jsxs)(`div`,{style:{display:`flex`},children:[(0,F.jsx)(Yq,{style:{paddingTop:`6px`}}),(0,F.jsx)(oJ,{multiline:!0,placeholder:`Enter an Alt Text description of this image`,helperText:`Users with visual limitations rely on Alt Text, since screen readers cannot otherwise describe the contents of an image.`,value:e,onChange:e=>this.setState({value:e.target.value}),FormHelperTextProps:{style:{fontSize:14}}})]})}),(0,F.jsx)(uJ,{children:(0,F.jsx)(ff,{onClick:this.onDone,children:`Done`})})]})}},xJ=R(`button`,{shouldForwardProp:e=>![`active`,`disabled`,`extraStyles`].includes(e)})(({active:e,disabled:t})=>({color:e?Il():Ll(),display:`inline-flex`,padding:`2px`,background:`none`,border:`none`,cursor:t?`not-allowed`:`pointer`,"& svg":{width:`24px`,height:`24px`},"&:hover":{color:t?Ll():Il()},"&:focus":{outline:`2px solid ${Tu()}`},...t&&{opacity:.7}})),SJ=Uu(`pie-elements:editable-html:raw-button`);(class extends P.Component{static propTypes={onClick:v.func.isRequired,children:v.oneOfType([v.arrayOf(v.node),v.node]).isRequired,active:v.bool,disabled:v.bool,extraStyles:v.object};constructor(e){super(e)}onClick=e=>{SJ(`[onClick]`),e.preventDefault();let{onClick:t}=this.props;t(e)};onKeyDown=e=>{if(e.key===`Enter`||e.key===` `){SJ(`[onKeyDown]`),e.preventDefault();let{onClick:t}=this.props;t(e)}};render(){let{active:e,children:t,disabled:n,extraStyles:r,ariaLabel:i}=this.props;return(0,F.jsx)(xJ,{style:r,active:e,disabled:n,onMouseDown:this.onClick,onKeyDown:this.onKeyDown,"aria-label":i,"aria-pressed":e,tabIndex:0,children:t})}});var CJ=class extends P.Component{static propTypes={onToggle:v.func.isRequired,mark:v.string,label:v.string.isRequired,children:v.oneOfType([v.arrayOf(v.node),v.node]).isRequired,active:v.bool};constructor(e){super(e)}onToggle=e=>{e.preventDefault(),this.props.onToggle(this.props.mark)};onKeyDown=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.props.onToggle(this.props.mark))};render(){let{children:e,active:t,label:n}=this.props;return(0,F.jsx)(xJ,{active:t,onMouseDown:this.onToggle,"aria-pressed":t,onKeyDown:this.onKeyDown,"aria-label":n,tabIndex:0,children:e})}},wJ=Uu(`@pie-lib:editable-html:plugins:image:image-toolbar`),TJ=R(`div`)(({theme:e})=>({paddingLeft:e.spacing.unit,display:`flex`,alignItems:`center`})),EJ=R(`span`,{shouldForwardProp:e=>![`disabled`,`hasAlignmentButtons`].includes(e)})(({disabled:e,hasAlignmentButtons:t})=>({...e&&{opacity:.5},...t&&{borderLeft:`1px solid grey`,paddingLeft:8,marginLeft:4}})),DJ=({alignment:e,active:t,onClick:n})=>(0,F.jsx)(CJ,{active:t,onToggle:()=>n(e),label:e,children:e});DJ.propTypes={alignment:v.string.isRequired,active:v.bool.isRequired,onClick:v.func.isRequired};var OJ=class extends P.Component{static propTypes={onChange:v.func.isRequired,alignment:v.string,alt:v.string,imageLoaded:v.bool,disableImageAlignmentButtons:v.bool};onAltTextDone=e=>{wJ(`[onAltTextDone]: alt:`,e),this.props.onChange({alt:e},!0)};onAlignmentClick=e=>{wJ(`[onAlignmentClick]: alignment:`,e),this.props.onChange({alignment:e})};renderDialog=()=>{let{alt:e}=this.props,t=document.createElement(`div`),n=(0,F.jsx)(bJ,{alt:e,onDone:this.onAltTextDone});Ms.render(n,t),document.body.appendChild(t)};render(){let{alignment:e,imageLoaded:t,disableImageAlignmentButtons:n}=this.props;return(0,F.jsxs)(TJ,{children:[!n&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(DJ,{alignment:`left`,active:e===`left`,onClick:this.onAlignmentClick}),(0,F.jsx)(DJ,{alignment:`center`,active:e===`center`,onClick:this.onAlignmentClick}),(0,F.jsx)(DJ,{alignment:`right`,active:e===`right`,onClick:this.onAlignmentClick})]}),(0,F.jsx)(EJ,{disabled:!t,hasAlignmentButtons:!n,onMouseDown:e=>t&&this.renderDialog(e),children:`Alt text`})]})}},kJ=R(Rq,{shouldForwardProp:e=>e!==`hideProgress`})(({hideProgress:e})=>({position:`absolute`,left:`0`,width:`fit-content`,top:`0%`,transition:`opacity 200ms linear`,...e&&{opacity:0}})),AJ=R(`div`,{shouldForwardProp:e=>![`active`,`loading`,`pendingDelete`].includes(e)})(({loading:e,pendingDelete:t})=>({position:`relative`,display:`flex`,transition:`opacity 200ms linear`,...e&&{opacity:.3},...t&&{opacity:.3}})),jJ=R(`div`)(({theme:e})=>({position:`relative`,width:`fit-content`,display:`flex`,alignItems:`center`,"&&:hover > .resize":{display:`block`}})),MJ=R(`img`,{shouldForwardProp:e=>e!==`active`})(({theme:e,active:t})=>({border:t?`solid 1px ${e.palette.primary.main}`:`solid 1px transparent`})),NJ=R(`div`)(({theme:e})=>({backgroundColor:e.palette.primary.main,cursor:`col-resize`,height:`35px`,width:`5px`,borderRadius:8,marginLeft:`5px`,marginRight:`10px`,display:`none`})),PJ=e=>e?`${e}px`:`calc(20px)`;function FJ(e){let{node:t,editor:n,attributes:r,onFocus:i,getPos:a,selected:o,options:s,maxImageWidth:c=700,maxImageHeight:l=900}=e,{alt:u}=t.attrs,d=a(),f=n.state.selection.from,p=n.state.selection.to,m=(0,P.useMemo)(()=>f+t.nodeSize===p,[f,p,t.nodeSize]),[h,g]=(0,P.useState)(!1),_=(0,P.useRef)(t),v=(0,P.useRef)(null),y=(0,P.useRef)(null),b=(0,P.useRef)(null),x=(0,P.useCallback)(e=>{let t=e/v.current.naturalWidth*4;return parseInt(t.toFixed(0)*25,10)},[]),S=(0,P.useCallback)(()=>{let e=zq(n,_.current.attrs.nodeKey);return e?e[1]:null},[n]),C=(0,P.useCallback)(e=>{let t=S();if(t===null)return;let r=n.state.doc.nodeAt(t);r&&n.view.dispatch(n.state.tr.setNodeMarkup(t,void 0,{...r.attrs,...e}))},[n,S]),w=(0,P.useCallback)(()=>{if(!t.attrs.width||!v.current||!v.current.naturalWidth)return;let e=x(t.attrs.width);t.attrs.resizePercent!==e&&C({resizePercent:e})},[t.attrs.width,t.attrs.resizePercent,x,C]);(0,P.useEffect)(()=>{_.current={...t,pos:d}},[t,d]),(0,P.useEffect)(()=>{o?m&&n.isEditable&&(!String(t.attrs?.src??``).trim()&&s.imageHandling?.insertImageRequested&&s.imageHandling.insertImageRequested(n,[t,d],e=>new Hq(n,[t,d],e)),g(o)):g(o)},[m,o,n.isEditable]),(0,P.useEffect)(()=>{w();let e=y?.current;return e&&n.isEditable&&e.addEventListener(`mousedown`,A,!1),()=>{e&&e.removeEventListener(`mousedown`,A,!1)}},[]),(0,P.useEffect)(()=>{w()});let T=(0,P.useCallback)(()=>{let e=v.current;if(e&&(!e.style.width||e.style.width===`calc(20px)`)){let n=Math.min(e.naturalWidth,c),r=Math.min(e.naturalHeight,l);e.style.width=`${n}px`,e.style.height=`${r}px`;let i={width:n,height:r};zp(i,{width:t.attrs.width,height:t.attrs.height})||C(i)}},[t.attrs.width,t.attrs.height,c,l,C]),E=(e,t,n=!0,r)=>{if(n){let n=e.width/e.height;return r===`height`?{width:t.height*n,height:t.height}:{width:t.width,height:t.width/n}}return t},D=(0,P.useCallback)(e=>{let t=v.current;if(!t)return;let n=e.target.getBoundingClientRect(),r={width:t.naturalWidth,height:t.naturalHeight},i=E(r,{width:e.clientX-n.left,height:e.clientY-n.top});i.width>50&&i.height>50&&i.width<=700&&i.height<=900&&(t.style.width=`${i.width}px`,t.style.height=`${i.height}px`,C({width:i.width,height:i.height}))},[n,C]),O=(0,P.useCallback)(e=>{C(e)},[n,C]),k=(0,P.useCallback)(()=>{window.removeEventListener(`mousemove`,D),window.removeEventListener(`mouseup`,k)},[D]),A=(0,P.useCallback)(()=>{window.addEventListener(`mousemove`,D),window.addEventListener(`mouseup`,k)},[D,k]),j={width:PJ(t.attrs.width),height:PJ(t.attrs.height),objectFit:`contain`},M={left:`flex-start`,center:`center`,right:`flex-end`}[t.attrs.alignment]||`flex-start`;return(0,F.jsxs)(Wk,{children:[(0,F.jsxs)(AJ,{onFocus:i,loading:!t.attrs.loaded,pendingDelete:t.attrs.deleteStatus===`pending`,style:{justifyContent:M},children:[(0,F.jsx)(kJ,{mode:`determinate`,value:t.attrs.percent||0,hideProgress:t.attrs.loaded}),(0,F.jsxs)(jJ,{onDragStart:e=>e.preventDefault(),children:[(0,F.jsx)(MJ,{...r,active:o&&t.attrs.loaded,draggable:!1,ref:v,src:t.attrs.src,style:j,onLoad:T,alt:t.attrs.alt}),(0,F.jsx)(NJ,{ref:y,className:`resize`,style:{display:n.isEditable?void 0:`none`}})]})]}),h&&n._tiptapContainerEl&&Ms.createPortal((0,F.jsx)(`div`,{ref:b,style:{zIndex:20,background:`var(--editable-html-toolbar-bg, #efefef)`,boxShadow:`0px 1px 5px 0px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 3px 1px -2px rgba(0, 0, 0, 0.12)`,width:`100%`},children:(0,F.jsx)(bR,{showDone:!0,deletable:!0,toolbarOpts:s.toolbarOpts||{},onDelete:()=>{let e=S();e!==null&&(s.imageHandling?.onDelete?.(_.current),n.view.dispatch(n.state.tr.delete(e,e+n.state.doc.nodeAt(e).nodeSize)),g(!1),n.commands.focus())},onDone:()=>{g(!1),s.imageHandling?.onDone?.(n),n.commands.focus(`end`)},children:(0,F.jsx)(OJ,{disableImageAlignmentButtons:s.imageHandling?.disableImageAlignmentButtons,alt:t.attrs.alt,imageLoaded:t.attrs.loaded,alignment:t.attrs.alignment||`left`,onChange:O})})}),n._tiptapContainerEl)]})}FJ.propTypes={node:v.object.isRequired,editor:v.object.isRequired,attributes:v.object,onFocus:v.func,maxImageWidth:v.number,maxImageHeight:v.number};var IJ=wO.create({name:`imageUploadNode`,group:`block`,atom:!0,selectable:!0,draggable:!0,addAttributes(){return{nodeKey:{default:null},loaded:{default:!1},deleteStatus:{default:null},alignment:{default:null},percent:{default:null},width:{default:null},height:{default:null},src:{default:null},alt:{default:null}}},parseHTML(){return[{tag:`img[data-type="image-upload-node"]`}]},renderHTML({HTMLAttributes:e}){return[`img`,nE(e,{"data-type":`image-upload-node`})]},addNodeView(){return iA(e=>(0,F.jsx)(FJ,{...e,options:this.options}))},addCommands(){return{setImageUploadNode:()=>({commands:e})=>e.insertContent({type:this.name,attrs:{nodeKey:Bq()}})}},addProseMirrorPlugins(){let e=this.editor,t=this.options;return[new ey({props:{handlePaste(n,r){let i=Array.from(r.clipboardData?.items||[]).find(e=>e.kind===`file`&&e.type.startsWith(`image/`));if(!i)return!1;let a=i.getAsFile();if(!a)return!1;let o=t?.imageHandling?.insertImageRequested,s=Bq(),c=new FileReader;return c.onload=()=>{let t=c.result;if(typeof t!=`string`||(e.commands.insertContent({type:`imageUploadNode`,attrs:{src:t,loaded:!o,nodeKey:s}}),!o))return;let n=zq(e,s);n&&o(e,n,t=>{let r;return r=new Hq(e,n,e=>{e||r?.updateNode({loaded:!0}),t(e)},!0),r.fileChosen(a),r})},c.readAsDataURL(a),!0}}})]}});function LJ(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}function RJ(e,t,n,r={},i=()=>{}){let{ease:a=LJ,duration:o=300}=r,s=null,c=t[e],l=!1,u=()=>{l=!0},d=r=>{if(l){i(Error(`Animation cancelled`));return}s===null&&(s=r);let u=Math.min(1,(r-s)/o);if(t[e]=a(u)*(n-c)+c,u>=1){requestAnimationFrame(()=>{i(null)});return}requestAnimationFrame(d)};return c===n?(i(Error(`Element already at target position`)),u):(requestAnimationFrame(d),u)}var zJ={width:99,height:99,position:`absolute`,top:-9999,overflow:`scroll`};function BJ(e){let{onChange:t,...n}=e,r=P.useRef(),i=P.useRef(null),a=()=>{r.current=i.current.offsetHeight-i.current.clientHeight};return gl(()=>{let e=us(()=>{let e=r.current;a(),e!==r.current&&t(r.current)}),n=ms(i.current);return n.addEventListener(`resize`,e),()=>{e.clear(),n.removeEventListener(`resize`,e)}},[t]),P.useEffect(()=>{a(),t(r.current)},[t]),(0,F.jsx)(`div`,{style:zJ,...n,ref:i})}var VJ=ml((0,F.jsx)(`path`,{d:`M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z`}),`KeyboardArrowLeft`),HJ=ml((0,F.jsx)(`path`,{d:`M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z`}),`KeyboardArrowRight`);function UJ(e){return Br(`MuiTabScrollButton`,e)}var WJ=Vr(`MuiTabScrollButton`,[`root`,`vertical`,`horizontal`,`disabled`]),GJ=e=>{let{classes:t,orientation:n,disabled:r}=e;return ca({root:[`root`,n,r&&`disabled`]},UJ,t)},KJ=R(Ld,{name:`MuiTabScrollButton`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.orientation&&t[n.orientation]]}})({width:40,flexShrink:0,opacity:.8,[`&.${WJ.disabled}`]:{opacity:0},variants:[{props:{orientation:`vertical`},style:{width:`100%`,height:40,"& svg":{transform:`var(--TabScrollButton-svgRotate)`}}}]}),qJ=P.forwardRef(function(e,t){let n=cs({props:e,name:`MuiTabScrollButton`}),{className:r,slots:i={},slotProps:a={},direction:o,orientation:s,disabled:c,...l}=n,u=Di(),d={isRtl:u,...n},f=GJ(d),p=i.StartScrollButtonIcon??VJ,m=i.EndScrollButtonIcon??HJ,h=lp({elementType:p,externalSlotProps:a.startScrollButtonIcon,additionalProps:{fontSize:`small`},ownerState:d}),g=lp({elementType:m,externalSlotProps:a.endScrollButtonIcon,additionalProps:{fontSize:`small`},ownerState:d});return(0,F.jsx)(KJ,{component:`div`,className:I(f.root,r),ref:t,role:null,ownerState:d,tabIndex:null,...l,style:{...l.style,...s===`vertical`&&{"--TabScrollButton-svgRotate":`rotate(${u?-90:90}deg)`}},children:o===`left`?(0,F.jsx)(p,{...h}):(0,F.jsx)(m,{...g})})});function JJ(e){return Br(`MuiTabs`,e)}var YJ=Vr(`MuiTabs`,[`root`,`vertical`,`list`,`flexContainer`,`flexContainerVertical`,`centered`,`scroller`,`fixed`,`scrollableX`,`scrollableY`,`hideScrollbar`,`scrollButtons`,`scrollButtonsHideMobile`,`indicator`]),XJ=(e,t)=>e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:e.firstChild,ZJ=(e,t)=>e===t?e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:e.lastChild,QJ=(e,t,n)=>{let r=!1,i=n(e,t);for(;i;){if(i===e.firstChild){if(r)return;r=!0}let t=i.disabled||i.getAttribute(`aria-disabled`)===`true`;if(!i.hasAttribute(`tabindex`)||t)i=n(e,i);else{i.focus();return}}},$J=e=>{let{vertical:t,fixed:n,hideScrollbar:r,scrollableX:i,scrollableY:a,centered:o,scrollButtonsHideMobile:s,classes:c}=e;return ca({root:[`root`,t&&`vertical`],scroller:[`scroller`,n&&`fixed`,r&&`hideScrollbar`,i&&`scrollableX`,a&&`scrollableY`],list:[`list`,`flexContainer`,t&&`flexContainerVertical`,t&&`vertical`,o&&`centered`],indicator:[`indicator`],scrollButtons:[`scrollButtons`,s&&`scrollButtonsHideMobile`],scrollableX:[i&&`scrollableX`],hideScrollbar:[r&&`hideScrollbar`]},JJ,c)},eY=R(`div`,{name:`MuiTabs`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`& .${YJ.scrollButtons}`]:t.scrollButtons},{[`& .${YJ.scrollButtons}`]:n.scrollButtonsHideMobile&&t.scrollButtonsHideMobile},t.root,n.vertical&&t.vertical]}})(Nc(({theme:e})=>({overflow:`hidden`,minHeight:48,WebkitOverflowScrolling:`touch`,display:`flex`,variants:[{props:({ownerState:e})=>e.vertical,style:{flexDirection:`column`}},{props:({ownerState:e})=>e.scrollButtonsHideMobile,style:{[`& .${YJ.scrollButtons}`]:{[e.breakpoints.down(`sm`)]:{display:`none`}}}}]}))),tY=R(`div`,{name:`MuiTabs`,slot:`Scroller`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.scroller,n.fixed&&t.fixed,n.hideScrollbar&&t.hideScrollbar,n.scrollableX&&t.scrollableX,n.scrollableY&&t.scrollableY]}})({position:`relative`,display:`inline-block`,flex:`1 1 auto`,whiteSpace:`nowrap`,variants:[{props:({ownerState:e})=>e.fixed,style:{overflowX:`hidden`,width:`100%`}},{props:({ownerState:e})=>e.hideScrollbar,style:{scrollbarWidth:`none`,"&::-webkit-scrollbar":{display:`none`}}},{props:({ownerState:e})=>e.scrollableX,style:{overflowX:`auto`,overflowY:`hidden`}},{props:({ownerState:e})=>e.scrollableY,style:{overflowY:`auto`,overflowX:`hidden`}}]}),nY=R(`div`,{name:`MuiTabs`,slot:`List`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.list,t.flexContainer,n.vertical&&t.flexContainerVertical,n.centered&&t.centered]}})({display:`flex`,variants:[{props:({ownerState:e})=>e.vertical,style:{flexDirection:`column`}},{props:({ownerState:e})=>e.centered,style:{justifyContent:`center`}}]}),rY=R(`span`,{name:`MuiTabs`,slot:`Indicator`})(Nc(({theme:e})=>({position:`absolute`,height:2,bottom:0,width:`100%`,transition:e.transitions.create(),variants:[{props:{indicatorColor:`primary`},style:{backgroundColor:(e.vars||e).palette.primary.main}},{props:{indicatorColor:`secondary`},style:{backgroundColor:(e.vars||e).palette.secondary.main}},{props:({ownerState:e})=>e.vertical,style:{height:`100%`,width:2,right:0}}]}))),iY=R(BJ)({overflowX:`auto`,overflowY:`hidden`,scrollbarWidth:`none`,"&::-webkit-scrollbar":{display:`none`}}),aY={},oY=P.forwardRef(function(e,t){let n=cs({props:e,name:`MuiTabs`}),r=xo(),i=Di(),{"aria-label":a,"aria-labelledby":o,action:s,centered:c=!1,children:l,className:u,component:d=`div`,allowScrollButtonsMobile:f=!1,indicatorColor:p=`primary`,onChange:m,orientation:h=`horizontal`,ScrollButtonComponent:g,scrollButtons:_=`auto`,selectionFollowsFocus:v,slots:y={},slotProps:b={},TabIndicatorProps:x={},TabScrollButtonProps:S={},textColor:C=`primary`,value:w,variant:T=`standard`,visibleScrollbar:E=!1,...D}=n,O=T===`scrollable`,k=h===`vertical`,A=k?`scrollTop`:`scrollLeft`,j=k?`top`:`left`,M=k?`bottom`:`right`,ee=k?`clientHeight`:`clientWidth`,N=k?`height`:`width`,te={...n,component:d,allowScrollButtonsMobile:f,indicatorColor:p,orientation:h,vertical:k,scrollButtons:_,textColor:C,variant:T,visibleScrollbar:E,fixed:!O,hideScrollbar:O&&!E,scrollableX:O&&!k,scrollableY:O&&k,centered:c&&!O,scrollButtonsHideMobile:!f},ne=$J(te),re=lp({elementType:y.StartScrollButtonIcon,externalSlotProps:b.startScrollButtonIcon,ownerState:te}),ie=lp({elementType:y.EndScrollButtonIcon,externalSlotProps:b.endScrollButtonIcon,ownerState:te}),[ae,oe]=P.useState(!1),[se,ce]=P.useState(aY),[le,ue]=P.useState(!1),[de,fe]=P.useState(!1),[pe,me]=P.useState(!1),[he,ge]=P.useState({overflow:`hidden`,scrollbarWidth:0}),_e=new Map,ve=P.useRef(null),ye=P.useRef(null),be={slots:y,slotProps:{indicator:x,scrollButtons:S,...b}},xe=()=>{let e=ve.current,t;if(e){let n=e.getBoundingClientRect();t={clientWidth:e.clientWidth,scrollLeft:e.scrollLeft,scrollTop:e.scrollTop,scrollWidth:e.scrollWidth,top:n.top,bottom:n.bottom,left:n.left,right:n.right}}let n;if(e&&w!==!1){let e=ye.current.children;if(e.length>0){let t=e[_e.get(w)];n=t?t.getBoundingClientRect():null}}return{tabsMeta:t,tabMeta:n}},Se=bl(()=>{let{tabsMeta:e,tabMeta:t}=xe(),n=0,r;k?(r=`top`,t&&e&&(n=t.top-e.top+e.scrollTop)):(r=i?`right`:`left`,t&&e&&(n=(i?-1:1)*(t[r]-e[r]+e.scrollLeft)));let a={[r]:n,[N]:t?t[N]:0};if(typeof se[r]!=`number`||typeof se[N]!=`number`)ce(a);else{let e=Math.abs(se[r]-a[r]),t=Math.abs(se[N]-a[N]);(e>=1||t>=1)&&ce(a)}}),Ce=(e,{animation:t=!0}={})=>{t?RJ(A,ve.current,e,{duration:r.transitions.duration.standard}):ve.current[A]=e},we=e=>{let t=ve.current[A];k?t+=e:t+=e*(i?-1:1),Ce(t)},Te=()=>{let e=ve.current[ee],t=0,n=Array.from(ye.current.children);for(let r=0;r<n.length;r+=1){let i=n[r];if(t+i[ee]>e){r===0&&(t=e);break}t+=i[ee]}return t},Ee=()=>{we(-1*Te())},De=()=>{we(Te())},[Oe,{onChange:ke,...Ae}]=zc(`scrollbar`,{className:I(ne.scrollableX,ne.hideScrollbar),elementType:iY,shouldForwardComponentProp:!0,externalForwardedProps:be,ownerState:te}),je=P.useCallback(e=>{ke?.(e),ge({overflow:null,scrollbarWidth:e})},[ke]),[Me,Ne]=zc(`scrollButtons`,{className:I(ne.scrollButtons,S.className),elementType:qJ,externalForwardedProps:be,ownerState:te,additionalProps:{orientation:h,slots:{StartScrollButtonIcon:y.startScrollButtonIcon||y.StartScrollButtonIcon,EndScrollButtonIcon:y.endScrollButtonIcon||y.EndScrollButtonIcon},slotProps:{startScrollButtonIcon:re,endScrollButtonIcon:ie}}}),Pe=()=>{let e={};e.scrollbarSizeListener=O?(0,F.jsx)(Oe,{...Ae,onChange:je}):null;let t=O&&(_===`auto`&&(le||de)||_===!0);return e.scrollButtonStart=t?(0,F.jsx)(Me,{direction:i?`right`:`left`,onClick:Ee,disabled:!le,...Ne}):null,e.scrollButtonEnd=t?(0,F.jsx)(Me,{direction:i?`left`:`right`,onClick:De,disabled:!de,...Ne}):null,e},Fe=bl(e=>{let{tabsMeta:t,tabMeta:n}=xe();if(!(!n||!t)){if(n[j]<t[j]){let r=t[A]+(n[j]-t[j]);Ce(r,{animation:e})}else if(n[M]>t[M]){let r=t[A]+(n[M]-t[M]);Ce(r,{animation:e})}}}),Ie=bl(()=>{O&&_!==!1&&me(!pe)});P.useEffect(()=>{let e=us(()=>{ve.current&&Se()}),t,n=n=>{n.forEach(e=>{e.removedNodes.forEach(e=>{t?.unobserve(e)}),e.addedNodes.forEach(e=>{t?.observe(e)})}),e(),Ie()},r=ms(ve.current);r.addEventListener(`resize`,e);let i;return typeof ResizeObserver<`u`&&(t=new ResizeObserver(e),Array.from(ye.current.children).forEach(e=>{t.observe(e)})),typeof MutationObserver<`u`&&(i=new MutationObserver(n),i.observe(ye.current,{childList:!0})),()=>{e.clear(),r.removeEventListener(`resize`,e),i?.disconnect(),t?.disconnect()}},[Se,Ie]),P.useEffect(()=>{let e=Array.from(ye.current.children),t=e.length;if(typeof IntersectionObserver<`u`&&t>0&&O&&_!==!1){let n=e[0],r=e[t-1],i={root:ve.current,threshold:.99},a=new IntersectionObserver(e=>{ue(!e[0].isIntersecting)},i);a.observe(n);let o=new IntersectionObserver(e=>{fe(!e[0].isIntersecting)},i);return o.observe(r),()=>{a.disconnect(),o.disconnect()}}},[O,_,pe,l?.length]),P.useEffect(()=>{oe(!0)},[]),P.useEffect(()=>{Se()}),P.useEffect(()=>{Fe(aY!==se)},[Fe,se]),P.useImperativeHandle(s,()=>({updateIndicator:Se,updateScrollButtons:Ie}),[Se,Ie]);let[Le,Re]=zc(`indicator`,{className:I(ne.indicator,x.className),elementType:rY,externalForwardedProps:be,ownerState:te,additionalProps:{style:se}}),ze=(0,F.jsx)(Le,{...Re}),Be=0,Ve=P.Children.map(l,e=>{if(!P.isValidElement(e))return null;let t=e.props.value===void 0?Be:e.props.value;_e.set(t,Be);let n=t===w;return Be+=1,P.cloneElement(e,{fullWidth:T===`fullWidth`,indicator:n&&!ae&&ze,selected:n,selectionFollowsFocus:v,onChange:m,textColor:C,value:t,...Be===1&&w===!1&&!e.props.tabIndex?{tabIndex:0}:{}})}),He=e=>{if(e.altKey||e.shiftKey||e.ctrlKey||e.metaKey)return;let t=ye.current,n=xc(fs(t));if(n?.getAttribute(`role`)!==`tab`)return;let r=h===`horizontal`?`ArrowLeft`:`ArrowUp`,a=h===`horizontal`?`ArrowRight`:`ArrowDown`;switch(h===`horizontal`&&i&&(r=`ArrowRight`,a=`ArrowLeft`),e.key){case r:e.preventDefault(),QJ(t,n,ZJ);break;case a:e.preventDefault(),QJ(t,n,XJ);break;case`Home`:e.preventDefault(),QJ(t,null,XJ);break;case`End`:e.preventDefault(),QJ(t,null,ZJ);break;default:break}},Ue=Pe(),[We,Ge]=zc(`root`,{ref:t,className:I(ne.root,u),elementType:eY,externalForwardedProps:{...be,...D,component:d},ownerState:te}),[Ke,qe]=zc(`scroller`,{ref:ve,className:ne.scroller,elementType:tY,externalForwardedProps:be,ownerState:te,additionalProps:{style:{overflow:he.overflow,[k?`margin${i?`Left`:`Right`}`:`marginBottom`]:E?void 0:-he.scrollbarWidth}}}),[Je,Ye]=zc(`list`,{ref:ye,className:I(ne.list,ne.flexContainer),elementType:nY,externalForwardedProps:be,ownerState:te,getSlotProps:e=>({...e,onKeyDown:t=>{He(t),e.onKeyDown?.(t)}})});return(0,F.jsxs)(We,{...Ge,children:[Ue.scrollButtonStart,Ue.scrollbarSizeListener,(0,F.jsxs)(Ke,{...qe,children:[(0,F.jsx)(Je,{"aria-label":a,"aria-labelledby":o,"aria-orientation":h===`vertical`?`vertical`:null,role:`tablist`,...Ye,children:Ve}),ae&&ze]}),Ue.scrollButtonEnd]})});function sY(e){return Br(`MuiTab`,e)}var cY=Vr(`MuiTab`,[`root`,`labelIcon`,`textColorInherit`,`textColorPrimary`,`textColorSecondary`,`selected`,`disabled`,`fullWidth`,`wrapped`,`iconWrapper`,`icon`]),lY=e=>{let{classes:t,textColor:n,fullWidth:r,wrapped:i,icon:a,label:o,selected:s,disabled:c}=e;return ca({root:[`root`,a&&o&&`labelIcon`,`textColor${B(n)}`,r&&`fullWidth`,i&&`wrapped`,s&&`selected`,c&&`disabled`],icon:[`iconWrapper`,`icon`]},sY,t)},uY=R(Ld,{name:`MuiTab`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.label&&n.icon&&t.labelIcon,t[`textColor${B(n.textColor)}`],n.fullWidth&&t.fullWidth,n.wrapped&&t.wrapped,{[`& .${cY.iconWrapper}`]:t.iconWrapper},{[`& .${cY.icon}`]:t.icon}]}})(Nc(({theme:e})=>({...e.typography.button,maxWidth:360,minWidth:90,position:`relative`,minHeight:48,flexShrink:0,padding:`12px 16px`,overflow:`hidden`,whiteSpace:`normal`,textAlign:`center`,lineHeight:1.25,variants:[{props:({ownerState:e})=>e.label&&(e.iconPosition===`top`||e.iconPosition===`bottom`),style:{flexDirection:`column`}},{props:({ownerState:e})=>e.label&&e.iconPosition!==`top`&&e.iconPosition!==`bottom`,style:{flexDirection:`row`}},{props:({ownerState:e})=>e.icon&&e.label,style:{minHeight:72,paddingTop:9,paddingBottom:9}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&t===`top`,style:{[`& > .${cY.icon}`]:{marginBottom:6}}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&t===`bottom`,style:{[`& > .${cY.icon}`]:{marginTop:6}}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&t===`start`,style:{[`& > .${cY.icon}`]:{marginRight:e.spacing(1)}}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&t===`end`,style:{[`& > .${cY.icon}`]:{marginLeft:e.spacing(1)}}},{props:{textColor:`inherit`},style:{color:`inherit`,opacity:.6,[`&.${cY.selected}`]:{opacity:1},[`&.${cY.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity}}},{props:{textColor:`primary`},style:{color:(e.vars||e).palette.text.secondary,[`&.${cY.selected}`]:{color:(e.vars||e).palette.primary.main},[`&.${cY.disabled}`]:{color:(e.vars||e).palette.text.disabled}}},{props:{textColor:`secondary`},style:{color:(e.vars||e).palette.text.secondary,[`&.${cY.selected}`]:{color:(e.vars||e).palette.secondary.main},[`&.${cY.disabled}`]:{color:(e.vars||e).palette.text.disabled}}},{props:({ownerState:e})=>e.fullWidth,style:{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:`none`}},{props:({ownerState:e})=>e.wrapped,style:{fontSize:e.typography.pxToRem(12)}}]}))),dY=P.forwardRef(function(e,t){let n=cs({props:e,name:`MuiTab`}),{className:r,disabled:i=!1,disableFocusRipple:a=!1,fullWidth:o,icon:s,iconPosition:c=`top`,indicator:l,label:u,onChange:d,onClick:f,onFocus:p,selected:m,selectionFollowsFocus:h,textColor:g=`inherit`,value:_,wrapped:v=!1,...y}=n,b={...n,disabled:i,disableFocusRipple:a,selected:m,icon:!!s,iconPosition:c,label:!!u,fullWidth:o,textColor:g,wrapped:v},x=lY(b),S=s&&u&&P.isValidElement(s)?P.cloneElement(s,{className:I(x.icon,s.props.className)}):s;return(0,F.jsxs)(uY,{focusRipple:!a,className:I(x.root,r),ref:t,role:`tab`,"aria-selected":m,disabled:i,onClick:e=>{!m&&d&&d(e,_),f&&f(e)},onFocus:e=>{h&&!m&&d&&d(e,_),p&&p(e)},ownerState:b,tabIndex:m?0:-1,...y,children:[c===`top`||c===`start`?(0,F.jsxs)(P.Fragment,{children:[S,u]}):(0,F.jsxs)(P.Fragment,{children:[u,S]}),l]})}),fY=e=>{let{classes:t}=e;return ca({root:[`root`]},Wq,t)},pY=R(gG,{name:`MuiDialogTitle`,slot:`Root`})({padding:`16px 24px`,flex:`0 0 auto`}),mY=P.forwardRef(function(e,t){let n=cs({props:e,name:`MuiDialogTitle`}),{className:r,id:i,...a}=n,o=n,s=fY(o),{titleId:c=i}=P.useContext(pJ);return(0,F.jsx)(pY,{component:`h2`,className:I(s.root,r),ownerState:o,ref:t,variant:`h6`,id:i??c,...a})});function hY(e){return Br(`MuiDialogContentText`,e)}Vr(`MuiDialogContentText`,[`root`]);var gY=e=>{let{classes:t}=e,n=ca({root:[`root`]},hY,t);return{...t,...n}},_Y=R(gG,{shouldForwardProp:e=>Co(e)||e===`classes`,name:`MuiDialogContentText`,slot:`Root`})({}),vY=P.forwardRef(function(e,t){let n=cs({props:e,name:`MuiDialogContentText`}),{children:r,className:i,...a}=n,o=gY(a);return(0,F.jsx)(_Y,{component:`p`,variant:`body1`,color:`textSecondary`,ref:t,ownerState:a,className:I(o.root,i),...n,classes:o})}),yY=Uu(`@pie-lib:editable-html:plugins:media:dialog`),bY=e=>{if(!e)return!1;let t=/^(?:https?:\/\/)?(?:m\.|www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/;return e.match(t)?e.match(t)[1]:!1},xY=e=>e&&/(http|https)?:\/\/(www\.)?(player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|)(video\/)?(\d+)(?:|\/\?)/.test(e),SY=e=>e&&/^https:\/\/drive\.google\.com\/(?:file\/d\/|drive\/(?:u\/\d+\/)?folders\/|uc\?id=)([a-zA-Z0-9_-]+)/.test(e),CY=e=>{if(!e)return!1;let t=/^https?:\/\/(soundcloud\.com|snd\.sc)\/(.*)$/;return e.match(t)&&e.match(t)[2]},wY=e=>new Promise(t=>{try{fetch(`https://soundcloud.com/oembed?format=json&url=${e}`).then(e=>e.json()).then(e=>{let n=document.createElement(`div`);n.innerHTML=e.html,t(n.querySelector(`iframe`).src)}).catch(e=>{t(``),yY(e)})}catch{t(``)}}),TY={video:`Video`,audio:`Audio`},EY={uploadFile:`upload-file`,insertUrl:`insert-url`},DY=R(yJ)(({theme:e})=>({"& .MuiDialog-paper":{minWidth:`500px`}})),OY=R(Jq)(({theme:e})=>({padding:0})),kY=R(`div`)(({theme:e})=>({display:`flex`,flexDirection:`space-between`})),AY=R(`div`)(({theme:e})=>({marginTop:e.spacing(1.5)})),jY=R(`input`)(({theme:e})=>({})),MY=R(gG)(({theme:e})=>({marginTop:e.spacing(1.5),color:e.palette.error.main})),NY=R(uR)(({theme:e})=>({marginLeft:e.spacing(1.5)})),PY=class extends P.Component{static propTypes={open:v.bool,edit:v.bool,disablePortal:v.bool,handleClose:v.func,uploadSoundSupport:v.shape({add:v.func,delete:v.func}),type:v.string,src:v.string,url:v.string,urlToUse:v.string,starts:v.number,ends:v.number,height:v.number,width:v.number};constructor(e){super(e);let{ends:t,height:n,src:r,starts:i,type:a,uploadSoundSupport:o,url:s,urlToUse:c,width:l}=e,u=o?.add&&o?.delete&&a!==`video`&&!r;this.state={ends:t||0,url:s,urlToUse:c,formattedUrl:r,height:n||315,invalid:!1,starts:i||0,width:l||560,tabValue:u?EY.uploadFile:EY.insertUrl,fileUpload:{error:null,loading:!1,scheduled:!1,url:``,mimeType:``}}}componentDidMount(){this.props.url&&this.urlChange({target:{value:this.props.url}})}formatUrl=()=>{let{url:e,urlToUse:t,starts:n,ends:r}=this.state,i=bY(e),a=xY(e),o=t;if((i||a)&&t){let e=[],s,c;switch(!0){case a:s=`t`,c=`#`;break;case i:s=`start`,c=`?`;break;default:s=`start`,c=`?`}n&&e.push(`${s}=${n}`),r&&e.push(`end=${r}`),o=`${t}${e.length?c:``}${e.join(`&`)}`}this.setState({formattedUrl:null,updating:!0},()=>this.setState({formattedUrl:o,updating:!1}))};handleStateChange=e=>this.setState(e,this.formatUrl);checkAudio=e=>{CY(e)&&wY(e).then(t=>{this.handleStateChange({urlToUse:t,invalid:!t,url:e})}).catch(yY)};checkVideo=e=>{if(bY(e)){let t=`https://youtube.com/embed/${e.match(/^.*(youtu\.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/)[2]}`;yY(`is youtube`),this.handleStateChange({urlToUse:t,url:e,invalid:!1})}if(xY(e)){let t=`https://player.vimeo.com/video/${e.replace(/.*vimeo.com\/(.*)/g,`$1`)}`;yY(`is vimeo`),this.handleStateChange({urlToUse:t,url:e,ends:null,invalid:!1})}if(SY(e)){let t=`https://drive.google.com/file/d/${e.replace(/^https:\/\/drive\.google\.com\/(?:file\/d\/|drive\/(?:u\/\d+\/)?folders\/|uc\?id=)([a-zA-Z0-9_-]+)\/.*/,`$1`)}/preview`;yY(`is google drive`),this.handleStateChange({urlToUse:t,url:e,ends:null,invalid:!1})}};urlChange=e=>{let{value:t}=e.target||{},{type:n}=this.props;if(n&&n===`audio`){this.checkAudio(t);return}else if(n&&n===`video`){this.checkVideo(t);return}this.handleStateChange({urlToUse:null,url:null,invalid:!0})};changeHandler=e=>t=>this.handleStateChange({[e]:t.target.value});handleDone=e=>{let{handleClose:t}=this.props,{tabValue:n,fileUpload:r}=this.state,i=n===EY.insertUrl;if(!e){r.url&&this.handleRemoveFile(),t(e);return}if(i){let{ends:n,height:r,url:i,urlToUse:a,formattedUrl:o,starts:s,width:c}=this.state;t(e,{tag:`iframe`,ends:n,height:r,starts:s,width:c,url:i,urlToUse:a,src:o});return}if(!r.loading){t(e,{tag:`audio`,src:r.url});return}this.setState({fileUpload:{...r,scheduled:!0}})};handleUploadFile=async e=>{e.preventDefault(),this.setState({fileUpload:{...this.state.fileUpload,error:null,loading:!0}});let t=e.target.files[0],n=new FileReader;n.onload=()=>{let e=n.result;this.setState({fileUpload:{...this.state.fileUpload,url:e,mimeType:t.type}})},n.readAsDataURL(t),this.props.uploadSoundSupport.add({fileChosen:t,done:(e,t)=>{if(yY(`done: err:`,e),e){console.log(e),this.setState({fileUpload:{...this.state.fileUpload,scheduled:!1,loading:!1,error:e}});return}let{fileUpload:n}=this.state,r=n&&n.scheduled?this.handleDone.bind(this,!0):void 0;this.setState({fileUpload:{...n,scheduled:!1,loading:!1,url:t}},r)}})};handleRemoveFile=async()=>{this.props.uploadSoundSupport.delete(this.state.fileUpload.url,e=>{e&&(console.log(e),this.setState({fileUpload:{...this.state.fileUpload,error:e}}))}),this.setState({fileUpload:{...this.state.fileUpload,loading:!1,url:``,mimeType:``}})};render(){let{open:e,disablePortal:t,type:n,edit:r,uploadSoundSupport:i}=this.props,{ends:a,height:o,invalid:s,starts:c,width:l,url:u,mimeType:d,formattedUrl:f,updating:p,tabValue:m,fileUpload:h}=this.state,g=bY(u),_=m===EY.insertUrl,v=m===EY.uploadFile,y=_?s||u==null:!h.url||h.scheduled,b=i?.add&&i?.delete&&n!==`video`;return(0,F.jsxs)(DY,{disablePortal:t,open:e,onClose:()=>this.handleDone(!1),"aria-labelledby":`form-dialog-title`,children:[(0,F.jsxs)(mY,{id:`form-dialog-title`,children:[`Insert `,TY[n]]}),(0,F.jsx)(Jq,{children:(0,F.jsxs)(`div`,{children:[(0,F.jsx)(kY,{children:(0,F.jsxs)(oY,{indicatorColor:`primary`,value:m,onChange:(e,t)=>{this.setState({tabValue:t})},children:[b?(0,F.jsx)(dY,{value:EY.uploadFile,label:`Upload file`}):null,(0,F.jsx)(dY,{value:EY.insertUrl,label:n===`video`?`Insert YouTube, Vimeo, or Google Drive URL`:`Insert SoundCloud URL`})]})}),_&&(0,F.jsxs)(`div`,{children:[(0,F.jsx)(oJ,{autoFocus:!0,error:s,helperText:s?`Invalid URL`:``,margin:`dense`,id:`name`,label:`URL`,placeholder:`Paste URL of ${n}...`,type:`text`,onChange:this.urlChange,value:u,fullWidth:!0}),n===`video`&&(0,F.jsxs)(OY,{children:[(0,F.jsx)(vY,{children:`Video Properties`}),(0,F.jsx)(oJ,{autoFocus:!0,margin:`dense`,id:`width`,label:`Width`,type:`number`,placeholder:`Width`,value:l,onChange:this.changeHandler(`width`)}),(0,F.jsx)(oJ,{autoFocus:!0,margin:`dense`,id:`height`,label:`Height`,type:`number`,placeholder:`Height`,value:o,onChange:this.changeHandler(`height`)})]}),f&&(0,F.jsx)(`iframe`,{width:l,height:o,src:f,frameBorder:`0`,allow:`accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture`,allowFullScreen:!0}),n===`video`&&(f||p)&&!s&&(0,F.jsx)(P.Fragment,{children:(0,F.jsxs)(OY,{children:[(0,F.jsx)(oJ,{autoFocus:!0,margin:`dense`,id:`starts`,label:`Starts`,type:`number`,placeholder:`Starts`,value:c,onChange:this.changeHandler(`starts`)}),g&&(0,F.jsx)(oJ,{autoFocus:!0,margin:`dense`,id:`ends`,label:`Ends`,type:`number`,placeholder:`Ends`,value:a,onChange:this.changeHandler(`ends`)})]})})]}),v&&(0,F.jsx)(AY,{children:(0,F.jsxs)(`div`,{children:[h.url?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(kY,{children:[(0,F.jsx)(`audio`,{controls:`controls`,controlsList:`nodownload`,children:(0,F.jsx)(`source`,{type:d,src:h.url})}),(0,F.jsx)(NY,{"aria-label":`delete`,onClick:this.handleRemoveFile,children:(0,F.jsx)(dR,{})})]}),!h.scheduled&&h.loading?(0,F.jsx)(gG,{variant:`subheading`,children:`Loading...`}):null,h.scheduled?(0,F.jsx)(gG,{variant:`subheading`,children:`Waiting for Upload to finish, then inserting item...`}):null]}):h.loading?null:(0,F.jsx)(jY,{accept:`audio/*`,onChange:this.handleUploadFile,type:`file`}),!!h.error&&(0,F.jsx)(MY,{variant:`caption`,children:h.error})]})})]})}),(0,F.jsxs)(uJ,{children:[(0,F.jsx)(ff,{onClick:()=>this.handleDone(!1),color:`primary`,children:`Cancel`}),(0,F.jsx)(ff,{disabled:y,onClick:()=>this.handleDone(!0),color:`primary`,children:r?`Update`:`Insert`})]})]})}},FY=R(`span`)(({theme:e})=>({position:`relative`,bottom:`5px`,left:0,width:`100%`,background:e.palette.common.white,display:`inline-flex`,padding:`5px`,boxShadow:`0px 4px 4px rgba(0, 0, 0, 0.25)`})),IY=R(`span`)(({theme:e})=>({cursor:`pointer`,flex:3,border:`solid ${e.palette.common.black}`,textAlign:`right`,borderWidth:`0 2px 0 0`,marginRight:`5px`,paddingRight:`5px`})),LY=R(`span`)({cursor:`pointer`}),RY=class extends P.Component{static propTypes={onEdit:v.func,hideEdit:v.bool,onRemove:v.func};render(){let{hideEdit:e,onEdit:t,onRemove:n}=this.props;return(0,F.jsxs)(FY,{children:[e?null:(0,F.jsx)(IY,{onClick:t,children:`Edit Settings`}),(0,F.jsx)(LY,{onClick:n,children:`Remove`})]})}},zY=wO.create({name:`media`,group:`inline`,inline:!0,atom:!0,addAttributes(){return{type:{default:`video`},src:{default:null},width:{default:null},height:{default:null},title:{default:null},starts:{default:null},ends:{default:null},editing:{default:!1},tag:{default:`iframe`},url:{default:null}}},parseHTML(){return[{tag:`iframe[data-type="video"]`,getAttrs:e=>({type:`video`,tag:`iframe`,src:e.getAttribute(`src`),width:e.getAttribute(`width`),height:e.getAttribute(`height`),title:e.dataset.title,starts:e.dataset.starts,ends:e.dataset.ends,url:e.dataset.url})},{tag:`audio`,getAttrs:e=>({type:`audio`,tag:`audio`,src:e.querySelector(`source`)?.getAttribute(`src`)})}]},renderHTML({HTMLAttributes:e}){let{tag:t,src:n,width:r,height:i}=e;return t===`audio`?[`audio`,{controls:`controls`,controlsList:`nodownload`},[`source`,{src:n,type:`audio/mp3`}]]:[`iframe`,nE({"data-type":`video`,frameborder:`0`,allow:`accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture`,allowfullscreen:``,src:n},r?{width:r}:{},i?{height:i}:{})]},addCommands(){return{insertMedia:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e}),updateMedia:e=>({commands:t})=>t.updateAttributes(this.name,e)}},addNodeView(){return iA(e=>(0,F.jsx)(HY,{...e,options:this.options}))}}),BY=()=>{document.querySelectorAll(`.insert-media-dialog`).forEach(e=>e.remove())},VY=e=>{let t=document.createElement(`div`),{type:n,callback:r,options:i,...a}=e,o=document.body.style.overflow;BY(),t.className=`insert-media-dialog`,document.body.style.overflow=`hidden`;let s=(e,n)=>{r(e,n),t.remove(),document.body.style.overflow=o},c=(0,F.jsx)(PY,{...a,uploadSoundSupport:i.uploadSoundSupport,type:n,disablePortal:!0,open:!0,handleClose:s});Ms.render(c,t),document.body.appendChild(t)};function HY({editor:e,node:t,updateAttributes:n,deleteNode:r,options:i}){let{type:a,src:o,width:s,height:c,tag:l}=t.attrs;return(0,P.useEffect)(()=>{o||VY({...t.attrs,options:i,edit:!0,callback:(t,i)=>{t?n(i):r(),e.chain().focus().run()}})},[]),(0,F.jsxs)(Wk,{"data-type":a,style:{width:s,height:c},children:[l===`audio`?(0,F.jsx)(`audio`,{controls:!0,controlsList:`nodownload`,children:(0,F.jsx)(`source`,{type:`audio/mp3`,src:o})}):(0,F.jsx)(`iframe`,{src:o,allowFullScreen:!0,frameBorder:`0`,width:s,height:c}),(0,F.jsx)(RY,{onEdit:()=>{VY({...t.attrs,options:i,edit:!0,callback:(t,r)=>{t&&n(r),e.chain().focus().run()}})},onRemove:r})]})}function UY(e){return Br(`MuiListItem`,e)}Vr(`MuiListItem`,[`root`,`container`,`dense`,`alignItemsFlexStart`,`divider`,`gutters`,`padding`,`secondaryAction`]);var WY=Vr(`MuiListItemButton`,[`root`,`focusVisible`,`dense`,`alignItemsFlexStart`,`disabled`,`divider`,`gutters`,`selected`]);function GY(e){return Br(`MuiListItemSecondaryAction`,e)}Vr(`MuiListItemSecondaryAction`,[`root`,`disableGutters`]);var KY=e=>{let{disableGutters:t,classes:n}=e;return ca({root:[`root`,t&&`disableGutters`]},GY,n)},qY=R(`div`,{name:`MuiListItemSecondaryAction`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.disableGutters&&t.disableGutters]}})({position:`absolute`,right:16,top:`50%`,transform:`translateY(-50%)`,variants:[{props:({ownerState:e})=>e.disableGutters,style:{right:0}}]}),JY=P.forwardRef(function(e,t){let n=cs({props:e,name:`MuiListItemSecondaryAction`}),{className:r,...i}=n,a=P.useContext(up),o={...n,disableGutters:a.disableGutters},s=KY(o);return(0,F.jsx)(qY,{className:I(s.root,r),ownerState:o,ref:t,...i})});JY.muiName=`ListItemSecondaryAction`;var YY=(e,t)=>{let{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.alignItems===`flex-start`&&t.alignItemsFlexStart,n.divider&&t.divider,!n.disableGutters&&t.gutters,!n.disablePadding&&t.padding,n.hasSecondaryAction&&t.secondaryAction]},XY=e=>{let{alignItems:t,classes:n,dense:r,disableGutters:i,disablePadding:a,divider:o,hasSecondaryAction:s}=e;return ca({root:[`root`,r&&`dense`,!i&&`gutters`,!a&&`padding`,o&&`divider`,t===`flex-start`&&`alignItemsFlexStart`,s&&`secondaryAction`],container:[`container`],secondaryAction:[`secondaryAction`]},UY,n)},ZY=R(`div`,{name:`MuiListItem`,slot:`Root`,overridesResolver:YY})(Nc(({theme:e})=>({display:`flex`,justifyContent:`flex-start`,alignItems:`center`,position:`relative`,textDecoration:`none`,width:`100%`,boxSizing:`border-box`,textAlign:`left`,variants:[{props:({ownerState:e})=>!e.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:e})=>!e.disablePadding&&e.dense,style:{paddingTop:4,paddingBottom:4}},{props:({ownerState:e})=>!e.disablePadding&&!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>!e.disablePadding&&!!e.secondaryAction,style:{paddingRight:48}},{props:({ownerState:e})=>!!e.secondaryAction,style:{[`& > .${WY.root}`]:{paddingRight:48}}},{props:{alignItems:`flex-start`},style:{alignItems:`flex-start`}},{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:`padding-box`}},{props:({ownerState:e})=>e.button,style:{transition:e.transitions.create(`background-color`,{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:`none`,backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:`transparent`}}}},{props:({ownerState:e})=>e.hasSecondaryAction,style:{paddingRight:48}}]}))),QY=R(`li`,{name:`MuiListItem`,slot:`Container`})({position:`relative`}),$Y=P.forwardRef(function(e,t){let n=cs({props:e,name:`MuiListItem`}),{alignItems:r=`center`,children:i,className:a,component:o,components:s={},componentsProps:c={},ContainerComponent:l=`li`,ContainerProps:{className:u,...d}={},dense:f=!1,disableGutters:p=!1,disablePadding:m=!1,divider:h=!1,secondaryAction:g,slotProps:_={},slots:v={},...y}=n,b=P.useContext(up),x=P.useMemo(()=>({dense:f||b.dense||!1,alignItems:r,disableGutters:p}),[r,b.dense,f,p]),S=P.useRef(null),C=P.Children.toArray(i),w=C.length&&hl(C[C.length-1],[`ListItemSecondaryAction`]),T={...n,alignItems:r,dense:x.dense,disableGutters:p,disablePadding:m,divider:h,hasSecondaryAction:w},E=XY(T),D=rc(S,t),[O,k]=zc(`secondaryAction`,{elementType:JY,externalForwardedProps:{slots:v,slotProps:_},ownerState:T,className:E.secondaryAction}),A=v.root||s.Root||ZY,j=_.root||c.root||{},M={className:I(E.root,j.className,a),...y},ee=o||`li`;return w?(ee=!M.component&&!o?`div`:ee,l===`li`&&(ee===`li`?ee=`div`:M.component===`li`&&(M.component=`div`)),(0,F.jsx)(up.Provider,{value:x,children:(0,F.jsxs)(QY,{as:l,className:I(E.container,u),ref:D,ownerState:T,...d,children:[(0,F.jsx)(A,{...j,...!rs(A)&&{as:ee,ownerState:{...T,...j.ownerState}},...M,children:C}),C.pop()]})})):(0,F.jsx)(up.Provider,{value:x,children:(0,F.jsxs)(A,{...j,as:ee,ref:D,...!rs(A)&&{ownerState:{...T,...j.ownerState}},...M,children:[C,g&&(0,F.jsx)(O,{...k,children:g})]})})}),eX=()=>{document.querySelectorAll(`.insert-css-dialog`).forEach(e=>e.remove())},tX=({editor:e,callback:t,opts:n,selectedText:r,parentNode:i})=>{let a=e.options.element,o=document.createElement(`div`),{selection:s}=e.state;eX(),o.className=`insert-css-dialog`;let c=!1,l=e=>{if(c){let t=o.contains(e.target)||void 0,n=a.contains(e.target);t||n||u()}else c=!0},u=()=>{t(void 0,!0),o.remove(),document.body.removeEventListener(`click`,l)},d=e=>{t(e,!0),o.remove(),document.body.removeEventListener(`click`,l)},f=i?.attrs.class,p=e=>{let t=`<span class="${e}">${r}</span>`;if(i){let e=`span`;i?.object===`inline`&&(e=`span`),i?.object===`block`&&(e=`div`),t=`<${e} class="${f}">${i.text.slice(0,s.$anchor.textOffset)}${t}${i.text.slice(s.$head.textOffset)}</${e}>`}return t},m=(0,F.jsxs)(`div`,{style:{background:`white`,height:500,padding:20,overflow:`hidden`,display:`flex`,flexFlow:`column`},children:[(0,F.jsx)(`h2`,{children:`Please choose a css class`}),f&&(0,F.jsxs)(`div`,{children:[`The current parent has this class `,f]}),(0,F.jsx)(pp,{component:`nav`,style:{overflow:`scroll`},children:n.names.map((e,t)=>(0,F.jsxs)($Y,{button:!0,onClick:()=>d(e),children:[(0,F.jsx)(`div`,{style:{marginRight:20},children:e}),(0,F.jsx)(`div`,{dangerouslySetInnerHTML:{__html:p(e)}})]},`rule-${t}`))})]});Ms.render(m,o,()=>{let t=e.view.nodeDOM(e.state.selection.from)?.parentNode;if(t){let e=a.parentElement.parentElement.parentElement.getBoundingClientRect(),n=t.getBoundingClientRect();a.parentElement.parentElement.parentElement.appendChild(o),o.style.maxWidth=`500px`,o.style.position=`absolute`,o.style.top=0,o.style.zIndex=99999;let r=`${n.left+Math.abs(e.left)+t.offsetWidth+10}px`,i=`${n.x}px`;o.style.left=r;let s=o.offsetWidth;o.style.left=`unset`,o.style.right=i;let c=o.offsetWidth;o.style.left=`unset`,o.style.right=`unset`,s>=c?o.style.left=r:o.style.right=i,document.body.addEventListener(`click`,l)}})},nX=qD.create({name:`cssmark`,addOptions(){return{classes:[]}},addAttributes(){return{class:{default:null,parseHTML:e=>e.getAttribute(`class`),renderHTML:e=>e.class?{class:e.class}:{}}}},parseHTML(){return[{tag:`span[class]`,getAttrs:e=>{let t=e.getAttribute(`class`)||``;if(!t)return!1;if((this.options&&this.options.classes||[]).length>0){let e=this.options.classes.find(e=>t.includes(e));return e?{class:e}:!1}return{class:t}}}]},renderHTML({HTMLAttributes:e}){return[`span`,nE(e),0]},addCommands(){return{setCSSClass:e=>({commands:t})=>t.setMark(this.name,{class:e}),unsetCSSClass:()=>({commands:e})=>e.unsetMark(this.name),openCSSClassDialog:()=>({editor:e})=>{tX({editor:e,selectedText:e.state.doc.textBetween(e.state.selection.from,e.state.selection.to),parentNode:e.state.selection.$from.nodeAfter,opts:this.options.extraCSSRules,callback:t=>{t&&e.chain().focus().setCSSClass(t).run()}})}}}}),rX=LN.extend({content:`(div | paragraph | heading | bulletList | orderedList | blockquote | codeBlock | horizontalRule | image | imageUploadNode)+`}),iX=wO.create({name:`headingParagraph`,group:`block`,content:`inline*`,defining:!0,addAttributes(){return{"data-heading":{default:`heading1`,parseHTML:e=>e.getAttribute(`data-heading`),renderHTML:e=>({"data-heading":e[`data-heading`]})}}},parseHTML(){return[{tag:`p[data-heading]`}]},renderHTML({HTMLAttributes:e}){return[`p`,nE(e),0]},addCommands(){return{toggleHeadingParagraph:()=>({commands:e,editor:t})=>t.isActive(`headingParagraph`)?e.setNode(`paragraph`):e.setNode(`headingParagraph`,{"data-heading":`heading1`})}}}),aX=e=>{if(!e)return;let t=/^calc\((.*)\)$/;if(typeof e==`string`){if(e.endsWith(`%`))return;if(e.endsWith(`px`)||e.endsWith(`vh`)||e.endsWith(`vw`)||e.endsWith(`ch`)||e.endsWith(`em`)||e.match(t))return e;let n=parseInt(e,10);return Number.isNaN(n)?n:`${n}px`}if(typeof e==`number`)return`${e}px`},oX=ml((0,F.jsx)(`path`,{d:`M15.6 10.79c.97-.67 1.65-1.77 1.65-2.79 0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79 0-1.52-.86-2.82-2.15-3.42M10 6.5h3c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-3zm3.5 9H10v-3h3.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5`}),`FormatBold`),sX=ml((0,F.jsx)(`path`,{d:`M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4z`}),`FormatItalic`),cX=ml((0,F.jsx)(`path`,{d:`M10 19h4v-3h-4zM5 4v3h5v3h4V7h5V4zM3 14h18v-2H3z`}),`FormatStrikethrough`),lX=ml((0,F.jsx)(`path`,{d:`M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6z`}),`Code`),uX=ml((0,F.jsx)(`path`,{d:`M20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2M8 20H4v-4h4zm0-6H4v-4h4zm0-6H4V4h4zm6 12h-4v-4h4zm0-6h-4v-4h4zm0-6h-4V4h4zm6 12h-4v-4h4zm0-6h-4v-4h4zm0-6h-4V4h4z`}),`GridOn`),dX=ml((0,F.jsx)(`path`,{d:`M4 10.5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5m0-6c-.83 0-1.5.67-1.5 1.5S3.17 7.5 4 7.5 5.5 6.83 5.5 6 4.83 4.5 4 4.5m0 12c-.83 0-1.5.68-1.5 1.5s.68 1.5 1.5 1.5 1.5-.68 1.5-1.5-.67-1.5-1.5-1.5M7 19h14v-2H7zm0-6h14v-2H7zm0-8v2h14V5z`}),`FormatListBulleted`),fX=ml((0,F.jsx)(`path`,{d:`M2 17h2v.5H3v1h1v.5H2v1h3v-4H2zm1-9h1V4H2v1h1zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2zm5-6v2h14V5zm0 14h14v-2H7zm0-6h14v-2H7z`}),`FormatListNumbered`),pX=ml((0,F.jsx)(`path`,{d:`M12 17c3.31 0 6-2.69 6-6V3h-2.5v8c0 1.93-1.57 3.5-3.5 3.5S8.5 12.93 8.5 11V3H6v8c0 3.31 2.69 6 6 6m-7 2v2h14v-2z`}),`FormatUnderlined`),mX=ml((0,F.jsx)(`path`,{d:`M18 4H6v2l6.5 6L6 18v2h12v-3h-7l5-5-5-5h7z`}),`Functions`),hX=ml((0,F.jsx)(`path`,{d:`M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2M8.5 13.5l2.5 3.01L14.5 12l4.5 6H5z`}),`Image`),gX=ml((0,F.jsx)(`path`,{d:`M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7z`}),`Redo`),_X=ml((0,F.jsx)(`path`,{d:`M6 17h3l2-4V7H5v6h3zm8 0h3l2-4V7h-6v6h3z`}),`FormatQuote`),vX=ml((0,F.jsx)(`path`,{d:`M18 3v2h-2V3H8v2H6V3H4v18h2v-2h2v2h8v-2h2v2h2V3zM8 17H6v-2h2zm0-4H6v-2h2zm0-4H6V7h2zm10 8h-2v-2h2zm0-4h-2v-2h2zm0-4h-2V7h2z`}),`Theaters`),yX=ml((0,F.jsx)(`path`,{d:`M3 9v6h4l5 5V4L7 9zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02M14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77`}),`VolumeUp`),bX=ml((0,F.jsx)(`path`,{d:`M3 3v18h18V3zm8 16H5v-6h6zm0-8H5V5h6zm8 8h-6v-6h6zm0-8h-6V5h6z`}),`BorderAll`),xX=R(`div`)(({theme:e})=>({fontFamily:`Cerebri Sans !important`,fontSize:e.typography.fontSize,fontWeight:`bold`,lineHeight:`14px`,position:`relative`,top:`7px`,width:`110px`,height:`28px`,whiteSpace:`nowrap`})),SX=()=>(0,F.jsx)(xX,{children:`+ Response Area`}),CX={characters:[[`á`,`é`,`í`,`ó`,`ú`],[`Á`,`É`,`Í`,`Ó`,`Ú`],[`—`,`«`,`»`,`ñ`,`ü`],[`-`,`¿`,`¡`,`Ñ`,`Ü`]]},wX={hasPreview:!0,characters:[[{unicode:`U+00A2`,description:`CENT SIGN`,write:`¢`,label:`¢`},{unicode:`U+00BF`,description:`INVERTED QUESTION MARK`,write:`¿`,label:`¿`},{unicode:`U+00B4`,description:`ACUTE ACCENT`,write:`´`,label:`´`,extraProps:{style:{gridRow:`span 2`}}},{unicode:`U+00E1`,description:`LATIN SMALL LETTER A WITH ACUTE`,write:`á`,label:`á`},{unicode:`U+00E9`,description:`LATIN SMALL LETTER E WITH ACUTE`,write:`é`,label:`é`},{unicode:`U+00ED`,description:`LATIN SMALL LETTER I WITH ACUTE`,write:`í`,label:`í`},{unicode:`U+00F3`,description:`LATIN SMALL LETTER O WITH ACUTE`,write:`ó`,label:`ó`},{unicode:`U+00FA`,description:`LATIN SMALL LETTER U WITH ACUTE`,write:`ú`,label:`ú`},{unicode:`U+00F1`,description:`LATIN SMALL LETTER N WITH TILDE`,write:`ñ`,label:`ñ`}],[{unicode:`U+20AC`,description:`EURO SIGN`,write:`€`,label:`€`},{unicode:`U+00A1`,description:`INVERTED EXCLAMATION MARK`,write:`¡`,label:`¡`},{unicode:`U+00C1`,description:`LATIN CAPITAL LETTER A WITH ACUTE`,write:`Á`,label:`Á`},{unicode:`U+00C9`,description:`LATIN CAPITAL LETTER E WITH ACUTE`,write:`É`,label:`É`},{unicode:`U+00CD`,description:`LATIN CAPITAL LETTER I WITH ACUTE`,write:`Í`,label:`Í`},{unicode:`U+00D3`,description:`LATIN CAPITAL LETTER O WITH ACUTE`,write:`Ó`,label:`Ó`},{unicode:`U+00DA`,description:`LATIN CAPITAL LETTER U WITH ACUTE`,write:`Ú`,label:`Ú`},{unicode:`U+00D1`,description:`LATIN CAPITAL LETTER N WITH TILDE`,write:`Ñ`,label:`Ñ`}],[{unicode:`U+00A3`,description:`POUND SIGN`,write:`£`,label:`£`},{unicode:`U+00AB`,description:`LEFT-POINTING DOUBLE ANGLE QUOTATION MARK`,write:`«`,label:`«`},{unicode:`U+005E`,description:`CIRCUMFLEX ACCENT`,write:`^`,label:`^`,extraProps:{style:{gridRow:`span 2`}}},{unicode:`U+00E2`,description:`LATIN SMALL LETTER A WITH CIRCUMFLEX`,write:`â`,label:`â`},{unicode:`U+00EA`,description:`LATIN SMALL LETTER E WITH CIRCUMFLEX`,write:`ê`,label:`ê`},{unicode:`U+00EE`,description:`LATIN SMALL LETTER I WITH CIRCUMFLEX`,write:`î`,label:`î`},{unicode:`U+00F4`,description:`LATIN SMALL LETTER O WITH CIRCUMFLEX`,write:`ô`,label:`ô`},{unicode:`U+00FB`,description:`LATIN SMALL LETTER U WITH CIRCUMFLEX`,write:`û`,label:`û`},{unicode:`U+00E7`,description:`LATIN SMALL LETTER C WITH CEDILLA`,write:`ç`,label:`ç`}],[{unicode:`U+00A5`,description:`YEN SIGN`,write:`¥`,label:`¥`},{unicode:`U+00BB`,description:`RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK`,write:`»`,label:`»`},{unicode:`U+00C2`,description:`LATIN CAPITAL LETTER A WITH CIRCUMFLEX`,write:`Â`,label:`Â`},{unicode:`U+00CA`,description:`LATIN CAPITAL LETTER E WITH CIRCUMFLEX`,write:`Ê`,label:`Ê`},{unicode:`U+00CE`,description:`LATIN CAPITAL LETTER I WITH CIRCUMFLEX`,write:`Î`,label:`Î`},{unicode:`U+00D4`,description:`LATIN CAPITAL LETTER O WITH CIRCUMFLEX`,write:`Ô`,label:`Ô`},{unicode:`U+00DB`,description:`LATIN CAPITAL LETTER U WITH CIRCUMFLEX`,write:`Û`,label:`Û`},{unicode:`U+00C7`,description:`LATIN CAPITAL LETTER C WITH CEDILLA`,write:`Ç`,label:`Ç`}],[{unicode:`U+200A`,description:`HAIR SPACE`,write:String.fromCodePoint(`0x200A`),label:` `},{unicode:`U+00A7`,description:`SECTION SIGN`,write:`§`,label:`§`},{unicode:`U+00A8`,description:`DIAERESIS`,write:`¨`,label:`¨`,extraProps:{style:{gridRow:`span 2`}}},{unicode:`U+00E4`,description:`LATIN SMALL LETTER A WITH DIAERESIS`,write:`ä`,label:`ä`},{unicode:`U+00EB`,description:`LATIN SMALL LETTER E WITH DIAERESIS`,write:`ë`,label:`ë`},{unicode:`U+00EF`,description:`LATIN SMALL LETTER I WITH DIAERESIS`,write:`ï`,label:`ï`},{unicode:`U+00F6`,description:`LATIN SMALL LETTER O WITH DIAERESIS`,write:`ö`,label:`ö`},{unicode:`U+00FC`,description:`LATIN SMALL LETTER U WITH DIAERESIS`,write:`ü`,label:`ü`},{unicode:`U+00DF`,description:`LATIN SMALL LETTER SHARP S`,write:`ß`,label:`ß`}],[{unicode:`U+2009`,description:`THIN SPACE`,write:String.fromCodePoint(`0x2009`),label:` `},{unicode:`U+2026`,description:`HORIZONTAL ELLIPSIS`,write:`…`,label:`…`},{unicode:`U+00C4`,description:`LATIN CAPITAL LETTER A WITH DIAERESIS`,write:`Ä`,label:`Ä`},{unicode:`U+00CB`,description:`LATIN CAPITAL LETTER E WITH DIAERESIS`,write:`Ë`,label:`Ë`},{unicode:`U+00CF`,description:`LATIN CAPITAL LETTER I WITH DIAERESIS`,write:`Ï`,label:`Ï`},{unicode:`U+00D6`,description:`LATIN CAPITAL LETTER O WITH DIAERESIS`,write:`Ö`,label:`Ö`},{unicode:`U+00DC`,description:`LATIN CAPITAL LETTER U WITH DIAERESIS`,write:`Ü`,label:`Ü`},{unicode:`U+2212`,description:`MINUS SIGN`,write:`−`,label:`−`}],[{unicode:`U+00A0`,description:`NO-BREAK SPACE`,write:String.fromCodePoint(`0x00A0`),label:` `},{unicode:`U+2022`,description:`BULLET`,write:`•`,label:`•`},{unicode:`U+0060`,description:`GRAVE ACCENT`,write:"`",label:"`",extraProps:{style:{gridRow:`span 2`}}},{unicode:`U+00E0`,description:`LATIN SMALL LETTER A WITH GRAVE`,write:`à`,label:`à`},{unicode:`U+00E8`,description:`LATIN SMALL LETTER E WITH GRAVE`,write:`è`,label:`è`},{unicode:`U+00EC`,description:`LATIN SMALL LETTER I WITH GRAVE`,write:`ì`,label:`ì`},{unicode:`U+00F2`,description:`LATIN SMALL LETTER O WITH GRAVE`,write:`ò`,label:`ò`},{unicode:`U+00F9`,description:`LATIN SMALL LETTER U WITH GRAVE`,write:`ù`,label:`ù`},{unicode:`U+2013`,description:`EN DASH`,write:`–`,label:`–`}],[{unicode:`U+2003`,description:`EM SPACE`,write:String.fromCodePoint(`0x2003`),label:` `},{unicode:`U+25E6`,description:`WHITE BULLET`,write:`◦`,label:`◦`},{unicode:`U+00C0`,description:`LATIN CAPITAL LETTER A WITH GRAVE`,write:`À`,label:`À`},{unicode:`U+00C8`,description:`LATIN CAPITAL LETTER E WITH GRAVE`,write:`È`,label:`È`},{unicode:`U+00CC`,description:`LATIN CAPITAL LETTER I WITH GRAVE`,write:`Ì`,label:`Ì`},{unicode:`U+00D2`,description:`LATIN CAPITAL LETTER O WITH GRAVE`,write:`Ò`,label:`Ò`},{unicode:`U+00D9`,description:`LATIN CAPITAL LETTER U WITH GRAVE`,write:`Ù`,label:`Ù`},{unicode:`U+2014`,description:`EM DASH`,write:`—`,label:`—`}]]},TX=()=>(0,F.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 66 66`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,focusable:`false`,children:(0,F.jsx)(`path`,{d:`M42.1875 4.75C42.1875 7.38672 39.9902 9.4375 37.5 9.4375H4.6875C2.05078 9.4375 0 7.38672 0 4.75C0 2.25977 2.05078 0.0625 4.6875 0.0625H37.5C39.9902 0.0625 42.1875 2.25977 42.1875 4.75ZM42.1875 42.25C42.1875 44.8867 39.9902 46.9375 37.5 46.9375H4.6875C2.05078 46.9375 0 44.8867 0 42.25C0 39.7598 2.05078 37.5625 4.6875 37.5625H37.5C39.9902 37.5625 42.1875 39.7598 42.1875 42.25ZM0 23.5C0 21.0098 2.05078 18.8125 4.6875 18.8125H60.9375C63.4277 18.8125 65.625 21.0098 65.625 23.5C65.625 26.1367 63.4277 28.1875 60.9375 28.1875H4.6875C2.05078 28.1875 0 26.1367 0 23.5ZM65.625 61C65.625 63.6367 63.4277 65.6875 60.9375 65.6875H4.6875C2.05078 65.6875 0 63.6367 0 61C0 58.5098 2.05078 56.3125 4.6875 56.3125H60.9375C63.4277 56.3125 65.625 58.5098 65.625 61Z`,fill:`currentColor`})}),EX=()=>(0,F.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 66 66`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,focusable:`false`,children:(0,F.jsx)(`path`,{d:`M65.625 4.75C65.625 7.38672 63.4277 9.4375 60.9375 9.4375H28.125C25.4883 9.4375 23.4375 7.38672 23.4375 4.75C23.4375 2.25977 25.4883 0.0625 28.125 0.0625H60.9375C63.4277 0.0625 65.625 2.25977 65.625 4.75ZM65.625 42.25C65.625 44.8867 63.4277 46.9375 60.9375 46.9375H28.125C25.4883 46.9375 23.4375 44.8867 23.4375 42.25C23.4375 39.7598 25.4883 37.5625 28.125 37.5625H60.9375C63.4277 37.5625 65.625 39.7598 65.625 42.25ZM0 23.5C0 21.0098 2.05078 18.8125 4.6875 18.8125H60.9375C63.4277 18.8125 65.625 21.0098 65.625 23.5C65.625 26.1367 63.4277 28.1875 60.9375 28.1875H4.6875C2.05078 28.1875 0 26.1367 0 23.5ZM65.625 61C65.625 63.6367 63.4277 65.6875 60.9375 65.6875H4.6875C2.05078 65.6875 0 63.6367 0 61C0 58.5098 2.05078 56.3125 4.6875 56.3125H60.9375C63.4277 56.3125 65.625 58.5098 65.625 61Z`,fill:`currentColor`})}),DX=()=>(0,F.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 66 66`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,focusable:`false`,children:(0,F.jsx)(`path`,{d:`M51.5625 4.75C51.5625 7.38672 49.3652 9.4375 46.875 9.4375H18.75C16.1133 9.4375 14.0625 7.38672 14.0625 4.75C14.0625 2.25977 16.1133 0.0625 18.75 0.0625H46.875C49.3652 0.0625 51.5625 2.25977 51.5625 4.75ZM65.625 23.5C65.625 26.1367 63.4277 28.1875 60.9375 28.1875H4.6875C2.05078 28.1875 0 26.1367 0 23.5C0 21.0098 2.05078 18.8125 4.6875 18.8125H60.9375C63.4277 18.8125 65.625 21.0098 65.625 23.5ZM0 61C0 58.5098 2.05078 56.3125 4.6875 56.3125H60.9375C63.4277 56.3125 65.625 58.5098 65.625 61C65.625 63.6367 63.4277 65.6875 60.9375 65.6875H4.6875C2.05078 65.6875 0 63.6367 0 61ZM51.5625 42.25C51.5625 44.8867 49.3652 46.9375 46.875 46.9375H18.75C16.1133 46.9375 14.0625 44.8867 14.0625 42.25C14.0625 39.7598 16.1133 37.5625 18.75 37.5625H46.875C49.3652 37.5625 51.5625 39.7598 51.5625 42.25Z`,fill:`currentColor`})}),OX=()=>(0,F.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 66 66`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,focusable:`false`,children:(0,F.jsx)(`path`,{d:`M65.625 4.75C65.625 7.38672 63.4277 9.4375 60.9375 9.4375H4.6875C2.05078 9.4375 0 7.38672 0 4.75C0 2.25977 2.05078 0.0625 4.6875 0.0625H60.9375C63.4277 0.0625 65.625 2.25977 65.625 4.75ZM65.625 42.25C65.625 44.8867 63.4277 46.9375 60.9375 46.9375H4.6875C2.05078 46.9375 0 44.8867 0 42.25C0 39.7598 2.05078 37.5625 4.6875 37.5625H60.9375C63.4277 37.5625 65.625 39.7598 65.625 42.25ZM0 23.5C0 21.0098 2.05078 18.8125 4.6875 18.8125H60.9375C63.4277 18.8125 65.625 21.0098 65.625 23.5C65.625 26.1367 63.4277 28.1875 60.9375 28.1875H4.6875C2.05078 28.1875 0 26.1367 0 23.5ZM65.625 61C65.625 63.6367 63.4277 65.6875 60.9375 65.6875H4.6875C2.05078 65.6875 0 63.6367 0 61C0 58.5098 2.05078 56.3125 4.6875 56.3125H60.9375C63.4277 56.3125 65.625 58.5098 65.625 61Z`,fill:`currentColor`})}),kX=({editor:e,onChange:t})=>{let[n,r]=(0,P.useState)(!1),i;switch(!0){case e.isActive({textAlign:`right`}):i=(0,F.jsx)(EX,{});break;case e.isActive({textAlign:`center`}):i=(0,F.jsx)(DX,{});break;case e.isActive({textAlign:`justify`}):i=(0,F.jsx)(OX,{});break;default:i=(0,F.jsx)(TX,{});break}let a=t=>{let n=t.currentTarget?.getAttribute(`value`);n&&e.commands.setTextAlign(n),r(!1)};return(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`},onClick:e=>{e.preventDefault(),e.stopPropagation(),r(!n)},children:[i,(0,F.jsx)(`span`,{style:{marginLeft:`5px`,fontSize:`8px`},"aria-hidden":`true`,children:`▼`})]}),(0,F.jsx)(ad,{in:n,timeout:`auto`,unmountOnExit:!0,style:{position:`absolute`},children:(0,F.jsxs)(pp,{component:`div`,disablePadding:!0,style:{background:`#fff`,display:`flex`,flexDirection:`row`,padding:0},children:[(0,F.jsx)($Y,{button:!0,type:`submit`,value:`left`,"aria-label":`Align text left`,onClick:a,children:(0,F.jsx)(TX,{})}),(0,F.jsx)($Y,{button:!0,type:`submit`,value:`center`,"aria-label":`Align text center`,onClick:a,children:(0,F.jsx)(DX,{})}),(0,F.jsx)($Y,{button:!0,type:`submit`,value:`right`,"aria-label":`Align text right`,onClick:a,children:(0,F.jsx)(EX,{})}),(0,F.jsx)($Y,{button:!0,type:`submit`,value:`justify`,"aria-label":`Justify text`,onClick:a,children:(0,F.jsx)(OX,{})})]})})]})},AX=R(`div`)(({theme:e})=>({fontFamily:`Cerebri Sans, Arial, sans-serif`,fontSize:e.typography.fontSize,fontWeight:`bold`,lineHeight:`14px`,position:`relative`,whiteSpace:`nowrap`})),jX=()=>(0,F.jsx)(AX,{children:`CSS`}),MX=R(`path`)({fill:`grey`,"&:hover":{fill:`black`}}),NX=e=>t=>(0,F.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,version:`1.1`,width:`24`,height:`24`,viewBox:`0 0 24 24`,"aria-hidden":`true`,focusable:`false`,children:(0,F.jsx)(e,{...t})}),PX=NX(e=>(0,F.jsx)(MX,{...e,d:`M22,10A2,2 0 0,1 20,12H4A2,2 0 0,1 2,10V3H4V5H8V3H10V5H14V3H16V5H20V3H22V10M4,10H8V7H4V10M10,10H14V7H10V10M20,10V7H16V10H20M11,14H13V17H16V19H13V22H11V19H8V17H11V14Z`})),FX=NX(e=>(0,F.jsx)(MX,{...e,d:`M9.41,13L12,15.59L14.59,13L16,14.41L13.41,17L16,19.59L14.59,21L12,18.41L9.41,21L8,19.59L10.59,17L8,14.41L9.41,13M22,9A2,2 0 0,1 20,11H4A2,2 0 0,1 2,9V6A2,2 0 0,1 4,4H20A2,2 0 0,1 22,6V9M4,9H8V6H4V9M10,9H14V6H10V9M16,9H20V6H16V9Z`})),IX=NX(e=>(0,F.jsx)(MX,{...e,d:`M11,2A2,2 0 0,1 13,4V20A2,2 0 0,1 11,22H2V2H11M4,10V14H11V10H4M4,16V20H11V16H4M4,4V8H11V4H4M15,11H18V8H20V11H23V13H20V16H18V13H15V11Z`})),LX=NX(e=>(0,F.jsx)(MX,{...e,d:`M4,2H11A2,2 0 0,1 13,4V20A2,2 0 0,1 11,22H4A2,2 0 0,1 2,20V4A2,2 0 0,1 4,2M4,10V14H11V10H4M4,16V20H11V16H4M4,4V8H11V4H4M17.59,12L15,9.41L16.41,8L19,10.59L21.59,8L23,9.41L20.41,12L23,14.59L21.59,16L19,13.41L16.41,16L15,14.59L17.59,12Z`})),RX=NX(e=>(0,F.jsx)(MX,{...e,d:`M15.46,15.88L16.88,14.46L19,16.59L21.12,14.46L22.54,15.88L20.41,18L22.54,20.12L21.12,21.54L19,19.41L16.88,21.54L15.46,20.12L17.59,18L15.46,15.88M4,3H18A2,2 0 0,1 20,5V12.08C18.45,11.82 16.92,12.18 15.68,13H12V17H13.08C12.97,17.68 12.97,18.35 13.08,19H4A2,2 0 0,1 2,17V5A2,2 0 0,1 4,3M4,7V11H10V7H4M12,7V11H18V7H12M4,13V17H10V13H4Z`})),zX=`bottom`,BX=`right`,VX=`left`,HX=`auto`,UX=[`top`,zX,BX,VX],WX=`start`,GX=`clippingParents`,KX=`viewport`,qX=`popper`,JX=`reference`,YX=UX.reduce(function(e,t){return e.concat([t+`-`+WX,t+`-end`])},[]),XX=[].concat(UX,[HX]).reduce(function(e,t){return e.concat([t,t+`-`+WX,t+`-end`])},[]),ZX=[`beforeRead`,`read`,`afterRead`,`beforeMain`,`main`,`afterMain`,`beforeWrite`,`write`,`afterWrite`];function QX(e){return e?(e.nodeName||``).toLowerCase():null}function $X(e){if(e==null)return window;if(e.toString()!==`[object Window]`){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function eZ(e){return e instanceof $X(e).Element||e instanceof Element}function tZ(e){return e instanceof $X(e).HTMLElement||e instanceof HTMLElement}function nZ(e){return typeof ShadowRoot>`u`?!1:e instanceof $X(e).ShadowRoot||e instanceof ShadowRoot}function rZ(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];!tZ(i)||!QX(i)||(Object.assign(i.style,n),Object.keys(r).forEach(function(e){var t=r[e];t===!1?i.removeAttribute(e):i.setAttribute(e,t===!0?``:t)}))})}function iZ(e){var t=e.state,n={popper:{position:t.options.strategy,left:`0`,top:`0`,margin:`0`},arrow:{position:`absolute`},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(e){var r=t.elements[e],i=t.attributes[e]||{},a=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce(function(e,t){return e[t]=``,e},{});!tZ(r)||!QX(r)||(Object.assign(r.style,a),Object.keys(i).forEach(function(e){r.removeAttribute(e)}))})}}var aZ={name:`applyStyles`,enabled:!0,phase:`write`,fn:rZ,effect:iZ,requires:[`computeStyles`]};function oZ(e){return e.split(`-`)[0]}var sZ=Math.max,cZ=Math.min,lZ=Math.round;function uZ(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+`/`+e.version}).join(` `):navigator.userAgent}function dZ(){return!/^((?!chrome|android).)*safari/i.test(uZ())}function fZ(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,a=1;t&&tZ(e)&&(i=e.offsetWidth>0&&lZ(r.width)/e.offsetWidth||1,a=e.offsetHeight>0&&lZ(r.height)/e.offsetHeight||1);var o=(eZ(e)?$X(e):window).visualViewport,s=!dZ()&&n,c=(r.left+(s&&o?o.offsetLeft:0))/i,l=(r.top+(s&&o?o.offsetTop:0))/a,u=r.width/i,d=r.height/a;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c,x:c,y:l}}function pZ(e){var t=fZ(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function mZ(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&nZ(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function hZ(e){return $X(e).getComputedStyle(e)}function gZ(e){return[`table`,`td`,`th`].indexOf(QX(e))>=0}function _Z(e){return((eZ(e)?e.ownerDocument:e.document)||window.document).documentElement}function vZ(e){return QX(e)===`html`?e:e.assignedSlot||e.parentNode||(nZ(e)?e.host:null)||_Z(e)}function yZ(e){return!tZ(e)||hZ(e).position===`fixed`?null:e.offsetParent}function bZ(e){var t=/firefox/i.test(uZ());if(/Trident/i.test(uZ())&&tZ(e)&&hZ(e).position===`fixed`)return null;var n=vZ(e);for(nZ(n)&&(n=n.host);tZ(n)&&[`html`,`body`].indexOf(QX(n))<0;){var r=hZ(n);if(r.transform!==`none`||r.perspective!==`none`||r.contain===`paint`||[`transform`,`perspective`].indexOf(r.willChange)!==-1||t&&r.willChange===`filter`||t&&r.filter&&r.filter!==`none`)return n;n=n.parentNode}return null}function xZ(e){for(var t=$X(e),n=yZ(e);n&&gZ(n)&&hZ(n).position===`static`;)n=yZ(n);return n&&(QX(n)===`html`||QX(n)===`body`&&hZ(n).position===`static`)?t:n||bZ(e)||t}function SZ(e){return[`top`,`bottom`].indexOf(e)>=0?`x`:`y`}function CZ(e,t,n){return sZ(e,cZ(t,n))}function wZ(e,t,n){var r=CZ(e,t,n);return r>n?n:r}function TZ(){return{top:0,right:0,bottom:0,left:0}}function EZ(e){return Object.assign({},TZ(),e)}function DZ(e,t){return t.reduce(function(t,n){return t[n]=e,t},{})}var OZ=function(e,t){return e=typeof e==`function`?e(Object.assign({},t.rects,{placement:t.placement})):e,EZ(typeof e==`number`?DZ(e,UX):e)};function kZ(e){var t,n=e.state,r=e.name,i=e.options,a=n.elements.arrow,o=n.modifiersData.popperOffsets,s=oZ(n.placement),c=SZ(s),l=[`left`,`right`].indexOf(s)>=0?`height`:`width`;if(!(!a||!o)){var u=OZ(i.padding,n),d=pZ(a),f=c===`y`?`top`:VX,p=c===`y`?zX:BX,m=n.rects.reference[l]+n.rects.reference[c]-o[c]-n.rects.popper[l],h=o[c]-n.rects.reference[c],g=xZ(a),_=g?c===`y`?g.clientHeight||0:g.clientWidth||0:0,v=m/2-h/2,y=u[f],b=_-d[l]-u[p],x=_/2-d[l]/2+v,S=CZ(y,x,b),C=c;n.modifiersData[r]=(t={},t[C]=S,t.centerOffset=S-x,t)}}function AZ(e){var t=e.state,n=e.options.element,r=n===void 0?`[data-popper-arrow]`:n;r!=null&&(typeof r==`string`&&(r=t.elements.popper.querySelector(r),!r)||mZ(t.elements.popper,r)&&(t.elements.arrow=r))}var jZ={name:`arrow`,enabled:!0,phase:`main`,fn:kZ,effect:AZ,requires:[`popperOffsets`],requiresIfExists:[`preventOverflow`]};function MZ(e){return e.split(`-`)[1]}var NZ={top:`auto`,right:`auto`,bottom:`auto`,left:`auto`};function PZ(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:lZ(n*i)/i||0,y:lZ(r*i)/i||0}}function FZ(e){var t,n=e.popper,r=e.popperRect,i=e.placement,a=e.variation,o=e.offsets,s=e.position,c=e.gpuAcceleration,l=e.adaptive,u=e.roundOffsets,d=e.isFixed,f=o.x,p=f===void 0?0:f,m=o.y,h=m===void 0?0:m,g=typeof u==`function`?u({x:p,y:h}):{x:p,y:h};p=g.x,h=g.y;var _=o.hasOwnProperty(`x`),v=o.hasOwnProperty(`y`),y=VX,b=`top`,x=window;if(l){var S=xZ(n),C=`clientHeight`,w=`clientWidth`;if(S===$X(n)&&(S=_Z(n),hZ(S).position!==`static`&&s===`absolute`&&(C=`scrollHeight`,w=`scrollWidth`)),S=S,i===`top`||(i===`left`||i===`right`)&&a===`end`){b=zX;var T=d&&S===x&&x.visualViewport?x.visualViewport.height:S[C];h-=T-r.height,h*=c?1:-1}if(i===`left`||(i===`top`||i===`bottom`)&&a===`end`){y=BX;var E=d&&S===x&&x.visualViewport?x.visualViewport.width:S[w];p-=E-r.width,p*=c?1:-1}}var D=Object.assign({position:s},l&&NZ),O=u===!0?PZ({x:p,y:h},$X(n)):{x:p,y:h};if(p=O.x,h=O.y,c){var k;return Object.assign({},D,(k={},k[b]=v?`0`:``,k[y]=_?`0`:``,k.transform=(x.devicePixelRatio||1)<=1?`translate(`+p+`px, `+h+`px)`:`translate3d(`+p+`px, `+h+`px, 0)`,k))}return Object.assign({},D,(t={},t[b]=v?h+`px`:``,t[y]=_?p+`px`:``,t.transform=``,t))}function IZ(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0||r,a=n.adaptive,o=a===void 0||a,s=n.roundOffsets,c=s===void 0||s,l={placement:oZ(t.placement),variation:MZ(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy===`fixed`};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,FZ(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,FZ(Object.assign({},l,{offsets:t.modifiersData.arrow,position:`absolute`,adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}var LZ={name:`computeStyles`,enabled:!0,phase:`beforeWrite`,fn:IZ,data:{}},RZ={passive:!0};function zZ(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,a=i===void 0||i,o=r.resize,s=o===void 0||o,c=$X(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&l.forEach(function(e){e.addEventListener(`scroll`,n.update,RZ)}),s&&c.addEventListener(`resize`,n.update,RZ),function(){a&&l.forEach(function(e){e.removeEventListener(`scroll`,n.update,RZ)}),s&&c.removeEventListener(`resize`,n.update,RZ)}}var BZ={name:`eventListeners`,enabled:!0,phase:`write`,fn:function(){},effect:zZ,data:{}},VZ={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function HZ(e){return e.replace(/left|right|bottom|top/g,function(e){return VZ[e]})}var UZ={start:`end`,end:`start`};function WZ(e){return e.replace(/start|end/g,function(e){return UZ[e]})}function GZ(e){var t=$X(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function KZ(e){return fZ(_Z(e)).left+GZ(e).scrollLeft}function qZ(e,t){var n=$X(e),r=_Z(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;var l=dZ();(l||!l&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}return{width:a,height:o,x:s+KZ(e),y:c}}function JZ(e){var t=_Z(e),n=GZ(e),r=e.ownerDocument?.body,i=sZ(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=sZ(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),o=-n.scrollLeft+KZ(e),s=-n.scrollTop;return hZ(r||t).direction===`rtl`&&(o+=sZ(t.clientWidth,r?r.clientWidth:0)-i),{width:i,height:a,x:o,y:s}}function YZ(e){var t=hZ(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function XZ(e){return[`html`,`body`,`#document`].indexOf(QX(e))>=0?e.ownerDocument.body:tZ(e)&&YZ(e)?e:XZ(vZ(e))}function ZZ(e,t){t===void 0&&(t=[]);var n=XZ(e),r=n===e.ownerDocument?.body,i=$X(n),a=r?[i].concat(i.visualViewport||[],YZ(n)?n:[]):n,o=t.concat(a);return r?o:o.concat(ZZ(vZ(a)))}function QZ(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function $Z(e,t){var n=fZ(e,!1,t===`fixed`);return n.top+=e.clientTop,n.left+=e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function eQ(e,t,n){return t===`viewport`?QZ(qZ(e,n)):eZ(t)?$Z(t,n):QZ(JZ(_Z(e)))}function tQ(e){var t=ZZ(vZ(e)),n=[`absolute`,`fixed`].indexOf(hZ(e).position)>=0&&tZ(e)?xZ(e):e;return eZ(n)?t.filter(function(e){return eZ(e)&&mZ(e,n)&&QX(e)!==`body`}):[]}function nQ(e,t,n,r){var i=t===`clippingParents`?tQ(e):[].concat(t),a=[].concat(i,[n]),o=a[0],s=a.reduce(function(t,n){var i=eQ(e,n,r);return t.top=sZ(i.top,t.top),t.right=cZ(i.right,t.right),t.bottom=cZ(i.bottom,t.bottom),t.left=sZ(i.left,t.left),t},eQ(e,o,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function rQ(e){var t=e.reference,n=e.element,r=e.placement,i=r?oZ(r):null,a=r?MZ(r):null,o=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,c;switch(i){case`top`:c={x:o,y:t.y-n.height};break;case zX:c={x:o,y:t.y+t.height};break;case BX:c={x:t.x+t.width,y:s};break;case VX:c={x:t.x-n.width,y:s};break;default:c={x:t.x,y:t.y}}var l=i?SZ(i):null;if(l!=null){var u=l===`y`?`height`:`width`;switch(a){case WX:c[l]=c[l]-(t[u]/2-n[u]/2);break;case`end`:c[l]=c[l]+(t[u]/2-n[u]/2);break;default:}}return c}function iQ(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,a=n.strategy,o=a===void 0?e.strategy:a,s=n.boundary,c=s===void 0?GX:s,l=n.rootBoundary,u=l===void 0?KX:l,d=n.elementContext,f=d===void 0?qX:d,p=n.altBoundary,m=p!==void 0&&p,h=n.padding,g=h===void 0?0:h,_=EZ(typeof g==`number`?DZ(g,UX):g),v=f===`popper`?JX:qX,y=e.rects.popper,b=e.elements[m?v:f],x=nQ(eZ(b)?b:b.contextElement||_Z(e.elements.popper),c,u,o),S=fZ(e.elements.reference),C=rQ({reference:S,element:y,strategy:`absolute`,placement:i}),w=QZ(Object.assign({},y,C)),T=f===`popper`?w:S,E={top:x.top-T.top+_.top,bottom:T.bottom-x.bottom+_.bottom,left:x.left-T.left+_.left,right:T.right-x.right+_.right},D=e.modifiersData.offset;if(f===`popper`&&D){var O=D[i];Object.keys(E).forEach(function(e){var t=[`right`,`bottom`].indexOf(e)>=0?1:-1,n=[`top`,`bottom`].indexOf(e)>=0?`y`:`x`;E[e]+=O[n]*t})}return E}function aQ(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,a=n.rootBoundary,o=n.padding,s=n.flipVariations,c=n.allowedAutoPlacements,l=c===void 0?XX:c,u=MZ(r),d=u?s?YX:YX.filter(function(e){return MZ(e)===u}):UX,f=d.filter(function(e){return l.indexOf(e)>=0});f.length===0&&(f=d);var p=f.reduce(function(t,n){return t[n]=iQ(e,{placement:n,boundary:i,rootBoundary:a,padding:o})[oZ(n)],t},{});return Object.keys(p).sort(function(e,t){return p[e]-p[t]})}function oQ(e){if(oZ(e)===`auto`)return[];var t=HZ(e);return[WZ(e),t,WZ(t)]}function sQ(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,a=i===void 0||i,o=n.altAxis,s=o===void 0||o,c=n.fallbackPlacements,l=n.padding,u=n.boundary,d=n.rootBoundary,f=n.altBoundary,p=n.flipVariations,m=p===void 0||p,h=n.allowedAutoPlacements,g=t.options.placement,_=oZ(g)===g,v=c||(_||!m?[HZ(g)]:oQ(g)),y=[g].concat(v).reduce(function(e,n){return e.concat(oZ(n)===`auto`?aQ(t,{placement:n,boundary:u,rootBoundary:d,padding:l,flipVariations:m,allowedAutoPlacements:h}):n)},[]),b=t.rects.reference,x=t.rects.popper,S=new Map,C=!0,w=y[0],T=0;T<y.length;T++){var E=y[T],D=oZ(E),O=MZ(E)===WX,k=[`top`,zX].indexOf(D)>=0,A=k?`width`:`height`,j=iQ(t,{placement:E,boundary:u,rootBoundary:d,altBoundary:f,padding:l}),M=k?O?BX:VX:O?zX:`top`;b[A]>x[A]&&(M=HZ(M));var ee=HZ(M),N=[];if(a&&N.push(j[D]<=0),s&&N.push(j[M]<=0,j[ee]<=0),N.every(function(e){return e})){w=E,C=!1;break}S.set(E,N)}if(C)for(var te=m?3:1,ne=function(e){var t=y.find(function(t){var n=S.get(t);if(n)return n.slice(0,e).every(function(e){return e})});if(t)return w=t,`break`},re=te;re>0&&ne(re)!==`break`;re--);t.placement!==w&&(t.modifiersData[r]._skip=!0,t.placement=w,t.reset=!0)}}var cQ={name:`flip`,enabled:!0,phase:`main`,fn:sQ,requiresIfExists:[`offset`],data:{_skip:!1}};function lQ(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function uQ(e){return[`top`,BX,zX,VX].some(function(t){return e[t]>=0})}function dQ(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,a=t.modifiersData.preventOverflow,o=iQ(t,{elementContext:`reference`}),s=iQ(t,{altBoundary:!0}),c=lQ(o,r),l=lQ(s,i,a),u=uQ(c),d=uQ(l);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}var fQ={name:`hide`,enabled:!0,phase:`main`,requiresIfExists:[`preventOverflow`],fn:dQ};function pQ(e,t,n){var r=oZ(e),i=[`left`,`top`].indexOf(r)>=0?-1:1,a=typeof n==`function`?n(Object.assign({},t,{placement:e})):n,o=a[0],s=a[1];return o||=0,s=(s||0)*i,[`left`,`right`].indexOf(r)>=0?{x:s,y:o}:{x:o,y:s}}function mQ(e){var t=e.state,n=e.options,r=e.name,i=n.offset,a=i===void 0?[0,0]:i,o=XX.reduce(function(e,n){return e[n]=pQ(n,t.rects,a),e},{}),s=o[t.placement],c=s.x,l=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=l),t.modifiersData[r]=o}var hQ={name:`offset`,enabled:!0,phase:`main`,requires:[`popperOffsets`],fn:mQ};function gQ(e){var t=e.state,n=e.name;t.modifiersData[n]=rQ({reference:t.rects.reference,element:t.rects.popper,strategy:`absolute`,placement:t.placement})}var _Q={name:`popperOffsets`,enabled:!0,phase:`read`,fn:gQ,data:{}};function vQ(e){return e===`x`?`y`:`x`}function yQ(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,a=i===void 0||i,o=n.altAxis,s=o!==void 0&&o,c=n.boundary,l=n.rootBoundary,u=n.altBoundary,d=n.padding,f=n.tether,p=f===void 0||f,m=n.tetherOffset,h=m===void 0?0:m,g=iQ(t,{boundary:c,rootBoundary:l,padding:d,altBoundary:u}),_=oZ(t.placement),v=MZ(t.placement),y=!v,b=SZ(_),x=vQ(b),S=t.modifiersData.popperOffsets,C=t.rects.reference,w=t.rects.popper,T=typeof h==`function`?h(Object.assign({},t.rects,{placement:t.placement})):h,E=typeof T==`number`?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),D=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,O={x:0,y:0};if(S){if(a){var k=b===`y`?`top`:VX,A=b===`y`?zX:BX,j=b===`y`?`height`:`width`,M=S[b],ee=M+g[k],N=M-g[A],te=p?-w[j]/2:0,ne=v===`start`?C[j]:w[j],re=v===`start`?-w[j]:-C[j],ie=t.elements.arrow,ae=p&&ie?pZ(ie):{width:0,height:0},oe=t.modifiersData[`arrow#persistent`]?t.modifiersData[`arrow#persistent`].padding:TZ(),se=oe[k],ce=oe[A],le=CZ(0,C[j],ae[j]),ue=y?C[j]/2-te-le-se-E.mainAxis:ne-le-se-E.mainAxis,de=y?-C[j]/2+te+le+ce+E.mainAxis:re+le+ce+E.mainAxis,fe=t.elements.arrow&&xZ(t.elements.arrow),pe=fe?b===`y`?fe.clientTop||0:fe.clientLeft||0:0,me=D?.[b]??0,he=M+ue-me-pe,ge=M+de-me,_e=CZ(p?cZ(ee,he):ee,M,p?sZ(N,ge):N);S[b]=_e,O[b]=_e-M}if(s){var ve=b===`x`?`top`:VX,ye=b===`x`?zX:BX,be=S[x],xe=x===`y`?`height`:`width`,Se=be+g[ve],Ce=be-g[ye],we=[`top`,VX].indexOf(_)!==-1,Te=D?.[x]??0,Ee=we?Se:be-C[xe]-w[xe]-Te+E.altAxis,De=we?be+C[xe]+w[xe]-Te-E.altAxis:Ce,Oe=p&&we?wZ(Ee,be,De):CZ(p?Ee:Se,be,p?De:Ce);S[x]=Oe,O[x]=Oe-be}t.modifiersData[r]=O}}var bQ={name:`preventOverflow`,enabled:!0,phase:`main`,fn:yQ,requiresIfExists:[`offset`]};function xQ(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function SQ(e){return e===$X(e)||!tZ(e)?GZ(e):xQ(e)}function Pee(e){var t=e.getBoundingClientRect(),n=lZ(t.width)/e.offsetWidth||1,r=lZ(t.height)/e.offsetHeight||1;return n!==1||r!==1}function CQ(e,t,n){n===void 0&&(n=!1);var r=tZ(t),i=tZ(t)&&Pee(t),a=_Z(t),o=fZ(e,i,n),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&((QX(t)!==`body`||YZ(a))&&(s=SQ(t)),tZ(t)?(c=fZ(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):a&&(c.x=KZ(a))),{x:o.left+s.scrollLeft-c.x,y:o.top+s.scrollTop-c.y,width:o.width,height:o.height}}function wQ(e){var t=new Map,n=new Set,r=[];e.forEach(function(e){t.set(e.name,e)});function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}}),r.push(e)}return e.forEach(function(e){n.has(e.name)||i(e)}),r}function TQ(e){var t=wQ(e);return ZX.reduce(function(e,n){return e.concat(t.filter(function(e){return e.phase===n}))},[])}function EQ(e){var t;return function(){return t||=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})}),t}}function DQ(e){var t=e.reduce(function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e},{});return Object.keys(t).map(function(e){return t[e]})}var OQ={placement:`bottom`,modifiers:[],strategy:`absolute`};function kQ(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(e){return!(e&&typeof e.getBoundingClientRect==`function`)})}function AQ(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,a=i===void 0?OQ:i;return function(e,t,n){n===void 0&&(n=a);var i={placement:`bottom`,orderedModifiers:[],options:Object.assign({},OQ,a),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},o=[],s=!1,c={state:i,setOptions:function(n){var o=typeof n==`function`?n(i.options):n;u(),i.options=Object.assign({},a,i.options,o),i.scrollParents={reference:eZ(e)?ZZ(e):e.contextElement?ZZ(e.contextElement):[],popper:ZZ(t)};var s=TQ(DQ([].concat(r,i.options.modifiers)));return i.orderedModifiers=s.filter(function(e){return e.enabled}),l(),c.update()},forceUpdate:function(){if(!s){var e=i.elements,t=e.reference,n=e.popper;if(kQ(t,n)){i.rects={reference:CQ(t,xZ(n),i.options.strategy===`fixed`),popper:pZ(n)},i.reset=!1,i.placement=i.options.placement,i.orderedModifiers.forEach(function(e){return i.modifiersData[e.name]=Object.assign({},e.data)});for(var r=0;r<i.orderedModifiers.length;r++){if(i.reset===!0){i.reset=!1,r=-1;continue}var a=i.orderedModifiers[r],o=a.fn,l=a.options,u=l===void 0?{}:l,d=a.name;typeof o==`function`&&(i=o({state:i,options:u,name:d,instance:c})||i)}}}},update:EQ(function(){return new Promise(function(e){c.forceUpdate(),e(i)})}),destroy:function(){u(),s=!0}};if(!kQ(e,t))return c;c.setOptions(n).then(function(e){!s&&n.onFirstUpdate&&n.onFirstUpdate(e)});function l(){i.orderedModifiers.forEach(function(e){var t=e.name,n=e.options,r=n===void 0?{}:n,a=e.effect;if(typeof a==`function`){var s=a({state:i,name:t,instance:c,options:r});o.push(s||function(){})}})}function u(){o.forEach(function(e){return e()}),o=[]}return c}}var jQ=AQ({defaultModifiers:[BZ,_Q,LZ,aZ,hQ,cQ,bQ,jZ,fQ]});function MQ(e){return Br(`MuiPopper`,e)}Vr(`MuiPopper`,[`root`]);function NQ(e,t){if(t===`ltr`)return e;switch(e){case`bottom-end`:return`bottom-start`;case`bottom-start`:return`bottom-end`;case`top-end`:return`top-start`;case`top-start`:return`top-end`;default:return e}}function PQ(e){return typeof e==`function`?e():e}function FQ(e){return e.nodeType!==void 0}var IQ=e=>{let{classes:t}=e;return ca({root:[`root`]},MQ,t)},LQ={},RQ=P.forwardRef(function(e,t){let{anchorEl:n,children:r,direction:i,disablePortal:a,modifiers:o,open:s,placement:c,popperOptions:l,popperRef:u,slotProps:d={},slots:f={},TransitionProps:p,ownerState:m,...h}=e,g=P.useRef(null),_=nc(g,t),v=P.useRef(null),y=nc(v,u),b=P.useRef(y);ti(()=>{b.current=y},[y]),P.useImperativeHandle(u,()=>v.current,[]);let x=NQ(c,i),[S,C]=P.useState(x),[w,T]=P.useState(PQ(n));P.useEffect(()=>{v.current&&v.current.forceUpdate()}),P.useEffect(()=>{n&&T(PQ(n))},[n]),ti(()=>{if(!w||!s)return;let e=e=>{C(e.placement)},t=[{name:`preventOverflow`,options:{altBoundary:a}},{name:`flip`,options:{altBoundary:a}},{name:`onUpdate`,enabled:!0,phase:`afterWrite`,fn:({state:t})=>{e(t)}}];o!=null&&(t=t.concat(o)),l&&l.modifiers!=null&&(t=t.concat(l.modifiers));let n=jQ(w,g.current,{placement:x,...l,modifiers:t});b.current(n);let r=g.current;return()=>{if(r){let{style:e}=r,t=e.position,i=e.top,a=e.left,o=e.transform;n.destroy(),e.position=t,e.top=i,e.left=a,e.transform=o}else n.destroy();b.current(null)}},[w,a,o,s,l,x]);let E={placement:S};p!==null&&(E.TransitionProps=p);let D=IQ(e),O=f.root??`div`;return(0,F.jsx)(O,{...lp({elementType:O,externalSlotProps:d.root,externalForwardedProps:h,additionalProps:{role:`tooltip`,ref:_},ownerState:e,className:D.root}),children:typeof r==`function`?r(E):r})}),zQ=R(P.forwardRef(function(e,t){let{anchorEl:n,children:r,container:i,direction:a=`ltr`,disablePortal:o=!1,keepMounted:s=!1,modifiers:c,open:l,placement:u=`bottom`,popperOptions:d=LQ,popperRef:f,style:p,transition:m=!1,slotProps:h={},slots:g={},..._}=e,[v,y]=P.useState(!0),b=()=>{y(!1)},x=()=>{y(!0)};if(!s&&!l&&(!m||v))return null;let S;if(i)S=i;else if(n){let e=PQ(n);S=e&&FQ(e)?ds(e).body:ds(null).body}let C=!l&&s&&(!m||v)?`none`:void 0,w=m?{in:l,onEnter:b,onExited:x}:void 0;return(0,F.jsx)(Mc,{disablePortal:o,container:S,children:(0,F.jsx)(RQ,{anchorEl:n,direction:a,disablePortal:o,modifiers:c,ref:t,open:m?!v:l,placement:u,popperOptions:d,popperRef:f,slotProps:h,slots:g,..._,style:{position:`fixed`,top:0,left:0,display:C,...p},TransitionProps:w,children:r})})}),{name:`MuiPopper`,slot:`Root`})({}),BQ=R(P.forwardRef(function(e,t){let n=Di(),{anchorEl:r,component:i,components:a,componentsProps:o,container:s,disablePortal:c,keepMounted:l,modifiers:u,open:d,placement:f,popperOptions:p,popperRef:m,transition:h,slots:g,slotProps:_,...v}=cs({props:e,name:`MuiPopper`}),y=g?.root??a?.Root,b={anchorEl:r,container:s,disablePortal:c,keepMounted:l,modifiers:u,open:d,placement:f,popperOptions:p,popperRef:m,transition:h,...v};return(0,F.jsx)(zQ,{as:i,direction:n?`rtl`:`ltr`,slots:{root:y},slotProps:_??o,...b,ref:t})}))({background:`#fff`,padding:`10px`,pointerEvents:`none`,zIndex:99999}),VQ=R(gG)({fontSize:50,textAlign:`center`}),HQ=({children:e,...t})=>(0,F.jsx)(BQ,{id:`mouse-over-popover`,open:!0,anchorOrigin:{vertical:`bottom`,horizontal:`left`},transformOrigin:{vertical:`top`,horizontal:`left`},disableRestoreFocus:!0,disableAutoFocus:!0,...t,children:(0,F.jsx)(VQ,{children:e})}),UQ=({letter:e})=>(0,F.jsx)(`div`,{style:{fontSize:`24px`,lineHeight:`24px`},children:e});UQ.propTypes={letter:v.string};function WQ({editor:e,opts:t,onClose:n}){if(!t?.characters?.length)return null;let r=(0,P.useRef)(null),i=(0,P.useRef)(n),[a,o]=(0,P.useState)({top:0,left:0}),[s,c]=(0,P.useState)(null);i.current=n;let l=(0,P.useMemo)(()=>{if(!t)return CX;switch(!0){case t.language===`spanish`:return CX;case t.language===`special`:return wX;default:return t}},[t]),u=(0,P.useMemo)(()=>l.characters.reduce((e,t)=>(t.length>=e.columns&&(e.columns=t.length),e),{rows:l.characters.length,columns:0}),[l]),d=()=>c(null);(0,P.useEffect)(()=>()=>{d()},[]),(0,P.useEffect)(()=>{if(!e)return;let t=e.options.element,n=e.view.dom,a=()=>{if(!r.current)return;let n=t.getBoundingClientRect(),{from:i}=e.state.selection,a=e.view.coordsAtPos(i),s=r.current.offsetHeight,c=r.current.offsetWidth,l=window.innerHeight-(n.bottom+60)>=s||n.top<s+80?n.bottom+60:n.top-s-20,u=a.left;l=Math.max(8,Math.min(l,window.innerHeight-s-8)),u=Math.max(8,Math.min(u,window.innerWidth-c-8)),o({top:l,left:u})};a();let s=null,c=()=>{s===null&&(s=requestAnimationFrame(()=>{s=null,a()}))};window.addEventListener(`scroll`,c,!0),window.addEventListener(`resize`,c);let l=e=>{r.current&&!r.current.contains(e.target)&&!n.contains(e.target)&&i.current()},u=setTimeout(()=>{document.addEventListener(`click`,l)});return()=>{clearTimeout(u),s!==null&&cancelAnimationFrame(s),window.removeEventListener(`scroll`,c,!0),window.removeEventListener(`resize`,c),document.removeEventListener(`click`,l)}},[e]);let f=(e,t)=>c({anchorEl:e.currentTarget,el:t});return(0,F.jsxs)(F.Fragment,{children:[Ms.createPortal((0,F.jsx)(`div`,{ref:r,className:`insert-character-dialog`,"data-toolbar-for":e.instanceId,style:{visibility:a.top===0&&a.left===0?`hidden`:`initial`,position:`fixed`,top:`${a.top}px`,left:`${a.left}px`,maxWidth:`500px`,zIndex:1e3},children:(0,F.jsx)(`div`,{children:(0,F.jsx)(gq,{keyPadCharacterRef:t.keyPadCharacterRef,setKeypadInteraction:t.setKeypadInteraction,autoFocus:!0,noDecimal:!0,hideInput:!0,noLatexHandling:!0,hideDoneButtonBackground:!0,layoutForKeyPad:u,additionalKeys:l.characters.reduce((e,t)=>(e=[...e,...t.map(e=>({name:Ip(e,`name`)||e,write:Ip(e,`write`)||e,label:Ip(e,`label`)||e,category:`character`,extraClass:`character`,extraProps:{...e.extraProps||{},style:{...(e.extraProps||{}).style,border:`1px solid #000`}},...l.hasPreview?{actions:{onMouseEnter:t=>f(t,e),onMouseLeave:d}}:{}}))],e),[]),keypadMode:`language`,onChange:t=>{typeof t==`string`&&e.chain().focus().insertContent(t).run()},onDone:n})})}),document.body),s&&Ms.createPortal((0,F.jsxs)(HQ,{onClose:d,anchorEl:s.anchorEl,children:[(0,F.jsx)(`div`,{children:s.el.label}),(0,F.jsx)(`div`,{style:{fontSize:20,lineHeight:`20px`},children:s.el.description}),(0,F.jsx)(`div`,{style:{fontSize:20,lineHeight:`20px`},children:s.el.unicode})]}),document.body)]})}WQ.propTypes={editor:v.object,opts:v.object,onClose:v.func.isRequired};var GQ=()=>(0,F.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:`24px`,viewBox:`0 0 24 24`,width:`24px`,fill:`none`,"aria-hidden":`true`,focusable:`false`,children:(0,F.jsx)(`path`,{d:`M22,7h-2v1h3v1h-4V7c0-0.55,0.45-1,1-1h2V5h-3V4h3c0.55,0,1,0.45,1,1v1C23,6.55,22.55,7,22,7z M5.88,20h2.66l3.4-5.42h0.12 l3.4,5.42h2.66l-4.65-7.27L17.81,6h-2.68l-3.07,4.99h-0.12L8.85,6H6.19l4.32,6.73L5.88,20z`,fill:`currentColor`})}),KQ=()=>(0,F.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:`24px`,viewBox:`0 0 24 24`,width:`24px`,fill:`none`,"aria-hidden":`true`,focusable:`false`,children:(0,F.jsx)(`path`,{d:`M22,18h-2v1h3v1h-4v-2c0-0.55,0.45-1,1-1h2v-1h-3v-1h3c0.55,0,1,0.45,1,1v1C23,17.55,22.55,18,22,18z M5.88,18h2.66 l3.4-5.42h0.12l3.4,5.42h2.66l-4.65-7.27L17.81,4h-2.68l-3.07,4.99h-0.12L8.85,4H6.19l4.32,6.73L5.88,18z`,fill:`currentColor`})}),qQ=()=>(0,F.jsx)(`svg`,{width:`30`,height:`28`,viewBox:`0 0 30 28`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,style:{width:`20px`,height:`18px`},"aria-hidden":`true`,focusable:`false`,children:(0,F.jsx)(`path`,{d:`M27 4V24H29C29.5 24 30 24.5 30 25V27C30 27.5625 29.5 28 29 28H19C18.4375 28 18 27.5625 18 27V25C18 24.5 18.4375 24 19 24H21V16H9V24H11C11.5 24 12 24.5 12 25V27C12 27.5625 11.5 28 11 28H1C0.4375 28 0 27.5625 0 27V25C0 24.5 0.4375 24 1 24H3V4H1C0.4375 4 0 3.5625 0 3V1C0 0.5 0.4375 0 1 0H11C11.5 0 12 0.5 12 1V3C12 3.5625 11.5 4 11 4H9V12H21V4H19C18.4375 4 18 3.5625 18 3V1C18 0.5 18.4375 0 19 0H29C29.5 0 30 0.5 30 1V3C30 3.5625 29.5 4 29 4H27Z`,fill:`currentColor`})});function JQ({editor:e,classes:t,activePlugins:n,toolbarOpts:r,responseAreaProps:i,onChange:a,autoWidthToolbar:o}){let[s,c]=(0,P.useState)(!1),l=r??{},u=Ik({editor:e,selector:e=>{let{selection:t}=e.editor?.state||{},n;if(!e.editor?.commandManager)return{};t instanceof Rv&&(n=t.node);let r=e.editor?.isActive(`math`)||e.editor?.isActive(`explicit_constructed_response`)||e.editor?.isActive(`imageUploadNode`)||e.editor?.isActive(`drag_in_the_blank`),i=t&&t.empty===!1&&e.editor.isActive(`table`);return{currentNode:n,hideDefaultToolbar:r,hasTextSelectionInTable:i,isFocused:e.editor?.isFocused,toolbarOpened:e.editor?._toolbarOpened??!1,isBold:e.editor.isActive(`bold`)??!1,canBold:e.editor.can().chain().toggleBold().run()??!1,isTable:e.editor.isActive(`table`)??!1,tableHasBorder:e.editor.getAttributes(`table`)?.border===`1`,canTable:e.editor.can().chain().insertTable().run()??!1,isItalic:e.editor.isActive(`italic`)??!1,canItalic:e.editor.can().chain().toggleItalic().run()??!1,isStrike:e.editor.isActive(`strike`)??!1,canStrike:e.editor.can().chain().toggleStrike().run()??!1,isCode:e.editor.isActive(`code`)??!1,canCode:e.editor.can().chain().toggleCode().run()??!1,canClearMarks:e.editor.can().chain().unsetAllMarks().run()??!1,isUnderline:e.editor.isActive(`underline`)??!1,isSubScript:e.editor.isActive(`subscript`)??!1,isSuperScript:e.editor.isActive(`superscript`)??!1,isParagraph:e.editor.isActive(`paragraph`)??!1,isHeading1:e.editor.isActive(`heading`,{level:1})??!1,isHeading2:e.editor.isActive(`heading`,{level:2})??!1,isHeading3:e.editor.isActive(`heading`,{level:3})??!1,isHeadingParagraph:e.editor.isActive(`headingParagraph`)??!1,isHeading4:e.editor.isActive(`heading`,{level:4})??!1,isHeading5:e.editor.isActive(`heading`,{level:5})??!1,isHeading6:e.editor.isActive(`heading`,{level:6})??!1,isBulletList:e.editor.isActive(`bulletList`)??!1,isOrderedList:e.editor.isActive(`orderedList`)??!1,isCodeBlock:e.editor.isActive(`codeBlock`)??!1,isBlockquote:e.editor.isActive(`blockquote`)??!1,canUndo:e.editor.can().chain().undo().run()??!1,canRedo:e.editor.can().chain().redo().run()??!1}}}),d=!!o,f=I(t.toolbar,fR,{[t.toolbarWithNoDone]:!0,[t.toolbarTop]:l.position===`top`,[t.toolbarRight]:l.alignment===`right`,[t.focused]:l.alwaysVisible||u.isFocused&&!u.toolbarOpened&&!u.hideDefaultToolbar,[t.autoWidth]:d,[t.fullWidth]:!d,[t.hidden]:l.isHidden===!0}),p=l.minWidth===void 0?{}:{minWidth:l.minWidth},m=e=>{e.preventDefault()},h=(0,P.useMemo)(()=>[{icon:(0,F.jsx)(uX,{}),label:`Insert table`,onClick:e=>e.chain().focus().insertTable({rows:2,cols:2,withHeaderRow:!1}).run(),hidden:e=>!n?.includes(`table`)||e.isTable,isActive:e=>e.isTable,isDisabled:e=>!e.canTable},{icon:(0,F.jsx)(PX,{}),label:`Add table row`,onClick:e=>e.chain().focus().addRowAfter().run(),hidden:e=>!(e.isTable&&!e.hasTextSelectionInTable),isActive:e=>e.isTable,isDisabled:e=>!e.canTable},{icon:(0,F.jsx)(FX,{}),label:`Remove table row`,onClick:e=>e.chain().focus().deleteRow().run(),hidden:e=>!(e.isTable&&!e.hasTextSelectionInTable),isActive:e=>e.isTable,isDisabled:e=>!e.canTable},{icon:(0,F.jsx)(IX,{}),label:`Add table column`,onClick:e=>e.chain().focus().addColumnAfter().run(),hidden:e=>!(e.isTable&&!e.hasTextSelectionInTable),isActive:e=>e.isTable,isDisabled:e=>!e.canTable},{icon:(0,F.jsx)(LX,{}),label:`Remove table column`,onClick:e=>e.chain().focus().deleteColumn().run(),hidden:e=>!(e.isTable&&!e.hasTextSelectionInTable),isActive:e=>e.isTable,isDisabled:e=>!e.canTable},{icon:(0,F.jsx)(RX,{}),label:`Remove table`,onClick:e=>e.chain().focus().deleteTable().run(),hidden:e=>!(e.isTable&&!e.hasTextSelectionInTable),isActive:e=>e.isTable,isDisabled:e=>!e.canTable},{icon:(0,F.jsx)(bX,{}),label:`Table borders`,toggle:!0,onClick:e=>{let t=e.getAttributes(`table`),n={...t,border:t.border===`0`?`1`:`0`};e.commands.updateAttributes(`table`,n)},hidden:e=>!(e.isTable&&!e.hasTextSelectionInTable),isActive:e=>e.tableHasBorder,isDisabled:e=>!e.canTable},{icon:(0,F.jsx)(oX,{}),label:`Bold`,toggle:!0,onClick:e=>e.chain().focus().toggleBold().run(),hidden:()=>!n?.includes(`bold`),isActive:e=>e.isBold,isDisabled:e=>!e.canBold},{icon:(0,F.jsx)(sX,{}),label:`Italic`,toggle:!0,onClick:e=>e.chain().focus().toggleItalic().run(),hidden:()=>!n?.includes(`italic`),isActive:e=>e.isItalic,isDisabled:e=>!e.canItalic},{icon:(0,F.jsx)(cX,{}),label:`Strikethrough`,toggle:!0,onClick:e=>e.chain().focus().toggleStrike().run(),hidden:()=>!n?.includes(`strikethrough`),isActive:e=>e.isStrike,isDisabled:e=>!e.canStrike},{icon:(0,F.jsx)(lX,{}),label:`Code`,toggle:!0,onClick:e=>e.chain().focus().toggleCode().run(),hidden:()=>!n?.includes(`code`),isActive:e=>e.isCode,isDisabled:e=>!e.canCode},{icon:(0,F.jsx)(pX,{}),label:`Underline`,toggle:!0,onClick:e=>e.chain().focus().toggleUnderline().run(),hidden:()=>!n?.includes(`underline`),isActive:e=>e.isUnderline},{icon:(0,F.jsx)(KQ,{}),label:`Subscript`,toggle:!0,onClick:e=>e.chain().focus().toggleSubscript().run(),hidden:()=>!n?.includes(`subscript`),isActive:e=>e.isSubScript},{icon:(0,F.jsx)(GQ,{}),label:`Superscript`,toggle:!0,onClick:e=>e.chain().focus().toggleSuperscript().run(),hidden:()=>!n?.includes(`superscript`),isActive:e=>e.isSuperScript},{icon:(0,F.jsx)(hX,{}),label:`Insert image`,hidden:()=>!n?.includes(`image`),onClick:e=>e.chain().focus().setImageUploadNode().run()},{icon:(0,F.jsx)(vX,{}),label:`Insert video`,hidden:()=>!n?.includes(`video`),onClick:e=>e.chain().focus().insertMedia({type:`video`}).run()},{icon:(0,F.jsx)(yX,{}),label:`Insert audio`,hidden:()=>!n?.includes(`audio`),onClick:e=>e.chain().focus().insertMedia({type:`audio`,tag:`audio`}).run()},{icon:(0,F.jsx)(jX,{}),label:`CSS classes`,hidden:()=>!n?.includes(`css`),onClick:e=>e.commands.openCSSClassDialog()},{icon:(0,F.jsx)(_X,{}),label:`Blockquote`,toggle:!0,hidden:()=>!n?.includes(`blockquote`),onClick:e=>e.chain().focus().toggleBlockquote().run(),isActive:e=>e.isBlockquote},{icon:(0,F.jsx)(qQ,{}),label:`Heading`,toggle:!0,hidden:()=>!n?.includes(`h3`),onClick:e=>e.chain().focus().toggleHeadingParagraph().run(),isActive:e=>e.isHeadingParagraph},{icon:(0,F.jsx)(mX,{}),label:`Insert math`,hidden:()=>!n?.includes(`math`),onClick:e=>e.chain().focus().insertMath(``).run()},{icon:(0,F.jsx)(UQ,{letter:`ñ`}),label:`Spanish characters (ñ)`,hidden:()=>!n?.includes(`languageCharacters`),onClick:()=>c(CX)},{icon:(0,F.jsx)(UQ,{letter:`€`}),label:`Special characters (€)`,hidden:()=>n?.filter(e=>e===`languageCharacters`).length!==2,onClick:()=>c(wX)},{icon:(0,F.jsx)(kX,{editor:e}),label:`Text alignment`,hidden:()=>!n?.includes(`text-align`),onClick:()=>{}},{icon:(0,F.jsx)(dX,{}),label:`Bulleted list`,toggle:!0,hidden:()=>!n?.includes(`bulleted-list`),onClick:e=>e.chain().focus().toggleBulletList().run(),isActive:e=>e.isBulletList},{icon:(0,F.jsx)(fX,{}),label:`Numbered list`,toggle:!0,hidden:()=>!n?.includes(`numbered-list`),onClick:e=>e.chain().focus().toggleOrderedList().run(),isActive:e=>e.isOrderedList},{icon:(0,F.jsx)(mf,{}),label:`Undo`,hidden:()=>!n?.includes(`undo`),onClick:e=>e.chain().focus().undo().run(),isDisabled:e=>!e.canUndo},{icon:(0,F.jsx)(gX,{}),label:`Redo`,hidden:()=>!n?.includes(`redo`),onClick:e=>e.chain().focus().redo().run(),isDisabled:e=>!e.canRedo}],[n,e]),g=u.hideDefaultToolbar&&u.currentNode?.type?.name===`drag_in_the_blank`;return(0,F.jsxs)(`div`,{className:f,style:{...p},onMouseDown:m,children:[g&&(0,F.jsx)(`div`,{className:t.defaultToolbar,tabIndex:`1`,children:(0,F.jsx)(`div`,{className:t.buttonsContainer,children:(0,F.jsx)(`button`,{type:`button`,className:t.button,onClick:t=>{t.preventDefault(),e.chain().focus().deleteSelection().run(),a?.(e.getHTML())},"aria-label":`Delete response area`,title:`Delete response area`,children:(0,F.jsx)(dR,{})})})}),!u.hideDefaultToolbar&&(0,F.jsxs)(`div`,{className:t.defaultToolbar,tabIndex:`1`,children:[(0,F.jsx)(`div`,{className:t.buttonsContainer,children:h.filter(e=>!e.hidden?.(u)).map((n,r)=>{let i=n.isDisabled?.(u),a=n.isActive?.(u);return(0,F.jsx)(`button`,{type:`button`,disabled:i,"aria-label":n.label,title:n.label,"aria-pressed":n.toggle?!!a:void 0,onClick:t=>{t.preventDefault(),n.onClick(e)},className:I(t.button,{[t.active]:a}),children:n.icon},r)})}),n?.includes(`responseArea`)&&(0,F.jsx)(`button`,{type:`button`,"aria-label":`Insert response area`,title:`Insert response area`,onClick:()=>{e.chain().focus().insertResponseArea(i.type).run()},className:t.button,children:(0,F.jsx)(SX,{})}),l.showDone&&(0,F.jsx)(gR,{onClick:()=>{a?.(e.getHTML()),e.commands.blur()}})]}),s&&(0,F.jsx)(WQ,{editor:e,opts:{...s,renderPopOver:(e,t)=>console.log(`Show popover`,t),closePopOver:()=>console.log(`Close popover`)},onClose:()=>c(!1)})]})}var YQ=e=>{xo();let t={defaultToolbar:`defaultToolbar`,buttonsContainer:`buttonsContainer`,button:`toolbarButton`,active:`active`,disabled:`disabled`,isActive:`isActive`,toolbar:`toolbar`,toolbarWithNoDone:`toolbarWithNoDone`,toolbarTop:`toolbarTop`,toolbarRight:`toolbarRight`,fullWidth:`fullWidth`,hidden:`hidden`,autoWidth:`autoWidth`,focused:`focused`,iconRoot:`iconRoot`,label:`label`,shared:`shared`};return(0,F.jsx)(XQ,{children:(0,F.jsx)(JQ,{...e,classes:t})})},XQ=R(`div`)(()=>({height:0,overflow:`visible`,"& .defaultToolbar":{display:`flex`,width:`100%`,justifyContent:`space-between`},"& .buttonsContainer":{alignItems:`center`,display:`flex`,width:`100%`},"& .toolbarButton":{color:`grey`,display:`inline-flex`,padding:`2px`,background:`none`,border:`none`,cursor:`pointer`,"& svg":{width:`24px`,height:`24px`},"&:hover":{color:Il()},"&:focus":{outline:`2px solid ${Tu()}`}},"& .active":{color:Il()},"& .disabled":{opacity:.7,cursor:`not-allowed`,"& :hover":{color:Ll()}},"& .isActive":{background:`var(--purple)`,color:`var(--white)`},"& .toolbar":{position:`relative`,top:`5px`,zIndex:20,cursor:`pointer`,justifyContent:`space-between`,background:`var(--editable-html-toolbar-bg, #efefef)`,minWidth:`280px`,margin:0,padding:`2px`,boxShadow:`0px 1px 5px 0px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 3px 1px -2px rgba(0, 0, 0, 0.12)`,boxSizing:`border-box`,display:`flex`,opacity:0,pointerEvents:`none`},"& .toolbarWithNoDone":{minWidth:`265px`},"& .toolbarTop":{position:`absolute`,top:`-45px`},"& .toolbarRight":{right:0},"& .fullWidth":{width:`fit-content`,minWidth:`100%`},"& .hidden":{visibility:`hidden`},"& .autoWidth":{width:`fit-content`},"& .focused":{opacity:1,pointerEvents:`auto`},"& .iconRoot":{width:`28px`,height:`28px`,padding:`4px`,verticalAlign:`top`},"& .label":{color:`var(--editable-html-toolbar-check, #00bb00)`},"& .shared":{display:`flex`}})),ZQ=R(`div`,{shouldForwardProp:e=>![`noBorder`,`error`].includes(e)})(({theme:e,noBorder:t,error:n})=>({position:`relative`,padding:`0px`,border:t?`none`:`1px solid #ccc`,borderRadius:`4px`,cursor:`text`,'& [data-slate-editor="true"]':{wordBreak:`break-word`,overflow:`visible`,maxHeight:`500px`,padding:`5px`},"&:first-child":{marginTop:0},"& ul, & ol":{padding:`0 1rem`,margin:`1.25rem 1rem 1.25rem 0.4rem`},"& ul li p, & ol li p":{marginTop:`0.25em`,marginBottom:`0.25em`},"& h1, & h2, & h3, & h4, & h5, & h6":{lineHeight:1.1,marginTop:`2.5rem`,textWrap:`pretty`},"& h1, & h2":{marginTop:`3.5rem`,marginBottom:`1.5rem`},"& h1":{fontSize:`1.4rem`},"& h2":{fontSize:`1.2rem`},"& h3":{fontSize:`1.1rem`},"& h4, & h5, & h6":{fontSize:`1rem`},"& code":{backgroundColor:`var(--purple-light)`,borderRadius:`0.4rem`,color:`var(--black)`,fontSize:`0.85rem`,padding:`0.25em 0.3em`},"& pre":{background:`var(--black)`,borderRadius:`0.5rem`,color:`var(--white)`,fontFamily:`'JetBrainsMono', monospace`,margin:`1.5rem 0`,padding:`0.75rem 1rem`,"& code":{background:`none`,color:`inherit`,fontSize:`0.8rem`,padding:0}},"& blockquote":{background:`#f9f9f9`,borderLeft:`5px solid #ccc`,margin:`1.5em 10px`,padding:`.5em 10px`},"& p":{margin:`0`},"& table":{tableLayout:`fixed`,width:`100%`,borderCollapse:`collapse`,color:Il(),backgroundColor:iu()},'& table:not([border="1"]) tr':{borderTop:`1px solid ${gu()}`},"& td, th":{padding:`.6em 1em`,textAlign:`center`},'& table:not([border="1"]) td, th':{border:`1px solid ${gu()}`},...n&&{border:`2px solid ${e.palette.error.main} !important`}})),QQ=R(`div`,{shouldForwardProp:e=>![`disableScrollbar`,`highlightShape`].includes(e)})(({theme:e,disableScrollbar:t,highlightShape:n})=>({position:`relative`,padding:`0px`,overflowY:`auto`,color:Il(),backgroundColor:n?e.palette.action.selected:iu(),...t&&{"&::-webkit-scrollbar":{display:`none`},scrollbarWidth:`none`,"-ms-overflow-style":`none`}})),$Q=R(`div`,{shouldForwardProp:e=>e!==`noPadding`})(({noPadding:e})=>({padding:e?0:`10px 8px`}));function e$(e){let[t,n]=(0,P.useState)(null),r=(0,P.useRef)(null),{editor:i,disabled:a,children:o,disableScrollbar:s,activePlugins:c,toolbarOpts:l,responseAreaProps:u,autoFocus:d,minWidth:f,width:p,maxWidth:m,minHeight:h,height:g,maxHeight:_,highlightShape:v,ref:y}=e;(0,P.useEffect)(()=>{i&&r.current&&(i._tiptapContainerEl=r.current)},[i,r.current]),(0,P.useEffect)(()=>{i&&d&&Promise.resolve().then(()=>{i.commands.focus(`end`)})},[i,d]),(0,P.useEffect)(()=>{if(e.adjustWidthForLimit){let t=document.createElement(`p`);t.style.visibility=`hidden`,t.style.position=`absolute`,t.style.whiteSpace=`nowrap`,t.textContent=`W`.repeat(e.charactersLimit);let i=window.getComputedStyle(r.current);[`fontFamily`,`fontSize`,`fontWeight`,`fontStyle`,`letterSpacing`,`wordSpacing`,`textTransform`,`lineHeight`].forEach(e=>{t.style[e]=i[e]}),document.body.appendChild(t),n(`${t.offsetWidth+27}px`),t.remove()}},[e.adjustWidthForLimit,e.charactersLimit]);let b=(0,P.useMemo)(()=>({width:aX(t||p),minWidth:aX(f),maxWidth:aX(m),height:aX(g),minHeight:aX(h),maxHeight:aX(_)}),[t,f,p,m,h,g,_]);return(0,F.jsxs)(ZQ,{noBorder:l&&l.noBorder,error:l&&l.error,className:e.className,style:{width:b.width,minWidth:b.minWidth,maxWidth:b.maxWidth},ref:r,children:[(0,F.jsx)(QQ,{disableScrollbar:s,highlightShape:v,children:(0,F.jsx)($Q,{noPadding:l&&l.noPadding,children:o})}),i&&(0,F.jsx)(YQ,{editor:i,responseAreaProps:u,toolbarOpts:l,activePlugins:c,onChange:e.onChange,autoWidthToolbar:e.autoWidthToolbar})]})}var t$=Uu(`@pie-lib:editable-html:plugins`),n$=[`bold`,`html`,`extraCSSRules`,`italic`,`underline`,`strikethrough`,`bulleted-list`,`numbered-list`,`image`,`math`,`languageCharacters`,`text-align`,`blockquote`,`h3`,`table`,`video`,`audio`,`responseArea`,`redo`,`undo`,`superscript`,`subscript`],r$={"text-align":`textAlign`,"bulleted-list":`ul_list`,"numbered-list":`ol_list`},i$=n$.filter(e=>![`responseArea`,`h3`,`blockquote`].includes(e)),a$=(e,t,n)=>{t$(`[buildPlugins] opts: `,n),e||=i$;let r=(t,n=!0)=>e.includes(t)&&n&&t,i=n.image&&n.image.delete,a=n.math,o=n.responseArea&&n.responseArea.type,s=!Lp(n.extraCSSRules),c=n?.languageCharacters||[];return Np([r(`table`),r(`bold`),r(`italic`),r(`strikethrough`),r(`underline`),r(`superscript`),r(`subscript`),r(`image`,!!i),r(`video`),r(`audio`),r(`math`,!!a),...c.map(e=>r(`languageCharacters`,e)),r(`text-align`),r(`blockquote`),r(`h3`),r(`bulleted-list`),r(`numbered-list`),r(`undo`),r(`redo`),r(`responseArea`,!!o),r(`css`,!!s),r(`html`,!!n.html)])},o$={position:`bottom`,alignment:`left`,alwaysVisible:!1,showDone:!0,doneOn:`blur`},s$={options:{},respAreaToolbar:()=>{},onHandleAreaChange:()=>{}},c$=[`bold`,`italic`,`underline`,`strikethrough`,`code`,`bulleted-list`,`numbered-list`,`image`,`math`,`languageCharacters`,`text-align`,`table`,`video`,`audio`,`responseArea`,`superscript`,`subscript`,`css`,`h3`,`undo`,`redo`],l$={"--white":`#fff`,"--black":`#2e2b29`,"--black-contrast":`#110f0e`,"--gray-1":`rgba(61, 37, 20, .05)`,"--gray-2":`rgba(61, 37, 20, .08)`,"--gray-3":`rgba(61, 37, 20, .12)`,"--gray-4":`rgba(53, 38, 28, .3)`,"--gray-5":`rgba(28, 25, 23, .6)`,"--green":`#22c55e`,"--purple":`#6a00f5`,"--purple-contrast":`#5800cc`,"--purple-light":`rgba(88, 5, 255, .05)`,"--yellow-contrast":`#facc15`,"--yellow":`rgba(250, 204, 21, .4)`,"--yellow-light":`#fffae5`,"--red":`#ff5c33`,"--red-light":`#ffebe5`,"--shadow":`0px 12px 33px 0px rgba(0, 0, 0, .06),
|
|
357
357
|
0px 3.618px 9.949px 0px rgba(0, 0, 0, .04)`},u$=e=>({role:`textbox`,"data-pie-editor":`true`,spellcheck:e?`true`:`false`,autocorrect:e?`on`:`off`,autocapitalize:e?`on`:`off`}),d$=e=>{let{showParagraphs:t,separateParagraphs:n}=e.pluginProps||{},[r,i]=(0,P.useState)([]),[a,o]=(0,P.useState)(!1),{toolbarOpts:s}=e,c=(0,P.useCallback)(e=>{i(t=>{let n=t.filter(t=>t.pos!==e);return n.length===0&&o(!1),n})},[i]),l={...o$,...s},u=(0,P.useCallback)(t=>{let n=t.getHTML();e.markup!==n&&e.onChange?.(n),l.doneOn===`blur`&&e.onDone?.(n)},[e.markup,e.onChange,e.onDone,l.doneOn]),d=(0,P.useMemo)(()=>({...s$,...e.responseAreaProps,onInlineDropdownToolbarClose:u}),[e.responseAreaProps,u]),f=(0,P.useMemo)(()=>{let{customPlugins:t,...n}=e.pluginProps||{};t||=[];let r=(e.activePlugins||c$)?.filter(e=>{let t=r$[e]||e,r=n[t]||{};return!r||!r.disabled});return a$(r,t,{math:{},textAlign:e.textAlign,html:{},extraCSSRules:e.extraCSSRules||{},image:{...e.imageSupport},toolbar:{},table:{},responseArea:{type:d.type},languageCharacters:e.languageCharactersProps,keyPadCharacterRef:{},setKeypadInteraction:{},media:{}})},[e,d.type]),p=[qF.configure({types:[`heading`,`paragraph`,`div`,`headingParagraph`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`td`,`th`],alignments:[`left`,`right`,`center`,`justify`]}),WF,oF.configure({limit:e.charactersLimit||1e6}),PF.configure({trailingNode:{node:`paragraph`,notAfter:[`paragraph`,`div`]},link:{autolink:!1,linkOnPaste:!1}}),rX,nR,iX,rR,iR,XF.configure({placeholder:e.placeholder,showOnlyWhenEditable:!0,showOnlyCurrent:!1,includeChildren:!0}),QL,PL,tR,eR,rG.configure(d),iG.configure(d),oG.configure(d),sG.configure(d),aG.configure(d),Sq.configure({toolbarOpts:l,math:e.pluginProps?.math||{}}),KF,GF,YF,IJ.configure({toolbarOpts:l,imageHandling:{disableImageAlignmentButtons:e.disableImageAlignmentButtons,onDone:t=>e.onDone?.(t.getHTML()),onDelete:e.imageSupport&&e.imageSupport.delete&&(t=>{let{src:n}=t.attrs;e.imageSupport.delete(n,e=>{c(t.pos)})}),insertImageRequested:e.imageSupport&&((t,n,r)=>{let[o,s]=n,l=n=>{let r;a&&n&&(r=e.onChange),c(s),r?.(t.getHTML())};t._insertingImage=!0,i(e=>[...e,o]),(()=>{let n=r(l),i=Pp(()=>{let e=()=>window.removeEventListener(`focus`,i);if(!t._insertingImage){e();return}c(s),t._insertingImage=!1,e()},500);window.addEventListener(`focus`,i),e.imageSupport.add(n)})()}),maxImageWidth:e.maxImageWidth,maxImageHeight:e.maxImageHeight},limit:3}),zY.configure({uploadSoundSupport:e.uploadSoundSupport}),nX.configure({extraCSSRules:e.extraCSSRules})],m=e.spellCheck!==!1,h=Bk({extensions:p,immediatelyRender:!1,editorProps:{attributes:u$(m),handleKeyDown(t,n){return e.onKeyDown?e.onKeyDown(n):!1}},editable:!e.disabled,content:$F(e.markup),onUpdate:({editor:t,transaction:n})=>{n.isDone&&e.onChange?.(t.getHTML())},onBlur:({editor:e})=>{e._insertingImage||e._toolbarOpened||e.isActive(`inline_dropdown`)||e.isActive(`explicit_constructed_response`)||!e.schema||u(e)}},[e.charactersLimit]);(0,P.useEffect)(()=>{e.editorRef&&e.editorRef(h)},[e.editorRef,h]),(0,P.useEffect)(()=>{h?.setEditable(!e.disabled)},[e.disabled,h]),(0,P.useEffect)(()=>{if(!h)return;let e=h.options?.editorProps,t={...e?.attributes,...u$(m)};e?.attributes?.spellcheck!==t.spellcheck&&h.setOptions({editorProps:{...e,attributes:t}})},[m,h]),(0,P.useEffect)(()=>{if(!h)return;let t=$F(e.markup);t!==h.getHTML()&&h.commands.setContent(t,{emitUpdate:!1})},[e.markup,h]),(0,P.useEffect)(()=>{Object.entries(l$).forEach(([e,t])=>{document.documentElement.style.setProperty(e,t)})},[]);let g=Ik({editor:h,selector:e=>({isFocused:e.editor?.isFocused})}),_=(0,P.useMemo)(()=>{let{minWidth:t,width:n,maxWidth:r,minHeight:i,height:a,maxHeight:o}=e;return{width:aX(n),minWidth:aX(t),maxWidth:aX(r),height:aX(a),minHeight:aX(i),maxHeight:aX(o)}},[e]);return(0,F.jsx)(e$,{...e,activePlugins:f,toolbarOpts:l,editorState:g,editor:h,children:h&&(0,F.jsx)(f$,{style:{minHeight:_.minHeight,height:_.height,maxHeight:_.maxHeight},showParagraph:t&&!t.disabled,separateParagraph:n&&!n.disabled,editor:h})})},f$=R(Nk,{shouldForwardProp:e=>![`showParagraph`,`separateParagraph`].includes(e)})(({showParagraph:e,separateParagraph:t})=>({display:`flex`,outline:`none !important`,"& .ProseMirror":{flex:1,padding:`5px`,maxHeight:`500px`,outline:`none !important`,position:`initial`,"& > p, & > div":{margin:`0`},"& p[data-placeholder].is-empty:only-child, & div[data-placeholder].is-empty:only-child":{position:`relative`},"& p[data-placeholder].is-empty:only-child::before, & div[data-placeholder].is-empty:only-child::before":{content:`attr(data-placeholder)`,position:`absolute`,left:0,top:0,color:`#9CA3AF`,pointerEvents:`none`,whiteSpace:`pre-wrap`},...e&&{"& > p:has(+ p)::after, & > div:has(+ div)::after":{display:`block`,content:`"¶"`,fontSize:`1em`,color:`#146EB3`}},...t&&{"& > p:has(+ p)":{marginBottom:`1em`}}}})),p$=d$,m$={min:v.number.isRequired,max:v.number.isRequired,step:v.number},h$=v.shape(m$),g$=v.shape(m$),_$=v.shape({width:v.number.isRequired,height:v.number.isRequired});v.shape({x:v.number.isRequired,y:v.number.isRequired});var v$=v.oneOfType([v.arrayOf(v.node),v.node]).isRequired,y$=v.shape({x:v.func.isRequired,y:v.func.isRequired}),b$=v.shape({x:v.func.isRequired,y:v.func.isRequired}),x$=v.shape({scale:y$.isRequired,snap:b$.isRequired,domain:h$.isRequired,range:g$.isRequired,size:_$.isRequired}),S$={graphProps:x$.isRequired,mark:v.object,onChange:v.func,onDelete:v.func,onClick:v.func};v.shape(S$);var C$=o(((e,t)=>{t.exports=function(e,t,n,r,i,a,o,s){if(!e){var c;if(t===void 0)c=Error(`Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.`);else{var l=[n,r,i,a,o,s],u=0;c=Error(t.replace(/%s/g,function(){return l[u++]})),c.name=`Invariant Violation`}throw c.framesToPop=1,c}}}));function w$(e,t){this.x=e,this.y=t}w$.prototype={clone(){return new w$(this.x,this.y)},add(e){return this.clone()._add(e)},sub(e){return this.clone()._sub(e)},multByPoint(e){return this.clone()._multByPoint(e)},divByPoint(e){return this.clone()._divByPoint(e)},mult(e){return this.clone()._mult(e)},div(e){return this.clone()._div(e)},rotate(e){return this.clone()._rotate(e)},rotateAround(e,t){return this.clone()._rotateAround(e,t)},matMult(e){return this.clone()._matMult(e)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(e){return this.x===e.x&&this.y===e.y},dist(e){return Math.sqrt(this.distSqr(e))},distSqr(e){let t=e.x-this.x,n=e.y-this.y;return t*t+n*n},angle(){return Math.atan2(this.y,this.x)},angleTo(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith(e){return this.angleWithSep(e.x,e.y)},angleWithSep(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult(e){let t=e[0]*this.x+e[1]*this.y,n=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=n,this},_add(e){return this.x+=e.x,this.y+=e.y,this},_sub(e){return this.x-=e.x,this.y-=e.y,this},_mult(e){return this.x*=e,this.y*=e,this},_div(e){return this.x/=e,this.y/=e,this},_multByPoint(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint(e){return this.x/=e.x,this.y/=e.y,this},_unit(){return this._div(this.mag()),this},_perp(){let e=this.y;return this.y=this.x,this.x=-e,this},_rotate(e){let t=Math.cos(e),n=Math.sin(e),r=t*this.x-n*this.y,i=n*this.x+t*this.y;return this.x=r,this.y=i,this},_rotateAround(e,t){let n=Math.cos(e),r=Math.sin(e),i=t.x+n*(this.x-t.x)-r*(this.y-t.y),a=t.y+r*(this.x-t.x)+n*(this.y-t.y);return this.x=i,this.y=a,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:w$},w$.convert=function(e){if(e instanceof w$)return e;if(Array.isArray(e))return new w$(+e[0],+e[1]);if(e.x!==void 0&&e.y!==void 0)return new w$(+e.x,+e.y);throw Error(`Expected [x, y] or {x, y} point format`)};var T$=l(C$(),1),E$=(e,t,n)=>{let r=Hp(e,t,n);return r.splice(r.length,1,t),r};function D$(e,t,n,r){if(r>=t)return t;if(r<=e)return e;let i=E$(e,t,n);return i=i.filter(e=>Math.abs(r-e)<=n),i.length&&i.reduce((e,t)=>Math.abs(t-r)<=Math.abs(e-r)?t:e)}var O$=(e,t,n)=>({left:t.min-e.left,right:Math.abs(e.right-t.max),top:Math.abs(e.top-n.max),bottom:n.min-e.bottom}),k$=e=>new w$(e.x,e.y),A$=(e,t)=>k$(t).sub(k$(e)),j$=e=>(new DOMParser()?.parseFromString(e,`text/html`))?.body?.textContent||``,M$=e=>e&&Object.keys(e).length===0&&e.constructor===Object,N$=e=>typeof e==`string`&&e.trim()===``;function P$(e){return typeof e==`function`||typeof e==`object`&&!!e&&typeof e.$$typeof==`symbol`}function F$(e,t){return!e||P$(e)?e:P$(e.default)?e.default:t&&P$(e[t])?e[t]:t&&P$(e[t]?.default)?e[t].default:e}var I$=F$(ep,`Readable`)||F$(z$.Readable,`Readable`),L$=Op,R$=L$.default,z$=R$&&typeof R$==`object`?R$:L$,B$={axisLabel:{fontSize:12,textAlign:`center`,margin:4,padding:`4px 0`},chartLabel:{fontSize:16,textAlign:`center`,margin:4,padding:`4px 0`},disabledLabel:{pointerEvents:`none`,width:`100%`},editLabel:{position:`absolute`,backgroundColor:`white`,borderRadius:4,boxShadow:`0px 5px 8px rgba(0,0,0,0.15)`,zIndex:10},rotateLeftLabel:{transform:`rotate(-90deg)`,transformOrigin:`0 0`,position:`absolute`},rotateRightLabel:{transform:`rotate(90deg)`,transformOrigin:`0 0`,position:`absolute`},customBottom:{position:`absolute`},displayNone:{display:`none`},centerPlaceholder:{"& .ProseMirror p.is-editor-empty::before, & .ProseMirror div.is-editor-empty::before":{left:0,right:0,width:`100%`,textAlign:`center`}}},V$=R(`div`)({...B$.centerPlaceholder}),H$=R(`div`)({...B$.disabledLabel,"& p":{margin:0}}),U$=e=>{let{disabledLabel:t,graphHeight:n,graphWidth:r,isChartBottomLabel:i,isDefineChartBottomLabel:a,isChartLeftLabel:o,isDefineChartLeftLabel:s,placeholder:c,text:l,side:u,onChange:d,mathMlOptions:f={},charactersLimit:p,titleHeight:m,preventNewLines:h}=e,[g,_]=(0,P.useState)(!1),v=[`bold`,`italic`,`underline`,`strikethrough`,`math`],y=i||o||a||s,b=u===`left`&&s&&n-220,x={width:b||(u===`left`||u===`right`?n-8:r-8),top:b||o&&`${n-70}px`||u===`left`&&`${n-8}px`||i&&`${n-60+m}px`||u===`bottom`&&`${n-120+m}px`||0,left:u===`right`&&`${r-8}px`||(s||a)&&`40px`||i&&`-10px`||0},S={width:r-8,top:u===`right`?`${n-22}px`:0,left:0},C=()=>{!t&&(u===`left`||u===`right`)&&_(!0)},w=()=>{_(!1),requestAnimationFrame(()=>{document.activeElement?.blur?.()})},T=e=>!!(h&&e.key===`Enter`);return(0,F.jsx)(I$,{false:!0,children:(0,F.jsx)(V$,{onClick:C,style:{...g?S:x,...y?B$.chartLabel:B$.axisLabel,...u===`left`&&!g?B$.rotateLeftLabel:{},...u===`right`&&!g?B$.rotateRightLabel:{},...g?B$.editLabel:{},...i||a?B$.customBottom:{},...t&&!y&&N$(j$(l))&&B$.displayNone},children:t?(0,F.jsx)(H$,{dangerouslySetInnerHTML:{__html:l||``}}):(0,F.jsx)(p$,{markup:l||``,onChange:d,placeholder:!t&&c,toolbarOpts:{position:u===`bottom`?`top`:`bottom`,noPadding:!0,noBorder:!0},disableScrollbar:!0,activePlugins:v,onDone:w,onKeyDown:T,mathMlOptions:f,charactersLimit:p})})})};U$.propTypes={disabledLabel:v.bool,graphHeight:v.number,graphWidth:v.number,isChartBottomLabel:v.bool,isDefineChartBottomLabel:v.bool,isChartLeftLabel:v.bool,isDefineChartLeftLabel:v.bool,placeholder:v.string,text:v.string,side:v.string,onChange:v.func,mathMlOptions:v.object,charactersLimit:v.number,titleHeight:v.number};function W$(e){return typeof e==`function`||typeof e==`object`&&!!e&&typeof e.$$typeof==`symbol`}function G$(e,t){return!e||W$(e)?e:W$(e.default)?e.default:t&&W$(e[t])?e[t]:t&&W$(e[t]?.default)?e[t].default:e}var K$=G$(ep,`Readable`)||G$(Y$.Readable,`Readable`),q$=Op,J$=q$.default,Y$=J$&&typeof J$==`object`?J$:q$,X$={"& .ProseMirror p.is-editor-empty::before, & .ProseMirror div.is-editor-empty::before":{left:0,right:0,width:`100%`,textAlign:`center`}},Z$=R(`div`)(({theme:e})=>({border:`solid 1px ${Xl()}`,color:V.TEXT,backgroundColor:e.palette.common.white,touchAction:`none`,position:`relative`,boxSizing:`unset`})),Q$=R(`div`)({display:`flex`,position:`relative`}),$$=R(`svg`)({paddingLeft:`50px`,overflow:`visible`,boxSizing:`content-box`}),e1=R(`svg`)({overflow:`visible`,boxSizing:`content-box`}),t1=R(`g`)({cursor:`pointer`,userSelect:`none`}),n1=R(`div`)(({theme:e})=>({color:V.TEXT,fontSize:e.typography.fontSize+2,padding:`${e.spacing(1.5)} ${e.spacing(.5)} 0`,textAlign:`center`,"&.disabledTitle":{pointerEvents:`none`},"&.rightMargin":{marginRight:`74px`},"& p":{margin:0},...X$})),r1=R(`div`)(({theme:e})=>({color:V.TEXT,fontSize:e.typography.fontSize+4,padding:`${e.spacing(1.5)} ${e.spacing(.5)} 0`,textAlign:`center`,"&.disabledTitle":{pointerEvents:`none`},"&.rightMargin":{marginRight:`74px`},"& p":{margin:0},...X$})),i1=R(`div`)({display:`flex`,paddingTop:`6px`}),a1=R(`div`)({display:`flex`,flexDirection:`column`,alignItems:`center`,width:`100px`,pointerEvents:`none`,userSelect:`none`}),o1=R(`div`)({width:`70px`,display:`flex`,flexDirection:`column`,marginRight:`6px`}),s1=R(`div`)({textAlign:`right`,height:`20px`,pointerEvents:`none`,userSelect:`none`,"&:not(:last-child)":{marginBottom:`80px`}}),c1=class extends P.Component{constructor(e){super(e),this.state={titleHeight:0},this.resizeObserver=null}static propTypes={title:v.string,children:v$,defineChart:v.bool,disabledLabels:v.bool,disabledTitle:v.bool,graphProps:x$.isRequired,isChart:v.bool,labels:v.object,labelsPlaceholders:v.object,onChangeTitle:v.func,onMouseMove:v.func,showLabels:v.bool,showTitle:v.bool,showPixelGuides:v.bool,rootRef:v.func,onChangeLabels:v.func,titlePlaceholder:v.string,mathMlOptions:v.object,labelsCharactersLimit:v.number};mouseMove=(e,t)=>{let{graphProps:n,onMouseMove:r}=this.props;if(!r)return;let{scale:i,snap:a}=n,o=Wh(t,e.node()),s=i.x.invert(o[0]),c=i.y.invert(o[1]);r({x:a.x(s),y:a.y(c)})};componentDidMount(){let e=Hh(this.g);e.on(`mousemove`,this.mouseMove.bind(this,e)),this.measureTitleHeight(),this.setupVisibilityObserver()}componentWillUnmount(){Hh(this.g).on(`mousemove`,null),this.cleanupVisibilityObserver()}componentDidUpdate(e){e.title!==this.props.title&&this.measureTitleHeight()}onChangeLabel=(e,t)=>{let{labels:n,onChangeLabels:r,isChart:i}=this.props;if(r){if(i){r(t===`left`?`range`:`domain`,e);return}r({...n,[t]:e})}};measureTitleHeight=()=>{let e=this.titleRef;if(e){let t=e.clientHeight;this.setState({titleHeight:t,prevTitle:this.props.title}),!this.resizeObserver&&typeof ResizeObserver<`u`&&this.setupVisibilityObserver()}};handleKeyDown=()=>{setTimeout(()=>{this.measureTitleHeight()},0)};setupVisibilityObserver=()=>{typeof ResizeObserver<`u`&&this.titleRef&&(this.resizeObserver=new ResizeObserver(e=>{for(let t of e){let{width:e,height:n}=t.contentRect;if(e>0&&n>0){setTimeout(()=>{this.measureTitleHeight()},10);break}}}),this.resizeObserver.observe(this.titleRef))};cleanupVisibilityObserver=()=>{this.resizeObserver&&=(this.resizeObserver.disconnect(),null)};render(){let{disabledTitle:e,disabledLabels:t,labels:n,labelsPlaceholders:r,titlePlaceholder:i,graphProps:a,children:o,defineChart:s,onChangeTitle:c,isChart:l,showLabels:u,showPixelGuides:d,showTitle:f,title:p,rootRef:m,mathMlOptions:h={},labelsCharactersLimit:g}=this.props,{size:{width:_=500,height:v=500},domain:y,range:b}=a,x=N$(j$(n?.left))&&M$(r)?48:70,S=N$(j$(n?.right))&&M$(r)?48:70,C=_+x+S+(y.padding||0)*2,w=v+80+(b.padding||0)*2,T=[`bold`,`italic`,`underline`,`superscript`,`subscript`,`strikethrough`,`math`],E=s&&d?v-160:v,D=parseInt(_/100),O=parseInt(E/100),k=parseInt(E%100),{titleHeight:A}=this.state;return(0,F.jsxs)(Z$,{children:[d&&(0,F.jsx)(i1,{style:{marginLeft:l?80:u?30:10},children:[...Array(D+1).keys()].map(e=>(0,F.jsx)(K$,{false:!0,children:(0,F.jsxs)(a1,{children:[(0,F.jsxs)(`div`,{children:[e*100,`px`]}),(0,F.jsx)(`div`,{children:`|`})]})},`top-guide-${e}`))}),f&&(e?(0,F.jsx)(`div`,{ref:e=>this.titleRef=e,style:{...l&&{width:C},...N$(j$(p))&&{display:`none`}},children:l?(0,F.jsx)(r1,{className:`disabledTitle`,dangerouslySetInnerHTML:{__html:p||``}}):(0,F.jsx)(n1,{className:`disabledTitle`,dangerouslySetInnerHTML:{__html:p||``}})}):(0,F.jsx)(`div`,{ref:e=>this.titleRef=e,children:l?(0,F.jsx)(r1,{className:d?`rightMargin`:``,children:(0,F.jsx)(p$,{...l&&{width:C},markup:p||``,onChange:c,placeholder:s&&i||!e&&`Click here to add a title for this graph`,toolbarOpts:{noPadding:!0,noBorder:!0},activePlugins:T,disableScrollbar:!0,onKeyDown:this.handleKeyDown})}):(0,F.jsx)(n1,{className:d?`rightMargin`:``,children:(0,F.jsx)(p$,{...l&&{width:C},markup:p||``,onChange:c,placeholder:s&&i||!e&&`Click here to add a title for this graph`,toolbarOpts:{noPadding:!0,noBorder:!0},activePlugins:T,disableScrollbar:!0,onKeyDown:this.handleKeyDown})})})),u&&!l&&(0,F.jsx)(U$,{side:`top`,text:n.top,disabledLabel:t,placeholder:r?.top,graphHeight:w,graphWidth:C,onChange:e=>this.onChangeLabel(e,`top`),mathMlOptions:h,preventNewLines:!0,charactersLimit:g}),(0,F.jsxs)(Q$,{children:[u&&(0,F.jsx)(U$,{side:`left`,text:n.left,disabledLabel:t,placeholder:r?.left,graphHeight:w,graphWidth:C,isChartLeftLabel:l&&!s,isDefineChartLeftLabel:l&&s,onChange:e=>this.onChangeLabel(e,`left`),mathMlOptions:h,preventNewLines:!0,charactersLimit:g}),s?(0,F.jsx)($$,{width:C,height:w,children:(0,F.jsx)(t1,{ref:e=>{this.g=e,m&&m(e)},transform:`translate(${x+(y.padding||0)}, ${40+(b.padding||0)})`,children:o})}):(0,F.jsx)(e1,{width:C,height:w,children:(0,F.jsx)(t1,{ref:e=>{this.g=e,m&&m(e)},transform:`translate(${x+(y.padding||0)}, ${40+(b.padding||0)})`,children:o})}),u&&!l&&(0,F.jsx)(U$,{side:`right`,text:n.right,disabledLabel:t,placeholder:r?.right,graphHeight:w,graphWidth:C,onChange:e=>this.onChangeLabel(e,`right`),mathMlOptions:h,preventNewLines:!0,charactersLimit:g}),d&&(0,F.jsx)(o1,{style:{paddingTop:k,marginTop:31},children:[...Array(O+1).keys()].reverse().map(e=>(0,F.jsx)(K$,{false:!0,children:(0,F.jsxs)(s1,{children:[`━ `,e*100,`px`]})},`top-guide-${e}`))})]}),u&&(0,F.jsx)(U$,{side:`bottom`,text:n.bottom,disabledLabel:t,placeholder:r?.bottom,graphHeight:w,graphWidth:C,titleHeight:A,isChartBottomLabel:l&&!s,isDefineChartBottomLabel:l&&s,onChange:e=>this.onChangeLabel(e,`bottom`),mathMlOptions:h,preventNewLines:!0,charactersLimit:g})]})}};function l1(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function u1(e){return typeof e==`function`||Object.prototype.toString.call(e)===`[object Function]`}function d1(e){return typeof e==`number`&&!isNaN(e)}function f1(e){return parseInt(e,10)}function p1(e,t,n){if(e[t])return Error(`Invalid prop ${t} passed to ${n} - do not set this, set it on the child.`)}var m1=[`Moz`,`Webkit`,`O`,`ms`];function h1(e=`transform`){if(typeof window>`u`)return``;let t=window.document?.documentElement?.style;if(!t||e in t)return``;for(let n=0;n<m1.length;n++)if(g1(e,m1[n])in t)return m1[n];return``}function g1(e,t){return t?`${t}${_1(e)}`:e}function _1(e){let t=``,n=!0;for(let r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):e[r]===`-`?n=!0:t+=e[r];return t}var v1=h1(),y1=``;function b1(e,t){y1||=l1([`matches`,`webkitMatchesSelector`,`mozMatchesSelector`,`msMatchesSelector`,`oMatchesSelector`],function(t){return u1(e[t])})??``;let n=e[y1];return u1(n)?!!n.call(e,t):!1}function x1(e,t,n){let r=e;do{if(b1(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function S1(e,t,n,r){if(!e)return;let i={capture:!0,...r},a=n;e.addEventListener?e.addEventListener(t,a,i):e.attachEvent?e.attachEvent(`on`+t,a):e[`on`+t]=a}function C1(e,t,n,r){if(!e)return;let i={capture:!0,...r},a=n;e.removeEventListener?e.removeEventListener(t,a,i):e.detachEvent?e.detachEvent(`on`+t,a):e[`on`+t]=null}function w1(e){let t=e.clientHeight,n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=f1(n.borderTopWidth),t+=f1(n.borderBottomWidth),t}function T1(e){let t=e.clientWidth,n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=f1(n.borderLeftWidth),t+=f1(n.borderRightWidth),t}function E1(e){let t=e.clientHeight,n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=f1(n.paddingTop),t-=f1(n.paddingBottom),t}function D1(e){let t=e.clientWidth,n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=f1(n.paddingLeft),t-=f1(n.paddingRight),t}function O1(e,t,n){let r=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect();return{x:(e.clientX+t.scrollLeft-r.left)/n,y:(e.clientY+t.scrollTop-r.top)/n}}function k1(e,t){let n=j1(e,t,`px`);return{[g1(`transform`,v1)]:n}}function A1(e,t){return j1(e,t,``)}function j1({x:e,y:t},n,r){let i=`translate(${e}${r},${t}${r})`;return n&&(i=`translate(${`${typeof n.x==`string`?n.x:n.x+r}`}, ${`${typeof n.y==`string`?n.y:n.y+r}`})`+i),i}function M1(e,t){return e.targetTouches&&l1(e.targetTouches,e=>t===e.identifier)||e.changedTouches&&l1(e.changedTouches,e=>t===e.identifier)}function N1(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function P1(){return typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0}function F1(e,t){if(!e)return;let n=e.getElementById(`react-draggable-style-el`);if(!n){n=e.createElement(`style`),n.type=`text/css`,n.id=`react-draggable-style-el`;let r=t??P1();r&&n.setAttribute(`nonce`,r),n.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
358
358
|
`,n.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
359
|
-
`,e.getElementsByTagName(`head`)[0].appendChild(n)}e.body&&R1(e.body,`react-draggable-transparent-selection`)}function I1(e){window.requestAnimationFrame?window.requestAnimationFrame(()=>{L1(e)}):L1(e)}function L1(e){if(e)try{e.body&&z1(e.body,`react-draggable-transparent-selection`);let t=e.selection;if(t)t.empty();else{let t=(e.defaultView||window).getSelection();t&&t.type!==`Caret`&&t.removeAllRanges()}}catch{}}function R1(e,t){e.classList?e.classList.add(t):e.className.match(RegExp(`(?:^|\\s)${t}(?!\\S)`))||(e.className+=` ${t}`)}function z1(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(RegExp(`(?:^|\\s)${t}(?!\\S)`,`g`),``)}function B1(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r==`string`?r:q1(r);let i=J1(e);if(typeof r==`string`){let{ownerDocument:e}=i,t=e.defaultView;if(!t)throw Error(`Cannot resolve the owner window of the draggable node.`);let n;if(n=r===`parent`?i.parentNode:i.getRootNode().querySelector(r),!(n instanceof t.HTMLElement))throw Error(`Bounds selector "`+r+`" could not find an element.`);let a=n,o=t.getComputedStyle(i),s=t.getComputedStyle(a);r={left:-i.offsetLeft+f1(s.paddingLeft)+f1(o.marginLeft),top:-i.offsetTop+f1(s.paddingTop)+f1(o.marginTop),right:D1(a)-T1(i)-i.offsetLeft+f1(s.paddingRight)-f1(o.marginRight),bottom:E1(a)-w1(i)-i.offsetTop+f1(s.paddingBottom)-f1(o.marginBottom)}}return d1(r.right)&&(t=Math.min(t,r.right)),d1(r.bottom)&&(n=Math.min(n,r.bottom)),d1(r.left)&&(t=Math.max(t,r.left)),d1(r.top)&&(n=Math.max(n,r.top)),[t,n]}function V1(e,t,n){return[Math.round(t/e[0])*e[0],Math.round(n/e[1])*e[1]]}function H1(e){return e.props.axis===`both`||e.props.axis===`x`}function U1(e){return e.props.axis===`both`||e.props.axis===`y`}function W1(e,t,n){let r=typeof t==`number`?M1(e,t):null;if(typeof t==`number`&&!r)return null;let i=J1(n),a=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return O1(r||e,a,n.props.scale)}function G1(e,t,n){let r=!d1(e.lastX),i=J1(e);return r?{node:i,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:i,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function K1(e,t){let n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function q1(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function J1(e){let t=e.findDOMNode();if(!t)throw Error(`<DraggableCore>: Unmounted during event!`);return t}var Y1=typeof process<`u`&&process.env.DRAGGABLE_DEBUG?console.log.bind(console):function(){},X1={touch:{start:`touchstart`,move:`touchmove`,stop:`touchend`},mouse:{start:`mousedown`,move:`mousemove`,stop:`mouseup`}},Z1=X1.mouse,Q1=class extends P.Component{constructor(){super(...arguments),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,this.touchIdentifier=null,this.mounted=!1,this.handleDragStart=e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&(typeof e.button==`number`&&e.button!==0||e.ctrlKey))return!1;let t=this.findDOMNode();if(!t||!t.ownerDocument||!t.ownerDocument.body)throw Error(`<DraggableCore> not mounted on DragStart!`);let{ownerDocument:n}=t;if(this.props.disabled||!(e.target instanceof n.defaultView.Node)||this.props.handle&&!x1(e.target,this.props.handle,t)||this.props.cancel&&x1(e.target,this.props.cancel,t))return;e.type===`touchstart`&&!this.props.allowMobileScroll&&e.preventDefault();let r=N1(e);this.touchIdentifier=r;let i=W1(e,r,this);if(i==null)return;let{x:a,y:o}=i,s=G1(this,a,o);Y1(`DraggableCore: handleDragStart: %j`,s),Y1(`calling`,this.props.onStart),!(this.props.onStart(e,s)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&F1(n,this.props.nonce),this.dragging=!0,this.lastX=a,this.lastY=o,S1(n,Z1.move,this.handleDrag),S1(n,Z1.stop,this.handleDragStop))},this.handleDrag=e=>{let t=W1(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX,t=r-this.lastY;if([e,t]=V1(this.props.grid,e,t),!e&&!t)return;n=this.lastX+e,r=this.lastY+t}let i=G1(this,n,r);if(Y1(`DraggableCore: handleDrag: %j`,i),this.props.onDrag(e,i)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent(`mouseup`))}catch{let e=document.createEvent(`MouseEvents`);e.initMouseEvent(`mouseup`,!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(e)}return}this.lastX=n,this.lastY=r},this.handleDragStop=e=>{if(!this.dragging)return;let t=W1(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX||0,t=r-this.lastY||0;[e,t]=V1(this.props.grid,e,t),n=this.lastX+e,r=this.lastY+t}let i=G1(this,n,r);if(this.props.onStop(e,i)===!1||this.mounted===!1)return!1;let a=this.findDOMNode();a&&this.props.enableUserSelectHack&&I1(a.ownerDocument),Y1(`DraggableCore: handleDragStop: %j`,i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&(Y1(`DraggableCore: Removing handlers`),C1(a.ownerDocument,Z1.move,this.handleDrag),C1(a.ownerDocument,Z1.stop,this.handleDragStop))},this.onMouseDown=e=>(Z1=X1.mouse,this.handleDragStart(e)),this.onMouseUp=e=>(Z1=X1.mouse,this.handleDragStop(e)),this.onTouchStart=e=>(Z1=X1.touch,this.handleDragStart(e)),this.onTouchEnd=e=>(Z1=X1.touch,this.handleDragStop(e))}componentDidMount(){this.mounted=!0;let e=this.findDOMNode();e&&S1(e,X1.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let e=this.findDOMNode();if(e){let{ownerDocument:t}=e;C1(t,X1.mouse.move,this.handleDrag),C1(t,X1.touch.move,this.handleDrag),C1(t,X1.mouse.stop,this.handleDragStop),C1(t,X1.touch.stop,this.handleDragStop),C1(e,X1.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&I1(t)}}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=Ms.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):(Y1(`react-draggable: ReactDOM.findDOMNode is not available in React 19+. You must provide a nodeRef prop. See: https://github.com/react-grid-layout/react-draggable#noderef`),null)}render(){return P.cloneElement(P.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Q1.displayName=`DraggableCore`,Q1.propTypes={allowAnyClick:v.bool,allowMobileScroll:v.bool,children:v.node.isRequired,disabled:v.bool,enableUserSelectHack:v.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw Error(`Draggable's offsetParent must be a DOM Node.`)},grid:v.arrayOf(v.number),handle:v.string,cancel:v.string,nodeRef:v.object,nonce:v.string,onStart:v.func,onDrag:v.func,onStop:v.func,onMouseDown:v.func,scale:v.number,className:p1,style:p1,transform:p1},Q1.defaultProps={allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1};var $1=class extends P.Component{constructor(e){super(e),this.onDragStart=(e,t)=>{if(Y1(`Draggable: onDragStart: %j`,t),this.props.onStart(e,K1(this,t))===!1)return!1;this.setState({dragging:!0,dragged:!0})},this.onDrag=(e,t)=>{if(!this.state.dragging)return!1;Y1(`Draggable: onDrag: %j`,t);let n=K1(this,t),r={x:n.x,y:n.y,slackX:0,slackY:0};if(this.props.bounds){let{x:e,y:t}=r;r.x+=this.state.slackX,r.y+=this.state.slackY;let[i,a]=B1(this,r.x,r.y);r.x=i,r.y=a,r.slackX=this.state.slackX+(e-r.x),r.slackY=this.state.slackY+(t-r.y),n.x=r.x,n.y=r.y,n.deltaX=r.x-this.state.x,n.deltaY=r.y-this.state.y}if(this.props.onDrag(e,n)===!1)return!1;this.setState(r)},this.onDragStop=(e,t)=>{if(!this.state.dragging||this.props.onStop(e,K1(this,t))===!1)return!1;Y1(`Draggable: onDragStop: %j`,t);let n={dragging:!1,slackX:0,slackY:0};if(this.props.position){let{x:e,y:t}=this.props.position;n.x=e,n.y=t}this.setState(n)},this.state={dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,prevPropsPosition:{...e.position},slackX:0,slackY:0,isElementSVG:!1},e.position&&!(e.onDrag||e.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}static getDerivedStateFromProps({position:e},{prevPropsPosition:t}){return e&&(!t||e.x!==t.x||e.y!==t.y)?(Y1(`Draggable: getDerivedStateFromProps %j`,{position:e,prevPropsPosition:t}),{x:e.x,y:e.y,prevPropsPosition:{...e}}):null}componentDidMount(){window.SVGElement!==void 0&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=Ms.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):null}render(){let{axis:e,bounds:t,children:n,defaultPosition:r,defaultClassName:i,defaultClassNameDragging:a,defaultClassNameDragged:o,position:s,positionOffset:c,scale:l,...u}=this.props,d={},f=null,p=!s||this.state.dragging,m=s||r,h={x:H1(this)&&p?this.state.x:m.x,y:U1(this)&&p?this.state.y:m.y};this.state.isElementSVG?f=A1(h,c):d=k1(h,c);let g=P.Children.only(n),_=I(g.props.className||``,i,{[a]:this.state.dragging,[o]:this.state.dragged});return P.createElement(Q1,{...u,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop},P.cloneElement(g,{className:_,style:{...g.props.style,...d},transform:f}))}};$1.displayName=`Draggable`,$1.propTypes={...Q1.propTypes,axis:v.oneOf([`both`,`x`,`y`,`none`]),bounds:v.oneOfType([v.shape({left:v.number,right:v.number,top:v.number,bottom:v.number}),v.string,v.oneOf([!1])]),defaultClassName:v.string,defaultClassNameDragging:v.string,defaultClassNameDragged:v.string,defaultPosition:v.shape({x:v.number,y:v.number}),positionOffset:v.shape({x:v.oneOfType([v.number,v.string]),y:v.oneOfType([v.number,v.string])}),position:v.shape({x:v.number,y:v.number}),className:p1,style:p1,transform:p1},$1.defaultProps={...Q1.defaultProps,axis:`both`,bounds:!1,defaultClassName:`react-draggable`,defaultClassNameDragging:`react-draggable-dragging`,defaultClassNameDragged:`react-draggable-dragged`,defaultPosition:{x:0,y:0},scale:1};var e0=Uu(`pie-lib:plot:grid-draggable`),t0=(e,t,n)=>r=>{let i=r+e(0);return t(n+e.invert(i)).toFixed(4)*1e3/1e3},n0=e=>t=>((0,T$.default)(!!e&&Bp(e.fromDelta)&&Bp(e.bounds)&&Bp(e.anchorPoint),`You must supply an object with: { anchorPoint: Function, fromDelta: Function, bounds: Function }`),class extends P.Component{static propTypes={disabled:v.bool,onDragStart:v.func,onDrag:v.func,onDragStop:v.func,onClick:v.func,onMove:v.func,graphProps:x$.isRequired};constructor(e){super(e),this.state={startX:null,startY:null}}grid=()=>{let{graphProps:e}=this.props,{scale:t,domain:n,range:r}=e;return{x:t.x(n.step)-t.x(0),y:t.y(r.step)-t.y(0)}};onStart=e=>{let{onDragStart:t}=this.props;document.activeElement&&document.activeElement.blur(),this._didDrag=!1,this.setState({startX:e.clientX,startY:e.clientY});let n=e.target,r=e=>{n.removeEventListener(`click`,r,!0),this._didDrag&&(e.stopPropagation(),e.preventDefault())};n.addEventListener(`click`,r,!0),t&&t()};position=()=>{let{x:t,y:n}=e.anchorPoint(this.props),{graphProps:r}=this.props,{scale:i,snap:a}=r;return{anchorPoint:{x:t,y:n},x:t0(i.x,a.x,t),y:t0(i.y,a.y,n)}};tiny=(e,t)=>{let n=e.toUpperCase(),r=Math.abs(t[`client${n}`]-this.state[`start${n}`]),i=r<Math.abs(this.grid()[e])/10;return e0(`[tiny] key: `,e,`delta: `,r,`out: `,i),i};getScaledBounds=()=>{let t=e.bounds(this.props,this.props.graphProps);e0(`bounds: `,t);let n=this.grid(),r={left:t.left*n.x,right:t.right*n.x,top:t.top*n.y,bottom:t.bottom*n.y},i=Math.abs(n.y);return r={...r,top:Math.min(0,r.top)-i,bottom:Math.abs(r.bottom)+i},e0(`[getScaledBounds]: `,r),r};getClientPoint=(e,t)=>{if(!e||!t)return null;let n=e.ownerSVGElement||e;if(n&&n.createSVGPoint){let r=n.createSVGPoint();if(t.touches&&t.touches.length>0){let e=t.touches[0];r.x=e.clientX,r.y=e.clientY}else r.x=t.clientX,r.y=t.clientY;return e.getScreenCTM?(r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]):null}let r=e.getBoundingClientRect();return r?[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]:null};skipDragOutsideOfBounds=(e,t,n)=>{let r=n.getRootNode(),i=this.getClientPoint(r,t);if(i===null)return!0;let[a,o]=i,{scale:s,domain:c,range:l}=n,u=s.x.invert(a),d=s.y.invert(o),f=e.deltaX>0&&u<c.min||e.deltaX<0&&u>c.max,p=e.deltaY>0&&d>l.max||e.deltaY<0&&d<l.min;return f||p};onDrag=(e,t)=>{let{onDrag:n,graphProps:r,disabled:i}=this.props;if((Math.abs(t.deltaX)>1||Math.abs(t.deltaY)>1)&&(this._didDrag=!0),!n||i)return;let a=this.getScaledBounds();if(t.deltaX<0&&t.deltaX<a.left||t.deltaX>0&&t.deltaX>a.right||t.deltaY<0&&t.deltaY<a.top||t.deltaY>0&&t.deltaY>a.bottom||this.skipDragOutsideOfBounds(t,e,r))return;let o=this.applyDelta({x:t.deltaX,y:t.deltaY});(o!==void 0||o!==null)&&n(o)};getDelta=e=>{let t=this.position(),n={x:t.x(e.x),y:t.y(e.y)};return A$(t.anchorPoint,n)};applyDelta=t=>{let n=this.getDelta(t);return e0(`[applyDelta] delta:`,n),e.fromDelta(this.props,n)};onStop=(e,t)=>{e0(`[onStop] dd:`,t);let{onDragStop:n,onClick:r,disabled:i}=this.props;if(n&&!i&&n(),e0(`[onStop] lastX/Y: `,t.lastX,t.lastY),!this._didDrag){if(!i&&typeof e?.stopPropagation==`function`&&e.stopPropagation(),r){e0(`call onClick`),this.setState({startX:null,startY:null});let{graphProps:t}=this.props,{scale:n,snap:i}=t;try{let[t,a]=Wh(e,e.target),o=n.x.invert(t),s=n.y.invert(a);o=i.x(o),s=i.y(s),r({x:o,y:s})}catch{r({})}}this.setState({startX:null,startY:null});return}this.setState({startX:null,startY:null})};render(){let{disabled:n,onClick:r,...i}=this.props,a=this.grid(),o=e=>e.nativeEvent.preventDefault(),s=this.state?!!this.state.startX:!1;return(0,F.jsx)(Q1,{onMouseDown:o,onStart:this.onStart,onDrag:this.onDrag,onStop:this.onStop,axis:e.axis||`both`,grid:[a.x,a.y],children:(0,F.jsx)(t,{...i,disabled:n,isDragging:s,onClick:s?void 0:r})})}});function r0(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function i0(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function a0(e){let t,n,r;e.length===2?(t=e===r0||e===i0?e:o0,n=e,r=e):(t=r0,n=(t,n)=>r0(e(t),n),r=(t,n)=>e(t)-n);function i(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<0?i=t+1:a=t}while(i<a)}return i}function a(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<=0?i=t+1:a=t}while(i<a)}return i}function o(e,t,n=0,a=e.length){let o=i(e,t,n,a-1);return o>n&&r(e[o-1],t)>-r(e[o],t)?o-1:o}return{left:i,center:o,right:a}}function o0(){return 0}function s0(e){return e===null?NaN:+e}var c0=a0(r0),l0=c0.right;c0.left,a0(s0).center;var u0=class extends Map{constructor(e,t=m0){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),e!=null)for(let[t,n]of e)this.set(t,n)}get(e){return super.get(d0(this,e))}has(e){return super.has(d0(this,e))}set(e,t){return super.set(f0(this,e),t)}delete(e){return super.delete(p0(this,e))}};function d0({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):n}function f0({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function p0({_intern:e,_key:t},n){let r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function m0(e){return typeof e==`object`&&e?e.valueOf():e}var h0=Math.sqrt(50),g0=Math.sqrt(10),_0=Math.sqrt(2);function v0(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=h0?10:a>=g0?5:a>=_0?2:1,s,c,l;return i<0?(l=10**-i/o,s=Math.round(e*l),c=Math.round(t*l),s/l<e&&++s,c/l>t&&--c,l=-l):(l=10**i*o,s=Math.round(e/l),c=Math.round(t/l),s*l<e&&++s,c*l>t&&--c),c<s&&.5<=n&&n<2?v0(e,t,n*2):[s,c,l]}function y0(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];let r=t<e,[i,a,o]=r?v0(t,e,n):v0(e,t,n);if(!(a>=i))return[];let s=a-i+1,c=Array(s);if(r)if(o<0)for(let e=0;e<s;++e)c[e]=(a-e)/-o;else for(let e=0;e<s;++e)c[e]=(a-e)*o;else if(o<0)for(let e=0;e<s;++e)c[e]=(i+e)/-o;else for(let e=0;e<s;++e)c[e]=(i+e)*o;return c}function b0(e,t,n){return t=+t,e=+e,n=+n,v0(e,t,n)[2]}function x0(e,t,n){t=+t,e=+e,n=+n;let r=t<e,i=r?b0(t,e,n):b0(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function S0(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=Array(i);++r<i;)a[r]=e+r*n;return a}function C0(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}var w0=Symbol(`implicit`);function T0(){var e=new u0,t=[],n=[],r=w0;function i(i){let a=e.get(i);if(a===void 0){if(r!==w0)return r;e.set(i,a=t.push(i)-1)}return n[a%n.length]}return i.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new u0;for(let r of n)e.has(r)||e.set(r,t.push(r)-1);return i},i.range=function(e){return arguments.length?(n=Array.from(e),i):n.slice()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return T0(t,n).unknown(r)},C0.apply(i,arguments),i}function E0(){var e=T0().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,s=!1,c=0,l=0,u=.5;delete e.unknown;function d(){var e=t().length,d=i<r,f=d?i:r,p=d?r:i;a=(p-f)/Math.max(1,e-c+l*2),s&&(a=Math.floor(a)),f+=(p-f-a*(e-c))*u,o=a*(1-c),s&&(f=Math.round(f),o=Math.round(o));var m=S0(e).map(function(e){return f+a*e});return n(d?m.reverse():m)}return e.domain=function(e){return arguments.length?(t(e),d()):t()},e.range=function(e){return arguments.length?([r,i]=e,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(e){return[r,i]=e,r=+r,i=+i,s=!0,d()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(e){return arguments.length?(s=!!e,d()):s},e.padding=function(e){return arguments.length?(c=Math.min(1,l=+e),d()):c},e.paddingInner=function(e){return arguments.length?(c=Math.min(1,e),d()):c},e.paddingOuter=function(e){return arguments.length?(l=+e,d()):l},e.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},e.copy=function(){return E0(t(),[r,i]).round(s).paddingInner(c).paddingOuter(l).align(u)},C0.apply(d(),arguments)}function D0(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return D0(t())},e}function O0(){return D0(E0.apply(null,arguments).paddingInner(1))}function k0(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function A0(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function j0(){}var M0=.7,N0=1/M0,P0=`\\s*([+-]?\\d+)\\s*`,F0=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,I0=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,L0=/^#([0-9a-f]{3,8})$/,R0=RegExp(`^rgb\\(${P0},${P0},${P0}\\)$`),z0=RegExp(`^rgb\\(${I0},${I0},${I0}\\)$`),B0=RegExp(`^rgba\\(${P0},${P0},${P0},${F0}\\)$`),V0=RegExp(`^rgba\\(${I0},${I0},${I0},${F0}\\)$`),H0=RegExp(`^hsl\\(${F0},${I0},${I0}\\)$`),U0=RegExp(`^hsla\\(${F0},${I0},${I0},${F0}\\)$`),W0={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};k0(j0,Y0,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:G0,formatHex:G0,formatHex8:K0,formatHsl:q0,formatRgb:J0,toString:J0});function G0(){return this.rgb().formatHex()}function K0(){return this.rgb().formatHex8()}function q0(){return c2(this).formatHsl()}function J0(){return this.rgb().formatRgb()}function Y0(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=L0.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?X0(t):n===3?new e2(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Z0(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Z0(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=R0.exec(e))?new e2(t[1],t[2],t[3],1):(t=z0.exec(e))?new e2(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=B0.exec(e))?Z0(t[1],t[2],t[3],t[4]):(t=V0.exec(e))?Z0(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=H0.exec(e))?s2(t[1],t[2]/100,t[3]/100,1):(t=U0.exec(e))?s2(t[1],t[2]/100,t[3]/100,t[4]):W0.hasOwnProperty(e)?X0(W0[e]):e===`transparent`?new e2(NaN,NaN,NaN,0):null}function X0(e){return new e2(e>>16&255,e>>8&255,e&255,1)}function Z0(e,t,n,r){return r<=0&&(e=t=n=NaN),new e2(e,t,n,r)}function Q0(e){return e instanceof j0||(e=Y0(e)),e?(e=e.rgb(),new e2(e.r,e.g,e.b,e.opacity)):new e2}function $0(e,t,n,r){return arguments.length===1?Q0(e):new e2(e,t,n,r??1)}function e2(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}k0(e2,$0,A0(j0,{brighter(e){return e=e==null?N0:N0**+e,new e2(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?M0:M0**+e,new e2(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new e2(a2(this.r),a2(this.g),a2(this.b),i2(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:t2,formatHex:t2,formatHex8:n2,formatRgb:r2,toString:r2}));function t2(){return`#${o2(this.r)}${o2(this.g)}${o2(this.b)}`}function n2(){return`#${o2(this.r)}${o2(this.g)}${o2(this.b)}${o2((isNaN(this.opacity)?1:this.opacity)*255)}`}function r2(){let e=i2(this.opacity);return`${e===1?`rgb(`:`rgba(`}${a2(this.r)}, ${a2(this.g)}, ${a2(this.b)}${e===1?`)`:`, ${e})`}`}function i2(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function a2(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function o2(e){return e=a2(e),(e<16?`0`:``)+e.toString(16)}function s2(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new u2(e,t,n,r)}function c2(e){if(e instanceof u2)return new u2(e.h,e.s,e.l,e.opacity);if(e instanceof j0||(e=Y0(e)),!e)return new u2;if(e instanceof u2)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new u2(o,s,c,e.opacity)}function l2(e,t,n,r){return arguments.length===1?c2(e):new u2(e,t,n,r??1)}function u2(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}k0(u2,l2,A0(j0,{brighter(e){return e=e==null?N0:N0**+e,new u2(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?M0:M0**+e,new u2(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new e2(p2(e>=240?e-240:e+120,i,r),p2(e,i,r),p2(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new u2(d2(this.h),f2(this.s),f2(this.l),i2(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=i2(this.opacity);return`${e===1?`hsl(`:`hsla(`}${d2(this.h)}, ${f2(this.s)*100}%, ${f2(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function d2(e){return e=(e||0)%360,e<0?e+360:e}function f2(e){return Math.max(0,Math.min(1,e||0))}function p2(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var m2=Math.PI/180,h2=180/Math.PI,g2=18,_2=.96422,v2=1,y2=.82521,b2=4/29,x2=6/29,S2=3*x2*x2,C2=x2*x2*x2;function w2(e){if(e instanceof E2)return new E2(e.l,e.a,e.b,e.opacity);if(e instanceof N2)return P2(e);e instanceof e2||(e=Q0(e));var t=A2(e.r),n=A2(e.g),r=A2(e.b),i=D2((.2225045*t+.7168786*n+.0606169*r)/v2),a,o;return t===n&&n===r?a=o=i:(a=D2((.4360747*t+.3850649*n+.1430804*r)/_2),o=D2((.0139322*t+.0971045*n+.7141733*r)/y2)),new E2(116*i-16,500*(a-i),200*(i-o),e.opacity)}function T2(e,t,n,r){return arguments.length===1?w2(e):new E2(e,t,n,r??1)}function E2(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}k0(E2,T2,A0(j0,{brighter(e){return new E2(this.l+g2*(e??1),this.a,this.b,this.opacity)},darker(e){return new E2(this.l-g2*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=_2*O2(t),e=v2*O2(e),n=y2*O2(n),new e2(k2(3.1338561*t-1.6168667*e-.4906146*n),k2(-.9787684*t+1.9161415*e+.033454*n),k2(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function D2(e){return e>C2?e**(1/3):e/S2+b2}function O2(e){return e>x2?e*e*e:S2*(e-b2)}function k2(e){return 255*(e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055)}function A2(e){return(e/=255)<=.04045?e/12.92:((e+.055)/1.055)**2.4}function j2(e){if(e instanceof N2)return new N2(e.h,e.c,e.l,e.opacity);if(e instanceof E2||(e=w2(e)),e.a===0&&e.b===0)return new N2(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*h2;return new N2(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function M2(e,t,n,r){return arguments.length===1?j2(e):new N2(e,t,n,r??1)}function N2(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function P2(e){if(isNaN(e.h))return new E2(e.l,0,0,e.opacity);var t=e.h*m2;return new E2(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}k0(N2,M2,A0(j0,{brighter(e){return new N2(this.h,this.c,this.l+g2*(e??1),this.opacity)},darker(e){return new N2(this.h,this.c,this.l-g2*(e??1),this.opacity)},rgb(){return P2(this).rgb()}}));var F2=-.14861,I2=1.78277,L2=-.29227,R2=-.90649,z2=1.97294,B2=z2*R2,V2=z2*I2,H2=I2*L2-R2*F2;function U2(e){if(e instanceof G2)return new G2(e.h,e.s,e.l,e.opacity);e instanceof e2||(e=Q0(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(H2*r+B2*t-V2*n)/(H2+B2-V2),a=r-i,o=(z2*(n-i)-L2*a)/R2,s=Math.sqrt(o*o+a*a)/(z2*i*(1-i)),c=s?Math.atan2(o,a)*h2-120:NaN;return new G2(c<0?c+360:c,s,i,e.opacity)}function W2(e,t,n,r){return arguments.length===1?U2(e):new G2(e,t,n,r??1)}function G2(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}k0(G2,W2,A0(j0,{brighter(e){return e=e==null?N0:N0**+e,new G2(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?M0:M0**+e,new G2(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*m2,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new e2(255*(t+n*(F2*r+I2*i)),255*(t+n*(L2*r+R2*i)),255*(t+z2*r*n),this.opacity)}}));var K2=e=>()=>e;function q2(e,t){return function(n){return e+n*t}}function J2(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function Y2(e,t){var n=t-e;return n?q2(e,n>180||n<-180?n-360*Math.round(n/360):n):K2(isNaN(e)?t:e)}function X2(e){return(e=+e)==1?Z2:function(t,n){return n-t?J2(t,n,e):K2(isNaN(t)?n:t)}}function Z2(e,t){var n=t-e;return n?q2(e,n):K2(isNaN(e)?t:e)}var Q2=(function e(t){var n=X2(t);function r(e,t){var r=n((e=$0(e)).r,(t=$0(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=Z2(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function $2(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function e4(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function t4(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o;for(o=0;o<r;++o)i[o]=u4(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function n4(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function r4(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function i4(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=u4(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var a4=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,o4=new RegExp(a4.source,`g`);function s4(e){return function(){return e}}function c4(e){return function(t){return e(t)+``}}function l4(e,t){var n=a4.lastIndex=o4.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=a4.exec(e))&&(i=o4.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:r4(r,i)})),n=o4.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?c4(c[0].x):s4(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function u4(e,t){var n=typeof t,r;return t==null||n===`boolean`?K2(t):(n===`number`?r4:n===`string`?(r=Y0(t))?(t=r,Q2):l4:t instanceof Y0?Q2:t instanceof Date?n4:e4(t)?$2:Array.isArray(t)?t4:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?i4:r4)(e,t)}function d4(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function f4(e){return function(t,n){var r=e((t=l2(t)).h,(n=l2(n)).h),i=Z2(t.s,n.s),a=Z2(t.l,n.l),o=Z2(t.opacity,n.opacity);return function(e){return t.h=r(e),t.s=i(e),t.l=a(e),t.opacity=o(e),t+``}}}var p4=f4(Y2),m4=f4(Z2);function h4(e,t){var n=Z2((e=T2(e)).l,(t=T2(t)).l),r=Z2(e.a,t.a),i=Z2(e.b,t.b),a=Z2(e.opacity,t.opacity);return function(t){return e.l=n(t),e.a=r(t),e.b=i(t),e.opacity=a(t),e+``}}function g4(e){return function(t,n){var r=e((t=M2(t)).h,(n=M2(n)).h),i=Z2(t.c,n.c),a=Z2(t.l,n.l),o=Z2(t.opacity,n.opacity);return function(e){return t.h=r(e),t.c=i(e),t.l=a(e),t.opacity=o(e),t+``}}}var _4=g4(Y2),v4=g4(Z2);function y4(e){return(function t(n){n=+n;function r(t,r){var i=e((t=W2(t)).h,(r=W2(r)).h),a=Z2(t.s,r.s),o=Z2(t.l,r.l),s=Z2(t.opacity,r.opacity);return function(e){return t.h=i(e),t.s=a(e),t.l=o(e**+n),t.opacity=s(e),t+``}}return r.gamma=t,r})(1)}var b4=y4(Y2),x4=y4(Z2);function S4(e){return function(){return e}}function C4(e){return+e}var w4=[0,1];function T4(e){return e}function E4(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:S4(isNaN(t)?NaN:.5)}function D4(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}function O4(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=E4(i,r),a=n(o,a)):(r=E4(r,i),a=n(a,o)),function(e){return a(r(e))}}function k4(e,t,n){var r=Math.min(e.length,t.length)-1,i=Array(r),a=Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=E4(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(t){var n=l0(e,t,1,r)-1;return a[n](i[n](t))}}function A4(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function j4(){var e=w4,t=w4,n=u4,r,i,a,o=T4,s,c,l;function u(){var n=Math.min(e.length,t.length);return o!==T4&&(o=D4(e[0],e[n-1])),s=n>2?k4:O4,c=l=null,d}function d(i){return i==null||isNaN(i=+i)?a:(c||=s(e.map(r),t,n))(r(o(i)))}return d.invert=function(n){return o(i((l||=s(t,e.map(r),r4))(n)))},d.domain=function(t){return arguments.length?(e=Array.from(t,C4),u()):e.slice()},d.range=function(e){return arguments.length?(t=Array.from(e),u()):t.slice()},d.rangeRound=function(e){return t=Array.from(e),n=d4,u()},d.clamp=function(e){return arguments.length?(o=e?!0:T4,u()):o!==T4},d.interpolate=function(e){return arguments.length?(n=e,u()):n},d.unknown=function(e){return arguments.length?(a=e,d):a},function(e,t){return r=e,i=t,u()}}function M4(){return j4()(T4,T4)}function N4(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}function P4(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf(`e`),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function F4(e){return e=P4(Math.abs(e)),e?e[1]:NaN}function I4(e,t){return function(n,r){for(var i=n.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function L4(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}var R4=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function z4(e){if(!(t=R4.exec(e)))throw Error(`invalid format: `+e);var t;return new B4({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}z4.prototype=B4.prototype;function B4(e){this.fill=e.fill===void 0?` `:e.fill+``,this.align=e.align===void 0?`>`:e.align+``,this.sign=e.sign===void 0?`-`:e.sign+``,this.symbol=e.symbol===void 0?``:e.symbol+``,this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?``:e.type+``}B4.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?`0`:``)+(this.width===void 0?``:Math.max(1,this.width|0))+(this.comma?`,`:``)+(this.precision===void 0?``:`.`+Math.max(0,this.precision|0))+(this.trim?`~`:``)+this.type};function V4(e){out:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case`.`:r=i=n;break;case`0`:r===0&&(r=n),i=n;break;default:if(!+e[n])break out;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var H4;function U4(e,t){var n=P4(e,t);if(!n)return H4=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(H4=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+Array(a-o+1).join(`0`):a>0?r.slice(0,a)+`.`+r.slice(a):`0.`+Array(1-a).join(`0`)+P4(e,Math.max(0,t+a-1))[0]}function W4(e,t){var n=P4(e,t);if(!n)return e+``;var r=n[0],i=n[1];return i<0?`0.`+Array(-i).join(`0`)+r:r.length>i+1?r.slice(0,i+1)+`.`+r.slice(i+1):r+Array(i-r.length+2).join(`0`)}var G4={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+``,d:N4,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>W4(e*100,t),r:W4,s:U4,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function K4(e){return e}var q4=Array.prototype.map,J4=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`];function Y4(e){var t=e.grouping===void 0||e.thousands===void 0?K4:I4(q4.call(e.grouping,Number),e.thousands+``),n=e.currency===void 0?``:e.currency[0]+``,r=e.currency===void 0?``:e.currency[1]+``,i=e.decimal===void 0?`.`:e.decimal+``,a=e.numerals===void 0?K4:L4(q4.call(e.numerals,String)),o=e.percent===void 0?`%`:e.percent+``,s=e.minus===void 0?`−`:e.minus+``,c=e.nan===void 0?`NaN`:e.nan+``;function l(e,l){e=z4(e);var u=e.fill,d=e.align,f=e.sign,p=e.symbol,m=e.zero,h=e.width,g=e.comma,_=e.precision,v=e.trim,y=e.type;y===`n`?(g=!0,y=`g`):G4[y]||(_===void 0&&(_=12),v=!0,y=`g`),(m||u===`0`&&d===`=`)&&(m=!0,u=`0`,d=`=`);var b=(l&&l.prefix!==void 0?l.prefix:``)+(p===`$`?n:p===`#`&&/[boxX]/.test(y)?`0`+y.toLowerCase():``),x=(p===`$`?r:/[%p]/.test(y)?o:``)+(l&&l.suffix!==void 0?l.suffix:``),S=G4[y],C=/[defgprs%]/.test(y);_=_===void 0?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function w(e){var n=b,r=x,o,l,p;if(y===`c`)r=S(e)+r,e=``;else{e=+e;var w=e<0||1/e<0;if(e=isNaN(e)?c:S(Math.abs(e),_),v&&(e=V4(e)),w&&+e==0&&f!==`+`&&(w=!1),n=(w?f===`(`?f:s:f===`-`||f===`(`?``:f)+n,r=(y===`s`&&!isNaN(e)&&H4!==void 0?J4[8+H4/3]:``)+r+(w&&f===`(`?`)`:``),C){for(o=-1,l=e.length;++o<l;)if(p=e.charCodeAt(o),48>p||p>57){r=(p===46?i+e.slice(o+1):e.slice(o))+r,e=e.slice(0,o);break}}}g&&!m&&(e=t(e,1/0));var T=n.length+e.length+r.length,E=T<h?Array(h-T+1).join(u):``;switch(g&&m&&(e=t(E+e,E.length?h-r.length:1/0),E=``),d){case`<`:e=n+e+r+E;break;case`=`:e=n+E+e+r;break;case`^`:e=E.slice(0,T=E.length>>1)+n+e+r+E.slice(T);break;default:e=E+n+e+r;break}return a(e)}return w.toString=function(){return e+``},w}function u(e,t){var n=Math.max(-8,Math.min(8,Math.floor(F4(t)/3)))*3,r=10**-n,i=l((e=z4(e),e.type=`f`,e),{suffix:J4[8+n/3]});return function(e){return i(r*e)}}return{format:l,formatPrefix:u}}var X4,Z4,Q4;$4({thousands:`,`,grouping:[3],currency:[`$`,``]});function $4(e){return X4=Y4(e),Z4=X4.format,Q4=X4.formatPrefix,X4}function e3(e){return Math.max(0,-F4(Math.abs(e)))}function t3(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(F4(t)/3)))*3-F4(Math.abs(e)))}function n3(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,F4(t)-F4(e))+1}function r3(e,t,n,r){var i=x0(e,t,n),a;switch(r=z4(r??`,f`),r.type){case`s`:var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=t3(i,o))&&(r.precision=a),Q4(r,o);case``:case`e`:case`g`:case`p`:case`r`:r.precision==null&&!isNaN(a=n3(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type===`e`));break;case`f`:case`%`:r.precision==null&&!isNaN(a=e3(i))&&(r.precision=a-(r.type===`%`)*2);break}return Z4(r)}function i3(e){var t=e.domain;return e.ticks=function(e){var n=t();return y0(n[0],n[n.length-1],e??10)},e.tickFormat=function(e,n){var r=t();return r3(r[0],r[r.length-1],e??10,n)},e.nice=function(n){n??=10;var r=t(),i=0,a=r.length-1,o=r[i],s=r[a],c,l,u=10;for(s<o&&(l=o,o=s,s=l,l=i,i=a,a=l);u-->0;){if(l=b0(o,s,n),l===c)return r[i]=o,r[a]=s,t(r);if(l>0)o=Math.floor(o/l)*l,s=Math.ceil(s/l)*l;else if(l<0)o=Math.ceil(o*l)/l,s=Math.floor(s*l)/l;else break;c=l}return e},e}function a3(){var e=M4();return e.copy=function(){return A4(e,a3())},C0.apply(e,arguments),i3(e)}var o3=new Date,s3=new Date;function c3(e,t,n,r){function i(t){return e(t=arguments.length===0?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{let t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=(e,n)=>(t(e=new Date(+e),n==null?1:Math.floor(n)),e),i.range=(n,r,a)=>{let o=[];if(n=i.ceil(n),a=a==null?1:Math.floor(a),!(n<r)||!(a>0))return o;let s;do o.push(s=new Date(+n)),t(n,a),e(n);while(s<n&&n<r);return o},i.filter=n=>c3(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,r)=>{if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}),n&&(i.count=(t,r)=>(o3.setTime(+t),s3.setTime(+r),e(o3),e(s3),Math.floor(n(o3,s3))),i.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?i.filter(r?t=>r(t)%e===0:t=>i.count(0,t)%e===0):i)),i}var l3=1e3,u3=l3*60,d3=u3*60,f3=d3*24,p3=f3*7;f3*30,f3*365;var m3=c3(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*l3)},(e,t)=>(t-e)/l3,e=>e.getUTCSeconds());m3.range;var h3=c3(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*l3)},(e,t)=>{e.setTime(+e+t*u3)},(e,t)=>(t-e)/u3,e=>e.getMinutes());h3.range;var g3=c3(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*u3)},(e,t)=>(t-e)/u3,e=>e.getUTCMinutes());g3.range;var _3=c3(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*l3-e.getMinutes()*u3)},(e,t)=>{e.setTime(+e+t*d3)},(e,t)=>(t-e)/d3,e=>e.getHours());_3.range;var v3=c3(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*d3)},(e,t)=>(t-e)/d3,e=>e.getUTCHours());v3.range;var y3=c3(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*u3)/f3,e=>e.getDate()-1);y3.range;var b3=c3(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/f3,e=>e.getUTCDate()-1);b3.range,c3(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/f3,e=>Math.floor(e/f3)).range;function x3(e){return c3(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+t*7)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*u3)/p3)}var S3=x3(0),C3=x3(1),w3=x3(2),T3=x3(3),E3=x3(4),D3=x3(5),O3=x3(6);S3.range,C3.range,w3.range,T3.range,E3.range,D3.range,O3.range;function k3(e){return c3(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t*7)},(e,t)=>(t-e)/p3)}var A3=k3(0),j3=k3(1),M3=k3(2),N3=k3(3),P3=k3(4),F3=k3(5),I3=k3(6);A3.range,j3.range,M3.range,N3.range,P3.range,F3.range,I3.range;var L3=c3(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());L3.range;var R3=c3(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());R3.range;var z3=c3(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());z3.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:c3(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}),z3.range;var B3=c3(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());B3.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:c3(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}),B3.range;var V3=({min:e,max:t,step:n})=>({step:n,min:parseInt(e/n)*n,max:parseInt(t/n)*n}),H3=(e,t,n,r)=>{(0,T$.default)(e.min<e.max,`domain: min must be less than max`),(0,T$.default)(t.min<t.max,`range: min must be less than max`);let i=V3(e),a=V3(t);return{scale:{x:a3().domain([e.min,e.max]).range([0,n.width]),y:a3().domain([t.max,t.min]).range([0,n.height])},snap:{x:D$.bind(null,i.min,i.max,i.step),y:D$.bind(null,a.min,a.max,a.step)},domain:e,range:t,size:n,getRootNode:r}};function U3(e){return Br(`PrivateSwitchBase`,e)}Vr(`PrivateSwitchBase`,[`root`,`checked`,`disabled`,`input`,`edgeStart`,`edgeEnd`]);var W3=e=>{let{classes:t,checked:n,disabled:r,edge:i}=e;return ca({root:[`root`,n&&`checked`,r&&`disabled`,i&&`edge${B(i)}`],input:[`input`]},U3,t)},G3=R(Ld,{name:`MuiSwitchBase`})({padding:9,borderRadius:`50%`,variants:[{props:{edge:`start`,size:`small`},style:{marginLeft:-3}},{props:({edge:e,ownerState:t})=>e===`start`&&t.size!==`small`,style:{marginLeft:-12}},{props:{edge:`end`,size:`small`},style:{marginRight:-3}},{props:({edge:e,ownerState:t})=>e===`end`&&t.size!==`small`,style:{marginRight:-12}}]}),K3=R(`input`,{name:`MuiSwitchBase`,shouldForwardProp:Co})({cursor:`inherit`,position:`absolute`,opacity:0,width:`100%`,height:`100%`,top:0,left:0,margin:0,padding:0,zIndex:1}),q3=P.forwardRef(function(e,t){let{autoFocus:n,checked:r,checkedIcon:i,defaultChecked:a,disabled:o,disableFocusRipple:s=!1,edge:c=!1,icon:l,id:u,inputProps:d,inputRef:f,name:p,onBlur:m,onChange:h,onFocus:g,readOnly:_,required:v=!1,tabIndex:y,type:b,value:x,slots:S={},slotProps:C={},...w}=e,[T,E]=yl({controlled:r,default:!!a,name:`SwitchBase`,state:`checked`}),D=Of(),O=e=>{g&&g(e),D&&D.onFocus&&D.onFocus(e)},k=e=>{m&&m(e),D&&D.onBlur&&D.onBlur(e)},A=e=>{if(e.nativeEvent.defaultPrevented||_)return;let t=e.target.checked;E(t),h&&h(e,t)},j=o;D&&j===void 0&&(j=D.disabled);let M=b===`checkbox`||b===`radio`,ee={...e,checked:T,disabled:j,disableFocusRipple:s,edge:c},N=W3(ee),te={slots:S,slotProps:{input:d,...C}},[ne,re]=zc(`root`,{ref:t,elementType:G3,className:N.root,shouldForwardComponentProp:!0,externalForwardedProps:{...te,component:`span`,...w},getSlotProps:e=>({...e,onFocus:t=>{e.onFocus?.(t),O(t)},onBlur:t=>{e.onBlur?.(t),k(t)}}),ownerState:ee,additionalProps:{centerRipple:!0,focusRipple:!s,role:void 0,tabIndex:null}}),[ie,ae]=zc(`input`,{ref:f,elementType:K3,className:N.input,externalForwardedProps:te,getSlotProps:e=>({...e,onChange:t=>{e.onChange?.(t),A(t)}}),ownerState:ee,additionalProps:{autoFocus:n,checked:r,defaultChecked:a,disabled:j,id:M?u:void 0,name:p,readOnly:_,required:v,tabIndex:y,type:b,...b===`checkbox`&&x===void 0?{}:{value:x}}});return(0,F.jsxs)(ne,{...re,children:[(0,F.jsx)(ie,{...ae}),T?i:l]})}),J3=ml((0,F.jsx)(`path`,{d:`M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z`}),`CheckBoxOutlineBlank`),Y3=ml((0,F.jsx)(`path`,{d:`M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z`}),`CheckBox`),X3=ml((0,F.jsx)(`path`,{d:`M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z`}),`IndeterminateCheckBox`);function Z3(e){return Br(`MuiCheckbox`,e)}var Q3=Vr(`MuiCheckbox`,[`root`,`checked`,`disabled`,`indeterminate`,`colorPrimary`,`colorSecondary`,`sizeSmall`,`sizeMedium`]),$3=e=>{let{classes:t,indeterminate:n,color:r,size:i}=e,a=ca({root:[`root`,n&&`indeterminate`,`color${B(r)}`,`size${B(i)}`]},Z3,t);return{...t,...a}},e6=R(q3,{shouldForwardProp:e=>Co(e)||e===`classes`,name:`MuiCheckbox`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.indeterminate&&t.indeterminate,t[`size${B(n.size)}`],n.color!=="default"&&t[`color${B(n.color)}`]]}})(Nc(({theme:e})=>({color:(e.vars||e).palette.text.secondary,variants:[{props:{color:`default`,disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity)}}},...Object.entries(e.palette).filter(Vd()).map(([t])=>({props:{color:t,disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}}})),...Object.entries(e.palette).filter(Vd()).map(([t])=>({props:{color:t},style:{[`&.${Q3.checked}, &.${Q3.indeterminate}`]:{color:(e.vars||e).palette[t].main},[`&.${Q3.disabled}`]:{color:(e.vars||e).palette.action.disabled}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:`transparent`}}}}]}))),t6=(0,F.jsx)(Y3,{}),n6=(0,F.jsx)(J3,{}),r6=(0,F.jsx)(X3,{}),i6=P.forwardRef(function(e,t){let n=cs({props:e,name:`MuiCheckbox`}),{checkedIcon:r=t6,color:i=`primary`,icon:a=n6,indeterminate:o=!1,indeterminateIcon:s=r6,inputProps:c,size:l=`medium`,disableRipple:u=!1,className:d,slots:f={},slotProps:p={},...m}=n,h=o?s:a,g=o?s:r,_={...n,disableRipple:u,color:i,indeterminate:o,size:l},v=$3(_),y=p.input??c,[b,x]=zc(`root`,{ref:t,elementType:e6,className:I(v.root,d),shouldForwardComponentProp:!0,externalForwardedProps:{slots:f,slotProps:p,...m},ownerState:_,additionalProps:{type:`checkbox`,icon:P.cloneElement(h,{fontSize:h.props.fontSize??l}),checkedIcon:P.cloneElement(g,{fontSize:g.props.fontSize??l}),disableRipple:u,slots:f,slotProps:{input:Sl(typeof y==`function`?y(_):y,{"data-indeterminate":o,"aria-checked":o?`mixed`:void 0})}}});return(0,F.jsx)(b,{...x,classes:v})}),a6=R(mY)(()=>({fontSize:`max(1.25rem, 18px)`})),o6=R(vY)(()=>({fontSize:`max(1rem, 14px)`})),s6=({text:e,title:t,onClose:n,onConfirm:r,open:i,onCloseText:a,onConfirmText:o,disableAutoFocus:s,disableEnforceFocus:c,disableRestoreFocus:l})=>(0,F.jsxs)(yJ,{open:i,disableAutoFocus:s,disableEnforceFocus:c,disableRestoreFocus:l,onClose:n,children:[t&&(0,F.jsx)(a6,{children:t}),e&&(0,F.jsx)(Jq,{children:(0,F.jsx)(o6,{children:e})}),(0,F.jsxs)(uJ,{children:[n&&(0,F.jsx)(ff,{onClick:n,color:`primary`,children:a}),r&&(0,F.jsx)(ff,{autoFocus:!0,onClick:r,color:`primary`,children:o})]})]});s6.defaultProps={onCloseText:`CANCEL`,onConfirmText:`OK`,disableAutoFocus:!1,disableEnforceFocus:!1,disableRestoreFocus:!1},s6.propTypes={text:v.oneOfType([v.string,v.object]),title:v.string,onClose:v.func,onConfirm:v.func,open:v.bool,onConfirmText:v.string,onCloseText:v.string,disableAutoFocus:v.bool,disableEnforceFocus:v.bool,disableRestoreFocus:v.bool};function c6(e){return typeof e==`function`||typeof e==`object`&&!!e&&typeof e.$$typeof==`symbol`}function l6(e,t){return!e||c6(e)?e:c6(e.default)?e.default:t&&c6(e[t])?e[t]:t&&c6(e[t]?.default)?e[t].default:e}l6(Jf,`InputContainer`)||l6(f6.InputContainer,`InputContainer`);var u6=Op,d6=u6.default,f6=d6&&typeof d6==`object`?d6:u6,p6=o(((e,t)=>{(function(){"use strict";var e={}.hasOwnProperty;function n(){for(var e=``,t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=i(e,r(n)))}return e}function r(t){if(typeof t==`string`||typeof t==`number`)return t;if(typeof t!=`object`)return``;if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes(`[native code]`))return t.toString();var r=``;for(var a in t)e.call(t,a)&&t[a]&&(r=i(r,a));return r}function i(e,t){return t?e?e+` `+t:e+t:e}t!==void 0&&t.exports?(n.default=n,t.exports=n):typeof define==`function`&&typeof define.amd==`object`&&define.amd?define(`classnames`,[],function(){return n}):window.classNames=n})()}));function m6(e){return function(){return e}}var h6=Math.PI,g6=2*h6,_6=1e-6,v6=g6-_6;function y6(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function b6(e){let t=Math.floor(e);if(!(t>=0))throw Error(`invalid digits: ${e}`);if(t>15)return y6;let n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}var x6=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._=``,this._append=e==null?y6:b6(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,i,a){this._append`C${+e},${+t},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(e,t,n,r,i){if(e=+e,t=+t,n=+n,r=+r,i=+i,i<0)throw Error(`negative radius: ${i}`);let a=this._x1,o=this._y1,s=n-e,c=r-t,l=a-e,u=o-t,d=l*l+u*u;if(this._x1===null)this._append`M${this._x1=e},${this._y1=t}`;else if(d>_6)if(!(Math.abs(u*s-c*l)>_6)||!i)this._append`L${this._x1=e},${this._y1=t}`;else{let f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((h6-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>_6&&this._append`L${e+y*l},${t+y*u}`,this._append`A${i},${i},0,0,${+(u*f>l*p)},${this._x1=e+b*s},${this._y1=t+b*c}`}}arc(e,t,n,r,i,a){if(e=+e,t=+t,n=+n,a=!!a,n<0)throw Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;this._x1===null?this._append`M${c},${l}`:(Math.abs(this._x1-c)>_6||Math.abs(this._y1-l)>_6)&&this._append`L${c},${l}`,n&&(d<0&&(d=d%g6+g6),d>v6?this._append`A${n},${n},0,1,${u},${e-o},${t-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:d>_6&&this._append`A${n},${n},0,${+(d>=h6)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};function S6(){return new x6}S6.prototype=x6.prototype;function C6(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{let e=Math.floor(n);if(!(e>=0))throw RangeError(`invalid digits: ${n}`);t=e}return e},()=>new x6(t)}Array.prototype.slice;function w6(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function T6(e){this._context=e}T6.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function E6(e){return new T6(e)}function D6(e){return e[0]}function O6(e){return e[1]}function k6(e,t){var n=m6(!0),r=null,i=E6,a=null,o=C6(s);e=typeof e==`function`?e:e===void 0?D6:m6(e),t=typeof t==`function`?t:t===void 0?O6:m6(t);function s(s){var c,l=(s=w6(s)).length,u,d=!1,f;for(r??(a=i(f=o())),c=0;c<=l;++c)!(c<l&&n(u=s[c],c,s))===d&&((d=!d)?a.lineStart():a.lineEnd()),d&&a.point(+e(u,c,s),+t(u,c,s));if(f)return a=null,f+``||null}return s.x=function(t){return arguments.length?(e=typeof t==`function`?t:m6(+t),s):e},s.y=function(e){return arguments.length?(t=typeof e==`function`?e:m6(+e),s):t},s.defined=function(e){return arguments.length?(n=typeof e==`function`?e:m6(!!e),s):n},s.curve=function(e){return arguments.length?(i=e,r!=null&&(a=i(r)),s):i},s.context=function(e){return arguments.length?(e==null?r=a=null:a=i(r=e),s):r},s}function A6(e,t){e(t)}function j6(){let{x:e,y:t,defined:n,curve:r}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=k6();return e&&A6(i.x,e),t&&A6(i.y,t),n&&i.defined(n),r&&i.curve(r),i}var M6=l(p6());function N6(e){let{top:t=0,left:n=0,transform:r,className:i,children:a,innerRef:o,...s}=e;return(0,F.jsx)(`g`,{ref:o,className:(0,M6.default)(`visx-group`,i),transform:r||`translate(${n}, ${t})`,...s,children:a})}function P6(e){let{from:t={x:0,y:0},to:n={x:1,y:1},fill:r=`transparent`,className:i,innerRef:a,...o}=e,s=t.x===n.x||t.y===n.y;return(0,F.jsx)(`line`,{ref:a,className:(0,M6.default)(`visx-line`,i),x1:t.x,y1:t.y,x2:n.x,y2:n.y,fill:r,shapeRendering:s?`crispEdges`:`auto`,...o})}function F6(e){let{children:t,data:n=[],x:r,y:i,fill:a=`transparent`,className:o,curve:s,innerRef:c,defined:l=()=>!0,...u}=e,d=j6({x:r,y:i,defined:l,curve:s});return t?(0,F.jsx)(F.Fragment,{children:t({path:d})}):(0,F.jsx)(`path`,{ref:c,className:(0,M6.default)(`visx-linepath`,o),d:d(n)||``,fill:a,strokeLinecap:`round`,...u})}function I6(e){let{className:t,innerRef:n,...r}=e;return(0,F.jsx)(`rect`,{ref:n,className:(0,M6.default)(`visx-bar`,t),...r})}function L6(e){let{className:t,innerRef:n,...r}=e;return(0,F.jsx)(`circle`,{ref:n,className:(0,M6.default)(`visx-circle`,t),...r})}var R6=class{x=0;y=0;constructor(e){let{x:t=0,y:n=0}=e;this.x=t,this.y=n}value(){return{x:this.x,y:this.y}}toArray(){return[this.x,this.y]}};function z6(e,t){t.domain&&(`nice`in e||`quantiles`in e||`padding`in e,e.domain(t.domain))}function B6(e,t){t.range&&(`padding`in e,e.range(t.range))}function V6(e,t){`align`in e&&`align`in t&&t.align!==void 0&&e.align(t.align)}function H6(e,t){`base`in e&&`base`in t&&t.base!==void 0&&e.base(t.base)}function U6(e,t){`clamp`in e&&`clamp`in t&&t.clamp!==void 0&&e.clamp(t.clamp)}function W6(e,t){`constant`in e&&`constant`in t&&t.constant!==void 0&&e.constant(t.constant)}function G6(e,t){`exponent`in e&&`exponent`in t&&t.exponent!==void 0&&e.exponent(t.exponent)}var K6={lab:h4,hcl:_4,"hcl-long":v4,hsl:p4,"hsl-long":m4,cubehelix:b4,"cubehelix-long":x4,rgb:Q2};function q6(e){switch(e){case`lab`:case`hcl`:case`hcl-long`:case`hsl`:case`hsl-long`:case`cubehelix`:case`cubehelix-long`:case`rgb`:return K6[e];default:}let{type:t,gamma:n}=e,r=K6[t];return n===void 0?r:r.gamma(n)}function J6(e,t){if(`interpolate`in t&&`interpolate`in e&&t.interpolate!==void 0){let n=q6(t.interpolate);e.interpolate(n)}}var Y6=new Date(Date.UTC(2020,1,2,3,4,5)),X6=`%Y-%m-%d %H:%M`;function Z6(e){return e.tickFormat(1,X6)(Y6)===`2020-02-02 03:04`}var Q6={day:y3,hour:_3,minute:h3,month:L3,second:m3,week:S3,year:z3},$6={day:b3,hour:v3,minute:g3,month:R3,second:m3,week:A3,year:B3};function e8(e,t){if(`nice`in t&&t.nice!==void 0&&`nice`in e){let{nice:n}=t;if(typeof n==`boolean`)n&&e.nice();else if(typeof n==`number`)e.nice(n);else{let t=e,r=Z6(t);if(typeof n==`string`)t.nice(r?$6[n]:Q6[n]);else{let{interval:e,step:i}=n,a=(r?$6[e]:Q6[e]).every(i);a!=null&&t.nice(a)}}}}function t8(e,t){`padding`in e&&`padding`in t&&t.padding!==void 0&&e.padding(t.padding),`paddingInner`in e&&`paddingInner`in t&&t.paddingInner!==void 0&&e.paddingInner(t.paddingInner),`paddingOuter`in e&&`paddingOuter`in t&&t.paddingOuter!==void 0&&e.paddingOuter(t.paddingOuter)}function n8(e,t){if(t.reverse){let t=e.range().slice().reverse();`padding`in e,e.range(t)}}function r8(e,t){`round`in t&&t.round!==void 0&&(t.round&&`interpolate`in t&&t.interpolate!==void 0?console.warn(`[visx/scale/applyRound] ignoring round: scale config contains round and interpolate. only applying interpolate. config:`,t):`round`in e?e.round(t.round):`interpolate`in e&&t.round&&e.interpolate(d4))}function i8(e,t){`unknown`in e&&`unknown`in t&&t.unknown!==void 0&&e.unknown(t.unknown)}function a8(e,t){if(`zero`in t&&t.zero===!0){let[t,n]=e.domain(),r=n<t,[i,a]=r?[n,t]:[t,n],o=[Math.min(0,i),Math.max(0,a)];e.domain(r?o.reverse():o)}}var o8=[`domain`,`nice`,`zero`,`interpolate`,`round`,`range`,`reverse`,`align`,`base`,`clamp`,`constant`,`exponent`,`padding`,`unknown`],s8={domain:z6,nice:e8,zero:a8,interpolate:J6,round:r8,align:V6,base:H6,clamp:U6,constant:W6,exponent:G6,padding:t8,range:B6,reverse:n8,unknown:i8};function c8(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let r=new Set(t),i=o8.filter(e=>r.has(e));return function(e,t){return t!==void 0&&i.forEach(n=>{s8[n](e,t)}),e}}var l8=c8(`domain`,`range`,`reverse`,`align`,`padding`,`round`);function u8(e){return l8(E0(),e)}var d8=c8(`domain`,`range`,`reverse`,`align`,`padding`,`round`);function f8(e){return d8(O0(),e)}function p8(e){if((typeof e==`function`||typeof e==`object`&&e)&&`valueOf`in e){let t=e.valueOf();if(typeof t==`number`)return t}return e}function m8(e,t){let n=e;return`ticks`in n?n.ticks(t):n.domain().filter((e,n,r)=>t==null||r.length<=t||n%Math.round((r.length-1)/t)===0)}function h8(e){return e?.toString()}function g8(e){return`bandwidth`in e?e.bandwidth():0}function _8(e){let{top:t=0,left:n=0,scale:r,width:i,stroke:a=`#eaf0f6`,strokeWidth:o=1,strokeDasharray:s,className:c,children:l,numTicks:u=10,lineStyle:d,offset:f,tickValues:p,...m}=e,h=p??m8(r,u),g=(f??0)+g8(r)/2,_=h.map((e,t)=>{let n=(p8(r(e))??0)+g;return{index:t,from:new R6({x:0,y:n}),to:new R6({x:i,y:n})}});return(0,F.jsx)(N6,{className:(0,M6.default)(`visx-rows`,c),top:t,left:n,children:l?l({lines:_}):_.map(e=>{let{from:t,to:n,index:r}=e;return(0,F.jsx)(P6,{from:t,to:n,stroke:a,strokeWidth:o,strokeDasharray:s,style:d,...m},`row-line-${r}`)})})}function v8(e){let{top:t=0,left:n=0,scale:r,height:i,stroke:a=`#eaf0f6`,strokeWidth:o=1,strokeDasharray:s,className:c,numTicks:l=10,lineStyle:u,offset:d,tickValues:f,children:p,...m}=e,h=f??m8(r,l),g=(d??0)+g8(r)/2,_=h.map((e,t)=>{let n=(p8(r(e))??0)+g;return{index:t,from:new R6({x:n,y:0}),to:new R6({x:n,y:i})}});return(0,F.jsx)(N6,{className:(0,M6.default)(`visx-columns`,c),top:t,left:n,children:p?p({lines:_}):_.map(e=>{let{from:t,to:n,index:r}=e;return(0,F.jsx)(P6,{from:t,to:n,stroke:a,strokeWidth:o,strokeDasharray:s,style:u,...m},`column-line-${r}`)})})}var y8=R(`g`)(()=>({stroke:Xl()})),b8=class extends P.Component{static propTypes={className:v.string,graphProps:x$.isRequired,xBand:v.func,columnTickValues:v.array,rowTickValues:v.array};static defaultProps={};render(){let{graphProps:e,xBand:t,rowTickValues:n,columnTickValues:r}=this.props,{scale:i={},size:a={},range:o={}}=e||{},{step:s=0,labelStep:c=0}=o,l=s&&c&&s<c,u=(e,t)=>{let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=10**Math.max(n,r);return e*i%(t*i)/i},{unlabeledLines:d,labeledLines:f}=(n||[]).reduce((e,t)=>(l&&u(t,c)!==0?e.unlabeledLines.push(t):e.labeledLines.push(t),e),{unlabeledLines:[],labeledLines:[]});return(0,F.jsxs)(y8,{children:[(0,F.jsx)(_8,{scale:i.y,width:a.width,tickValues:d,lineStyle:{stroke:$l(),strokeWidth:1}}),(0,F.jsx)(_8,{scale:i.y,width:a.width,tickValues:f,lineStyle:{stroke:d.length?Ru.GRIDLINES_COLOR:$l(),strokeWidth:1}}),(0,F.jsx)(v8,{scale:t,height:a.height,offset:t.bandwidth()/2,tickValues:r})]})}},x8=o(((e,t)=>{t.exports=n;function n(e,t,n){e instanceof RegExp&&(e=r(e,n)),t instanceof RegExp&&(t=r(t,n));var a=i(e,t,n);return a&&{start:a[0],end:a[1],pre:n.slice(0,a[0]),body:n.slice(a[0]+e.length,a[1]),post:n.slice(a[1]+t.length)}}function r(e,t){var n=t.match(e);return n?n[0]:null}n.range=i;function i(e,t,n){var r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){for(r=[],a=n.length;u>=0&&!s;)u==c?(r.push(u),c=n.indexOf(e,u+1)):r.length==1?s=[r.pop(),l]:(i=r.pop(),i<a&&(a=i,o=l),l=n.indexOf(t,u+1)),u=c<l&&c>=0?c:l;r.length&&(s=[a,o])}return s}})),S8=o(((e,t)=>{t.exports=n;function n(e,t,n){e instanceof RegExp&&(e=r(e,n)),t instanceof RegExp&&(t=r(t,n));var a=i(e,t,n);return a&&{start:a[0],end:a[1],pre:n.slice(0,a[0]),body:n.slice(a[0]+e.length,a[1]),post:n.slice(a[1]+t.length)}}function r(e,t){var n=t.match(e);return n?n[0]:null}n.range=i;function i(e,t,n){var r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){if(e===t)return[c,l];for(r=[],a=n.length;u>=0&&!s;)u==c?(r.push(u),c=n.indexOf(e,u+1)):r.length==1?s=[r.pop(),l]:(i=r.pop(),i<a&&(a=i,o=l),l=n.indexOf(t,u+1)),u=c<l&&c>=0?c:l;r.length&&(s=[a,o])}return s}})),C8=o(((e,t)=>{var n=S8();t.exports=r;function r(e,t,n){var r=e;return i(e,t).reduce(function(e,i){return e.replace(i.functionIdentifier+`(`+i.matches.body+`)`,a(i.matches.body,i.functionIdentifier,n,r,t))},e)}function i(e,t){var r=[],i=typeof t==`string`?RegExp(`\\b(`+t+`)\\(`):t;do{var a=i.exec(e);if(!a)return r;if(a[1]===void 0)throw Error(`Missing the first couple of parenthesis to get the function identifier in `+t);var o=a[1],s=a.index,c=n(`(`,`)`,e.substring(s));if(!c||c.start!==a[0].length-1)throw SyntaxError(o+`(): missing closing ')' in the value '`+e+`'`);r.push({matches:c,functionIdentifier:o}),e=c.post}while(i.test(e));return r}function a(e,t,n,i,a){return n(r(e,a,n),t,i)}})),w8=o(((e,t)=>{var n=function(e){this.value=e};n.math={isDegree:!0,acos:function(e){return n.math.isDegree?180/Math.PI*Math.acos(e):Math.acos(e)},add:function(e,t){return e+t},asin:function(e){return n.math.isDegree?180/Math.PI*Math.asin(e):Math.asin(e)},atan:function(e){return n.math.isDegree?180/Math.PI*Math.atan(e):Math.atan(e)},acosh:function(e){return Math.log(e+Math.sqrt(e*e-1))},asinh:function(e){return Math.log(e+Math.sqrt(e*e+1))},atanh:function(e){return Math.log((1+e)/(1-e))},C:function(e,t){var r=1,i=e-t,a=t;a<i&&(a=i,i=t);for(var o=a+1;o<=e;o++)r*=o;return r/n.math.fact(i)},changeSign:function(e){return-e},cos:function(e){return n.math.isDegree&&(e=n.math.toRadian(e)),Math.cos(e)},cosh:function(e){return(Math.E**+e+Math.E**(-1*e))/2},div:function(e,t){return e/t},fact:function(e){if(e%1!=0)return`NaN`;for(var t=1,n=2;n<=e;n++)t*=n;return t},inverse:function(e){return 1/e},log:function(e){return Math.log(e)/Math.log(10)},mod:function(e,t){return e%t},mul:function(e,t){return e*t},P:function(e,t){for(var n=1,r=Math.floor(e)-Math.floor(t)+1;r<=Math.floor(e);r++)n*=r;return n},Pi:function(e,t,n){for(var r=1,i=e;i<=t;i++)r*=Number(n.postfixEval({n:i}));return r},pow10x:function(e){for(var t=1;e--;)t*=10;return t},sigma:function(e,t,n){for(var r=0,i=e;i<=t;i++)r+=Number(n.postfixEval({n:i}));return r},sin:function(e){return n.math.isDegree&&(e=n.math.toRadian(e)),Math.sin(e)},sinh:function(e){return(Math.E**+e-Math.E**(-1*e))/2},sub:function(e,t){return e-t},tan:function(e){return n.math.isDegree&&(e=n.math.toRadian(e)),Math.tan(e)},tanh:function(e){return n.sinha(e)/n.cosha(e)},toRadian:function(e){return e*Math.PI/180},and:function(e,t){return e&t}},n.Exception=function(e){this.message=e},t.exports=n})),T8=o(((e,t)=>{var n=w8();function r(e,t){for(var n=0;n<e.length;n++)e[n]+=t;return e}for(var i=[{token:`sin`,show:`sin`,type:0,value:n.math.sin},{token:`cos`,show:`cos`,type:0,value:n.math.cos},{token:`tan`,show:`tan`,type:0,value:n.math.tan},{token:`pi`,show:`π`,type:3,value:`PI`},{token:`(`,show:`(`,type:4,value:`(`},{token:`)`,show:`)`,type:5,value:`)`},{token:`P`,show:`P`,type:10,value:n.math.P},{token:`C`,show:`C`,type:10,value:n.math.C},{token:` `,show:` `,type:14,value:` `.anchor},{token:`asin`,show:`asin`,type:0,value:n.math.asin},{token:`acos`,show:`acos`,type:0,value:n.math.acos},{token:`atan`,show:`atan`,type:0,value:n.math.atan},{token:`7`,show:`7`,type:1,value:`7`},{token:`8`,show:`8`,type:1,value:`8`},{token:`9`,show:`9`,type:1,value:`9`},{token:`int`,show:`Int`,type:0,value:Math.floor},{token:`cosh`,show:`cosh`,type:0,value:n.math.cosh},{token:`acosh`,show:`acosh`,type:0,value:n.math.acosh},{token:`ln`,show:` ln`,type:0,value:Math.log},{token:`^`,show:`^`,type:10,value:Math.pow},{token:`root`,show:`root`,type:0,value:Math.sqrt},{token:`4`,show:`4`,type:1,value:`4`},{token:`5`,show:`5`,type:1,value:`5`},{token:`6`,show:`6`,type:1,value:`6`},{token:`/`,show:`÷`,type:2,value:n.math.div},{token:`!`,show:`!`,type:7,value:n.math.fact},{token:`tanh`,show:`tanh`,type:0,value:n.math.tanh},{token:`atanh`,show:`atanh`,type:0,value:n.math.atanh},{token:`Mod`,show:` Mod `,type:2,value:n.math.mod},{token:`1`,show:`1`,type:1,value:`1`},{token:`2`,show:`2`,type:1,value:`2`},{token:`3`,show:`3`,type:1,value:`3`},{token:`*`,show:`×`,type:2,value:n.math.mul},{token:`sinh`,show:`sinh`,type:0,value:n.math.sinh},{token:`asinh`,show:`asinh`,type:0,value:n.math.asinh},{token:`e`,show:`e`,type:3,value:`E`},{token:`log`,show:` log`,type:0,value:n.math.log},{token:`0`,show:`0`,type:1,value:`0`},{token:`.`,show:`.`,type:6,value:`.`},{token:`+`,show:`+`,type:9,value:n.math.add},{token:`-`,show:`-`,type:9,value:n.math.sub},{token:`,`,show:`,`,type:11,value:`,`},{token:`Sigma`,show:`Σ`,type:12,value:n.math.sigma},{token:`n`,show:`n`,type:13,value:`n`},{token:`Pi`,show:`Π`,type:12,value:n.math.Pi},{token:`pow`,show:`pow`,type:8,value:Math.pow,numberOfArguments:2},{token:`&`,show:`&`,type:9,value:n.math.and}],a={0:11,1:0,2:3,3:0,4:0,5:0,6:0,7:11,8:11,9:1,10:10,11:0,12:11,13:0,14:-1,15:11},o=0;o<i.length;o++)i[o].precedence=a[i[o].type];var s={0:!0,1:!0,3:!0,4:!0,6:!0,8:!0,9:!0,12:!0,13:!0,14:!0,15:!0},c={0:!0,1:!0,2:!0,3:!0,4:!0,5:!0,6:!0,7:!0,8:!0,9:!0,10:!0,11:!0,12:!0,13:!0,15:!0},l={0:!0,3:!0,4:!0,8:!0,12:!0,13:!0,15:!0},u={},d={0:!0,1:!0,3:!0,4:!0,6:!0,8:!0,12:!0,13:!0,15:!0},f={1:!0},p=[[],`123789456+-*/()^!PCe0.,n &`.split(``),[`pi`,`ln`,`Pi`],[`sin`,`cos`,`tan`,`Del`,`int`,`Mod`,`log`,`pow`],[`asin`,`acos`,`atan`,`cosh`,`root`,`tanh`,`sinh`],[`acosh`,`atanh`,`asinh`,`Sigma`]];function m(e,t,n,r){for(var i=0;i<r;i++)if(e[n+i]!==t[i])return!1;return!0}n.tokenTypes={FUNCTION_WITH_ONE_ARG:0,NUMBER:1,BINARY_OPERATOR_HIGH_PRECENDENCE:2,CONSTANT:3,OPENING_PARENTHESIS:4,CLOSING_PARENTHESIS:5,DECIMAL:6,POSTFIX_FUNCTION_WITH_ONE_ARG:7,FUNCTION_WITH_N_ARGS:8,BINARY_OPERATOR_LOW_PRECENDENCE:9,BINARY_OPERATOR_PERMUTATION:10,COMMA:11,EVALUATED_FUNCTION:12,EVALUATED_FUNCTION_PARAMETER:13,SPACE:14},n.addToken=function(e){for(var t=0;t<e.length;t++){var r=e[t].token.length,o=-1;e[t].type===n.tokenTypes.FUNCTION_WITH_N_ARGS&&e[t].numberOfArguments===void 0&&(e[t].numberOfArguments=2),p[r]=p[r]||[];for(var s=0;s<p[r].length;s++)if(e[t].token===p[r][s]){o=h(p[r][s],i);break}o===-1?(i.push(e[t]),e[t].precedence=a[e[t].type],p.length<=e[t].token.length&&(p[e[t].token.length]=[]),p[e[t].token.length].push(e[t].token)):(i[o]=e[t],e[t].precedence=a[e[t].type])}};function h(e,t){for(var n=0;n<t.length;n++)if(t[n].token===e)return n;return-1}function g(e){for(var t=[],r=e.length,a,o,s,c=0;c<r;c++)if(!(c<r-1&&e[c]===` `&&e[c+1]===` `)){for(a=``,o=e.length-c>p.length-2?p.length-1:e.length-c;o>0;o--)if(p[o]!==void 0)for(s=0;s<p[o].length;s++)m(e,p[o][s],c,o)&&(a=p[o][s],s=p[o].length,o=0);if(c+=a.length-1,a===``)throw new n.Exception(`Can't understand after `+e.slice(c));t.push(i[h(a,i)])}return t}var _={value:n.math.changeSign,type:0,pre:21,show:`-`},v={value:`)`,show:`)`,type:5,pre:0},y={value:`(`,type:4,pre:0,show:`(`};n.lex=function(e,t){"use strict";var i=[y],a=[],o=e,p=s,m=0,h=u,b=``,x;t!==void 0&&n.addToken(t);var S={},C=g(o);for(x=0;x<C.length;x++){var w=C[x];if(w.type===14){if(x>0&&x<C.length-1&&C[x+1].type===1&&(C[x-1].type===1||C[x-1].type===6))throw new n.Exception(`Unexpected Space`);continue}var T=w.token,E=w.type,D=w.value,O=w.precedence,k=w.show,A=i[i.length-1],j;for(j=a.length;j--&&a[j]===0;)if([0,2,3,4,5,9,11,12,13].indexOf(E)!==-1){if(p[E]!==!0)throw new n.Exception(T+` is not allowed after `+b);i.push(v),p=c,h=d,a.pop()}if(p[E]!==!0)throw new n.Exception(T+` is not allowed after `+b);if(h[E]===!0&&(E=2,D=n.math.mul,k=`×`,O=3,--x),S={value:D,type:E,pre:O,show:k,numberOfArguments:w.numberOfArguments},E===0)p=s,h=u,r(a,2),i.push(S),C[x+1].type!==4&&(i.push(y),a.push(2));else if(E===1)A.type===1?(A.value+=D,r(a,1)):i.push(S),p=c,h=l;else if(E===2)p=s,h=u,r(a,2),i.push(S);else if(E===3)i.push(S),p=c,h=d;else if(E===4)r(a,1),m++,p=s,h=u,i.push(S);else if(E===5){if(!m)throw new n.Exception(`Closing parenthesis are more than opening one, wait What!!!`);m--,p=c,h=d,i.push(S),r(a,1)}else if(E===6){if(A.hasDec)throw new n.Exception(`Two decimals are not allowed in one number`);A.type!==1&&(A={value:0,type:1,pre:0},i.push(A)),p=f,r(a,1),h=u,A.value+=D,A.hasDec=!0}else E===7&&(p=c,h=d,r(a,1),i.push(S));E===8?(p=s,h=u,r(a,w.numberOfArguments+2),i.push(S),C[x+1].type!==4&&(i.push(y),a.push(w.numberOfArguments+2))):E===9?(A.type===9?A.value===n.math.add?(A.value=D,A.show=k,r(a,1)):A.value===n.math.sub&&k===`-`&&(A.value=n.math.add,A.show=`+`,r(a,1)):A.type!==5&&A.type!==7&&A.type!==1&&A.type!==3&&A.type!==13?T===`-`&&(p=s,h=u,r(a,2).push(2),i.push(_),i.push(y)):(i.push(S),r(a,2)),p=s,h=u):E===10?(p=s,h=u,r(a,2),i.push(S)):E===11?(p=s,h=u,i.push(S)):E===12?(p=s,h=u,r(a,6),i.push(S),C[x+1].type!==4&&(i.push(y),a.push(6))):E===13&&(p=c,h=d,i.push(S)),r(a,-1),b=T}for(j=a.length;j--;)i.push(v);if(p[5]!==!0)throw new n.Exception(`complete the expression`);for(;m--;)i.push(v);return i.push(v),new n(i)},t.exports=n})),E8=o(((e,t)=>{var n=T8();n.prototype.toPostfix=function(){"use strict";for(var e=[],t,r,i,a,o,s=[{value:`(`,type:4,pre:0}],c=this.value,l=1;l<c.length;l++)if(c[l].type===1||c[l].type===3||c[l].type===13)c[l].type===1&&(c[l].value=Number(c[l].value)),e.push(c[l]);else if(c[l].type===4)s.push(c[l]);else if(c[l].type===5)for(;(r=s.pop()).type!==4;)e.push(r);else if(c[l].type===11){for(;(r=s.pop()).type!==4;)e.push(r);s.push(r)}else{t=c[l],a=t.pre,o=s[s.length-1],i=o.pre;var u=o.value==`Math.pow`&&t.value==`Math.pow`;if(a>i)s.push(t);else{for(;i>=a&&!u||u&&a<i;)r=s.pop(),o=s[s.length-1],e.push(r),i=o.pre,u=t.value==`Math.pow`&&o.value==`Math.pow`;s.push(t)}}return new n(e)},t.exports=n})),D8=o(((e,t)=>{var n=E8();n.prototype.postfixEval=function(e){"use strict";e||={},e.PI=Math.PI,e.E=Math.E;for(var t=[],r,i,a,o=this.value,s=e.n!==void 0,c=0;c<o.length;c++)if(o[c].type===1)t.push({value:o[c].value,type:1});else if(o[c].type===3)t.push({value:e[o[c].value],type:1});else if(o[c].type===0)t[t.length-1].type===void 0?t[t.length-1].value.push(o[c]):t[t.length-1].value=o[c].value(t[t.length-1].value);else if(o[c].type===7)t[t.length-1].type===void 0?t[t.length-1].value.push(o[c]):t[t.length-1].value=o[c].value(t[t.length-1].value);else if(o[c].type===8){for(var l=[],u=0;u<o[c].numberOfArguments;u++)l.push(t.pop().value);t.push({type:1,value:o[c].value.apply(o[c],l.reverse())})}else o[c].type===10?(r=t.pop(),i=t.pop(),i.type===void 0?(i.value=i.concat(r),i.value.push(o[c]),t.push(i)):r.type===void 0?(r.unshift(i),r.push(o[c]),t.push(r)):t.push({type:1,value:o[c].value(i.value,r.value)})):o[c].type===2||o[c].type===9?(r=t.pop(),i=t.pop(),i.type===void 0?(i=i.concat(r),i.push(o[c]),t.push(i)):r.type===void 0?(r.unshift(i),r.push(o[c]),t.push(r)):t.push({type:1,value:o[c].value(i.value,r.value)})):o[c].type===12?(r=t.pop(),r.type!==void 0&&(r=[r]),i=t.pop(),a=t.pop(),t.push({type:1,value:o[c].value(a.value,i.value,new n(r))})):o[c].type===13&&(s?t.push({value:e[o[c].value],type:3}):t.push([o[c]]));if(t.length>1)throw new n.Exception(`Uncaught Syntax error`);return t[0].value>0x38d7ea4c68000?`Infinity`:parseFloat(t[0].value.toFixed(15))},n.eval=function(e,t,n){return t===void 0?this.lex(e).toPostfix().postfixEval():n===void 0?t.length===void 0?this.lex(e).toPostfix().postfixEval(t):this.lex(e,t).toPostfix().postfixEval():this.lex(e,t).toPostfix().postfixEval(n)},t.exports=n})),O8=o(((e,t)=>{var n=D8();n.prototype.formulaEval=function(){"use strict";for(var e,t,n,r=[],i=this.value,a=0;a<i.length;a++)i[a].type===1||i[a].type===3?r.push({value:i[a].type===3?i[a].show:i[a].value,type:1}):i[a].type===13?r.push({value:i[a].show,type:1}):i[a].type===0?r[r.length-1]={value:i[a].show+(i[a].show==`-`?``:`(`)+r[r.length-1].value+(i[a].show==`-`?``:`)`),type:0}:i[a].type===7?r[r.length-1]={value:(r[r.length-1].type==1?``:`(`)+r[r.length-1].value+(r[r.length-1].type==1?``:`)`)+i[a].show,type:7}:i[a].type===10?(e=r.pop(),t=r.pop(),i[a].show===`P`||i[a].show===`C`?r.push({value:`<sup>`+t.value+`</sup>`+i[a].show+`<sub>`+e.value+`</sub>`,type:10}):r.push({value:(t.type==1?``:`(`)+t.value+(t.type==1?``:`)`)+`<sup>`+e.value+`</sup>`,type:1})):i[a].type===2||i[a].type===9?(e=r.pop(),t=r.pop(),r.push({value:(t.type==1?``:`(`)+t.value+(t.type==1?``:`)`)+i[a].show+(e.type==1?``:`(`)+e.value+(e.type==1?``:`)`),type:i[a].type})):i[a].type===12&&(e=r.pop(),t=r.pop(),n=r.pop(),r.push({value:i[a].show+`(`+n.value+`,`+t.value+`,`+e.value+`)`,type:12}));return r[0].value},t.exports=n})),k8=o(((e,t)=>{var n=x8(),r=C8(),i=O8(),a=100,o=/(\+|\-|\*|\\|[^a-z]|)(\s*)(\()/g,s;t.exports=c;function c(e,t){s=0,t=10**(t===void 0?5:t),e=e.replace(/\n+/g,` `);function c(e,n,r){if(s++>a)throw s=0,Error(`Call stack overflow for `+r);if(e===``)throw Error(n+`(): '`+r+`' must contain a non-whitespace string`);e=u(e,r);var o=l(e);if(o.length>1||e.indexOf(`var(`)>-1)return n+`(`+e+`)`;var c=o[0]||``;c===`%`&&(e=e.replace(/\b[0-9\.]+%/g,function(e){return parseFloat(e.slice(0,-1))*.01}));var d=e.replace(new RegExp(c,`gi`),``),f;try{f=i.eval(d)}catch{return n+`(`+e+`)`}return c===`%`&&(f*=100),(n.length||c===`%`)&&(f=Math.round(f*t)/t),f+=c,f}function u(e,t){e=e.replace(/((?:\-[a-z]+\-)?calc)/g,``);for(var r=``,i=e,a;a=o.exec(i);){a[0].index>0&&(r+=i.substring(0,a[0].index));var s=n(`(`,`)`,i.substring([0].index));if(s.body===``)throw Error(`'`+e+`' must contain a non-whitespace string`);var l=c(s.body,``,t);r+=s.pre+l,i=s.post}return r+i}return r(e,/((?:\-[a-z]+\-)?calc)\(/,c)}function l(e){for(var t=[],n=[],r=/[\.0-9]([%a-z]+)/gi,i=r.exec(e);i;)!i||!i[1]||(n.indexOf(i[1].toLowerCase())===-1&&(t.push(i[1]),n.push(i[1].toLowerCase())),i=r.exec(e));return t}}));function A8(e,t){let n=new Map;return function(){for(var r=arguments.length,i=Array(r),a=0;a<r;a++)i[a]=arguments[a];let o=t(...i);if(n.has(o))return n.get(o);let s=e.apply(this,i);return n.set(o,s),s}}var j8=`__react_svg_text_measurement_id`;function M8(e,t){if(typeof document>`u`)return null;try{let n=document.getElementById(j8);if(!n){let e=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);e.setAttribute(`aria-hidden`,`true`),e.style.width=`0`,e.style.height=`0`,e.style.position=`absolute`,e.style.top=`-100%`,e.style.left=`-100%`,n=document.createElementNS(`http://www.w3.org/2000/svg`,`text`),n.setAttribute(`id`,j8),e.appendChild(n),document.body.appendChild(e)}return Object.assign(n.style,t),n.textContent=e,n.getComputedTextLength()}catch{return null}}var N8=A8(M8,(e,t)=>`${e}_${JSON.stringify(t)}`),P8=l(k8());function F8(e){return typeof e==`number`}function I8(e){return typeof e==`number`&&Number.isFinite(e)||typeof e==`string`}function L8(e){let{verticalAnchor:t=`end`,scaleToFit:n=!1,angle:r,width:i,lineHeight:a=`1em`,capHeight:o=`0.71em`,children:s,style:c,...l}=e,{x:u=0,y:d=0}=l,f=!I8(u)||!I8(d),{wordsWithWidth:p,spaceWidth:m}=(0,P.useMemo)(()=>({wordsWithWidth:(s==null?[]:s.toString().split(/(?:(?!\u00A0+)\s+)/)).map(e=>({word:e,wordWidth:N8(e,c)||0})),spaceWidth:N8(`\xA0`,c)||0}),[s,c]),h=(0,P.useMemo)(()=>f?[]:i||n?p.reduce((e,t)=>{let{word:r,wordWidth:a}=t,o=e[e.length-1];if(o&&(i==null||n||(o.width||0)+a+m<i))o.words.push(r),o.width=o.width||0,o.width+=a+m;else{let t={words:[r],width:a};e.push(t)}return e},[]):[{words:s==null?[]:s.toString().split(/(?:(?!\u00A0+)\s+)/)}],[f,i,n,s,p,m]);return{wordsByLines:h,startDy:(0,P.useMemo)(()=>f?``:t===`start`?(0,P8.default)(`calc(${o})`):t===`middle`?(0,P8.default)(`calc(${(h.length-1)/2} * -${a} + (${o} / 2))`):(0,P8.default)(`calc(${h.length-1} * -${a})`),[f,t,o,h.length,a]),transform:(0,P.useMemo)(()=>{let e=[];if(f)return``;if(F8(u)&&F8(d)&&F8(i)&&n&&h.length>0){let t=h[0].width||1,r=n===`shrink-only`?Math.min(i/t,1):i/t,a=r,o=u-r*u,s=d-a*d;e.push(`matrix(${r}, 0, 0, ${a}, ${o}, ${s})`)}return r&&e.push(`rotate(${r}, ${u}, ${d})`),e.length>0?e.join(` `):``},[f,u,d,i,n,h,r])}}var R8={overflow:`visible`};function z8(e){let{dx:t=0,dy:n=0,textAnchor:r=`start`,innerRef:i,innerTextRef:a,verticalAnchor:o,angle:s,lineHeight:c=`1em`,scaleToFit:l=!1,capHeight:u,width:d,...f}=e,{x:p=0,fontSize:m}=f,{wordsByLines:h,startDy:g,transform:_}=L8(e);return(0,F.jsx)(`svg`,{ref:i,x:t,y:n,fontSize:m,style:R8,children:h.length>0?(0,F.jsx)(`text`,{ref:a,transform:_,...f,textAnchor:r,children:h.map((e,t)=>(0,F.jsx)(`tspan`,{x:p,dy:t===0?g:c,children:e.words.join(` `)},t))}):null})}var B8={top:`top`,left:`left`,right:`right`,bottom:`bottom`};function V8(e){let{labelOffset:t,labelProps:n,orientation:r,range:i,tickLabelFontSize:a,tickLength:o}=e,s=r===B8.left||r===B8.top?-1:1,c,l,u;if(r===B8.top||r===B8.bottom){let e=r===B8.bottom&&typeof n.fontSize==`number`?n.fontSize:0;c=(Number(i[0])+Number(i[i.length-1]))/2,l=s*(o+t+a+e)}else c=s*((Number(i[0])+Number(i[i.length-1]))/2),l=-(o+t),u=`rotate(${s*90})`;return{x:c,y:l,transform:u}}function H8(e){let{hideTicks:t,horizontal:n,orientation:r,tickClassName:i,tickComponent:a,tickLabelProps:o,tickStroke:s=`#222`,tickTransform:c,ticks:l,strokeWidth:u,tickLineProps:d}=e;return l.map(e=>{let{value:l,index:f,from:p,to:m,formattedValue:h}=e,g=o[f]??{},_=Math.max(10,typeof g.fontSize==`number`&&g.fontSize||0),v=m.y+(n&&r!==B8.top?_:0);return(0,F.jsxs)(N6,{className:(0,M6.default)(`visx-axis-tick`,i),transform:c,children:[!t&&(0,F.jsx)(P6,{from:p,to:m,stroke:s,strokeWidth:u,strokeLinecap:`square`,...d}),a?a({...g,x:m.x,y:v,formattedValue:h}):(0,F.jsx)(z8,{x:m.x,y:v,...g,children:h})]},`visx-tick-${l}-${f}`)})}var U8={textAnchor:`middle`,fontFamily:`Arial`,fontSize:10,fill:`#222`};function W8(e){let{axisFromPoint:t,axisLineClassName:n,axisToPoint:r,hideAxisLine:i,hideTicks:a,horizontal:o,label:s=``,labelClassName:c,labelOffset:l=14,labelProps:u,orientation:d=B8.bottom,scale:f,stroke:p=`#222`,strokeDasharray:m,strokeWidth:h=1,tickClassName:g,tickComponent:_,tickLineProps:v,tickLabelProps:y,tickLength:b=8,tickStroke:x=`#222`,tickTransform:S,ticks:C,ticksComponent:w=H8}=e,T={...U8,...u},E={...U8,...typeof y==`object`?y:null},D=C.map(e=>{let{value:t,index:n}=e;return typeof y==`function`?y(t,n,C):E}),O=Math.max(10,...D.map(e=>typeof e.fontSize==`number`?e.fontSize:0));return(0,F.jsxs)(F.Fragment,{children:[w({hideTicks:a,horizontal:o,orientation:d,scale:f,tickClassName:g,tickComponent:_,tickLabelProps:D,tickStroke:x,tickTransform:S,ticks:C,strokeWidth:h,tickLineProps:v}),!i&&(0,F.jsx)(P6,{className:(0,M6.default)(`visx-axis-line`,n),from:t,to:r,stroke:p,strokeWidth:h,strokeDasharray:m}),s&&(0,F.jsx)(z8,{className:(0,M6.default)(`visx-axis-label`,c),...V8({labelOffset:l,labelProps:T,orientation:d,range:f.range(),tickLabelFontSize:O,tickLength:b}),...T,children:s})]})}function G8(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`center`,n=e;if(t!==`start`&&`bandwidth`in n){let e=n.bandwidth();return t===`center`&&(e/=2),n.round()&&(e=Math.round(e)),t=>{let r=n(t);return typeof r==`number`?r+e:r}}return e}function K8(e){let t=e;return`tickFormat`in t?t.tickFormat():h8}function q8(e,t){let{x:n,y:r}=e;return new R6(t?{x:n,y:r}:{x:r,y:n})}function J8(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return typeof e==`number`?{start:e,end:e}:{start:0,end:0,...e}}function Y8(e){let{children:t=W8,axisClassName:n,hideAxisLine:r=!1,hideTicks:i=!1,hideZero:a=!1,innerRef:o,left:s=0,numTicks:c=10,orientation:l=B8.bottom,rangePadding:u=0,scale:d,tickFormat:f,tickLength:p=8,tickValues:m,top:h=0,...g}=e,_=f??K8(d),v=l===B8.left,y=l===B8.top,b=y||l===B8.bottom,x=G8(d),S=v||y?-1:1,C=d.range(),w=J8(u),T=q8({x:Number(C[0])+.5-w.start,y:0},b),E=q8({x:Number(C[C.length-1])+.5+w.end,y:0},b),D=(m??m8(d,c)).filter(e=>!a||e!==0&&e!==`0`).map((e,t)=>({value:e,index:t})),O=D.map(e=>{let{value:t,index:n}=e,r=p8(x(t));return{value:t,index:n,from:q8({x:r,y:0},b),to:q8({x:r,y:p*S},b),formattedValue:_(t,n,D)}});return(0,F.jsx)(N6,{className:(0,M6.default)(`visx-axis`,n),innerRef:o,top:h,left:s,children:t({...g,axisFromPoint:T,axisToPoint:E,hideAxisLine:r,hideTicks:i,hideZero:a,horizontal:b,numTicks:c,orientation:l,rangePadding:u,scale:d,tickFormat:_,tickLength:p,tickPosition:x,tickSign:S,ticks:O})})}var X8={dx:`-0.25em`,dy:`0.25em`,fill:`#222`,fontFamily:`Arial`,fontSize:10,textAnchor:`end`};function Z8(e){let{axisClassName:t,labelOffset:n=36,tickLength:r=8,tickLabelProps:i,...a}=e,o=typeof i==`function`?i:{...X8,...i};return(0,F.jsx)(Y8,{axisClassName:(0,M6.default)(`visx-axis-left`,t),labelOffset:n,orientation:B8.left,tickLabelProps:o,tickLength:r,...a})}var Q8={dy:`0.25em`,fill:`#222`,fontFamily:`Arial`,fontSize:10,textAnchor:`middle`};function $8(e){let{axisClassName:t,labelOffset:n=8,tickLength:r=8,tickLabelProps:i,...a}=e,o=typeof i==`function`?i:{...Q8,...i};return(0,F.jsx)(Y8,{axisClassName:(0,M6.default)(`visx-axis-bottom`,t),labelOffset:n,orientation:B8.bottom,tickLabelProps:o,tickLength:r,...a})}var e5=ml((0,F.jsx)(`path`,{d:`M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z`}),`Close`),t5=R(pR)(({theme:e})=>({borderRadius:e.spacing(2),color:V.WHITE,fontSize:`16px`,width:`16px`,height:`16px`,padding:`2px`,border:`1px solid ${V.WHITE}`,stroke:`initial`,boxSizing:`unset`,backgroundColor:Bl(),display:`block`,"&.small":{fontSize:`10px`,width:`10px`,height:`10px`}})),n5=R(e5)(({theme:e})=>({borderRadius:e.spacing(2),color:V.WHITE,fontSize:`16px`,width:`16px`,height:`16px`,padding:`2px`,border:`1px solid ${V.WHITE}`,stroke:`initial`,boxSizing:`unset`,backgroundColor:Gl(),display:`block`,"&.small":{fontSize:`10px`,width:`10px`,height:`10px`}})),r5=({scale:e,x:t,y:n,correctness:r,interactive:i})=>{if(!r||!i)return null;let a=e?e.x(t):t,o=e?e.y(n):n,s=r.value===`correct`;return(0,F.jsx)(`foreignObject`,{x:a-11,y:o-11,width:22,height:22,children:s?(0,F.jsx)(t5,{title:r.label}):(0,F.jsx)(n5,{title:r.label})})},i5=({scale:e,x:t,correctness:n,correctData:r,label:i})=>{if(n&&n.value===`incorrect`){let a=parseFloat(r.find(e=>e.label===i)?.value);if(isNaN(a))return null;let o=e.y(a)-7.5;return(0,F.jsx)(`foreignObject`,{x:e.x(t)-7.5,y:o,width:15,height:15,children:(0,F.jsx)(t5,{className:`small`,title:n.label})})}return null},a5=({correctness:e,interactive:t})=>!e||!t?null:e.value===`correct`?(0,F.jsx)(t5,{title:e.label}):(0,F.jsx)(n5,{title:e.label});r5.propTypes={scale:v.shape({x:v.func,y:v.func}),x:v.number.isRequired,y:v.number.isRequired,correctness:v.shape({value:v.string,label:v.string}),interactive:v.bool},i5.propTypes={scale:v.shape({x:v.func,y:v.func}).isRequired,x:v.number.isRequired,correctness:v.shape({value:v.string,label:v.string}),correctData:v.arrayOf(v.shape({label:v.string,value:v.oneOfType([v.string,v.number])})),label:v.string},a5.propTypes={correctness:v.shape({value:v.string,label:v.string}),interactive:v.bool};var o5=(e,t)=>`${t}-${e.label||`-`}`,s5=(e,t,n,r)=>{let i=n||400,a=t&&t.length?t.map(o5):[`default`];switch(r){case`bar`:case`dotPlot`:case`linePlot`:return u8({range:[0,i],domain:a,padding:.2});case`histogram`:return u8({range:[0,i],domain:a,padding:0});case`lineCross`:case`lineDot`:return f8({domain:a,range:[0,i]});default:return u8({range:[0,i],domain:a,padding:0})}},c5=(e={})=>{let t=[],n=e.min;for(;n<=e.max;)t.push(n),n=Math.round((n+e.step)*1e4)/1e4;return t},l5=(e,t,n)=>{let{step:r,labelStep:i,min:a,max:o}=t||{};switch(a||=0,(!o||o<0)&&(o=t.min+1),r||=i||1,(!i||isNaN(i)&&r)&&(i=r||1),t.max=o,n){case`dotPlot`:case`linePlot`:{let n=Math.round(a),r=Math.round(o);return{domain:{...e,step:1,labelStep:1,min:0,max:1},range:{...t,min:n,max:n===r?n+1:r,labelStep:i,step:1}}}default:return{domain:{...e,step:1,labelStep:1,min:0,max:1},range:{...t,labelStep:i,step:r}}}},u5=(e,t)=>{switch(t){case`lineDot`:case`lineCross`:return{verticalLines:void 0,horizontalLines:c5(e),leftAxis:!0};case`dotPlot`:case`linePlot`:return{verticalLines:[],horizontalLines:[],leftAxis:!1};default:return{verticalLines:[],horizontalLines:c5(e),leftAxis:!0}}},d5=(e,t)=>t>=e*2?25:0,f5=e=>e<30?50:e<40?30:e<60?15:0,p5=e=>{let t,n;return e>91?(t=1.3,n=-55):e>45?(t=1.1,n=-45):e>40?(t=.5+(e-34)*.02,n=-25):e>30?(t=.5+(e-34)*.02,n=-20):(t=.5*.98**(34-e),n=-15),{scale:t,deltay:n}},m5=(e,t)=>(e-57*t)/2,h5=e=>{let t=Number.parseFloat(e);return Number.isFinite(t)?t:0},g5=(e,t)=>{let n=e??t;return typeof n==`number`?n:typeof n==`string`&&n.endsWith(`px`)?h5(n):1},_5=P.forwardRef(({className:e,inputClassName:t,inputRef:n,inputStyle:r,minWidth:i,placeholder:a,style:o,value:s,defaultValue:c,...l},u)=>{let d=(0,P.useRef)(null),f=(0,P.useRef)(n),p=(0,P.useRef)(u),m=(0,P.useRef)(null),[h,g]=(0,P.useState)(()=>g5(i,r?.minWidth));f.current=n,p.current=u;let _=(0,P.useCallback)(e=>{d.current=e,f.current?.(e);let t=p.current;typeof t==`function`?t(e):t&&(t.current=e)},[]);return(0,P.useLayoutEffect)(()=>{let e=d.current,t=m.current;if(!e||!t)return;let n=window.getComputedStyle(e);t.style.font=n.font,t.style.letterSpacing=n.letterSpacing,t.style.textTransform=n.textTransform,t.textContent=String(s??c??a??``)||` `;let o=h5(n.paddingLeft)+h5(n.paddingRight)+h5(n.borderLeftWidth)+h5(n.borderRightWidth),l=Math.ceil(t.getBoundingClientRect().width+2),u=n.boxSizing===`border-box`?l+o:l;g(Math.max(g5(i,r?.minWidth),u))},[c,t,r,i,a,s]),(0,F.jsxs)(`span`,{className:e,style:{display:`inline-block`,...o},children:[(0,F.jsx)(`input`,{...l,ref:_,className:t,placeholder:a,style:{width:h,...r},value:s,defaultValue:c}),(0,F.jsx)(`span`,{ref:m,"aria-hidden":`true`,style:{height:0,left:0,overflow:`hidden`,position:`absolute`,top:0,visibility:`hidden`,whiteSpace:`pre`}})]})});_5.displayName=`AutosizeInput`;var v5=(e=`fill`)=>({[e]:`var(--graph-disabled, ${Ll()})`,pointerEvents:`none`,border:`none`}),y5=(e=`fill`)=>({[e]:Bl(),pointerEvents:`none`,border:`solid 1px ${Bl()}`}),b5=(e=`fill`)=>({[e]:Wl(),pointerEvents:`none`,border:`solid 1px ${Wl()}`}),x5=R(`div`)({display:`flex`,flexDirection:`column`,alignItems:`center`}),S5=zl();R(`input`)(({theme:e})=>({float:`right`,fontFamily:e.typography.fontFamily,fontSize:e.typography.fontSize,border:`none`,"&.correct":y5(`color`),"&.incorrect":b5(`color`),"&.disabledMarkLabel":{backgroundColor:`transparent !important`},"&.error":{border:`2px solid ${e.palette.error.main}`}}));var C5=R(`div`)(({theme:e})=>({pointerEvents:`auto`,textAlign:`center`,fontSize:e.typography.fontSize+2,fontFamily:e.typography.fontFamily,color:Zl(),paddingTop:e.typography.fontSize/2,"&.disabledMarkLabel":{...v5(`color`),color:S5,backgroundColor:`transparent !important`},"&.error":{border:`2px solid ${e.palette.error.main}`},"&.correct":{...y5(`color`)},"&.incorrect":{...b5(`color`)}}));function w5(e){let t=e?.trim()||``;return new RegExp(/^[1-9]*[0-9]*\s?[1-9][0-9]*\/[1-9][0-9]*$/).test(t)}function T5(e){let t=e?.trim()||``,n,r=``,i=t.split(` `);n=i[1]&&i[1].includes(`/`)?i[1].split(`/`)||``:t?.split(`/`)||``;let a;if(w5(e))return i[0]&&i[1]&&(r=i[0]),a=`\\(${r}\\frac{${n[0]}}{${n[1]}}\\)`,a}var E5=e=>{let[t,n]=(0,P.useState)(null),r=(0,P.useCallback)(e=>n(e),null),{mark:i={},disabled:a,inputRef:o,barWidth:s,rotate:c,correctness:l,autoFocus:u,error:d,isHiddenLabel:f,limitCharacters:p,correctnessIndicator:m}=e,[h,g]=(0,P.useState)(i.label),[_,v]=(0,P.useState)(T5(i.label)),[y,b]=(0,P.useState)(!1),x=(0,P.useRef)(null),S=e=>{p&&e.target.value&&e.target.value.length>20||g(e.target.value)},C=()=>y===!1&&_!==void 0,w=t=>{v(T5(i.label)),b(!1),e.onChange(t.target.value)},T={};return c&&(T={width:`unset`,textAlign:`left`}),(0,P.useEffect)(()=>{g(i.label)},[i.label]),(0,P.useEffect)(()=>{let e=x.current;e&&_&&(e.innerHTML=_,hd(e))},[h,_]),(0,F.jsxs)(x5,{children:[m,C()?(0,F.jsx)(C5,{ref:e=>{x.current=e,typeof o==`function`&&o(e)},className:I({disabledMarkLabel:a,error:d,correct:i.editable&&l?.label===`correct`,incorrect:i.editable&&l?.label===`incorrect`}),onClick:()=>b(!0),style:{minWidth:s,position:`fixed`,transformOrigin:`left`,transform:`rotate(${c}deg)`,visibility:f?`hidden`:`unset`,marginTop:m?`24px`:`0`}}):(0,F.jsx)(_5,{inputRef:e=>{r(e),typeof o==`function`&&o(e)},name:`mark-label-input`,autoFocus:y||u,disabled:a,inputClassName:I(l&&i.editable?l.label:null,a&&`disabledMarkLabel`,d&&`error`),inputStyle:{minWidth:s,textAlign:`center`,background:`transparent`,boxSizing:`border-box`,paddingLeft:0,paddingRight:0,border:`none`,...a?{color:S5,WebkitTextFillColor:S5}:{},...T},value:h,style:{position:`fixed`,pointerEvents:`auto`,top:0,left:0,minWidth:s,transformOrigin:`left`,transform:`rotate(${c}deg)`,visibility:f?`hidden`:`unset`,marginTop:m?`24px`:`0`},onChange:S,onBlur:w})]})};E5.propTypes={autoFocus:v.bool,disabled:v.bool,error:v.any,onChange:v.func,graphProps:x$,inputRef:v.func,mark:v.object,barWidth:v.number,rotate:v.number,correctness:v.shape({value:v.string,label:v.string}),isHiddenLabel:v.bool,limitCharacters:v.bool,correctnessIndicator:v.node};var D5=new Set,O5=null;function k5(e){D5.add(e),!O5&&typeof document<`u`&&(O5=new MutationObserver(()=>{D5.forEach(e=>e())}),O5.observe(document.body,{childList:!0,subtree:!0}))}function A5(e){D5.delete(e),D5.size===0&&O5&&(O5.disconnect(),O5=null)}var j5=R(`text`)(({theme:e})=>({fontSize:e.typography.fontSize-2,fill:e.palette.error.main})),M5=R(i6)(()=>({color:`${lu()} !important`})),N5=R(`g`)(({theme:e})=>({"& .vx-axis-line":{stroke:Ru.AXIS_LINE_COLOR,strokeWidth:2},"& .vx-axis-tick":{fill:Ru.AXIS_TICK_COLOR,"& line":{stroke:Ru.AXIS_TICK_COLOR,strokeWidth:2},fontFamily:e.typography.body1?.fontFamily,fontSize:e.typography.fontSize,textAnchor:`middle`}})),P5=e=>({borderRadius:e.spacing(2),color:V.WHITE,fontSize:`16px`,width:`16px`,height:`16px`,padding:`2px`,border:`1px solid ${V.WHITE}`,boxSizing:`unset`}),F5={backgroundColor:Gl()},I5={backgroundColor:Bl()},L5=class extends P.Component{static propTypes={defineChart:v.bool,error:v.any};constructor(e){super(e),this.state={dialog:{open:!1}}}componentDidUpdate(e){this.props.autoFocus&&!e.autoFocus&&this.props.onAutoFocusUsed()}handleAlertDialog=(e,t)=>this.setState({dialog:{open:e}},t);changeCategory=(e,t)=>{let{categories:n,onChangeCategory:r}=this.props,i=n[e];r(e,{...i,label:t})};changeInteractive=(e,t)=>{let{categories:n,onChangeCategory:r}=this.props,i=n[e];t?r(e,{...i,interactive:!i.interactive}):this.setState({dialog:{open:!0,title:`Warning`,text:`This will remove the correct answer value that has been defined for this category.`,onConfirm:()=>this.handleAlertDialog(!1,r(e,{...i,interactive:!i.interactive})),onClose:()=>this.handleAlertDialog(!1)}})};changeEditable=(e,t)=>{let{categories:n,onChangeCategory:r}=this.props,i=n[e];t?r(e,{...i,editable:!i.editable||!1}):this.setState({dialog:{open:!0,title:`Warning`,text:`This will remove the correct answer category name that has been defined for this category.`,onConfirm:()=>this.handleAlertDialog(!1,r(e,{...i,editable:!i.editable||!1})),onClose:()=>this.handleAlertDialog(!1)}})};splitText=(e,t)=>{let n=[];for(;(e||``).length>0;){let r;e.length>t?(r=e.lastIndexOf(` `,t),r===-1&&(r=t)):r=e.length,n.push(e.substring(0,r)),e=e.substring(r).trim()}return n};render(){let{categories:e,xBand:t,bandWidth:n,barWidth:r,rotate:i,top:a,graphProps:o,defineChart:s,chartingOptions:c,x:l,y:u,formattedValue:d,changeInteractiveEnabled:f,changeEditableEnabled:p,error:m,autoFocus:h,hiddenLabelRef:g,showCorrectness:_}=this.props;if(!d)return null;let v={correctnessIcon:P5,incorrectIcon:F5,correctIcon:I5},{dialog:y}=this.state,{changeEditable:b,changeInteractive:x}=c||{},S=parseInt(d.split(`-`)[0],10),C=e[S],{editable:w,interactive:T,label:E,correctness:D}=C||{},O=t(o5({label:E},S)),k=(e||[]).reduce((e,t)=>(e&&e.label?e.label.length:0)>(t&&t.label?t.label.length:0)?e:t,{label:``}),A=m?[...new Set(Object.values(m))].join(` `):``;return(0,F.jsxs)(`g`,{children:[(0,F.jsxs)(`foreignObject`,{x:n?O:l-r/2,y:18,width:r,height:4,style:{pointerEvents:`none`,overflow:`visible`},children:[S===0&&(0,F.jsx)(E5,{isHiddenLabel:!0,inputRef:g,disabled:!0,mark:k,graphProps:o,barWidth:r}),(0,F.jsx)(E5,{autoFocus:s&&h,inputRef:e=>this.input=e,disabled:!s&&!w,mark:C,graphProps:o,onChange:e=>this.changeCategory(S,e),barWidth:r,rotate:i,correctness:D,error:m&&m[S],limitCharacters:!0,correctnessIndicator:_&&D&&(0,F.jsx)(a5,{correctness:D,interactive:T,classes:v})})]}),m&&S===0&&(0,F.jsx)(j5,{y:u+23,height:6,textAnchor:`start`,children:A}),s&&S===0&&(0,F.jsxs)(`svg`,{x:-55,style:{overflow:`visible`},children:[f&&(0,F.jsx)(`text`,{y:u+90+a,width:r,height:4,style:{position:`absolute`,pointerEvents:`none`,wordBreak:`break-word`,maxWidth:r,display:`inline-block`},children:this.splitText(x?.authoringLabel,20).map((e,t)=>(0,F.jsx)(`tspan`,{x:`0`,dy:`${t>0?`1.2em`:`.6em`}`,children:e},t))}),p&&(0,F.jsx)(`text`,{y:u+145+a,width:r,height:4,style:{position:`absolute`,pointerEvents:`none`,wordBreak:`break-word`,maxWidth:r,display:`inline-block`},children:this.splitText(b?.authoringLabel,20).map((e,t)=>(0,F.jsx)(`tspan`,{x:`0`,dy:`${t>0?`1.2em`:`.6em`}`,children:e},t))})]}),s&&f&&(0,F.jsx)(`foreignObject`,{x:l-24,y:u+80+a,width:r,height:4,style:{pointerEvents:`visible`,overflow:`visible`},children:(0,F.jsx)(M5,{style:{position:`fixed`},checked:T,onChange:e=>this.changeInteractive(S,e.target.checked)})}),s&&p&&(0,F.jsx)(`foreignObject`,{x:l-24,y:u+130+a,width:r,height:4,style:{pointerEvents:`visible`,overflow:`visible`},children:(0,F.jsx)(M5,{style:{position:`fixed`},checked:w,onChange:e=>this.changeEditable(S,e.target.checked)})}),(0,F.jsx)(`foreignObject`,{x:l-24,y:u+100+a,width:r,height:4,style:{pointerEvents:`visible`,overflow:`visible`},children:(0,F.jsx)(s6,{open:y.open,title:y.title,text:y.text,onClose:y.onClose,onConfirm:y.onConfirm})})]})}};L5.propTypes={categories:v.array,xBand:v.func,bandWidth:v.number,barWidth:v.number,rotate:v.number,top:v.number,x:v.number,y:v.number,graphProps:v.object,formattedValue:v.string,onChangeCategory:v.func,onChange:v.func,error:v.object,defineChart:v.bool,chartingOptions:v.object,changeInteractiveEnabled:v.bool,changeEditableEnabled:v.bool,autoFocus:v.bool,onAutoFocusUsed:v.func,showCorrectness:v.bool,hiddenLabelRef:v.oneOfType([v.func,v.shape({current:v.instanceOf(Element)})])};var R5=class extends P.Component{static propTypes={bottomScale:v.func,categories:v.array,defineChart:v.bool,error:v.any,graphProps:x$.isRequired,xBand:v.func,leftAxis:v.bool,onChange:v.func,onChangeCategory:v.func,top:v.number,theme:v.object,chartingOptions:v.object,changeInteractiveEnabled:v.bool,changeEditableEnabled:v.bool,autoFocus:v.bool,onAutoFocusUsed:v.func,showCorrectness:v.bool,hiddenLabelRef:v.oneOfType([v.func,v.shape({current:v.instanceOf(Element)})])};state={height:0,width:0};measureHiddenLabel=()=>{if(!this.hiddenLabelRef)return;let e=this.hiddenLabelRef.querySelector(`mjx-container`),t=this.hiddenLabelRef.querySelector(`input`),n=(e||t||this.hiddenLabelRef).getBoundingClientRect(),r=Math.floor(n.height),i=Math.floor(n.width);(r!==this.state.height||i!==this.state.width)&&this.setState({height:r,width:i})};_onDocMutation=()=>{this.hiddenLabelRef&&this.hiddenLabelRef.querySelector(`mjx-container`)&&this.measureHiddenLabel()};observeHiddenLabel=e=>{if(!e)return;let t=e.querySelector(`[data-latex], [data-raw]`);t&&hd(e),(e.querySelector(`mjx-container`)||!t)&&this.measureHiddenLabel(),k5(this._onDocMutation)};setHiddenLabelRef=e=>{e&&e!==this.hiddenLabelRef&&(this.hiddenLabelRef=e,this.observeHiddenLabel(e))};componentDidMount(){this.hiddenLabelRef&&this.observeHiddenLabel(this.hiddenLabelRef)}componentWillUnmount(){A5(this._onDocMutation),this._updateTimer&&clearTimeout(this._updateTimer)}componentDidUpdate(e){e.categories!==this.props.categories&&(this._updateTimer&&clearTimeout(this._updateTimer),this._updateTimer=setTimeout(()=>this.measureHiddenLabel(),50))}render(){let{graphProps:e,xBand:t,leftAxis:n,onChange:r,onChangeCategory:i,categories:a=[],top:o,defineChart:s,chartingOptions:c,changeInteractiveEnabled:l,changeEditableEnabled:u,theme:d,autoFocus:f,onAutoFocusUsed:p,error:m,showCorrectness:h}=this.props,{scale:g={},range:_={},domain:v={},size:y={}}=e||{},{height:b,width:x}=this.state,S=t&&typeof t.rangeRound==`function`&&t.rangeRound([0,y.width]),C=t&&typeof t.bandwidth==`function`&&t.bandwidth(),w=C||g.x&&g.x(v.max)/a.length,T=c5({..._,step:_.labelStep}),E=d5(d&&d.typography?d.typography.fontSize:14,b),D=x>w?25:0;return(0,F.jsxs)(N5,{children:[n&&(0,F.jsx)(Z8,{scale:g.y,tickLength:10,tickFormat:e=>e,tickValues:T,tickLabelProps:e=>({dy:4,dx:-10-(e.toLocaleString().length||1)*5})}),(0,F.jsx)($8,{scale:S,labelProps:{y:60+o},top:g.y&&g.y(_.min),textLabelProps:()=>({textAnchor:`middle`}),tickFormat:e=>e,tickComponent:n=>{let d={hiddenLabelRef:this.setHiddenLabelRef,categories:a,xBand:t,bandWidth:C,barWidth:w,rotate:E||D,top:o,defineChart:s,chartingOptions:c,autoFocus:f,onAutoFocusUsed:p,error:m,onChangeCategory:i,changeInteractiveEnabled:l,changeEditableEnabled:u,onChange:r,graphProps:e,x:n.x,y:n.y,formattedValue:n.formattedValue,showCorrectness:h};return(0,F.jsx)(L5,{...d})},autoFocus:f,onAutoFocusUsed:p})]})}},z5=({width:e,scaleValue:t,color:n})=>(0,F.jsx)(`svg`,{x:m5(e,t),y:p5(e)?.deltay,color:n,width:e,height:e,overflow:`visible`,viewBox:`0 0 ${e} ${e}`,style:{overflow:`visible !important`},children:(0,F.jsxs)(`g`,{xmlns:`http://www.w3.org/2000/svg`,fill:`currentColor`,stroke:`currentColor`,transform:`scale(${t})`,children:[(0,F.jsx)(`circle`,{cx:`28.5`,cy:`23.5`,r:`22`,fill:`white`,stroke:`currentColor`}),(0,F.jsx)(`path`,{d:`M33.5 21.25H23.4609C22.7578 21.25 22.4062 20.4297 22.9141 19.9219L27.9141 14.9219C28.2266 14.6094 28.7344 14.6094 29.0469 14.9219L34.0469 19.9219C34.5547 20.4297 34.2031 21.25 33.5 21.25Z`,fill:`currentColor`}),(0,F.jsx)(`path`,{d:`M23.5 25.75L33.5391 25.75C34.2422 25.75 34.5938 26.5703 34.0859 27.0781L29.0859 32.0781C28.7734 32.3906 28.2656 32.3906 27.9531 32.0781L22.9531 27.0781C22.4453 26.5703 22.7969 25.75 23.5 25.75Z`,fill:`currentColor`})]})});z5.propTypes={width:v.number.isRequired,scaleValue:v.number.isRequired,color:v.string};var B5=R(`svg`)(()=>({overflow:`visible !important`})),V5=R(`ellipse`)(()=>({fill:`transparent`,clipPath:`polygon(50% 0%, 100% 0%, 100% 50%, 0% 50%, 0% 0%)`})),H5=R(pR)(()=>({backgroundColor:Bl(),borderRadius:`16px`,color:V.WHITE,fontSize:`16px`,padding:`2px`,border:`4px solid ${V.WHITE}`,width:`16px`,height:`16px`,boxSizing:`unset`})),U5=R(e5)(()=>({backgroundColor:Gl(),borderRadius:`16px`,color:V.WHITE,fontSize:`16px`,padding:`2px`,border:`4px solid ${V.WHITE}`,width:`16px`,height:`16px`,boxSizing:`unset`})),W5=({x:e,y:t,width:n,graphProps:r,interactive:i,isHovered:a,correctness:o,isPlot:s,...c})=>{let{scale:l}=r,u=p5(n)?.scale;return(0,F.jsxs)(B5,{x:e,y:l.y(t)-10,width:n,overflow:`visible`,children:[a&&!o&&i&&(0,F.jsx)(z5,{width:n,scaleValue:u,color:V.BORDER_GRAY}),i&&!o&&(0,F.jsx)(V5,{cx:n/2,cy:10,rx:n/2,ry:66,...c}),(0,F.jsx)(`defs`,{children:(0,F.jsxs)(`filter`,{id:`bottomShadow`,x:`0`,y:`0`,width:`140%`,height:`140%`,children:[(0,F.jsx)(`feGaussianBlur`,{in:`SourceAlpha`,stdDeviation:`3`}),(0,F.jsx)(`feOffset`,{dx:`0`,dy:`5`,result:`offsetblur`}),(0,F.jsx)(`feFlood`,{floodColor:`#00000033`}),(0,F.jsx)(`feComposite`,{in2:`offsetblur`,operator:`in`}),(0,F.jsxs)(`feMerge`,{children:[(0,F.jsx)(`feMergeNode`,{}),(0,F.jsx)(`feMergeNode`,{in:`SourceGraphic`})]})]})}),o&&i&&!s&&(0,F.jsx)(`foreignObject`,{x:n/2-14,y:0,width:40,height:40,children:o.value===`correct`?(0,F.jsx)(H5,{title:o.label}):(0,F.jsx)(U5,{title:o.label})})]})};W5.propTypes={x:v.number.isRequired,y:v.number.isRequired,width:v.number,graphProps:x$.isRequired,interactive:v.bool,isHovered:v.bool,correctness:v.shape({value:v.string,label:v.string}),isPlot:v.bool};var G5=W5,K5=n0({axis:`y`,fromDelta:(e,t)=>(t.x=0,k$(e).add(k$(t)).y),bounds:(e,{domain:t,range:n})=>O$({left:0,top:e.y,bottom:e.y,right:0},t,n),anchorPoint:e=>({x:e.x,y:e.y})})(G5),q5=({dashColor:e})=>(0,F.jsxs)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,F.jsx)(`circle`,{cx:`12`,cy:`12`,r:`11`,fill:`white`,stroke:e||`#7E8494`,strokeWidth:`2`,strokeDasharray:`5 5`}),(0,F.jsxs)(`mask`,{id:`path-2-outside-1_3089_3799`,maskUnits:`userSpaceOnUse`,x:`2`,y:`3`,width:`19`,height:`18`,fill:`black`,children:[(0,F.jsx)(`rect`,{fill:`white`,x:`2`,y:`3`,width:`19`,height:`18`}),(0,F.jsx)(`path`,{d:`M12 20C9.125 20 6.5 18.5 5.0625 16C3.625 13.5312 3.625 10.5 5.0625 8C6.5 5.53125 9.125 4 12 4C14.8438 4 17.4688 5.53125 18.9062 8C20.3438 10.5 20.3438 13.5312 18.9062 16C17.4688 18.5 14.8438 20 12 20ZM15.5312 10.5312H15.5C15.8125 10.25 15.8125 9.78125 15.5 9.46875C15.2188 9.1875 14.75 9.1875 14.4688 9.46875L11 12.9688L9.53125 11.5C9.21875 11.1875 8.75 11.1875 8.46875 11.5C8.15625 11.7812 8.15625 12.25 8.46875 12.5312L10.4688 14.5312C10.75 14.8438 11.2188 14.8438 11.5312 14.5312L15.5312 10.5312Z`})]}),(0,F.jsx)(`path`,{d:`M12 20C9.125 20 6.5 18.5 5.0625 16C3.625 13.5312 3.625 10.5 5.0625 8C6.5 5.53125 9.125 4 12 4C14.8438 4 17.4688 5.53125 18.9062 8C20.3438 10.5 20.3438 13.5312 18.9062 16C17.4688 18.5 14.8438 20 12 20ZM15.5312 10.5312H15.5C15.8125 10.25 15.8125 9.78125 15.5 9.46875C15.2188 9.1875 14.75 9.1875 14.4688 9.46875L11 12.9688L9.53125 11.5C9.21875 11.1875 8.75 11.1875 8.46875 11.5C8.15625 11.7812 8.15625 12.25 8.46875 12.5312L10.4688 14.5312C10.75 14.8438 11.2188 14.8438 11.5312 14.5312L15.5312 10.5312Z`,fill:`#0EA449`}),(0,F.jsx)(`path`,{d:`M5.0625 16L5.92942 15.5015L5.92668 15.4968L5.0625 16ZM5.0625 8L4.19831 7.4968L4.19559 7.50153L5.0625 8ZM18.9062 8L19.7732 7.50152L19.7704 7.49681L18.9062 8ZM18.9062 16L18.0421 15.4968L18.0393 15.5015L18.9062 16ZM15.5312 10.5312L16.2384 11.2384L17.9455 9.53125H15.5312V10.5312ZM15.5 10.5312L14.831 9.78796L12.894 11.5312H15.5V10.5312ZM14.4688 9.46875L13.7616 8.76164L13.7585 8.76482L14.4688 9.46875ZM11 12.9688L10.2929 13.6759L11.0032 14.3861L11.7103 13.6727L11 12.9688ZM8.46875 11.5L9.13771 12.2433L9.17684 12.2081L9.21204 12.169L8.46875 11.5ZM8.46875 12.5312L9.17586 11.8241L9.15726 11.8055L9.13771 11.788L8.46875 12.5312ZM10.4688 14.5312L11.212 13.8623L11.1945 13.8427L11.1759 13.8241L10.4688 14.5312ZM12 20V19C9.479 19 7.18657 17.6879 5.92941 15.5015L5.0625 16L4.19559 16.4985C5.81343 19.3121 8.771 21 12 21V20ZM5.0625 16L5.92668 15.4968C4.6714 13.341 4.66824 10.6918 5.92941 8.49847L5.0625 8L4.19559 7.50153C2.58176 10.3082 2.5786 13.7215 4.19832 16.5032L5.0625 16ZM5.0625 8L5.92668 8.50319C7.18712 6.33851 9.48502 5 12 5V4V3C8.76498 3 5.81288 4.72399 4.19832 7.49681L5.0625 8ZM12 4V5C14.4816 5 16.7805 6.33661 18.0421 8.50319L18.9062 8L19.7704 7.49681C18.157 4.72589 15.2059 3 12 3V4ZM18.9062 8L18.0393 8.49847C19.3005 10.6918 19.2973 13.341 18.0421 15.4968L18.9062 16L19.7704 16.5032C21.3902 13.7215 21.387 10.3082 19.7732 7.50153L18.9062 8ZM18.9062 16L18.0393 15.5015C16.7811 17.6898 14.4876 19 12 19V20V21C15.1999 21 18.1564 19.3102 19.7732 16.4985L18.9062 16ZM15.5312 10.5312V9.53125H15.5V10.5312V11.5312H15.5312V10.5312ZM15.5 10.5312L16.169 11.2745C16.9447 10.5764 16.8883 9.44281 16.2071 8.76164L15.5 9.46875L14.7929 10.1759C14.7696 10.1525 14.7344 10.0966 14.7344 10.0117C14.7344 9.92377 14.7735 9.83972 14.831 9.78796L15.5 10.5312ZM15.5 9.46875L16.2071 8.76164C15.5353 8.08987 14.4334 8.08987 13.7616 8.76164L14.4688 9.46875L15.1759 10.1759C15.1167 10.235 15.0442 10.2578 14.9844 10.2578C14.9245 10.2578 14.8521 10.235 14.7929 10.1759L15.5 9.46875ZM14.4688 9.46875L13.7585 8.76482L10.2897 12.2648L11 12.9688L11.7103 13.6727L15.179 10.1727L14.4688 9.46875ZM11 12.9688L11.7071 12.2616L10.2384 10.7929L9.53125 11.5L8.82414 12.2071L10.2929 13.6759L11 12.9688ZM9.53125 11.5L10.2384 10.7929C9.55719 10.1117 8.42362 10.0553 7.72546 10.831L8.46875 11.5L9.21204 12.169C9.16028 12.2265 9.07623 12.2656 8.98828 12.2656C8.90344 12.2656 8.84748 12.2304 8.82414 12.2071L9.53125 11.5ZM8.46875 11.5L7.79979 10.7567C7.04591 11.4352 7.04591 12.5961 7.79979 13.2745L8.46875 12.5312L9.13771 11.788C9.19301 11.8377 9.23438 11.9208 9.23438 12.0156C9.23438 12.1105 9.19301 12.1935 9.13771 12.2433L8.46875 11.5ZM8.46875 12.5312L7.76164 13.2384L9.76164 15.2384L10.4688 14.5312L11.1759 13.8241L9.17586 11.8241L8.46875 12.5312ZM10.4688 14.5312L9.72546 15.2002C10.4236 15.976 11.5572 15.9195 12.2384 15.2384L11.5312 14.5312L10.8241 13.8241C10.8475 13.8008 10.9034 13.7656 10.9883 13.7656C11.0762 13.7656 11.1603 13.8048 11.212 13.8623L10.4688 14.5312ZM11.5312 14.5312L12.2384 15.2384L16.2384 11.2384L15.5312 10.5312L14.8241 9.82414L10.8241 13.8241L11.5312 14.5312Z`,fill:`white`,mask:`url(#path-2-outside-1_3089_3799)`})]});q5.propTypes={dashColor:v.string};var J5=Uu(`pie-lib:chart:bars`),Y5=[`#006699`,`#F59B00`,`#08916D`,`#529EE0`,`#52B7D8`,`#D9A6C2`,`#FFB03B`,`#54A77B`,`#E16032`,`#4FD2D2`,`#F0E442`,`#E287B2`],X5=[`#003754`,`#975616`,`#00503B`,`#225982`,`#1F687D`,`#825E6F`,`#996428`,`#255E44`,`#8A331F`,`#167A7A`,`#91862D`,`#894A65`],Z5=(e,t,n,r,i)=>e&&t&&i?r[n%r.length]:e&&i?Ru.ROLLOVER_FILL_BAR_COLOR:t||null,Q5=R(I6)(()=>({fill:V.TERTIARY})),$5=class extends P.Component{static propTypes={barColor:v.string,onChangeCategory:v.func,value:v.number,label:v.string,xBand:v.func,index:v.number.isRequired,graphProps:x$.isRequired,interactive:v.bool,correctness:v.shape({value:v.string,label:v.string}),correctData:v.array,defineChart:v.bool};constructor(e){super(e),this.state={dragValue:void 0,isHovered:!1},this.mouseX=0,this.mouseY=0}componentDidMount(){window.addEventListener(`mousemove`,this.handleMouseMove)}componentWillUnmount(){window.removeEventListener(`mousemove`,this.handleMouseMove)}handleMouseMove=e=>{this.mouseX=e.clientX,this.mouseY=e.clientY;let t=this.isMouseInsideSvgElement();this.setState({isHovered:t})};isMouseInsideSvgElement=()=>{let e=this.gRef.getBoundingClientRect();return this.mouseX>=e.left&&this.mouseX<=e.right&&this.mouseY>=e.top&&this.mouseY<=e.bottom};handleMouseEnter=()=>this.setState({isHovered:!0});handleMouseLeave=()=>this.setState({isHovered:!1});setDragValue=e=>this.setState({dragValue:e});dragStop=()=>{let{label:e,onChangeCategory:t}=this.props,{dragValue:n}=this.state;J5(`[dragStop]`,n),n!==void 0&&t({label:e,value:n}),this.setDragValue(void 0)};dragValue=(e,t)=>{J5(`[dragValue] next:`,t),this.setDragValue(t)};render(){let{graphProps:e,value:t,label:n,xBand:r,index:i,interactive:a,correctness:o,barColor:s,defineChart:c,correctData:l}=this.props,{scale:u,range:d}=e,{dragValue:f,isHovered:p}=this.state,m=Z5(p,s,i,X5,a&&!o),h=Number.isFinite(f)?f:t,g=r.bandwidth(),_=u.y(d.max-h),v=r(o5({label:n},i)),y=d.max-h,b=d.max-y,x=l?l.find(e=>e.label===n):null,S=a?K5:G5,C=!!s;return(0,F.jsxs)(`g`,{ref:e=>this.gRef=e,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,onTouchStart:this.handleMouseEnter,onTouchEnd:this.handleMouseLeave,children:[(0,F.jsx)(Q5,{x:v,y:u.y(b),width:g,height:_,style:{fill:m}}),o&&o.value===`incorrect`&&(()=>{let e=parseFloat(x&&x.value);if(isNaN(e))return null;let t=u.y(d.max-e),n=_,r=Math.abs(t-n),i=u.y(e),a=t>n?mu():V.WHITE,o=t>n?i:i-r;return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Q5,{x:v+2,y:o,width:g-4,height:r,style:{stroke:a,strokeWidth:2,strokeDasharray:`5,2`,fill:`none`}}),(0,F.jsx)(`foreignObject`,{x:v+g-(C?24:14),y:i-12,width:24,height:24,children:(0,F.jsx)(q5,{dashColor:a})})]})})(),(0,F.jsx)(S,{x:v,y:h,defineChart:c,interactive:a,width:g,onDrag:e=>this.dragValue(t,e),onDragStop:this.dragStop,graphProps:e,correctness:o,isHovered:p,color:m})]})}},e7=class extends P.Component{static propTypes={data:v.array,correctData:v.array,onChangeCategory:v.func,defineChart:v.bool,xBand:v.func,graphProps:x$.isRequired,histogram:v.bool};render(){let{data:e,graphProps:t,xBand:n,onChangeCategory:r,defineChart:i,histogram:a,correctData:o}=this.props;return(0,F.jsx)(N6,{children:(e||[]).map((e,s)=>(0,F.jsx)($5,{value:e.value,interactive:i||e.interactive,defineChart:i,label:e.label,xBand:n,index:s,onChangeCategory:e=>r(s,e),graphProps:t,correctness:e.correctness,correctData:o,barColor:a&&(Y5[s]?Y5[s]:Y5[s%Y5.length])},`bar-${e.label}-${e.value}-${s}`))})}},t7=class extends P.Component{static propTypes={data:v.array,onChange:v.func,graphProps:x$.isRequired};render(){let e=this.props,{data:t,graphProps:n}=e,{scale:r={},size:i={}}=n||{},a=s5(r.x,t,i.width,`bar`);return(0,F.jsx)(e7,{...e,xBand:a})}},n7=()=>({type:`bar`,Component:t7,name:`Bar`}),r7=class extends P.Component{static propTypes={data:v.array,onChange:v.func,graphProps:x$.isRequired};render(){let e=this.props,{data:t,graphProps:n}=e,{scale:r={},size:i={}}=n||{},a=s5(r.x,t,i.width,`histogram`);return(0,F.jsx)(e7,{...e,xBand:a,histogram:!0})}},i7=()=>({type:`histogram`,Component:r7,name:`Histogram`}),a7=R(`g`)(({theme:e})=>({color:`black`,"& .handle":{transition:`fill 200ms linear, height 200ms linear`,"&.non-interactive":v5(`fill`)},"& .transparentHandle":{height:`20px`,fill:`transparent`,stroke:`transparent`},"& .line":{stroke:V.TEXT,transition:`fill 200ms linear, height 200ms linear`,"&.non-interactive":v5(`stroke`)},"& .disabledPoint":{fill:V.BLACK+` !important`,stroke:V.BLACK+` !important`},"& .correctIcon":{backgroundColor:Bl()},"& .incorrectIcon":{backgroundColor:Gl()},"& .correctnessIcon":{borderRadius:e.spacing(2),color:V.WHITE,fontSize:`16px`,width:`16px`,height:`16px`,padding:`2px`,border:`1px solid ${V.WHITE}`,stroke:`initial`,boxSizing:`unset`},"& .smallIcon":{fontSize:`10px`,width:`10px`,height:`10px`}})),o7=class extends P.Component{static propTypes={x:v.number.isRequired,y:v.number.isRequired,width:v.number,graphProps:x$.isRequired,className:v.string,interactive:v.bool,CustomDraggableComponent:v.func,correctness:v.shape({value:v.string,label:v.string})};render(){let{x:e,y:t,graphProps:n,className:r,interactive:i,CustomDraggableComponent:a,correctness:o,...s}=this.props,{scale:c}=n;return a?(0,F.jsx)(a7,{children:(0,F.jsx)(a,{scale:c,x:e,y:t,className:I(r,!i&&`non-interactive`),correctness:o,interactive:i,...s})}):null}},s7=n0({axis:`y`,fromDelta:(e,t)=>(t.x=0,k$(e).add(k$(t)).y),bounds:(e,{domain:t,range:n})=>O$({left:0,top:e.y,bottom:e.y,right:0},t,n),anchorPoint:e=>({x:e.x,y:e.y})})(o7),c7=(e,t)=>{let{max:n}=t||{},r=e.length;return!n||!r?[]:e.map((e,t)=>({...e,x:r>1?t*(n/(r-1)):.5,y:e.value}))},l7=R(F6)(()=>({fill:`transparent`,stroke:V.TERTIARY,strokeWidth:3,transition:`stroke 200ms ease-in, stroke-width 200ms ease-in`})),u7=R(class extends P.Component{static propTypes={onChange:v.func,value:v.number,label:v.string,xBand:v.func,index:v.number.isRequired,graphProps:x$.isRequired,defineChart:v.bool,data:v.arrayOf(v.shape({label:v.string,value:v.number})),CustomDraggableComponent:v.func,correctData:v.array};static defaultProps={index:0};constructor(e){super(e),this.state={dragValue:void 0,line:c7(e.data,e.graphProps.domain)}}UNSAFE_componentWillReceiveProps(e){zp(this.props.data,e.data)||this.setState({line:c7(e.data,e.graphProps.domain)})}setDragValue=e=>this.setState({line:e});dragStop=e=>{let{onChange:t}=this.props;this.setState({dragging:!1},()=>{t(e,this.state.line[e])})};dragValue=(e,t,n)=>{let r=[...this.state.line];r[e].dragValue=n,this.setDragValue(r)};render(){let{graphProps:e,data:t,CustomDraggableComponent:n,defineChart:r,correctData:i}=this.props,{line:a,dragging:o}=this.state,{scale:s}=e,c=o?a:c7(t,e.domain);return(0,F.jsxs)(P.Fragment,{children:[(0,F.jsx)(l7,{data:c,x:e=>s.x(e.x),y:e=>s.y(e.dragValue===void 0?e.y:e.dragValue),className:`line`}),c&&c.map((t,a)=>{let o=r||t.interactive;return(0,F.jsx)(o?s7:o7,{x:t.x,y:t.dragValue===void 0?t.y:t.dragValue,interactive:o,r:6,onDragStart:()=>this.setState({dragging:!0}),onDrag:e=>this.dragValue(a,t.dragValue===void 0?t.y:t.dragValue,e),onDragStop:()=>this.dragStop(a),graphProps:e,CustomDraggableComponent:n,correctness:t.correctness,correctData:i,label:t.label},`point-${t.x}-${a}`)})]})}})(()=>({"& .line":{fill:`transparent`,stroke:V.TERTIARY,strokeWidth:3,transition:`stroke 200ms ease-in, stroke-width 200ms ease-in`}})),d7=class extends P.Component{static propTypes={data:v.array,onChange:v.func,xBand:v.func,graphProps:x$.isRequired,CustomDraggableComponent:v.func,defineChart:v.bool,correctData:v.array};changeLine=(e,t)=>{let{onChange:n}=this.props,r=[...this.props.data],{dragValue:i,value:a}=t;r[e].value=i>=0?i:a,n(r)};render(){let e=this.props;return(0,F.jsx)(N6,{children:(0,F.jsx)(u7,{...e,onChange:this.changeLine})})}},f7=R(`circle`)(()=>({})),p7=R(`circle`)(()=>({height:`20px`,fill:`transparent`,stroke:`none`,pointerEvents:`auto`})),m7=({scale:e,x:t,y:n,r,correctness:i,interactive:a,correctData:o,label:s,...c})=>{let[l,u]=P.useState(!1),d=!i&&a;return(0,F.jsxs)(`g`,{onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),onTouchStart:()=>u(!0),onTouchEnd:()=>u(!1),children:[(0,F.jsx)(p7,{cx:e.x(t),cy:e.y(n),r:r*3,onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),...c}),(0,F.jsx)(f7,{cx:e.x(t),cy:e.y(n),r,correctness:i,interactive:a,...c}),(0,F.jsx)(r5,{scale:e,x:t,y:n,r,correctness:i,interactive:a}),(0,F.jsx)(i5,{scale:e,x:t,r,correctness:i,correctData:o,label:s}),l&&d&&(0,F.jsx)(`rect`,{x:e.x(t)-r*2,y:e.y(n)-r*2,width:r*4,height:r*4,stroke:V.BORDER_GRAY,strokeWidth:`1`,fill:`none`})]})};m7.propTypes={scale:v.object,x:v.number,y:v.number,r:v.number,correctness:v.shape({value:v.string,label:v.string}),interactive:v.bool,correctData:v.array,label:v.string};var h7=class extends P.Component{static propTypes={data:v.array,onChange:v.func,graphProps:x$.isRequired};render(){let e=this.props,{data:t,graphProps:n}=e,{scale:r={},size:i={}}=n||{},a=s5(r.x,t,i.width,`lineDot`);return(0,F.jsx)(d7,{...e,xBand:a,CustomDraggableComponent:m7})}},g7=()=>({type:`lineDot`,Component:h7,name:`Line Dot`}),_7=R(F6)(()=>({stroke:V.TEXT,transition:`fill 200ms linear, height 200ms linear`,"&.non-interactive":{stroke:Ll?.()||`#ccc`}})),v7=R(N6)(({correctness:e,interactive:t})=>({stroke:V.TEXT,transition:`fill 200ms linear, height 200ms linear`,...e&&!t&&{fill:`${V.BLACK} !important`,stroke:`${V.BLACK} !important`},"&.non-interactive":{stroke:Ll?.()||`#ccc`}})),y7=R(`circle`)(()=>({height:`20px`,fill:`transparent`,stroke:`transparent`})),b7=e=>{let{className:t,scale:n,x:r,y:i,r:a,correctness:o,interactive:s,correctData:c,label:l,...u}=e,[d,f]=(0,P.useState)(!1),p=a*4,m=p/2,h=n.x(r),g=n.y(i);return(0,F.jsxs)(v7,{className:t,correctness:o,interactive:s,children:[(0,F.jsx)(_7,{data:[{x:n.x(r)-a,y:n.y(i)+a},{x:n.x(r)+a,y:n.y(i)-a}],x:e=>e.x,y:e=>e.y,strokeWidth:5,style:{pointerEvents:`none`}},`point-${r}-${i}-1`),(0,F.jsx)(_7,{data:[{x:n.x(r)-a,y:n.y(i)-a},{x:n.x(r)+a,y:n.y(i)+a}],x:e=>e.x,y:e=>e.y,strokeWidth:5,style:{pointerEvents:`none`}},`point-${r}-${i}-2`),d&&(0,F.jsx)(`rect`,{x:h-m,y:g-m,width:p,height:p,stroke:V.BORDER_GRAY,fill:`none`,strokeWidth:2,pointerEvents:`none`}),(0,F.jsx)(y7,{cx:h,cy:g,r:a*2,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),...u}),(0,F.jsx)(r5,{scale:n,x:r,y:i,r:a,correctness:o,interactive:s}),(0,F.jsx)(i5,{scale:n,x:r,r:a,correctness:o,correctData:c,label:l})]})};b7.propTypes={scale:v.object,x:v.number,y:v.number,r:v.number,className:v.string,correctness:v.shape({value:v.string,label:v.string}),interactive:v.bool,correctData:v.array,label:v.string};var x7=class extends P.Component{static propTypes={data:v.array,onChange:v.func,graphProps:x$.isRequired};render(){let e=this.props,{data:t,graphProps:n}=e,{scale:r={},size:i={}}=n||{},a=s5(r.x,t,i.width,`lineCross`);return(0,F.jsx)(d7,{...e,xBand:a,CustomDraggableComponent:b7})}},S7=()=>({type:`lineCross`,Component:x7,name:`Line Cross`}),C7=Uu(`pie-lib:chart:bars`),w7=16,T7=R(class extends P.Component{static propTypes={onChangeCategory:v.func,value:v.number,label:v.string,xBand:v.func,index:v.number.isRequired,graphProps:x$.isRequired,CustomBarElement:v.func,interactive:v.bool,correctness:v.shape({value:v.string,label:v.string}),defineChart:v.bool,correctData:v.arrayOf(v.shape({value:v.oneOfType([v.string,v.number]),label:v.string})),className:v.string};constructor(e){super(e),this.state={dragValue:void 0,isHovered:!1}}handleMouseEnter=()=>{this.setState({isHovered:!0})};handleMouseLeave=()=>{this.setState({isHovered:!1})};setDragValue=e=>this.setState({dragValue:e});dragStop=()=>{let{label:e,onChangeCategory:t}=this.props,{dragValue:n}=this.state;C7(`[dragStop]`,n),n!==void 0&&t({label:e,value:n}),this.setDragValue(void 0)};dragValue=(e,t)=>{C7(`[dragValue] next:`,t),this.setDragValue(t)};renderCorrectnessIcon=(e,t,n,r,i,a,o)=>{let s;if(n===0)s=i.y(0)-w7/2;else{let e=n-1;s=i.y(e)-(a-o)/2-o/2-w7/2}return(0,F.jsx)(`foreignObject`,{x:e+t/2-w7/2,y:s,width:w7,height:w7,children:(0,F.jsx)(pR,{className:`correctnessIcon correctIcon smallIcon`,title:r.label})})};render(){let{graphProps:e,value:t,label:n,xBand:r,index:i,CustomBarElement:a,interactive:o,correctness:s,defineChart:c,correctData:l,className:u}=this.props,{scale:d,range:f,size:p}=e,{max:m}=f||{},{dragValue:h,isHovered:g}=this.state,_=Number.isFinite(h)?h:t,v=r.bandwidth(),y=d.y(f.max-_),b=r(o5({label:n},i));C7(`label:`,n,`barX:`,b,`v: `,_,`barHeight:`,y,`barWidth: `,v);let x=[];for(let e=0;e<_;e++)x.push(e);let S=p.height/m,C=(S>v?v:S)*.8,w=o?K5:G5,T=o&&!s;return(0,F.jsx)(P.Fragment,{children:(0,F.jsxs)(`g`,{className:u,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,onTouchStart:this.handleMouseEnter,onTouchEnd:this.handleMouseLeave,children:[g&&T&&(0,F.jsx)(`rect`,{x:b,y:d.y(_),width:v,height:x?.length?S*x.length:0,stroke:V.BORDER_GRAY,strokeWidth:`4px`,fill:`transparent`}),x.map(e=>a({index:e,pointDiameter:C,barX:b,barWidth:v,pointHeight:S,label:n,value:t,scale:d})),s&&s.value===`incorrect`&&(()=>{let e=parseFloat(l[i]&&l[i].value);if(isNaN(e))return null;let o=_;if(e===0)return this.renderCorrectnessIcon(b,v,e,s,d,S,C);if(o>e){let o=[];for(let t=0;t<e;t++)o.push(t);let c=o[o.length-1],l=r(o5({label:n},i)),u=r.bandwidth(),f=p.height/m,h=(f>u?u:f)*.8;return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(a,{index:c,pointDiameter:h+10,barX:l,barWidth:u,pointHeight:f,label:n,value:t,scale:d,dottedOverline:!0}),this.renderCorrectnessIcon(l,u,e,s,d,f,h)]})}let c=[];for(let t=o;t<e;t++)c.push(t);return(0,F.jsxs)(F.Fragment,{children:[c.map(e=>a({index:e,pointDiameter:C,barX:b,barWidth:v,pointHeight:S,label:n,value:t,scale:d,dottedOverline:!0})),this.renderCorrectnessIcon(b,v,e,s,d,S,C)]})})(),(0,F.jsx)(w,{x:b,y:_,interactive:o,width:v,onDrag:e=>this.dragValue(t,e),onDragStop:this.dragStop,graphProps:e,correctness:s,isHovered:g,defineChart:c,color:Zl(),isPlot:!0})]})})}})(({theme:e})=>({"& .dot":{fill:Ru.PLOT_FILL_COLOR,"&.correct":y5(`stroke`),"&.incorrect":b5(`stroke`)},"& .dotColor":{fill:Ru.PLOT_FILL_COLOR,"&.correct":y5(`fill`),"&.incorrect":b5(`fill`)},"& .line":{stroke:Ru.PLOT_FILL_COLOR,"&.correct":y5(`stroke`),"&.incorrect":b5(`stroke`)},"& .correctIcon":{backgroundColor:Bl()},"& .incorrectIcon":{backgroundColor:Gl()},"& .correctnessIcon":{borderRadius:e.spacing(2),color:V.WHITE,fontSize:`16px`,width:`16px`,height:`16px`,padding:`2px`,border:`1px solid ${V.WHITE}`,stroke:`initial`,boxSizing:`unset`,display:`block`},"& .smallIcon":{fontSize:`10px`,width:`10px`,height:`10px`}})),E7=class extends P.Component{static propTypes={data:v.array,onChangeCategory:v.func,xBand:v.func,graphProps:x$.isRequired,defineChart:v.bool,CustomBarElement:v.func,correctData:v.arrayOf(v.shape({value:v.oneOfType([v.string,v.number]),label:v.string})),className:v.string};render(){let{data:e,graphProps:t,xBand:n,CustomBarElement:r,onChangeCategory:i,defineChart:a,correctData:o}=this.props;return(0,F.jsx)(N6,{children:(e||[]).map((e,s)=>(0,F.jsx)(T7,{value:e.value,label:e.label,interactive:a||e.interactive,defineChart:a,xBand:n,index:s,onChangeCategory:e=>i(s,e),graphProps:t,CustomBarElement:r,correctness:e.correctness,correctData:o},`bar-${e.label}-${e.value}-${s}`))})}},D7=R(L6)(()=>({fill:Ru.PLOT_FILL_COLOR,"&.correct":y5(`stroke`),"&.incorrect":b5(`stroke`)})),O7=e=>{let{index:t,pointDiameter:n,barX:r,barWidth:i,pointHeight:a,label:o,value:s,scale:c,dottedOverline:l}=e,u=n/2,d=r+(i-n)/2+u,f=c.y(t)-(a-n)/2-u;return l?(0,F.jsx)(L6,{cx:d,cy:f,r:u+2,strokeDasharray:`4,4`,stroke:V.BORDER_GRAY,fill:`none`},`point-${o}-${s}-${t}`):(0,F.jsx)(D7,{cx:d,cy:f,r:u},`point-${o}-${s}-${t}`)};O7.propTypes={index:v.number,pointDiameter:v.number,barX:v.number,barWidth:v.number,pointHeight:v.number,value:v.number,label:v.string,scale:v.object,dottedOverline:v.bool};var k7=class extends P.Component{static propTypes={data:v.array,onChange:v.func,graphProps:x$.isRequired};render(){let e=this.props,{data:t,graphProps:n}=e,{scale:r={},size:i={}}=n||{},a=s5(r.x,t,i.width,`dotPlot`);return(0,F.jsx)(E7,{...e,xBand:a,CustomBarElement:O7})}},A7=()=>({type:`dotPlot`,Component:k7,name:`Dot Plot`}),j7=R(F6)(()=>({stroke:Ru.PLOT_FILL_COLOR,"&.correct":y5(`stroke`),"&.incorrect":b5(`stroke`)})),M7=e=>{let{index:t,pointDiameter:n,barX:r,barWidth:i,pointHeight:a,label:o,value:s,scale:c,dottedOverline:l}=e,u=r+(i-n)/2,d=c.y(t)-(a-n)/2;return l?(0,F.jsx)(`rect`,{x:u-2,y:d-n-2,width:n+4,height:n+4,strokeDasharray:`4,4`,stroke:V.BORDER_GRAY,fill:`none`},`point-${o}-${s}-${t}`):(0,F.jsxs)(N6,{children:[(0,F.jsx)(j7,{data:[{x:u,y:d},{x:u+n,y:d-n}],className:`line`,x:e=>e.x,y:e=>e.y,strokeWidth:n/5},`point-${o}-${s}-${t}-1`),(0,F.jsx)(j7,{data:[{x:u,y:d-n},{x:u+n,y:d}],x:e=>e.x,y:e=>e.y,strokeWidth:n/5,className:`line`},`point-${o}-${s}-${t}-2`)]})};M7.propTypes={index:v.number,pointDiameter:v.number,barX:v.number,barWidth:v.number,pointHeight:v.number,value:v.number,label:v.string,scale:v.object,dottedOverline:v.bool};var N7=class extends P.Component{static propTypes={data:v.array,onChange:v.func,graphProps:x$.isRequired};render(){let e=this.props,{data:t,graphProps:n}=e,{scale:r={},size:i={}}=n||{},a=s5(r.x,t,i.width,`linePlot`);return(0,F.jsx)(E7,{...e,xBand:a,CustomBarElement:M7})}},P7={Bar:n7,Histogram:i7,LineDot:g7,DotPlot:A7,LinePlot:()=>({type:`linePlot`,Component:N7,name:`Line Plot`}),LineCross:S7},F7={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.`},mcPopulatedBlank:{answerChoices:`Answer choices`,blankLabel:`blank`,emptyBlank:`(blank)`,blankPreSelectionHint:`The answer you choose will appear on the blank line above.`,correctAnswerSelected:`Correct answer selected`,incorrectAnswerSelected:`Incorrect answer selected`,selectedAnswerImage:`Selected answer image`,choiceImage:`Choice {{id}}`,clickToEnableAutoplay:`Click to enable audio autoplay`,audioResourceUnavailable:`Audio is enabled but no playable audio URL is configured.`,listen:`Listen`,listenSilentAlt:`Repeat instructions`,listenPlayingAlt:`Instructions are playing`,printAudio:`Audio:`,printTranscript:`Transcript:`,printKey:`(key)`},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`},simpleCloze:{correctAnswerShown:`Correct answer`,correct:`Correct`,incorrect:`Incorrect`,unanswered:`No answer`,placeholder:`Enter your answer...`,answerInput:`Your answer`,printCorrectAnswer:`Correct answer:`,printAnswerBlank:`Answer blank`},vennClassification:{tray:`Tiles to classify`,unknownTarget:`unknown`,cancelled:`Cancelled`,returnedToTray:`{{name}} returned to tray`,placedIn:`{{name}} placed in {{target}}`,pickedUp:`Picked up {{name}}`,pickedUpWithKeyboard:`Picked up {{name}}, drop target: {{target}}. Use arrow keys to choose a drop target, Enter to drop, Escape to cancel.`,dropTarget:`Drop target: {{target}}`,unsupportedCircles_one:`This diagram cannot be shown: it has {{count}} circle, and only {{supported}} are supported.`,unsupportedCircles_other:`This diagram cannot be shown: it has {{count}} circles, and only {{supported}} are supported.`,setNumber:`Set {{number}}`,regionOnly:`{{set}} only`,regionNeither:`Neither {{first}} nor {{second}}`,regionNoneOf:`None of {{sets}}`,regionAndSeparator:` and `,tileFallbackName:`Tile`,tileNotPlaced:`not placed`,tileInRegion:`in {{region}}`,tileCorrect:`correct`,tileIncorrect:`incorrect`}},common:{undo:`Undo`,clearAll:`Clear all`,correct:`Correct`,incorrect:`Incorrect`,showCorrectAnswer:`Show correct answer`,hideCorrectAnswer:`Hide correct answer`,showTeacherInstructions:`Show Teacher Instructions`,hideTeacherInstructions:`Hide Teacher Instructions`,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`}},I7={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.`},mcPopulatedBlank:{answerChoices:`Opciones de respuesta`,blankLabel:`espacio en blanco`,emptyBlank:`(en blanco)`,blankPreSelectionHint:`La respuesta que elijas aparecerá en la línea en blanco de arriba.`,correctAnswerSelected:`Respuesta correcta seleccionada`,incorrectAnswerSelected:`Respuesta incorrecta seleccionada`,selectedAnswerImage:`Imagen de la respuesta seleccionada`,choiceImage:`Opción {{id}}`,clickToEnableAutoplay:`Haz clic para activar la reproducción automática del audio`,audioResourceUnavailable:`El audio está activado, pero no hay una URL de audio reproducible configurada.`,listen:`Escuchar`,listenSilentAlt:`Escuchar. Repetir las instrucciones.`,listenPlayingAlt:`Escuchar. Estas son las instrucciones.`,printAudio:`Audio:`,printTranscript:`Transcripción:`,printKey:`(clave)`},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`},simpleCloze:{correctAnswerShown:`Respuesta correcta`,correct:`Correcto`,incorrect:`Incorrecto`,unanswered:`Sin respuesta`,placeholder:`Escribe tu respuesta...`,answerInput:`Tu respuesta`,printCorrectAnswer:`Respuesta correcta:`,printAnswerBlank:`Espacio para la respuesta`},vennClassification:{tray:`Fichas para clasificar`,unknownTarget:`desconocido`,cancelled:`Cancelado`,returnedToTray:`Se devolvió {{name}} a la bandeja`,placedIn:`Se colocó {{name}} en {{target}}`,pickedUp:`Se tomó {{name}}`,pickedUpWithKeyboard:`Se tomó {{name}}, destino: {{target}}. Usa las flechas para elegir un destino, Enter para soltar y Escape para cancelar.`,dropTarget:`Destino: {{target}}`,unsupportedCircles_one:`No se puede mostrar este diagrama: tiene {{count}} círculo, y solo se admiten {{supported}}.`,unsupportedCircles_other:`No se puede mostrar este diagrama: tiene {{count}} círculos, y solo se admiten {{supported}}.`,setNumber:`Conjunto {{number}}`,regionOnly:`Solo {{set}}`,regionNeither:`Ni {{first}} ni {{second}}`,regionNoneOf:`Ninguno de {{sets}}`,regionAndSeparator:` y `,tileFallbackName:`Ficha`,tileNotPlaced:`sin colocar`,tileInRegion:`en {{region}}`,tileCorrect:`correcta`,tileIncorrect:`incorrecta`}},common:{undo:`Deshacer`,clearAll:`Borrar todo`,correct:`Correcto`,incorrect:`Incorrecto`,showCorrectAnswer:`Mostrar respuesta correcta`,hideCorrectAnswer:`Ocultar respuesta correcta`,showTeacherInstructions:`Mostrar instrucciones para el maestro`,hideTeacherInstructions:`Ocultar instrucciones para el maestro`,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`}},L7=e=>typeof e==`string`,R7=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},z7=e=>e==null?``:``+e,B7=(e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})},V7=/###/g,H7=e=>e&&e.indexOf(`###`)>-1?e.replace(V7,`.`):e,U7=e=>!e||L7(e),W7=(e,t,n)=>{let r=L7(t)?t.split(`.`):t,i=0;for(;i<r.length-1;){if(U7(e))return{};let t=H7(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return U7(e)?{}:{obj:e,k:H7(r[i])}},G7=(e,t,n)=>{let{obj:r,k:i}=W7(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let a=t[t.length-1],o=t.slice(0,t.length-1),s=W7(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=W7(e,o,Object),s?.obj&&s.obj[`${s.k}.${a}`]!==void 0&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},K7=(e,t,n,r)=>{let{obj:i,k:a}=W7(e,t,Object);i[a]=i[a]||[],i[a].push(n)},q7=(e,t)=>{let{obj:n,k:r}=W7(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},J7=(e,t,n)=>{let r=q7(e,n);return r===void 0?q7(t,n):r},Y7=(e,t,n)=>{for(let r in t)r!==`__proto__`&&r!==`constructor`&&(r in e?L7(e[r])||e[r]instanceof String||L7(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):Y7(e[r],t[r],n):e[r]=t[r]);return e},X7=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`),Z7={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`,"/":`/`},Q7=e=>L7(e)?e.replace(/[&<>"'\/]/g,e=>Z7[e]):e,$7=class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(t!==void 0)return t;let 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}},e9=[` `,`,`,`?`,`!`,`;`],t9=new $7(20),n9=(e,t,n)=>{t||=``,n||=``;let r=e9.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(r.length===0)return!0;let i=t9.getRegExp(`(${r.map(e=>e===`?`?`\\?`:e).join(`|`)})`),a=!i.test(e);if(!a){let t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(a=!0)}return a},r9=(e,t,n=`.`)=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;let r=t.split(n),i=e;for(let e=0;e<r.length;){if(!i||typeof i!=`object`)return;let t,a=``;for(let o=e;o<r.length;++o)if(o!==e&&(a+=n),a+=r[o],t=i[a],t!==void 0){if([`string`,`number`,`boolean`].indexOf(typeof t)>-1&&o<r.length-1)continue;e+=o-e+1;break}i=t}return i},i9=e=>e?.replace(/_/g,`-`),a9={type:`logger`,log(e){this.output(`log`,e)},warn(e){this.output(`warn`,e)},error(e){this.output(`error`,e)},output(e,t){console?.[e]?.apply?.(console,t)}},o9=new class e{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||`i18next:`,this.logger=e||a9,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:(L7(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(t){return new e(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t||=this.options,t.prefix=t.prefix||this.prefix,new e(this.logger,t)}},s9=class{constructor(){this.observers={}}on(e,t){return e.split(` `).forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)}),this.observers[`*`]&&Array.from(this.observers[`*`].entries()).forEach(([n,r])=>{for(let i=0;i<r;i++)n.apply(n,[e,...t])})}},c9=class extends s9{constructor(e,t={ns:[`translation`],defaultNS:`translation`}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){let i=r.keySeparator===void 0?this.options.keySeparator:r.keySeparator,a=r.ignoreJSONStructure===void 0?this.options.ignoreJSONStructure:r.ignoreJSONStructure,o;e.indexOf(`.`)>-1?o=e.split(`.`):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):L7(n)&&i?o.push(...n.split(i)):o.push(n)));let s=q7(this.data,o);return!s&&!t&&!n&&e.indexOf(`.`)>-1&&(e=o[0],t=o[1],n=o.slice(2).join(`.`)),s||!a||!L7(n)?s:r9(this.data?.[e]?.[t],n,i)}addResource(e,t,n,r,i={silent:!1}){let a=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,o=[e,t];n&&(o=o.concat(a?n.split(a):n)),e.indexOf(`.`)>-1&&(o=e.split(`.`),r=t,t=o[1]),this.addNamespaces(t),G7(this.data,o,r),i.silent||this.emit(`added`,e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(let r in n)(L7(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,i,a={silent:!1,skipCopy:!1}){let o=[e,t];e.indexOf(`.`)>-1&&(o=e.split(`.`),r=n,n=t,t=o[1]),this.addNamespaces(t);let s=q7(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?Y7(s,n,i):s={...s,...n},G7(this.data,o,s),a.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 this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||=this.options.defaultNS,this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}},l9={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(e=>{t=this.processors[e]?.process(t,n,r,i)??t}),t}},u9=Symbol(`i18next/PATH_KEY`);function d9(){let e=[],t=Object.create(null),n;return t.get=(r,i)=>(n?.revoke?.(),i===u9?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function f9(e,t){let{[u9]:n}=e(d9()),r=t?.keySeparator??`.`,i=t?.nsSeparator??`:`;if(n.length>1&&i){let e=t?.ns,a=Array.isArray(e)?e:null;if(a&&a.length>1&&a.slice(1).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(r)}`}return n.join(r)}var p9={},m9=e=>!L7(e)&&typeof e!=`boolean`&&typeof e!=`number`,h9=class e extends s9{constructor(e,t={}){super(),B7([`resourceStore`,`languageUtils`,`pluralResolver`,`interpolator`,`backendConnector`,`i18nFormat`,`utils`],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.logger=o9.create(`translator`)}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let n={...t};if(e==null)return!1;let r=this.resolve(e,n);if(r?.res===void 0)return!1;let i=m9(r.res);return!(n.returnObjects===!1&&i)}extractFromKey(e,t){let n=t.nsSeparator===void 0?this.options.nsSeparator:t.nsSeparator;n===void 0&&(n=`:`);let r=t.keySeparator===void 0?this.options.keySeparator:t.keySeparator,i=t.ns||this.options.defaultNS||[],a=n&&e.indexOf(n)>-1,o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!n9(e,n,r);if(a&&!o){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:L7(i)?[i]:i};let a=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(a[0])>-1)&&(i=a.shift()),e=a.join(r)}return{key:e,namespaces:L7(i)?[i]:i}}translate(t,n,r){let i=typeof n==`object`?{...n}:n;if(typeof i!=`object`&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i==`object`&&(i={...i}),i||={},t==null)return``;typeof t==`function`&&(t=f9(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]),t=t.map(e=>typeof e==`function`?f9(e,{...this.options,...i}):String(e));let a=i.returnDetails===void 0?this.options.returnDetails:i.returnDetails,o=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,{key:s,namespaces:c}=this.extractFromKey(t[t.length-1],i),l=c[c.length-1],u=i.nsSeparator===void 0?this.options.nsSeparator:i.nsSeparator;u===void 0&&(u=`:`);let d=i.lng||this.language,f=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d?.toLowerCase()===`cimode`)return f?a?{res:`${l}${u}${s}`,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:`${l}${u}${s}`:a?{res:s,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:s;let p=this.resolve(t,i),m=p?.res,h=p?.usedKey||s,g=p?.exactUsedKey||s,_=[`[object Number]`,`[object Function]`,`[object RegExp]`],v=i.joinArrays===void 0?this.options.joinArrays:i.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,b=i.count!==void 0&&!L7(i.count),x=e.hasDefaultValue(i),S=b?this.pluralResolver.getSuffix(d,i.count,i):``,C=i.ordinal&&b?this.pluralResolver.getSuffix(d,i.count,{ordinal:!1}):``,w=b&&!i.ordinal&&i.count===0,T=w&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${S}`]||i[`defaultValue${C}`]||i.defaultValue,E=m;y&&!m&&x&&(E=T);let D=m9(E),O=Object.prototype.toString.apply(E);if(y&&E&&D&&_.indexOf(O)<0&&!(L7(v)&&Array.isArray(E))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,E,{...i,ns:c}):`key '${s} (${this.language})' returned an object instead of string.`;return a?(p.res=e,p.usedParams=this.getUsedParamsDetails(i),p):e}if(o){let e=Array.isArray(E),t=e?[]:{},n=e?g:h;for(let e in E)if(Object.prototype.hasOwnProperty.call(E,e)){let r=`${n}${o}${e}`;x&&!m?t[e]=this.translate(r,{...i,defaultValue:m9(T)?T[e]:void 0,joinArrays:!1,ns:c}):t[e]=this.translate(r,{...i,joinArrays:!1,ns:c}),t[e]===r&&(t[e]=E[e])}m=t}}else if(y&&L7(v)&&Array.isArray(m))m=m.join(v),m&&=this.extendTranslation(m,t,i,r);else{let e=!1,n=!1;!this.isValidLookup(m)&&x&&(e=!0,m=T),this.isValidLookup(m)||(n=!0,m=s);let a=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:m,c=x&&T!==m&&this.options.updateMissing;if(n||e||c){if(this.logger.log(c?`updateKey`:`missingKey`,d,l,s,c?T:m),o){let e=this.resolve(s,{...i,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=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo===`fallback`&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else this.options.saveMissingTo===`all`?e=this.languageUtils.toResolveHierarchy(i.lng||this.language):e.push(i.lng||this.language);let n=(e,t,n)=>{let r=x&&n!==m?n:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,r,c,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,r,c,i),this.emit(`missingKey`,e,l,t,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,i);w&&i[`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,i[`defaultValue${t}`]||T)})}):n(e,s,T))}m=this.extendTranslation(m,t,i,p,r),n&&m===s&&this.options.appendNamespaceToMissingKey&&(m=`${l}${u}${s}`),(n||e)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${s}`:s,e?m:void 0,i))}return a?(p.res=m,p.usedParams=this.getUsedParamsDetails(i),p):m}extendTranslation(e,t,n,r,i){if(this.i18nFormat?.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}});let a=L7(e)&&(n?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:n.interpolation.skipOnVariables),o;if(a){let t=e.match(this.interpolator.nestingRegexp);o=t&&t.length}let s=n.replace&&!L7(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||r.usedLng,n),a){let t=e.match(this.interpolator.nestingRegexp),r=t&&t.length;o<r&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...e)=>i?.[0]===e[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null):this.translate(...e,t),n)),n.interpolation&&this.interpolator.reset()}let a=n.postProcess||this.options.postProcess,o=L7(a)?[a]:a;return e!=null&&o?.length&&n.applyPostProcessor!==!1&&(e=l9.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,i,a,o;return L7(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>typeof e==`function`?f9(e,{...this.options,...t}):e)),e.forEach(e=>{if(this.isValidLookup(n))return;let s=this.extractFromKey(e,t),c=s.key;r=c;let l=s.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));let u=t.count!==void 0&&!L7(t.count),d=u&&!t.ordinal&&t.count===0,f=t.context!==void 0&&(L7(t.context)||typeof t.context==`number`)&&t.context!==``,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);l.forEach(e=>{this.isValidLookup(n)||(o=e,!p9[`${p[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&(p9[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${p.join(`, `)}" won't get resolved as namespace "${o}" 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!!!`)),p.forEach(r=>{if(this.isValidLookup(n))return;a=r;let o=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(o,c,r,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(r,t.count,t));let n=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(t.ordinal&&e.indexOf(i)===0&&o.push(c+e.replace(i,this.options.pluralSeparator)),o.push(c+e),d&&o.push(c+n)),f){let r=`${c}${this.options.contextSeparator||`_`}${t.context}`;o.push(r),u&&(t.ordinal&&e.indexOf(i)===0&&o.push(r+e.replace(i,this.options.pluralSeparator)),o.push(r+e),d&&o.push(r+n))}}let s;for(;s=o.pop();)this.isValidLookup(n)||(i=s,n=this.getResource(r,e,s,t))}))})}),{res:n,usedKey:r,exactUsedKey:i,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e===``)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){let t=[`defaultValue`,`ordinal`,`context`,`replace`,`lng`,`lngs`,`fallbackLng`,`ns`,`keySeparator`,`nsSeparator`,`returnObjects`,`returnDetails`,`joinArrays`,`postProcess`,`interpolation`],n=e.replace&&!L7(e.replace),r=n?e.replace:e;if(n&&e.count!==void 0&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(let e of t)delete r[e]}return r}static hasDefaultValue(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.substring(0,12)===`defaultValue`&&e[t]!==void 0)return!0;return!1}},g9=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=o9.create(`languageUtils`)}getScriptPartFromCode(e){if(e=i9(e),!e||e.indexOf(`-`)<0)return null;let t=e.split(`-`);return t.length===2||(t.pop(),t[t.length-1].toLowerCase()===`x`)?null:this.formatLanguageCode(t.join(`-`))}getLanguagePartFromCode(e){if(e=i9(e),!e||e.indexOf(`-`)<0)return e;let t=e.split(`-`);return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(L7(e)&&e.indexOf(`-`)>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}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(this.options.load===`languageOnly`||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;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;let r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>{if(e===r||!(e.indexOf(`-`)<0&&r.indexOf(`-`)<0)&&(e.indexOf(`-`)>0&&r.indexOf(`-`)<0&&e.substring(0,e.indexOf(`-`))===r||e.indexOf(r)===0&&r.length>1))return e})}),t||=this.getFallbackCodes(this.options.fallbackLng)[0],t}getFallbackCodes(e,t){if(!e)return[];if(typeof e==`function`&&(e=e(t)),L7(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||=e[this.getScriptPartFromCode(t)],n||=e[this.formatLanguageCode(t)],n||=e[this.getLanguagePartFromCode(t)],n||=e.default,n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),r=[],i=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return L7(e)&&(e.indexOf(`-`)>-1||e.indexOf(`_`)>-1)?(this.options.load!==`languageOnly`&&i(this.formatLanguageCode(e)),this.options.load!==`languageOnly`&&this.options.load!==`currentOnly`&&i(this.getScriptPartFromCode(e)),this.options.load!==`currentOnly`&&i(this.getLanguagePartFromCode(e))):L7(e)&&i(this.formatLanguageCode(e)),n.forEach(e=>{r.indexOf(e)<0&&i(this.formatLanguageCode(e))}),r}},_9={zero:0,one:1,two:2,few:3,many:4,other:5},v9={select:e=>e===1?`one`:`other`,resolvedOptions:()=>({pluralCategories:[`one`,`other`]})},y9=class{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=o9.create(`pluralResolver`),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n=i9(e===`dev`?`en`:e),r=t.ordinal?`ordinal`:`cardinal`,i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(n,{type:r})}catch{if(typeof Intl>`u`)return this.logger.error(`No Intl support, please use an Intl polyfill!`),v9;if(!e.match(/-|_/))return v9;let n=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(n,t)}return this.pluralRulesCache[i]=a,a}needsPlural(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?.resolvedOptions().pluralCategories.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||=this.getRule(`dev`,t),n?n.resolvedOptions().pluralCategories.sort((e,t)=>_9[e]-_9[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:``}${e}`):[]}getSuffix(e,t,n={}){let 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))}},b9=(e,t,n,r=`.`,i=!0)=>{let a=J7(e,t,n);return!a&&i&&L7(n)&&(a=r9(e,n,r),a===void 0&&(a=r9(t,n,r))),a},x9=e=>e.replace(/\$/g,`$$$$`),S9=class{constructor(e={}){this.logger=o9.create(`interpolator`),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||={escapeValue:!0};let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:a,suffix:o,suffixEscaped:s,formatSeparator:c,unescapeSuffix:l,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:m,nestingOptionsSeparator:h,maxReplaces:g,alwaysFormat:_}=e.interpolation;this.escape=t===void 0?Q7:t,this.escapeValue=n===void 0||n,this.useRawValueToEscape=r!==void 0&&r,this.prefix=i?X7(i):a||`{{`,this.suffix=o?X7(o):s||`}}`,this.formatSeparator=c||`,`,this.unescapePrefix=l?``:u||`-`,this.unescapeSuffix=this.unescapePrefix?``:l||``,this.nestingPrefix=d?X7(d):f||X7(`$t(`),this.nestingSuffix=p?X7(p):m||X7(`)`),this.nestingOptionsSeparator=h||`,`,this.maxReplaces=g||1e3,this.alwaysFormat=_!==void 0&&_,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>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 i,a,o,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(e.indexOf(this.formatSeparator)<0){let i=b9(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...r,...t,interpolationkey:e}):i}let i=e.split(this.formatSeparator),a=i.shift().trim(),o=i.join(this.formatSeparator).trim();return this.format(b9(t,s,a,this.options.keySeparator,this.options.ignoreJSONStructure),o,n,{...r,...t,interpolationkey:a})};this.resetRegExp();let l=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=r?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:r.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>x9(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?x9(this.escape(e)):x9(e)}].forEach(t=>{for(o=0;i=t.regex.exec(e);){let n=i[1].trim();if(a=c(n),a===void 0)if(typeof l==`function`){let t=l(e,i,r);a=L7(t)?t:``}else if(r&&Object.prototype.hasOwnProperty.call(r,n))a=``;else if(u){a=i[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),a=``;else!L7(a)&&!this.useRawValueToEscape&&(a=z7(a));let s=t.safeValue(a);if(e=e.replace(i[0],s),u?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,i,a,o=(e,t)=>{let n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;let r=e.split(RegExp(`${X7(n)}[ ]*{`)),i=`{${r[1]}`;e=r[0],i=this.interpolate(i,a);let o=i.match(/'/g),s=i.match(/"/g);((o?.length??0)%2==0&&!s||(s?.length??0)%2!=0)&&(i=i.replace(/'/g,`"`));try{a=JSON.parse(i),t&&(a={...t,...a})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];a={...n},a=a.replace&&!L7(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=/{.*}/.test(r[1])?r[1].lastIndexOf(`}`)+1:r[1].indexOf(this.formatSeparator);if(c!==-1&&(s=r[1].slice(c).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,c)),i=t(o.call(this,r[1].trim(),a),a),i&&r[0]===e&&!L7(i))return i;L7(i)||(i=z7(i)),i||=(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),``),s.length&&(i=s.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),i.trim())),e=e.replace(r[0],i),this.regexp.lastIndex=0}return e}},Fee=e=>{let t=e.toLowerCase().trim(),n={};if(e.indexOf(`(`)>-1){let r=e.split(`(`);t=r[0].toLowerCase().trim();let i=r[1].substring(0,r[1].length-1);t===`currency`&&i.indexOf(`:`)<0?n.currency||=i.trim():t===`relativetime`&&i.indexOf(`:`)<0?n.range||=i.trim():i.split(`;`).forEach(e=>{if(e){let[t,...r]=e.split(`:`),i=r.join(`:`).trim().replace(/^'+|'+$/g,``),a=t.trim();n[a]||(n[a]=i),i===`false`&&(n[a]=!1),i===`true`&&(n[a]=!0),isNaN(i)||(n[a]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}},C9=e=>{let t={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});let o=r+JSON.stringify(a),s=t[o];return s||(s=e(i9(r),i),t[o]=s),s(n)}},Iee=e=>(t,n,r)=>e(i9(n),r)(t),Lee=class{constructor(e={}){this.logger=o9.create(`formatter`),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||`,`;let n=t.cacheInBuiltFormats?C9:Iee;this.formats={number:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:`currency`});return e=>n.format(e)}),datetime:n((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||`day`)}),list:n((e,t)=>{let 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()]=C9(t)}format(e,t,n,r={}){let i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf(`(`)>1&&i[0].indexOf(`)`)<0&&i.find(e=>e.indexOf(`)`)>-1)){let e=i.findIndex(e=>e.indexOf(`)`)>-1);i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}return i.reduce((e,t)=>{let{formatName:i,formatOptions:a}=Fee(t);if(this.formats[i]){let t=e;try{let o=r?.formatParams?.[r.interpolationkey]||{},s=o.locale||o.lng||r.locale||r.lng||n;t=this.formats[i](e,s,{...a,...r,...o})}catch(e){this.logger.warn(e)}return t}else this.logger.warn(`there was no format function for ${i}`);return e},e)}},Ree=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},zee=class extends s9{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=o9.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=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){let i={},a={},o={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(this.state[o]===1?a[o]===void 0&&(a[o]=!0):(this.state[o]=1,r=!1,a[o]===void 0&&(a[o]=!0),i[o]===void 0&&(i[o]=!0),s[t]===void 0&&(s[t]=!0)))}),r||(o[e]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split(`|`),i=r[0],a=r[1];t&&this.emit(`failedLoading`,i,a,t),!t&&n&&this.store.addResourceBundle(i,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let o={};this.queue.forEach(n=>{K7(n.loaded,[i],a),Ree(n,e),t&&n.errors.push(t),n.pendingCount===0&&!n.done&&(Object.keys(n.loaded).forEach(e=>{o[e]||(o[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{o[e][t]===void 0&&(o[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit(`loaded`,o),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,i=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:a});return}this.readingCalls++;let o=(o,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}if(o&&s&&r<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,n,r+1,i*2,a)},i);return}a(o,s)},s=this.backend[n].bind(this.backend);if(s.length===2){try{let n=s(e,t);n&&typeof n.then==`function`?n.then(e=>o(null,e)).catch(o):o(null,n)}catch(e){o(e)}return}return s(e,t,o)}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();L7(e)&&(e=this.languageUtils.toResolveHierarchy(e)),L7(t)&&(t=[t]);let i=this.queueLoad(e,t,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.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=``){let n=e.split(`|`),r=n[0],i=n[1];this.read(r,i,`read`,void 0,void 0,(n,a)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,a),this.loaded(e,n,a)})}saveMissing(e,t,n,r,i,a={},o=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){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!!!`);return}if(!(n==null||n===``)){if(this.backend?.create){let s={...a,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let i;i=c.length===5?c(e,t,n,r,s):c(e,t,n,r),i&&typeof i.then==`function`?i.then(e=>o(null,e)).catch(o):o(null,i)}catch(e){o(e)}else c(e,t,n,r,o,s)}!e||!e[0]||this.store.addResource(e[0],t,n,r)}}},w9=()=>({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(typeof e[1]==`object`&&(t=e[1]),L7(e[1])&&(t.defaultValue=e[1]),L7(e[2])&&(t.tDescription=e[2]),typeof e[2]==`object`||typeof e[3]==`object`){let 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}),T9=e=>(L7(e.ns)&&(e.ns=[e.ns]),L7(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),L7(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.(`cimode`)<0&&(e.supportedLngs=e.supportedLngs.concat([`cimode`])),typeof e.initImmediate==`boolean`&&(e.initAsync=e.initImmediate),e),E9=()=>{},Bee=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]==`function`&&(e[t]=e[t].bind(e))})},D9=`__i18next_supportNoticeShown`,Vee=()=>!!(typeof globalThis<`u`&&globalThis[D9]||typeof process<`u`&&process.env&&process.env.I18NEXT_NO_SUPPORT_NOTICE||typeof process<`u`&&process.env),Hee=()=>{typeof globalThis<`u`&&(globalThis[D9]=!0)},Uee=e=>!!(e?.modules?.backend?.name?.indexOf(`Locize`)>0||e?.modules?.backend?.constructor?.name?.indexOf(`Locize`)>0||e?.options?.backend?.backends&&e.options.backend.backends.some(e=>e?.name?.indexOf(`Locize`)>0||e?.constructor?.name?.indexOf(`Locize`)>0)||e?.options?.backend?.projectId||e?.options?.backend?.backendOptions&&e.options.backend.backendOptions.some(e=>e?.projectId)),O9=class e extends s9{constructor(e={},t){if(super(),this.options=T9(e),this.services={},this.logger=o9,this.modules={external:[]},Bee(this),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,typeof e==`function`&&(t=e,e={}),e.defaultNS==null&&e.ns&&(L7(e.ns)?e.defaultNS=e.ns:e.ns.indexOf(`translation`)<0&&(e.defaultNS=e.ns[0]));let n=w9();this.options={...n,...this.options,...T9(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!=`function`&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!Uee(this)&&!Vee()&&(typeof console<`u`&&console.info!==void 0&&console.info(`🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙`),Hee());let r=e=>e?typeof e==`function`?new e:e:null;if(!this.options.isClone){this.modules.logger?o9.init(r(this.modules.logger),this.options):o9.init(null,this.options);let e;e=this.modules.formatter?this.modules.formatter:Lee;let t=new g9(this.options);this.store=new c9(this.options.resources,this.options);let i=this.services;i.logger=o9,i.resourceStore=this.store,i.languageUtils=t,i.pluralResolver=new y9(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)&&(i.formatter=r(e),i.formatter.init&&i.formatter.init(i,this.options),this.options.interpolation.format=i.formatter.format.bind(i.formatter)),i.interpolator=new S9(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new zee(r(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(i.languageDetector=r(this.modules.languageDetector),i.languageDetector.init&&i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=r(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new h9(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||=E9,this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&e[0]!==`dev`&&(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)});let i=R7(),a=()=>{let e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn(`init: i18next is already initialized. You should call init just once!`),this.isInitialized=!0,this.options.isClone||this.logger.log(`initialized`,this.options),this.emit(`initialized`,this.options),i.resolve(n),t(e,n)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),i}loadResources(e,t=E9){let n=t,r=L7(e)?e:this.language;if(typeof e==`function`&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r?.toLowerCase()===`cimode`&&(!this.options.preload||this.options.preload.length===0))return n();let e=[],t=t=>{t&&t!==`cimode`&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{t!==`cimode`&&e.indexOf(t)<0&&e.push(t)})};r?t(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(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){let r=R7();return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=void 0),e||=this.languages,t||=this.options.ns,n||=E9,this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);if(!e.type)throw Error(`You are passing a wrong module! Please check the object you are passing to i18next.use()`);return e.type===`backend`&&(this.modules.backend=e),(e.type===`logger`||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type===`languageDetector`&&(this.modules.languageDetector=e),e.type===`i18nFormat`&&(this.modules.i18nFormat=e),e.type===`postProcessor`&&l9.addPostProcessor(e),e.type===`formatter`&&(this.modules.formatter=e),e.type===`3rdParty`&&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++){let 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;let n=R7();this.emit(`languageChanging`,e);let r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(i,a)=>{a?this.isLanguageChangingTo===e&&(r(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit(`languageChanged`,a),this.logger.log(`languageChanged`,a)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(i,(...e)=>this.t(...e))},a=t=>{!e&&!t&&this.services.languageDetector&&(t=[]);let n=L7(t)?t:t&&t[0],a=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(L7(t)?[t]:t);a&&(this.language||r(a),this.translator.language||this.translator.changeLanguage(a),this.services.languageDetector?.cacheUserLanguage?.(a)),this.loadResources(a,e=>{i(e,a)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),n}getFixedT(e,t,n){let r=(e,t,...i)=>{let a;a=typeof t==`object`?{...t}:this.options.overloadTranslationOptionHandler([e,t].concat(i)),a.lng=a.lng||r.lng,a.lngs=a.lngs||r.lngs,a.ns=a.ns||r.ns,a.keyPrefix!==``&&(a.keyPrefix=a.keyPrefix||n||r.keyPrefix);let o={...this.options,...a};typeof a.keyPrefix==`function`&&(a.keyPrefix=f9(a.keyPrefix,o));let s=this.options.keySeparator||`.`,c;return a.keyPrefix&&Array.isArray(e)?c=e.map(e=>(typeof e==`function`&&(e=f9(e,o)),`${a.keyPrefix}${s}${e}`)):(typeof e==`function`&&(e=f9(e,o)),c=a.keyPrefix?`${a.keyPrefix}${s}${e}`:e),this.t(c,a)};return L7(e)?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=n,r}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...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;let n=t.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(n.toLowerCase()===`cimode`)return!0;let a=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return n===-1||n===0||n===2};if(t.precheck){let e=t.precheck(this,a);if(e!==void 0)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(n,e)&&(!r||a(i,e)))}loadNamespaces(e,t){let n=R7();return this.options.ns?(L7(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){let n=R7();L7(e)&&(e=[e]);let r=this.options.preload||[],i=e.filter(e=>r.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=r.concat(i),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language),!e)return`rtl`;try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch{}let t=`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`.split(`.`),n=this.services?.languageUtils||new g9(w9());return e.toLowerCase().indexOf(`-latn`)>1?`ltr`:t.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf(`-arab`)>1?`rtl`:`ltr`}static createInstance(t={},n){let r=new e(t,n);return r.createInstance=e.createInstance,r}cloneInstance(t={},n=E9){let r=t.forkResourceStore;r&&delete t.forkResourceStore;let i={...this.options,...t,isClone:!0},a=new e(i);if((t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),[`store`,`services`,`language`].forEach(e=>{a[e]=this[e]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new c9(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),{}),i),a.services.resourceStore=a.store),t.interpolation){let e={...w9().interpolation,...this.options.interpolation,...t.interpolation},n={...i,interpolation:e};a.services.interpolator=new S9(n)}return a.translator=new h9(a.services,i),a.translator.on(`*`,(e,...t)=>{a.emit(e,...t)}),a.init(i,n),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}.createInstance();O9.createInstance,O9.dir,O9.init,O9.loadResources,O9.reloadResources,O9.use,O9.changeLanguage,O9.getFixedT,O9.t,O9.exists,O9.setDefaultNamespace,O9.hasLoadedNamespace,O9.loadNamespaces,O9.loadLanguages,O9.init({fallbackLng:`en`,lng:`en`,showSupportNotice:!1,resources:{en:F7,es:I7}});var k9={translator:{...O9,t:(e,t)=>{let{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`;break;default:break}return O9.t(e,{lng:n,...t})}},languageOptions:[{value:`en_US`,label:`English (US)`},{value:`es_ES`,label:`Spanish`}]},{translator:A9}=k9,Wee=R(`div`)(()=>({alignSelf:`flex-end`})),Gee=R(`div`)(({theme:e})=>({cursor:`pointer`,fontSize:e.typography.fontSize,color:lu(),padding:e.spacing(1)})),Kee=R(cl)(({theme:e})=>({padding:e.spacing(1),display:`flex`,flexDirection:`column`,gap:e.spacing(1),"& button":{textTransform:`none`,fontSize:e.typography.fontSize,color:Il(),justifyContent:`flex-start`}})),qee=class extends P.Component{constructor(e){super(e),this.state={actionsAnchorEl:null}}componentWillUnmount(){this.setState({actionsAnchorEl:null})}static propTypes={addCategory:v.func.isRequired,deleteCategory:v.func.isRequired,language:v.string,categories:v.array};handleActionsClick=e=>{this.setState({actionsAnchorEl:e.currentTarget})};handleActionsClose=()=>{this.setState({actionsAnchorEl:null})};handleAddCategory=()=>{let{addCategory:e}=this.props;e(),this.handleActionsClose()};handleDeleteCategory=e=>{let{deleteCategory:t}=this.props;t(e),this.handleActionsClose()};render(){let{categories:e,language:t}=this.props,{actionsAnchorEl:n}=this.state;return(0,F.jsxs)(Wee,{children:[(0,F.jsx)(Gee,{role:`button`,tabIndex:0,onClick:this.handleActionsClick,children:`Actions`}),(0,F.jsx)(Al,{open:!!n,anchorEl:n,onClose:this.handleActionsClose,anchorOrigin:{vertical:`bottom`,horizontal:`left`},transformOrigin:{vertical:`top`,horizontal:`left`},children:(0,F.jsxs)(Kee,{children:[(0,F.jsxs)(ff,{onClick:()=>this.handleAddCategory(),children:[`+ `,A9.t(`charting.add`,{lng:t})]}),e.length>0&&e.map((e,n)=>e.deletable&&!e.correctness&&(0,F.jsx)(ff,{onClick:()=>this.handleDeleteCategory(n),children:`${A9.t(`charting.delete`,{lng:t})} <${e.label||A9.t(`charting.newLabel`,{lng:t})}>`},n))]})},`actions-popover-${Math.random()}`)]})}},{translator:j9}=k9,Jee=Uu(`pie-lib:charts:chart`),Yee=R(`div`)(()=>({width:`min-content`})),Xee=class extends P.Component{constructor(e){super(e),this.state={dialog:{open:!1},actionsAnchorEl:null},this.maskUid=this.generateMaskId()}static propTypes={className:v.string,chartType:v.string.isRequired,size:v.shape({width:v.number,height:v.number}),domain:v.shape({label:v.string,min:v.number,max:v.number,axisLabel:v.string}),data:v.arrayOf(v.shape({label:v.string,value:v.number})),range:v.shape({label:v.string,min:v.number,max:v.number,step:v.number,labelStep:v.number,axisLabel:v.string}),charts:v.array,labelsPlaceholders:v.object,title:v.string,titlePlaceholder:v.string,onDataChange:v.func,onChangeLabels:v.func,onChangeTitle:v.func,error:v.any,addCategoryEnabled:v.bool,showPixelGuides:v.bool,categoryDefaultLabel:v.string,categoryDefaults:v.object,defineChart:v.bool,theme:v.object,chartingOptions:v.object,changeInteractiveEnabled:v.bool,changeEditableEnabled:v.bool,language:v.string,mathMlOptions:v.object,labelsCharactersLimit:v.number,correctData:v.arrayOf(v.shape({label:v.string,value:v.number}))};static defaultProps={size:{width:480,height:480}};state={charts:[P7.Bar(),P7.Histogram(),P7.LineDot(),P7.LineCross(),P7.DotPlot(),P7.LinePlot()],autoFocus:!1};generateMaskId(){return`chart-`+(Math.random()*1e4).toFixed()}handleAlertDialog=(e,t)=>this.setState({dialog:{open:e}},t);getChart=()=>{let e=this.props.charts||this.state.charts,{chartType:t}=this.props,n=null,r=null;return t?(r=e&&e.find(e=>e.type===t),n=r&&r.Component):(r=e&&e[0],n=r&&r.Component,t=r&&r.type),{type:t,ChartComponent:n}};changeData=e=>{let{onDataChange:t}=this.props;t(e)};changeCategory=(e,t)=>{let n=parseInt(e,10);if(n>=0){let{data:e,onDataChange:r}=this.props;e[n]={...e[n],...t},r(e)}};addCategory=()=>{let{onDataChange:e,data:t,categoryDefaultLabel:n,defineChart:r,categoryDefaults:i,language:a}=this.props;(t||[]).length>19?this.setState({dialog:{open:!0,title:j9.t(`common:warning`,{lng:a}),text:j9.t(`charting.reachedLimit_other`,{count:20,lng:a}),onConfirm:()=>this.handleAlertDialog(!1)}}):(this.setState({autoFocus:!0}),e([...t,{inDefineChart:r,label:n||j9.t(`charting.newLabel`,{lng:a}),value:0,deletable:!0,editable:!i||i?.editable,interactive:!i||i?.interactive}]))};deleteCategory=e=>{let{data:t,onDataChange:n}=this.props;typeof e!=`number`||e<0||t&&t.length>0&&n(t.filter((t,n)=>n!==e))};getFilteredCategories=()=>{let{data:e,defineChart:t}=this.props;return e?e.map(e=>({...e,deletable:t||e.deletable})):[]};resetAutoFocus=()=>{this.setState({autoFocus:!1})};render(){let{domain:e={},range:t={},chartingOptions:n,size:r,title:i,onChangeTitle:a,onChangeLabels:o,labelsPlaceholders:s,titlePlaceholder:c,addCategoryEnabled:l,changeInteractiveEnabled:u,changeEditableEnabled:d,showPixelGuides:f,error:p,mathMlOptions:m={},language:h,labelsCharactersLimit:g,correctData:_}=this.props,{chartType:v}=this.props,{dialog:y}=this.state,b=this.props.defineChart||!1,{width:x,height:S}=r||{},C={left:t?.label||``,bottom:e?.label||``},{ChartComponent:w}=this.getChart(),T=this.getFilteredCategories(),E=l5(e,t,v),{verticalLines:D,horizontalLines:O,leftAxis:k}=u5(E.range,v),A={graphProps:H3(E.domain,E.range,r,()=>this.rootNode)};Jee(`[render] common:`,A);let j={x:-10,y:-75,width:x+20,height:S+130},{scale:M}=A.graphProps,ee=s5(M.x,T,x,v),N=ee.bandwidth()||M.x(E.domain.max)/T.length,te=b?160:60,ne=f5(N),re=Mp(A);return re.graphProps.size.height+=ne+te,(v===`dotPlot`||v===`linePlot`)&&_?.length&&C.bottom&&(re.graphProps.size.height+=25),(0,F.jsxs)(Yee,{children:[(0,F.jsxs)(c1,{title:i,onChangeTitle:a,disabledTitle:!b,showTitle:!0,showLabels:!0,labels:C,onChangeLabels:o,labelsPlaceholders:s,titlePlaceholder:c,defineChart:b,disabledLabels:!b,isChart:!0,showPixelGuides:f,rootRef:e=>this.rootNode=e,mathMlOptions:m,labelsCharactersLimit:g,...re,children:[(0,F.jsx)(b8,{...A,xBand:ee,rowTickValues:O,columnTickValues:D}),(0,F.jsx)(R5,{autoFocus:this.state.autoFocus,onAutoFocusUsed:this.resetAutoFocus,...A,defineChart:b,categories:T,xBand:ee,leftAxis:k,onChange:this.changeData,onChangeCategory:this.changeCategory,chartingOptions:n,changeInteractiveEnabled:u,changeEditableEnabled:d,top:ne,error:p,showCorrectness:v===`linePlot`||v===`dotPlot`}),l?(0,F.jsx)(`foreignObject`,{x,y:S-16,width:x,height:S,children:(0,F.jsx)(`div`,{xmlns:`http://www.w3.org/1999/xhtml`,style:{display:`flex`,justifyContent:`flex-start`},children:(0,F.jsx)(qee,{categories:T,addCategory:this.addCategory,deleteCategory:this.deleteCategory,language:h})})}):null,(0,F.jsx)(`mask`,{id:`${this.maskUid}`,children:(0,F.jsx)(`rect`,{...j,fill:`white`})}),(0,F.jsx)(`g`,{id:`marks`,mask:`url('#${this.maskUid}')`,children:w&&(0,F.jsx)(w,{...A,data:T,height:re.graphProps.size.height,defineChart:b,onChange:this.changeData,onChangeCategory:this.changeCategory,correctData:_})})]}),(0,F.jsx)(s6,{open:y.open,title:y.title,text:y.text,onClose:y.onClose,onConfirm:y.onConfirm})]})}},Zee=R(`div`)(({theme:e})=>({backgroundColor:V.WHITE,padding:e.spacing(2),width:`355px`,boxShadow:`inset 0px 1px 5px 0px #9297A6`,display:`flex`,flexDirection:`column`,gap:`16px`})),M9=R(`div`)(()=>({display:`flex`,alignItems:`center`,gap:`12px`})),Qee=R(`div`)(({theme:e})=>({fontSize:e.typography.h6.fontSize,fontWeight:`700`})),$ee=R(`div`)(()=>({marginLeft:`2px`})),N9=R(pR)(({theme:e})=>({backgroundColor:Bl(),borderRadius:e.spacing(2),color:V.WHITE})),ete=R(e5)(({theme:e})=>({backgroundColor:Gl(),borderRadius:e.spacing(2),color:V.WHITE})),tte=R(`div`)(()=>({marginLeft:`3px`,display:`flex`,alignItems:`center`,gap:`12px`})),{translator:P9}=k9,F9=({language:e})=>(0,F.jsxs)(Zee,{children:[(0,F.jsx)(Qee,{children:`Key`}),(0,F.jsxs)(M9,{children:[(0,F.jsx)(ete,{}),(0,F.jsx)(`div`,{children:P9.t(`charting.keyLegend.incorrectAnswer`,{lng:e})})]}),(0,F.jsxs)(M9,{children:[(0,F.jsx)(N9,{}),(0,F.jsx)(`div`,{children:P9.t(`charting.keyLegend.correctAnswer`,{lng:e})})]}),(0,F.jsxs)(tte,{children:[(0,F.jsx)(N9,{fontSize:`small`}),(0,F.jsx)($ee,{children:P9.t(`charting.keyLegend.correctKeyAnswer`,{lng:e})})]})]});F9.propTypes={language:v.string};var I9=`height ease-in 300ms, opacity ease-in 300ms`,nte=R(`div`)(()=>({position:`relative`,height:0,overflow:`hidden`,display:`flex`,visibility:`hidden`,width:0,"&.enter":{transition:I9,opacity:1,height:`auto`,width:`auto`,visibility:`visible`,minHeight:`25px`},"&.enter-done":{height:`auto`,visibility:`visible`,width:`auto`,minHeight:`25px`},"&.exit":{transition:I9,opacity:0,height:0,visibility:`visible`,width:0},"&.exit-done":{opacity:0,visibility:`hidden`,height:0,width:0}})),L9=e=>{let{show:t,children:n,className:r}=e,i=(0,P.useRef)(null);return(0,F.jsx)(Hs,{nodeRef:i,in:t,appear:!0,mountOnEnter:!1,timeout:300,classNames:{enter:`enter`,enterDone:`enter-done`,exit:`exit`,exitDone:`exit-done`},children:(0,F.jsx)(nte,{ref:i,className:r,children:n})})};L9.propTypes={show:v.bool.isRequired,className:v.string,children:v.oneOfType([v.arrayOf(v.node),v.node]).isRequired};function R9(e){return typeof e==`function`||typeof e==`object`&&!!e&&typeof e.$$typeof==`symbol`}function z9(e,t){return!e||R9(e)?e:R9(e.default)?e.default:t&&R9(e[t])?e[t]:t&&R9(e[t]?.default)?e[t].default:e}var rte=z9(ep,`Readable`)||z9(ite.Readable,`Readable`),B9=Op,V9=B9.default,ite=V9&&typeof V9==`object`?V9:B9,{translator:H9}=k9,ate={WebkitTouchCallout:`none`,WebkitUserSelect:`none`,KhtmlUserSelect:`none`,MozUserSelect:`none`,msUserSelect:`none`,userSelect:`none`},ote=R(`div`)(()=>({width:`100%`,cursor:`pointer`})),ste=R(`div`)(()=>({margin:`0 auto`,textAlign:`center`,display:`flex`})),cte=R(`div`)(()=>({width:`fit-content`,minWidth:`140px`,alignSelf:`center`,verticalAlign:`middle`,color:`var(--correct-answer-toggle-label-color, ${Il()})`,fontWeight:`normal`,...ate})),U9=R(`div`)(()=>({position:`absolute`,width:`25px`,"&.enter":{opacity:`0`},"&.enter-active":{opacity:`1`,transition:`opacity 0.3s ease-in`},"&.exit":{opacity:`1`},"&.exit-active":{opacity:`0`,transition:`opacity 0.3s ease-in`}})),lte=R(`div`)(()=>({width:`25px`,marginRight:`5px`,display:`flex`,alignItems:`center`})),ute=class e extends P.Component{static propTypes={onToggle:v.func,toggled:v.bool,show:v.bool,hideMessage:v.string,showMessage:v.string,className:v.string,language:v.string};static defaultProps={showMessage:`Show correct answer`,hideMessage:`Hide correct answer`,show:!1,toggled:!1};constructor(t){super(t),this.state={show:t.show},this.openIconRef=P.createRef(),this.closedIconRef=P.createRef(),e.defaultProps={...e.defaultProps,showMessage:H9.t(`common:showCorrectAnswer`,{lng:t.language}),hideMessage:H9.t(`common:hideCorrectAnswer`,{lng:t.language})}}onClick(){this.props.onToggle(!this.props.toggled)}onTouch(e){e.preventDefault(),this.props.onToggle(!this.props.toggled)}UNSAFE_componentWillReceiveProps(t){this.setState({show:t.show}),t.language!==this.props?.language&&(e.defaultProps={...e.defaultProps,showMessage:H9.t(`common:showCorrectAnswer`,{lng:t.language}),hideMessage:H9.t(`common:hideCorrectAnswer`,{lng:t.language})})}render(){let{className:e,toggled:t,hideMessage:n,showMessage:r}=this.props;return(0,F.jsx)(ote,{className:e,children:(0,F.jsx)(L9,{show:this.state.show,children:(0,F.jsxs)(ste,{onClick:this.onClick.bind(this),onTouchEnd:this.onTouch.bind(this),children:[(0,F.jsxs)(lte,{children:[(0,F.jsx)(Hs,{nodeRef:this.openIconRef,timeout:400,in:t,exit:!t,classNames:{enter:`enter`,enterActive:`enter-active`,exit:`exit`,exitActive:`exit-active`},children:(0,F.jsx)(U9,{ref:this.openIconRef,children:(0,F.jsx)(Ko,{open:t},`correct-open`)})}),(0,F.jsx)(Hs,{nodeRef:this.closedIconRef,timeout:5e3,in:!t,exit:t,classNames:{enter:`enter`,enterActive:`enter-active`,exit:`exit`,exitActive:`exit-active`},children:(0,F.jsx)(U9,{ref:this.closedIconRef,children:(0,F.jsx)(Ko,{open:t},`correct-closed`)})})]}),(0,F.jsx)(rte,{false:!0,children:(0,F.jsx)(cte,{"aria-hidden":!this.state.show,children:t?n:r})})]})})})}};function W9(e){return typeof e==`function`||typeof e==`object`&&!!e&&typeof e.$$typeof==`symbol`}function G9(e,t){return!e||W9(e)?e:W9(e.default)?e.default:t&&W9(e[t])?e[t]:t&&W9(e[t]?.default)?e[t].default:e}var dte=G9(Sf,`UiLayout`)||G9(X9.UiLayout,`UiLayout`),K9=G9($f,`PreviewPrompt`)||G9(X9.PreviewPrompt,`PreviewPrompt`),q9=G9(yd,`Collapsible`)||G9(X9.Collapsible,`Collapsible`),J9=Op,Y9=J9.default,X9=Y9&&typeof Y9==`object`?Y9:J9,fte=R(dte)({color:Il(),backgroundColor:iu(),overflowX:`scroll`,overflowY:`hidden`}),Z9=R(Xee)(({theme:e})=>({marginTop:e.spacing(2),marginBottom:e.spacing(2)})),pte=R(q9)(({theme:e})=>({marginBottom:e.spacing(2)})),mte=class extends P.Component{static propTypes={model:v.object.isRequired,onAnswersChange:v.func,categories:v.array};constructor(e){super(e),this.state={categories:e.categories||e.model.data,showingCorrect:!1}}componentDidUpdate(e){zp(e.categories,this.props.categories)?zp(e.model.data,this.props.model.data)||this.setState({categories:this.props.model.data}):this.setState({categories:this.props.categories})}changeData=e=>this.setState({categories:e},()=>this.props.onAnswersChange(e));toggleCorrect=e=>this.setState({showingCorrect:e});render(){let{categories:e,showingCorrect:t}=this.state,{model:n}=this.props,{teacherInstructions:r,prompt:i,chartType:a,size:o,domain:s,range:c,title:l,addCategoryEnabled:u,studentNewCategoryDefaultLabel:d,showToggle:f,rationale:p,correctAnswer:m,language:h,env:g,showKeyLegend:_}=n,{correctedAnswer:v,extraCSSRules:y}=n,b=(m?.data||[]).map(e=>({...e,interactive:!1,editable:!1})),{mode:x}=g||{};x===`view`&&(v=(v||[]).map(e=>({...e,editable:!1})));let S=n.rationale&&(ip(n.rationale)||op(n.rationale)),C=n.teacherInstructions&&(ip(n.teacherInstructions)||op(n.teacherInstructions));return(0,F.jsxs)(fte,{extraCSSRules:y,children:[C&&(0,F.jsx)(pte,{labels:{hidden:`Show Teacher Instructions`,visible:`Hide Teacher Instructions`},children:(0,F.jsx)(K9,{prompt:r})}),i&&(0,F.jsx)(K9,{className:`prompt`,prompt:i}),(0,F.jsx)(ute,{show:f,toggled:t,onToggle:this.toggleCorrect,language:h}),t&&f?(0,F.jsx)(Z9,{chartType:a,size:o,domain:s,range:c,charts:[P7.Bar(),P7.Histogram(),P7.LineDot(),P7.LineCross(),P7.DotPlot(),P7.LinePlot()],data:b||e,title:l,onDataChange:this.changeData,addCategoryEnabled:!1,categoryDefaultLabel:d,language:h,labelsPlaceholders:{}}):(0,F.jsx)(Z9,{chartType:a,size:o,domain:s,range:c,charts:[P7.Bar(),P7.Histogram(),P7.LineDot(),P7.LineCross(),P7.DotPlot(),P7.LinePlot()],data:v||e,title:l,onDataChange:this.changeData,addCategoryEnabled:u,categoryDefaultLabel:d,language:h,labelsPlaceholders:{},correctData:f?b:void 0}),!t&&_&&(0,F.jsx)(F9,{language:h}),S&&(0,F.jsx)(q9,{labels:{hidden:`Show Rationale`,visible:`Hide Rationale`},children:(0,F.jsx)(K9,{prompt:p})})]})}},Q9=class e extends CustomEvent{static{this.TYPE=`model-set`}constructor(t,n,r){super(e.TYPE,{bubbles:!0,composed:!0,detail:{complete:n,component:t,hasModel:r}}),this.component=t,this.complete=n}},hte=class e extends CustomEvent{static{this.TYPE=`session-changed`}constructor(t,n){super(e.TYPE,{bubbles:!0,composed:!0,detail:{complete:n,component:t}}),this.component=t,this.complete=n}},gte=g(),$9=class extends HTMLElement{constructor(){super(),this._root=null,this._mathObserver=null,this._mathRenderPending=!1}_scheduleMathRender=()=>{this._mathRenderPending||(this._mathRenderPending=!0,requestAnimationFrame(()=>{this._mathObserver&&this._mathObserver.disconnect(),hd(this),this._mathRenderPending=!1,setTimeout(()=>{this._mathObserver&&this._mathObserver.observe(this,{childList:!0,subtree:!0})},50)}))};_initMathObserver(){this._mathObserver||(this._mathObserver=new MutationObserver(this._scheduleMathRender),this._mathObserver.observe(this,{childList:!0,subtree:!0}))}_disconnectMathObserver(){this._mathObserver&&=(this._mathObserver.disconnect(),null)}set model(e){this._model=e,this._session&&this.isComplete(this._session.answer)?this.dispatchEvent(new Q9(this.tagName.toLowerCase(),!0,!!this._model)):this.dispatchEvent(new Q9(this.tagName.toLowerCase(),!1,!!this._model)),this._render()}set session(e){this._session=e,this._render()}get session(){return this._session}connectedCallback(){this._initMathObserver(),this._render()}isComplete=e=>Array.isArray(e)&&e.length>0;changeAnswers=e=>{this._session.answer=e,this.dispatchEvent(new hte(this.tagName.toLowerCase(),this.isComplete(this._session.answer))),this._render()};_render(){if(!this._model||!this._session)return;this._initMathObserver();let e={...this._model,data:this._model.data?[...this._model.data]:this._model.data},t=P.createElement(mte,{model:e,categories:this._session.answer,onAnswersChange:this.changeAnswers});this._root||=(0,gte.createRoot)(this),this._root.render(t)}disconnectedCallback(){this._disconnectMathObserver(),this._root&&=(this._root.unmount(),null)}};return typeof window<`u`&&!customElements.get(`charting-element`)&&customElements.define(`charting-element`,$9),$9})();
|
|
359
|
+
`,e.getElementsByTagName(`head`)[0].appendChild(n)}e.body&&R1(e.body,`react-draggable-transparent-selection`)}function I1(e){window.requestAnimationFrame?window.requestAnimationFrame(()=>{L1(e)}):L1(e)}function L1(e){if(e)try{e.body&&z1(e.body,`react-draggable-transparent-selection`);let t=e.selection;if(t)t.empty();else{let t=(e.defaultView||window).getSelection();t&&t.type!==`Caret`&&t.removeAllRanges()}}catch{}}function R1(e,t){e.classList?e.classList.add(t):e.className.match(RegExp(`(?:^|\\s)${t}(?!\\S)`))||(e.className+=` ${t}`)}function z1(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(RegExp(`(?:^|\\s)${t}(?!\\S)`,`g`),``)}function B1(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r==`string`?r:q1(r);let i=J1(e);if(typeof r==`string`){let{ownerDocument:e}=i,t=e.defaultView;if(!t)throw Error(`Cannot resolve the owner window of the draggable node.`);let n;if(n=r===`parent`?i.parentNode:i.getRootNode().querySelector(r),!(n instanceof t.HTMLElement))throw Error(`Bounds selector "`+r+`" could not find an element.`);let a=n,o=t.getComputedStyle(i),s=t.getComputedStyle(a);r={left:-i.offsetLeft+f1(s.paddingLeft)+f1(o.marginLeft),top:-i.offsetTop+f1(s.paddingTop)+f1(o.marginTop),right:D1(a)-T1(i)-i.offsetLeft+f1(s.paddingRight)-f1(o.marginRight),bottom:E1(a)-w1(i)-i.offsetTop+f1(s.paddingBottom)-f1(o.marginBottom)}}return d1(r.right)&&(t=Math.min(t,r.right)),d1(r.bottom)&&(n=Math.min(n,r.bottom)),d1(r.left)&&(t=Math.max(t,r.left)),d1(r.top)&&(n=Math.max(n,r.top)),[t,n]}function V1(e,t,n){return[Math.round(t/e[0])*e[0],Math.round(n/e[1])*e[1]]}function H1(e){return e.props.axis===`both`||e.props.axis===`x`}function U1(e){return e.props.axis===`both`||e.props.axis===`y`}function W1(e,t,n){let r=typeof t==`number`?M1(e,t):null;if(typeof t==`number`&&!r)return null;let i=J1(n),a=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return O1(r||e,a,n.props.scale)}function G1(e,t,n){let r=!d1(e.lastX),i=J1(e);return r?{node:i,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:i,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function K1(e,t){let n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function q1(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function J1(e){let t=e.findDOMNode();if(!t)throw Error(`<DraggableCore>: Unmounted during event!`);return t}var Y1=typeof process<`u`&&process.env.DRAGGABLE_DEBUG?console.log.bind(console):function(){},X1={touch:{start:`touchstart`,move:`touchmove`,stop:`touchend`},mouse:{start:`mousedown`,move:`mousemove`,stop:`mouseup`}},Z1=X1.mouse,Q1=class extends P.Component{constructor(){super(...arguments),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,this.touchIdentifier=null,this.mounted=!1,this.handleDragStart=e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&(typeof e.button==`number`&&e.button!==0||e.ctrlKey))return!1;let t=this.findDOMNode();if(!t||!t.ownerDocument||!t.ownerDocument.body)throw Error(`<DraggableCore> not mounted on DragStart!`);let{ownerDocument:n}=t;if(this.props.disabled||!(e.target instanceof n.defaultView.Node)||this.props.handle&&!x1(e.target,this.props.handle,t)||this.props.cancel&&x1(e.target,this.props.cancel,t))return;e.type===`touchstart`&&!this.props.allowMobileScroll&&e.preventDefault();let r=N1(e);this.touchIdentifier=r;let i=W1(e,r,this);if(i==null)return;let{x:a,y:o}=i,s=G1(this,a,o);Y1(`DraggableCore: handleDragStart: %j`,s),Y1(`calling`,this.props.onStart),!(this.props.onStart(e,s)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&F1(n,this.props.nonce),this.dragging=!0,this.lastX=a,this.lastY=o,S1(n,Z1.move,this.handleDrag),S1(n,Z1.stop,this.handleDragStop))},this.handleDrag=e=>{let t=W1(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX,t=r-this.lastY;if([e,t]=V1(this.props.grid,e,t),!e&&!t)return;n=this.lastX+e,r=this.lastY+t}let i=G1(this,n,r);if(Y1(`DraggableCore: handleDrag: %j`,i),this.props.onDrag(e,i)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent(`mouseup`))}catch{let e=document.createEvent(`MouseEvents`);e.initMouseEvent(`mouseup`,!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(e)}return}this.lastX=n,this.lastY=r},this.handleDragStop=e=>{if(!this.dragging)return;let t=W1(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX||0,t=r-this.lastY||0;[e,t]=V1(this.props.grid,e,t),n=this.lastX+e,r=this.lastY+t}let i=G1(this,n,r);if(this.props.onStop(e,i)===!1||this.mounted===!1)return!1;let a=this.findDOMNode();a&&this.props.enableUserSelectHack&&I1(a.ownerDocument),Y1(`DraggableCore: handleDragStop: %j`,i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&(Y1(`DraggableCore: Removing handlers`),C1(a.ownerDocument,Z1.move,this.handleDrag),C1(a.ownerDocument,Z1.stop,this.handleDragStop))},this.onMouseDown=e=>(Z1=X1.mouse,this.handleDragStart(e)),this.onMouseUp=e=>(Z1=X1.mouse,this.handleDragStop(e)),this.onTouchStart=e=>(Z1=X1.touch,this.handleDragStart(e)),this.onTouchEnd=e=>(Z1=X1.touch,this.handleDragStop(e))}componentDidMount(){this.mounted=!0;let e=this.findDOMNode();e&&S1(e,X1.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let e=this.findDOMNode();if(e){let{ownerDocument:t}=e;C1(t,X1.mouse.move,this.handleDrag),C1(t,X1.touch.move,this.handleDrag),C1(t,X1.mouse.stop,this.handleDragStop),C1(t,X1.touch.stop,this.handleDragStop),C1(e,X1.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&I1(t)}}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=Ms.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):(Y1(`react-draggable: ReactDOM.findDOMNode is not available in React 19+. You must provide a nodeRef prop. See: https://github.com/react-grid-layout/react-draggable#noderef`),null)}render(){return P.cloneElement(P.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Q1.displayName=`DraggableCore`,Q1.propTypes={allowAnyClick:v.bool,allowMobileScroll:v.bool,children:v.node.isRequired,disabled:v.bool,enableUserSelectHack:v.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw Error(`Draggable's offsetParent must be a DOM Node.`)},grid:v.arrayOf(v.number),handle:v.string,cancel:v.string,nodeRef:v.object,nonce:v.string,onStart:v.func,onDrag:v.func,onStop:v.func,onMouseDown:v.func,scale:v.number,className:p1,style:p1,transform:p1},Q1.defaultProps={allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1};var $1=class extends P.Component{constructor(e){super(e),this.onDragStart=(e,t)=>{if(Y1(`Draggable: onDragStart: %j`,t),this.props.onStart(e,K1(this,t))===!1)return!1;this.setState({dragging:!0,dragged:!0})},this.onDrag=(e,t)=>{if(!this.state.dragging)return!1;Y1(`Draggable: onDrag: %j`,t);let n=K1(this,t),r={x:n.x,y:n.y,slackX:0,slackY:0};if(this.props.bounds){let{x:e,y:t}=r;r.x+=this.state.slackX,r.y+=this.state.slackY;let[i,a]=B1(this,r.x,r.y);r.x=i,r.y=a,r.slackX=this.state.slackX+(e-r.x),r.slackY=this.state.slackY+(t-r.y),n.x=r.x,n.y=r.y,n.deltaX=r.x-this.state.x,n.deltaY=r.y-this.state.y}if(this.props.onDrag(e,n)===!1)return!1;this.setState(r)},this.onDragStop=(e,t)=>{if(!this.state.dragging||this.props.onStop(e,K1(this,t))===!1)return!1;Y1(`Draggable: onDragStop: %j`,t);let n={dragging:!1,slackX:0,slackY:0};if(this.props.position){let{x:e,y:t}=this.props.position;n.x=e,n.y=t}this.setState(n)},this.state={dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,prevPropsPosition:{...e.position},slackX:0,slackY:0,isElementSVG:!1},e.position&&!(e.onDrag||e.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}static getDerivedStateFromProps({position:e},{prevPropsPosition:t}){return e&&(!t||e.x!==t.x||e.y!==t.y)?(Y1(`Draggable: getDerivedStateFromProps %j`,{position:e,prevPropsPosition:t}),{x:e.x,y:e.y,prevPropsPosition:{...e}}):null}componentDidMount(){window.SVGElement!==void 0&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=Ms.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):null}render(){let{axis:e,bounds:t,children:n,defaultPosition:r,defaultClassName:i,defaultClassNameDragging:a,defaultClassNameDragged:o,position:s,positionOffset:c,scale:l,...u}=this.props,d={},f=null,p=!s||this.state.dragging,m=s||r,h={x:H1(this)&&p?this.state.x:m.x,y:U1(this)&&p?this.state.y:m.y};this.state.isElementSVG?f=A1(h,c):d=k1(h,c);let g=P.Children.only(n),_=I(g.props.className||``,i,{[a]:this.state.dragging,[o]:this.state.dragged});return P.createElement(Q1,{...u,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop},P.cloneElement(g,{className:_,style:{...g.props.style,...d},transform:f}))}};$1.displayName=`Draggable`,$1.propTypes={...Q1.propTypes,axis:v.oneOf([`both`,`x`,`y`,`none`]),bounds:v.oneOfType([v.shape({left:v.number,right:v.number,top:v.number,bottom:v.number}),v.string,v.oneOf([!1])]),defaultClassName:v.string,defaultClassNameDragging:v.string,defaultClassNameDragged:v.string,defaultPosition:v.shape({x:v.number,y:v.number}),positionOffset:v.shape({x:v.oneOfType([v.number,v.string]),y:v.oneOfType([v.number,v.string])}),position:v.shape({x:v.number,y:v.number}),className:p1,style:p1,transform:p1},$1.defaultProps={...Q1.defaultProps,axis:`both`,bounds:!1,defaultClassName:`react-draggable`,defaultClassNameDragging:`react-draggable-dragging`,defaultClassNameDragged:`react-draggable-dragged`,defaultPosition:{x:0,y:0},scale:1};var e0=Uu(`pie-lib:plot:grid-draggable`),t0=(e,t,n)=>r=>{let i=r+e(0);return t(n+e.invert(i)).toFixed(4)*1e3/1e3},n0=e=>t=>((0,T$.default)(!!e&&Bp(e.fromDelta)&&Bp(e.bounds)&&Bp(e.anchorPoint),`You must supply an object with: { anchorPoint: Function, fromDelta: Function, bounds: Function }`),class extends P.Component{static propTypes={disabled:v.bool,onDragStart:v.func,onDrag:v.func,onDragStop:v.func,onClick:v.func,onMove:v.func,graphProps:x$.isRequired};constructor(e){super(e),this.state={startX:null,startY:null}}grid=()=>{let{graphProps:e}=this.props,{scale:t,domain:n,range:r}=e;return{x:t.x(n.step)-t.x(0),y:t.y(r.step)-t.y(0)}};onStart=e=>{let{onDragStart:t}=this.props;document.activeElement&&document.activeElement.blur(),this._didDrag=!1,this.setState({startX:e.clientX,startY:e.clientY});let n=e.target,r=e=>{n.removeEventListener(`click`,r,!0),this._didDrag&&(e.stopPropagation(),e.preventDefault())};n.addEventListener(`click`,r,!0),t&&t()};position=()=>{let{x:t,y:n}=e.anchorPoint(this.props),{graphProps:r}=this.props,{scale:i,snap:a}=r;return{anchorPoint:{x:t,y:n},x:t0(i.x,a.x,t),y:t0(i.y,a.y,n)}};tiny=(e,t)=>{let n=e.toUpperCase(),r=Math.abs(t[`client${n}`]-this.state[`start${n}`]),i=r<Math.abs(this.grid()[e])/10;return e0(`[tiny] key: `,e,`delta: `,r,`out: `,i),i};getScaledBounds=()=>{let t=e.bounds(this.props,this.props.graphProps);e0(`bounds: `,t);let n=this.grid(),r={left:t.left*n.x,right:t.right*n.x,top:t.top*n.y,bottom:t.bottom*n.y},i=Math.abs(n.y);return r={...r,top:Math.min(0,r.top)-i,bottom:Math.abs(r.bottom)+i},e0(`[getScaledBounds]: `,r),r};getClientPoint=(e,t)=>{if(!e||!t)return null;let n=e.ownerSVGElement||e;if(n&&n.createSVGPoint){let r=n.createSVGPoint();if(t.touches&&t.touches.length>0){let e=t.touches[0];r.x=e.clientX,r.y=e.clientY}else r.x=t.clientX,r.y=t.clientY;return e.getScreenCTM?(r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]):null}let r=e.getBoundingClientRect();return r?[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]:null};skipDragOutsideOfBounds=(e,t,n)=>{let r=n.getRootNode(),i=this.getClientPoint(r,t);if(i===null)return!0;let[a,o]=i,{scale:s,domain:c,range:l}=n,u=s.x.invert(a),d=s.y.invert(o),f=e.deltaX>0&&u<c.min||e.deltaX<0&&u>c.max,p=e.deltaY>0&&d>l.max||e.deltaY<0&&d<l.min;return f||p};onDrag=(e,t)=>{let{onDrag:n,graphProps:r,disabled:i}=this.props;if((Math.abs(t.deltaX)>1||Math.abs(t.deltaY)>1)&&(this._didDrag=!0),!n||i)return;let a=this.getScaledBounds();if(t.deltaX<0&&t.deltaX<a.left||t.deltaX>0&&t.deltaX>a.right||t.deltaY<0&&t.deltaY<a.top||t.deltaY>0&&t.deltaY>a.bottom||this.skipDragOutsideOfBounds(t,e,r))return;let o=this.applyDelta({x:t.deltaX,y:t.deltaY});(o!==void 0||o!==null)&&n(o)};getDelta=e=>{let t=this.position(),n={x:t.x(e.x),y:t.y(e.y)};return A$(t.anchorPoint,n)};applyDelta=t=>{let n=this.getDelta(t);return e0(`[applyDelta] delta:`,n),e.fromDelta(this.props,n)};onStop=(e,t)=>{e0(`[onStop] dd:`,t);let{onDragStop:n,onClick:r,disabled:i}=this.props;if(n&&!i&&n(),e0(`[onStop] lastX/Y: `,t.lastX,t.lastY),!this._didDrag){if(!i&&typeof e?.stopPropagation==`function`&&e.stopPropagation(),r){e0(`call onClick`),this.setState({startX:null,startY:null});let{graphProps:t}=this.props,{scale:n,snap:i}=t;try{let[t,a]=Wh(e,e.target),o=n.x.invert(t),s=n.y.invert(a);o=i.x(o),s=i.y(s),r({x:o,y:s})}catch{r({})}}this.setState({startX:null,startY:null});return}this.setState({startX:null,startY:null})};render(){let{disabled:n,onClick:r,...i}=this.props,a=this.grid(),o=e=>e.nativeEvent.preventDefault(),s=this.state?!!this.state.startX:!1;return(0,F.jsx)(Q1,{onMouseDown:o,onStart:this.onStart,onDrag:this.onDrag,onStop:this.onStop,axis:e.axis||`both`,grid:[a.x,a.y],children:(0,F.jsx)(t,{...i,disabled:n,isDragging:s,onClick:s?void 0:r})})}});function r0(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function i0(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function a0(e){let t,n,r;e.length===2?(t=e===r0||e===i0?e:o0,n=e,r=e):(t=r0,n=(t,n)=>r0(e(t),n),r=(t,n)=>e(t)-n);function i(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<0?i=t+1:a=t}while(i<a)}return i}function a(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<=0?i=t+1:a=t}while(i<a)}return i}function o(e,t,n=0,a=e.length){let o=i(e,t,n,a-1);return o>n&&r(e[o-1],t)>-r(e[o],t)?o-1:o}return{left:i,center:o,right:a}}function o0(){return 0}function s0(e){return e===null?NaN:+e}var c0=a0(r0),l0=c0.right;c0.left,a0(s0).center;var u0=class extends Map{constructor(e,t=m0){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),e!=null)for(let[t,n]of e)this.set(t,n)}get(e){return super.get(d0(this,e))}has(e){return super.has(d0(this,e))}set(e,t){return super.set(f0(this,e),t)}delete(e){return super.delete(p0(this,e))}};function d0({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):n}function f0({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function p0({_intern:e,_key:t},n){let r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function m0(e){return typeof e==`object`&&e?e.valueOf():e}var h0=Math.sqrt(50),g0=Math.sqrt(10),_0=Math.sqrt(2);function v0(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=h0?10:a>=g0?5:a>=_0?2:1,s,c,l;return i<0?(l=10**-i/o,s=Math.round(e*l),c=Math.round(t*l),s/l<e&&++s,c/l>t&&--c,l=-l):(l=10**i*o,s=Math.round(e/l),c=Math.round(t/l),s*l<e&&++s,c*l>t&&--c),c<s&&.5<=n&&n<2?v0(e,t,n*2):[s,c,l]}function y0(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];let r=t<e,[i,a,o]=r?v0(t,e,n):v0(e,t,n);if(!(a>=i))return[];let s=a-i+1,c=Array(s);if(r)if(o<0)for(let e=0;e<s;++e)c[e]=(a-e)/-o;else for(let e=0;e<s;++e)c[e]=(a-e)*o;else if(o<0)for(let e=0;e<s;++e)c[e]=(i+e)/-o;else for(let e=0;e<s;++e)c[e]=(i+e)*o;return c}function b0(e,t,n){return t=+t,e=+e,n=+n,v0(e,t,n)[2]}function x0(e,t,n){t=+t,e=+e,n=+n;let r=t<e,i=r?b0(t,e,n):b0(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function S0(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=Array(i);++r<i;)a[r]=e+r*n;return a}function C0(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}var w0=Symbol(`implicit`);function T0(){var e=new u0,t=[],n=[],r=w0;function i(i){let a=e.get(i);if(a===void 0){if(r!==w0)return r;e.set(i,a=t.push(i)-1)}return n[a%n.length]}return i.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new u0;for(let r of n)e.has(r)||e.set(r,t.push(r)-1);return i},i.range=function(e){return arguments.length?(n=Array.from(e),i):n.slice()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return T0(t,n).unknown(r)},C0.apply(i,arguments),i}function E0(){var e=T0().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,s=!1,c=0,l=0,u=.5;delete e.unknown;function d(){var e=t().length,d=i<r,f=d?i:r,p=d?r:i;a=(p-f)/Math.max(1,e-c+l*2),s&&(a=Math.floor(a)),f+=(p-f-a*(e-c))*u,o=a*(1-c),s&&(f=Math.round(f),o=Math.round(o));var m=S0(e).map(function(e){return f+a*e});return n(d?m.reverse():m)}return e.domain=function(e){return arguments.length?(t(e),d()):t()},e.range=function(e){return arguments.length?([r,i]=e,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(e){return[r,i]=e,r=+r,i=+i,s=!0,d()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(e){return arguments.length?(s=!!e,d()):s},e.padding=function(e){return arguments.length?(c=Math.min(1,l=+e),d()):c},e.paddingInner=function(e){return arguments.length?(c=Math.min(1,e),d()):c},e.paddingOuter=function(e){return arguments.length?(l=+e,d()):l},e.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},e.copy=function(){return E0(t(),[r,i]).round(s).paddingInner(c).paddingOuter(l).align(u)},C0.apply(d(),arguments)}function D0(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return D0(t())},e}function O0(){return D0(E0.apply(null,arguments).paddingInner(1))}function k0(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function A0(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function j0(){}var M0=.7,N0=1/M0,P0=`\\s*([+-]?\\d+)\\s*`,F0=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,I0=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,L0=/^#([0-9a-f]{3,8})$/,R0=RegExp(`^rgb\\(${P0},${P0},${P0}\\)$`),z0=RegExp(`^rgb\\(${I0},${I0},${I0}\\)$`),B0=RegExp(`^rgba\\(${P0},${P0},${P0},${F0}\\)$`),V0=RegExp(`^rgba\\(${I0},${I0},${I0},${F0}\\)$`),H0=RegExp(`^hsl\\(${F0},${I0},${I0}\\)$`),U0=RegExp(`^hsla\\(${F0},${I0},${I0},${F0}\\)$`),W0={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};k0(j0,Y0,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:G0,formatHex:G0,formatHex8:K0,formatHsl:q0,formatRgb:J0,toString:J0});function G0(){return this.rgb().formatHex()}function K0(){return this.rgb().formatHex8()}function q0(){return c2(this).formatHsl()}function J0(){return this.rgb().formatRgb()}function Y0(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=L0.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?X0(t):n===3?new e2(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Z0(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Z0(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=R0.exec(e))?new e2(t[1],t[2],t[3],1):(t=z0.exec(e))?new e2(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=B0.exec(e))?Z0(t[1],t[2],t[3],t[4]):(t=V0.exec(e))?Z0(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=H0.exec(e))?s2(t[1],t[2]/100,t[3]/100,1):(t=U0.exec(e))?s2(t[1],t[2]/100,t[3]/100,t[4]):W0.hasOwnProperty(e)?X0(W0[e]):e===`transparent`?new e2(NaN,NaN,NaN,0):null}function X0(e){return new e2(e>>16&255,e>>8&255,e&255,1)}function Z0(e,t,n,r){return r<=0&&(e=t=n=NaN),new e2(e,t,n,r)}function Q0(e){return e instanceof j0||(e=Y0(e)),e?(e=e.rgb(),new e2(e.r,e.g,e.b,e.opacity)):new e2}function $0(e,t,n,r){return arguments.length===1?Q0(e):new e2(e,t,n,r??1)}function e2(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}k0(e2,$0,A0(j0,{brighter(e){return e=e==null?N0:N0**+e,new e2(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?M0:M0**+e,new e2(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new e2(a2(this.r),a2(this.g),a2(this.b),i2(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:t2,formatHex:t2,formatHex8:n2,formatRgb:r2,toString:r2}));function t2(){return`#${o2(this.r)}${o2(this.g)}${o2(this.b)}`}function n2(){return`#${o2(this.r)}${o2(this.g)}${o2(this.b)}${o2((isNaN(this.opacity)?1:this.opacity)*255)}`}function r2(){let e=i2(this.opacity);return`${e===1?`rgb(`:`rgba(`}${a2(this.r)}, ${a2(this.g)}, ${a2(this.b)}${e===1?`)`:`, ${e})`}`}function i2(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function a2(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function o2(e){return e=a2(e),(e<16?`0`:``)+e.toString(16)}function s2(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new u2(e,t,n,r)}function c2(e){if(e instanceof u2)return new u2(e.h,e.s,e.l,e.opacity);if(e instanceof j0||(e=Y0(e)),!e)return new u2;if(e instanceof u2)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new u2(o,s,c,e.opacity)}function l2(e,t,n,r){return arguments.length===1?c2(e):new u2(e,t,n,r??1)}function u2(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}k0(u2,l2,A0(j0,{brighter(e){return e=e==null?N0:N0**+e,new u2(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?M0:M0**+e,new u2(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new e2(p2(e>=240?e-240:e+120,i,r),p2(e,i,r),p2(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new u2(d2(this.h),f2(this.s),f2(this.l),i2(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=i2(this.opacity);return`${e===1?`hsl(`:`hsla(`}${d2(this.h)}, ${f2(this.s)*100}%, ${f2(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function d2(e){return e=(e||0)%360,e<0?e+360:e}function f2(e){return Math.max(0,Math.min(1,e||0))}function p2(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var m2=Math.PI/180,h2=180/Math.PI,g2=18,_2=.96422,v2=1,y2=.82521,b2=4/29,x2=6/29,S2=3*x2*x2,C2=x2*x2*x2;function w2(e){if(e instanceof E2)return new E2(e.l,e.a,e.b,e.opacity);if(e instanceof N2)return P2(e);e instanceof e2||(e=Q0(e));var t=A2(e.r),n=A2(e.g),r=A2(e.b),i=D2((.2225045*t+.7168786*n+.0606169*r)/v2),a,o;return t===n&&n===r?a=o=i:(a=D2((.4360747*t+.3850649*n+.1430804*r)/_2),o=D2((.0139322*t+.0971045*n+.7141733*r)/y2)),new E2(116*i-16,500*(a-i),200*(i-o),e.opacity)}function T2(e,t,n,r){return arguments.length===1?w2(e):new E2(e,t,n,r??1)}function E2(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}k0(E2,T2,A0(j0,{brighter(e){return new E2(this.l+g2*(e??1),this.a,this.b,this.opacity)},darker(e){return new E2(this.l-g2*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=_2*O2(t),e=v2*O2(e),n=y2*O2(n),new e2(k2(3.1338561*t-1.6168667*e-.4906146*n),k2(-.9787684*t+1.9161415*e+.033454*n),k2(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function D2(e){return e>C2?e**(1/3):e/S2+b2}function O2(e){return e>x2?e*e*e:S2*(e-b2)}function k2(e){return 255*(e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055)}function A2(e){return(e/=255)<=.04045?e/12.92:((e+.055)/1.055)**2.4}function j2(e){if(e instanceof N2)return new N2(e.h,e.c,e.l,e.opacity);if(e instanceof E2||(e=w2(e)),e.a===0&&e.b===0)return new N2(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*h2;return new N2(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function M2(e,t,n,r){return arguments.length===1?j2(e):new N2(e,t,n,r??1)}function N2(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function P2(e){if(isNaN(e.h))return new E2(e.l,0,0,e.opacity);var t=e.h*m2;return new E2(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}k0(N2,M2,A0(j0,{brighter(e){return new N2(this.h,this.c,this.l+g2*(e??1),this.opacity)},darker(e){return new N2(this.h,this.c,this.l-g2*(e??1),this.opacity)},rgb(){return P2(this).rgb()}}));var F2=-.14861,I2=1.78277,L2=-.29227,R2=-.90649,z2=1.97294,B2=z2*R2,V2=z2*I2,H2=I2*L2-R2*F2;function U2(e){if(e instanceof G2)return new G2(e.h,e.s,e.l,e.opacity);e instanceof e2||(e=Q0(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(H2*r+B2*t-V2*n)/(H2+B2-V2),a=r-i,o=(z2*(n-i)-L2*a)/R2,s=Math.sqrt(o*o+a*a)/(z2*i*(1-i)),c=s?Math.atan2(o,a)*h2-120:NaN;return new G2(c<0?c+360:c,s,i,e.opacity)}function W2(e,t,n,r){return arguments.length===1?U2(e):new G2(e,t,n,r??1)}function G2(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}k0(G2,W2,A0(j0,{brighter(e){return e=e==null?N0:N0**+e,new G2(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?M0:M0**+e,new G2(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*m2,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new e2(255*(t+n*(F2*r+I2*i)),255*(t+n*(L2*r+R2*i)),255*(t+z2*r*n),this.opacity)}}));var K2=e=>()=>e;function q2(e,t){return function(n){return e+n*t}}function J2(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function Y2(e,t){var n=t-e;return n?q2(e,n>180||n<-180?n-360*Math.round(n/360):n):K2(isNaN(e)?t:e)}function X2(e){return(e=+e)==1?Z2:function(t,n){return n-t?J2(t,n,e):K2(isNaN(t)?n:t)}}function Z2(e,t){var n=t-e;return n?q2(e,n):K2(isNaN(e)?t:e)}var Q2=(function e(t){var n=X2(t);function r(e,t){var r=n((e=$0(e)).r,(t=$0(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=Z2(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function $2(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function e4(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function t4(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o;for(o=0;o<r;++o)i[o]=u4(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function n4(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function r4(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function i4(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=u4(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var a4=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,o4=new RegExp(a4.source,`g`);function s4(e){return function(){return e}}function c4(e){return function(t){return e(t)+``}}function l4(e,t){var n=a4.lastIndex=o4.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=a4.exec(e))&&(i=o4.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:r4(r,i)})),n=o4.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?c4(c[0].x):s4(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function u4(e,t){var n=typeof t,r;return t==null||n===`boolean`?K2(t):(n===`number`?r4:n===`string`?(r=Y0(t))?(t=r,Q2):l4:t instanceof Y0?Q2:t instanceof Date?n4:e4(t)?$2:Array.isArray(t)?t4:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?i4:r4)(e,t)}function d4(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function f4(e){return function(t,n){var r=e((t=l2(t)).h,(n=l2(n)).h),i=Z2(t.s,n.s),a=Z2(t.l,n.l),o=Z2(t.opacity,n.opacity);return function(e){return t.h=r(e),t.s=i(e),t.l=a(e),t.opacity=o(e),t+``}}}var p4=f4(Y2),m4=f4(Z2);function h4(e,t){var n=Z2((e=T2(e)).l,(t=T2(t)).l),r=Z2(e.a,t.a),i=Z2(e.b,t.b),a=Z2(e.opacity,t.opacity);return function(t){return e.l=n(t),e.a=r(t),e.b=i(t),e.opacity=a(t),e+``}}function g4(e){return function(t,n){var r=e((t=M2(t)).h,(n=M2(n)).h),i=Z2(t.c,n.c),a=Z2(t.l,n.l),o=Z2(t.opacity,n.opacity);return function(e){return t.h=r(e),t.c=i(e),t.l=a(e),t.opacity=o(e),t+``}}}var _4=g4(Y2),v4=g4(Z2);function y4(e){return(function t(n){n=+n;function r(t,r){var i=e((t=W2(t)).h,(r=W2(r)).h),a=Z2(t.s,r.s),o=Z2(t.l,r.l),s=Z2(t.opacity,r.opacity);return function(e){return t.h=i(e),t.s=a(e),t.l=o(e**+n),t.opacity=s(e),t+``}}return r.gamma=t,r})(1)}var b4=y4(Y2),x4=y4(Z2);function S4(e){return function(){return e}}function C4(e){return+e}var w4=[0,1];function T4(e){return e}function E4(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:S4(isNaN(t)?NaN:.5)}function D4(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}function O4(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=E4(i,r),a=n(o,a)):(r=E4(r,i),a=n(a,o)),function(e){return a(r(e))}}function k4(e,t,n){var r=Math.min(e.length,t.length)-1,i=Array(r),a=Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=E4(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(t){var n=l0(e,t,1,r)-1;return a[n](i[n](t))}}function A4(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function j4(){var e=w4,t=w4,n=u4,r,i,a,o=T4,s,c,l;function u(){var n=Math.min(e.length,t.length);return o!==T4&&(o=D4(e[0],e[n-1])),s=n>2?k4:O4,c=l=null,d}function d(i){return i==null||isNaN(i=+i)?a:(c||=s(e.map(r),t,n))(r(o(i)))}return d.invert=function(n){return o(i((l||=s(t,e.map(r),r4))(n)))},d.domain=function(t){return arguments.length?(e=Array.from(t,C4),u()):e.slice()},d.range=function(e){return arguments.length?(t=Array.from(e),u()):t.slice()},d.rangeRound=function(e){return t=Array.from(e),n=d4,u()},d.clamp=function(e){return arguments.length?(o=e?!0:T4,u()):o!==T4},d.interpolate=function(e){return arguments.length?(n=e,u()):n},d.unknown=function(e){return arguments.length?(a=e,d):a},function(e,t){return r=e,i=t,u()}}function M4(){return j4()(T4,T4)}function N4(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}function P4(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf(`e`),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function F4(e){return e=P4(Math.abs(e)),e?e[1]:NaN}function I4(e,t){return function(n,r){for(var i=n.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function L4(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}var R4=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function z4(e){if(!(t=R4.exec(e)))throw Error(`invalid format: `+e);var t;return new B4({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}z4.prototype=B4.prototype;function B4(e){this.fill=e.fill===void 0?` `:e.fill+``,this.align=e.align===void 0?`>`:e.align+``,this.sign=e.sign===void 0?`-`:e.sign+``,this.symbol=e.symbol===void 0?``:e.symbol+``,this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?``:e.type+``}B4.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?`0`:``)+(this.width===void 0?``:Math.max(1,this.width|0))+(this.comma?`,`:``)+(this.precision===void 0?``:`.`+Math.max(0,this.precision|0))+(this.trim?`~`:``)+this.type};function V4(e){out:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case`.`:r=i=n;break;case`0`:r===0&&(r=n),i=n;break;default:if(!+e[n])break out;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var H4;function U4(e,t){var n=P4(e,t);if(!n)return H4=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(H4=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+Array(a-o+1).join(`0`):a>0?r.slice(0,a)+`.`+r.slice(a):`0.`+Array(1-a).join(`0`)+P4(e,Math.max(0,t+a-1))[0]}function W4(e,t){var n=P4(e,t);if(!n)return e+``;var r=n[0],i=n[1];return i<0?`0.`+Array(-i).join(`0`)+r:r.length>i+1?r.slice(0,i+1)+`.`+r.slice(i+1):r+Array(i-r.length+2).join(`0`)}var G4={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+``,d:N4,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>W4(e*100,t),r:W4,s:U4,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function K4(e){return e}var q4=Array.prototype.map,J4=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`];function Y4(e){var t=e.grouping===void 0||e.thousands===void 0?K4:I4(q4.call(e.grouping,Number),e.thousands+``),n=e.currency===void 0?``:e.currency[0]+``,r=e.currency===void 0?``:e.currency[1]+``,i=e.decimal===void 0?`.`:e.decimal+``,a=e.numerals===void 0?K4:L4(q4.call(e.numerals,String)),o=e.percent===void 0?`%`:e.percent+``,s=e.minus===void 0?`−`:e.minus+``,c=e.nan===void 0?`NaN`:e.nan+``;function l(e,l){e=z4(e);var u=e.fill,d=e.align,f=e.sign,p=e.symbol,m=e.zero,h=e.width,g=e.comma,_=e.precision,v=e.trim,y=e.type;y===`n`?(g=!0,y=`g`):G4[y]||(_===void 0&&(_=12),v=!0,y=`g`),(m||u===`0`&&d===`=`)&&(m=!0,u=`0`,d=`=`);var b=(l&&l.prefix!==void 0?l.prefix:``)+(p===`$`?n:p===`#`&&/[boxX]/.test(y)?`0`+y.toLowerCase():``),x=(p===`$`?r:/[%p]/.test(y)?o:``)+(l&&l.suffix!==void 0?l.suffix:``),S=G4[y],C=/[defgprs%]/.test(y);_=_===void 0?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function w(e){var n=b,r=x,o,l,p;if(y===`c`)r=S(e)+r,e=``;else{e=+e;var w=e<0||1/e<0;if(e=isNaN(e)?c:S(Math.abs(e),_),v&&(e=V4(e)),w&&+e==0&&f!==`+`&&(w=!1),n=(w?f===`(`?f:s:f===`-`||f===`(`?``:f)+n,r=(y===`s`&&!isNaN(e)&&H4!==void 0?J4[8+H4/3]:``)+r+(w&&f===`(`?`)`:``),C){for(o=-1,l=e.length;++o<l;)if(p=e.charCodeAt(o),48>p||p>57){r=(p===46?i+e.slice(o+1):e.slice(o))+r,e=e.slice(0,o);break}}}g&&!m&&(e=t(e,1/0));var T=n.length+e.length+r.length,E=T<h?Array(h-T+1).join(u):``;switch(g&&m&&(e=t(E+e,E.length?h-r.length:1/0),E=``),d){case`<`:e=n+e+r+E;break;case`=`:e=n+E+e+r;break;case`^`:e=E.slice(0,T=E.length>>1)+n+e+r+E.slice(T);break;default:e=E+n+e+r;break}return a(e)}return w.toString=function(){return e+``},w}function u(e,t){var n=Math.max(-8,Math.min(8,Math.floor(F4(t)/3)))*3,r=10**-n,i=l((e=z4(e),e.type=`f`,e),{suffix:J4[8+n/3]});return function(e){return i(r*e)}}return{format:l,formatPrefix:u}}var X4,Z4,Q4;$4({thousands:`,`,grouping:[3],currency:[`$`,``]});function $4(e){return X4=Y4(e),Z4=X4.format,Q4=X4.formatPrefix,X4}function e3(e){return Math.max(0,-F4(Math.abs(e)))}function t3(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(F4(t)/3)))*3-F4(Math.abs(e)))}function n3(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,F4(t)-F4(e))+1}function r3(e,t,n,r){var i=x0(e,t,n),a;switch(r=z4(r??`,f`),r.type){case`s`:var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=t3(i,o))&&(r.precision=a),Q4(r,o);case``:case`e`:case`g`:case`p`:case`r`:r.precision==null&&!isNaN(a=n3(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type===`e`));break;case`f`:case`%`:r.precision==null&&!isNaN(a=e3(i))&&(r.precision=a-(r.type===`%`)*2);break}return Z4(r)}function i3(e){var t=e.domain;return e.ticks=function(e){var n=t();return y0(n[0],n[n.length-1],e??10)},e.tickFormat=function(e,n){var r=t();return r3(r[0],r[r.length-1],e??10,n)},e.nice=function(n){n??=10;var r=t(),i=0,a=r.length-1,o=r[i],s=r[a],c,l,u=10;for(s<o&&(l=o,o=s,s=l,l=i,i=a,a=l);u-->0;){if(l=b0(o,s,n),l===c)return r[i]=o,r[a]=s,t(r);if(l>0)o=Math.floor(o/l)*l,s=Math.ceil(s/l)*l;else if(l<0)o=Math.ceil(o*l)/l,s=Math.floor(s*l)/l;else break;c=l}return e},e}function a3(){var e=M4();return e.copy=function(){return A4(e,a3())},C0.apply(e,arguments),i3(e)}var o3=new Date,s3=new Date;function c3(e,t,n,r){function i(t){return e(t=arguments.length===0?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{let t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=(e,n)=>(t(e=new Date(+e),n==null?1:Math.floor(n)),e),i.range=(n,r,a)=>{let o=[];if(n=i.ceil(n),a=a==null?1:Math.floor(a),!(n<r)||!(a>0))return o;let s;do o.push(s=new Date(+n)),t(n,a),e(n);while(s<n&&n<r);return o},i.filter=n=>c3(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,r)=>{if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}),n&&(i.count=(t,r)=>(o3.setTime(+t),s3.setTime(+r),e(o3),e(s3),Math.floor(n(o3,s3))),i.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?i.filter(r?t=>r(t)%e===0:t=>i.count(0,t)%e===0):i)),i}var l3=1e3,u3=l3*60,d3=u3*60,f3=d3*24,p3=f3*7;f3*30,f3*365;var m3=c3(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*l3)},(e,t)=>(t-e)/l3,e=>e.getUTCSeconds());m3.range;var h3=c3(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*l3)},(e,t)=>{e.setTime(+e+t*u3)},(e,t)=>(t-e)/u3,e=>e.getMinutes());h3.range;var g3=c3(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*u3)},(e,t)=>(t-e)/u3,e=>e.getUTCMinutes());g3.range;var _3=c3(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*l3-e.getMinutes()*u3)},(e,t)=>{e.setTime(+e+t*d3)},(e,t)=>(t-e)/d3,e=>e.getHours());_3.range;var v3=c3(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*d3)},(e,t)=>(t-e)/d3,e=>e.getUTCHours());v3.range;var y3=c3(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*u3)/f3,e=>e.getDate()-1);y3.range;var b3=c3(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/f3,e=>e.getUTCDate()-1);b3.range,c3(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/f3,e=>Math.floor(e/f3)).range;function x3(e){return c3(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+t*7)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*u3)/p3)}var S3=x3(0),C3=x3(1),w3=x3(2),T3=x3(3),E3=x3(4),D3=x3(5),O3=x3(6);S3.range,C3.range,w3.range,T3.range,E3.range,D3.range,O3.range;function k3(e){return c3(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t*7)},(e,t)=>(t-e)/p3)}var A3=k3(0),j3=k3(1),M3=k3(2),N3=k3(3),P3=k3(4),F3=k3(5),I3=k3(6);A3.range,j3.range,M3.range,N3.range,P3.range,F3.range,I3.range;var L3=c3(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());L3.range;var R3=c3(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());R3.range;var z3=c3(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());z3.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:c3(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}),z3.range;var B3=c3(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());B3.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:c3(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}),B3.range;var V3=({min:e,max:t,step:n})=>({step:n,min:parseInt(e/n)*n,max:parseInt(t/n)*n}),H3=(e,t,n,r)=>{(0,T$.default)(e.min<e.max,`domain: min must be less than max`),(0,T$.default)(t.min<t.max,`range: min must be less than max`);let i=V3(e),a=V3(t);return{scale:{x:a3().domain([e.min,e.max]).range([0,n.width]),y:a3().domain([t.max,t.min]).range([0,n.height])},snap:{x:D$.bind(null,i.min,i.max,i.step),y:D$.bind(null,a.min,a.max,a.step)},domain:e,range:t,size:n,getRootNode:r}};function U3(e){return Br(`PrivateSwitchBase`,e)}Vr(`PrivateSwitchBase`,[`root`,`checked`,`disabled`,`input`,`edgeStart`,`edgeEnd`]);var W3=e=>{let{classes:t,checked:n,disabled:r,edge:i}=e;return ca({root:[`root`,n&&`checked`,r&&`disabled`,i&&`edge${B(i)}`],input:[`input`]},U3,t)},G3=R(Ld,{name:`MuiSwitchBase`})({padding:9,borderRadius:`50%`,variants:[{props:{edge:`start`,size:`small`},style:{marginLeft:-3}},{props:({edge:e,ownerState:t})=>e===`start`&&t.size!==`small`,style:{marginLeft:-12}},{props:{edge:`end`,size:`small`},style:{marginRight:-3}},{props:({edge:e,ownerState:t})=>e===`end`&&t.size!==`small`,style:{marginRight:-12}}]}),K3=R(`input`,{name:`MuiSwitchBase`,shouldForwardProp:Co})({cursor:`inherit`,position:`absolute`,opacity:0,width:`100%`,height:`100%`,top:0,left:0,margin:0,padding:0,zIndex:1}),q3=P.forwardRef(function(e,t){let{autoFocus:n,checked:r,checkedIcon:i,defaultChecked:a,disabled:o,disableFocusRipple:s=!1,edge:c=!1,icon:l,id:u,inputProps:d,inputRef:f,name:p,onBlur:m,onChange:h,onFocus:g,readOnly:_,required:v=!1,tabIndex:y,type:b,value:x,slots:S={},slotProps:C={},...w}=e,[T,E]=yl({controlled:r,default:!!a,name:`SwitchBase`,state:`checked`}),D=Of(),O=e=>{g&&g(e),D&&D.onFocus&&D.onFocus(e)},k=e=>{m&&m(e),D&&D.onBlur&&D.onBlur(e)},A=e=>{if(e.nativeEvent.defaultPrevented||_)return;let t=e.target.checked;E(t),h&&h(e,t)},j=o;D&&j===void 0&&(j=D.disabled);let M=b===`checkbox`||b===`radio`,ee={...e,checked:T,disabled:j,disableFocusRipple:s,edge:c},N=W3(ee),te={slots:S,slotProps:{input:d,...C}},[ne,re]=zc(`root`,{ref:t,elementType:G3,className:N.root,shouldForwardComponentProp:!0,externalForwardedProps:{...te,component:`span`,...w},getSlotProps:e=>({...e,onFocus:t=>{e.onFocus?.(t),O(t)},onBlur:t=>{e.onBlur?.(t),k(t)}}),ownerState:ee,additionalProps:{centerRipple:!0,focusRipple:!s,role:void 0,tabIndex:null}}),[ie,ae]=zc(`input`,{ref:f,elementType:K3,className:N.input,externalForwardedProps:te,getSlotProps:e=>({...e,onChange:t=>{e.onChange?.(t),A(t)}}),ownerState:ee,additionalProps:{autoFocus:n,checked:r,defaultChecked:a,disabled:j,id:M?u:void 0,name:p,readOnly:_,required:v,tabIndex:y,type:b,...b===`checkbox`&&x===void 0?{}:{value:x}}});return(0,F.jsxs)(ne,{...re,children:[(0,F.jsx)(ie,{...ae}),T?i:l]})}),J3=ml((0,F.jsx)(`path`,{d:`M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z`}),`CheckBoxOutlineBlank`),Y3=ml((0,F.jsx)(`path`,{d:`M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z`}),`CheckBox`),X3=ml((0,F.jsx)(`path`,{d:`M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z`}),`IndeterminateCheckBox`);function Z3(e){return Br(`MuiCheckbox`,e)}var Q3=Vr(`MuiCheckbox`,[`root`,`checked`,`disabled`,`indeterminate`,`colorPrimary`,`colorSecondary`,`sizeSmall`,`sizeMedium`]),$3=e=>{let{classes:t,indeterminate:n,color:r,size:i}=e,a=ca({root:[`root`,n&&`indeterminate`,`color${B(r)}`,`size${B(i)}`]},Z3,t);return{...t,...a}},e6=R(q3,{shouldForwardProp:e=>Co(e)||e===`classes`,name:`MuiCheckbox`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.indeterminate&&t.indeterminate,t[`size${B(n.size)}`],n.color!=="default"&&t[`color${B(n.color)}`]]}})(Nc(({theme:e})=>({color:(e.vars||e).palette.text.secondary,variants:[{props:{color:`default`,disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity)}}},...Object.entries(e.palette).filter(Vd()).map(([t])=>({props:{color:t,disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}}})),...Object.entries(e.palette).filter(Vd()).map(([t])=>({props:{color:t},style:{[`&.${Q3.checked}, &.${Q3.indeterminate}`]:{color:(e.vars||e).palette[t].main},[`&.${Q3.disabled}`]:{color:(e.vars||e).palette.action.disabled}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:`transparent`}}}}]}))),t6=(0,F.jsx)(Y3,{}),n6=(0,F.jsx)(J3,{}),r6=(0,F.jsx)(X3,{}),i6=P.forwardRef(function(e,t){let n=cs({props:e,name:`MuiCheckbox`}),{checkedIcon:r=t6,color:i=`primary`,icon:a=n6,indeterminate:o=!1,indeterminateIcon:s=r6,inputProps:c,size:l=`medium`,disableRipple:u=!1,className:d,slots:f={},slotProps:p={},...m}=n,h=o?s:a,g=o?s:r,_={...n,disableRipple:u,color:i,indeterminate:o,size:l},v=$3(_),y=p.input??c,[b,x]=zc(`root`,{ref:t,elementType:e6,className:I(v.root,d),shouldForwardComponentProp:!0,externalForwardedProps:{slots:f,slotProps:p,...m},ownerState:_,additionalProps:{type:`checkbox`,icon:P.cloneElement(h,{fontSize:h.props.fontSize??l}),checkedIcon:P.cloneElement(g,{fontSize:g.props.fontSize??l}),disableRipple:u,slots:f,slotProps:{input:Sl(typeof y==`function`?y(_):y,{"data-indeterminate":o,"aria-checked":o?`mixed`:void 0})}}});return(0,F.jsx)(b,{...x,classes:v})}),a6=R(mY)(()=>({fontSize:`max(1.25rem, 18px)`})),o6=R(vY)(()=>({fontSize:`max(1rem, 14px)`})),s6=({text:e,title:t,onClose:n,onConfirm:r,open:i,onCloseText:a,onConfirmText:o,disableAutoFocus:s,disableEnforceFocus:c,disableRestoreFocus:l})=>(0,F.jsxs)(yJ,{open:i,disableAutoFocus:s,disableEnforceFocus:c,disableRestoreFocus:l,onClose:n,children:[t&&(0,F.jsx)(a6,{children:t}),e&&(0,F.jsx)(Jq,{children:(0,F.jsx)(o6,{children:e})}),(0,F.jsxs)(uJ,{children:[n&&(0,F.jsx)(ff,{onClick:n,color:`primary`,children:a}),r&&(0,F.jsx)(ff,{autoFocus:!0,onClick:r,color:`primary`,children:o})]})]});s6.defaultProps={onCloseText:`CANCEL`,onConfirmText:`OK`,disableAutoFocus:!1,disableEnforceFocus:!1,disableRestoreFocus:!1},s6.propTypes={text:v.oneOfType([v.string,v.object]),title:v.string,onClose:v.func,onConfirm:v.func,open:v.bool,onConfirmText:v.string,onCloseText:v.string,disableAutoFocus:v.bool,disableEnforceFocus:v.bool,disableRestoreFocus:v.bool};function c6(e){return typeof e==`function`||typeof e==`object`&&!!e&&typeof e.$$typeof==`symbol`}function l6(e,t){return!e||c6(e)?e:c6(e.default)?e.default:t&&c6(e[t])?e[t]:t&&c6(e[t]?.default)?e[t].default:e}l6(Jf,`InputContainer`)||l6(f6.InputContainer,`InputContainer`);var u6=Op,d6=u6.default,f6=d6&&typeof d6==`object`?d6:u6,p6=o(((e,t)=>{(function(){"use strict";var e={}.hasOwnProperty;function n(){for(var e=``,t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=i(e,r(n)))}return e}function r(t){if(typeof t==`string`||typeof t==`number`)return t;if(typeof t!=`object`)return``;if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes(`[native code]`))return t.toString();var r=``;for(var a in t)e.call(t,a)&&t[a]&&(r=i(r,a));return r}function i(e,t){return t?e?e+` `+t:e+t:e}t!==void 0&&t.exports?(n.default=n,t.exports=n):typeof define==`function`&&typeof define.amd==`object`&&define.amd?define(`classnames`,[],function(){return n}):window.classNames=n})()}));function m6(e){return function(){return e}}var h6=Math.PI,g6=2*h6,_6=1e-6,v6=g6-_6;function y6(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function b6(e){let t=Math.floor(e);if(!(t>=0))throw Error(`invalid digits: ${e}`);if(t>15)return y6;let n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}var x6=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._=``,this._append=e==null?y6:b6(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,i,a){this._append`C${+e},${+t},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(e,t,n,r,i){if(e=+e,t=+t,n=+n,r=+r,i=+i,i<0)throw Error(`negative radius: ${i}`);let a=this._x1,o=this._y1,s=n-e,c=r-t,l=a-e,u=o-t,d=l*l+u*u;if(this._x1===null)this._append`M${this._x1=e},${this._y1=t}`;else if(d>_6)if(!(Math.abs(u*s-c*l)>_6)||!i)this._append`L${this._x1=e},${this._y1=t}`;else{let f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((h6-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>_6&&this._append`L${e+y*l},${t+y*u}`,this._append`A${i},${i},0,0,${+(u*f>l*p)},${this._x1=e+b*s},${this._y1=t+b*c}`}}arc(e,t,n,r,i,a){if(e=+e,t=+t,n=+n,a=!!a,n<0)throw Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;this._x1===null?this._append`M${c},${l}`:(Math.abs(this._x1-c)>_6||Math.abs(this._y1-l)>_6)&&this._append`L${c},${l}`,n&&(d<0&&(d=d%g6+g6),d>v6?this._append`A${n},${n},0,1,${u},${e-o},${t-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:d>_6&&this._append`A${n},${n},0,${+(d>=h6)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};function S6(){return new x6}S6.prototype=x6.prototype;function C6(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{let e=Math.floor(n);if(!(e>=0))throw RangeError(`invalid digits: ${n}`);t=e}return e},()=>new x6(t)}Array.prototype.slice;function w6(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function T6(e){this._context=e}T6.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function E6(e){return new T6(e)}function D6(e){return e[0]}function O6(e){return e[1]}function k6(e,t){var n=m6(!0),r=null,i=E6,a=null,o=C6(s);e=typeof e==`function`?e:e===void 0?D6:m6(e),t=typeof t==`function`?t:t===void 0?O6:m6(t);function s(s){var c,l=(s=w6(s)).length,u,d=!1,f;for(r??(a=i(f=o())),c=0;c<=l;++c)!(c<l&&n(u=s[c],c,s))===d&&((d=!d)?a.lineStart():a.lineEnd()),d&&a.point(+e(u,c,s),+t(u,c,s));if(f)return a=null,f+``||null}return s.x=function(t){return arguments.length?(e=typeof t==`function`?t:m6(+t),s):e},s.y=function(e){return arguments.length?(t=typeof e==`function`?e:m6(+e),s):t},s.defined=function(e){return arguments.length?(n=typeof e==`function`?e:m6(!!e),s):n},s.curve=function(e){return arguments.length?(i=e,r!=null&&(a=i(r)),s):i},s.context=function(e){return arguments.length?(e==null?r=a=null:a=i(r=e),s):r},s}function A6(e,t){e(t)}function j6(){let{x:e,y:t,defined:n,curve:r}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=k6();return e&&A6(i.x,e),t&&A6(i.y,t),n&&i.defined(n),r&&i.curve(r),i}var M6=l(p6());function N6(e){let{top:t=0,left:n=0,transform:r,className:i,children:a,innerRef:o,...s}=e;return(0,F.jsx)(`g`,{ref:o,className:(0,M6.default)(`visx-group`,i),transform:r||`translate(${n}, ${t})`,...s,children:a})}function P6(e){let{from:t={x:0,y:0},to:n={x:1,y:1},fill:r=`transparent`,className:i,innerRef:a,...o}=e,s=t.x===n.x||t.y===n.y;return(0,F.jsx)(`line`,{ref:a,className:(0,M6.default)(`visx-line`,i),x1:t.x,y1:t.y,x2:n.x,y2:n.y,fill:r,shapeRendering:s?`crispEdges`:`auto`,...o})}function F6(e){let{children:t,data:n=[],x:r,y:i,fill:a=`transparent`,className:o,curve:s,innerRef:c,defined:l=()=>!0,...u}=e,d=j6({x:r,y:i,defined:l,curve:s});return t?(0,F.jsx)(F.Fragment,{children:t({path:d})}):(0,F.jsx)(`path`,{ref:c,className:(0,M6.default)(`visx-linepath`,o),d:d(n)||``,fill:a,strokeLinecap:`round`,...u})}function I6(e){let{className:t,innerRef:n,...r}=e;return(0,F.jsx)(`rect`,{ref:n,className:(0,M6.default)(`visx-bar`,t),...r})}function L6(e){let{className:t,innerRef:n,...r}=e;return(0,F.jsx)(`circle`,{ref:n,className:(0,M6.default)(`visx-circle`,t),...r})}var R6=class{x=0;y=0;constructor(e){let{x:t=0,y:n=0}=e;this.x=t,this.y=n}value(){return{x:this.x,y:this.y}}toArray(){return[this.x,this.y]}};function z6(e,t){t.domain&&(`nice`in e||`quantiles`in e||`padding`in e,e.domain(t.domain))}function B6(e,t){t.range&&(`padding`in e,e.range(t.range))}function V6(e,t){`align`in e&&`align`in t&&t.align!==void 0&&e.align(t.align)}function H6(e,t){`base`in e&&`base`in t&&t.base!==void 0&&e.base(t.base)}function U6(e,t){`clamp`in e&&`clamp`in t&&t.clamp!==void 0&&e.clamp(t.clamp)}function W6(e,t){`constant`in e&&`constant`in t&&t.constant!==void 0&&e.constant(t.constant)}function G6(e,t){`exponent`in e&&`exponent`in t&&t.exponent!==void 0&&e.exponent(t.exponent)}var K6={lab:h4,hcl:_4,"hcl-long":v4,hsl:p4,"hsl-long":m4,cubehelix:b4,"cubehelix-long":x4,rgb:Q2};function q6(e){switch(e){case`lab`:case`hcl`:case`hcl-long`:case`hsl`:case`hsl-long`:case`cubehelix`:case`cubehelix-long`:case`rgb`:return K6[e];default:}let{type:t,gamma:n}=e,r=K6[t];return n===void 0?r:r.gamma(n)}function J6(e,t){if(`interpolate`in t&&`interpolate`in e&&t.interpolate!==void 0){let n=q6(t.interpolate);e.interpolate(n)}}var Y6=new Date(Date.UTC(2020,1,2,3,4,5)),X6=`%Y-%m-%d %H:%M`;function Z6(e){return e.tickFormat(1,X6)(Y6)===`2020-02-02 03:04`}var Q6={day:y3,hour:_3,minute:h3,month:L3,second:m3,week:S3,year:z3},$6={day:b3,hour:v3,minute:g3,month:R3,second:m3,week:A3,year:B3};function e8(e,t){if(`nice`in t&&t.nice!==void 0&&`nice`in e){let{nice:n}=t;if(typeof n==`boolean`)n&&e.nice();else if(typeof n==`number`)e.nice(n);else{let t=e,r=Z6(t);if(typeof n==`string`)t.nice(r?$6[n]:Q6[n]);else{let{interval:e,step:i}=n,a=(r?$6[e]:Q6[e]).every(i);a!=null&&t.nice(a)}}}}function t8(e,t){`padding`in e&&`padding`in t&&t.padding!==void 0&&e.padding(t.padding),`paddingInner`in e&&`paddingInner`in t&&t.paddingInner!==void 0&&e.paddingInner(t.paddingInner),`paddingOuter`in e&&`paddingOuter`in t&&t.paddingOuter!==void 0&&e.paddingOuter(t.paddingOuter)}function n8(e,t){if(t.reverse){let t=e.range().slice().reverse();`padding`in e,e.range(t)}}function r8(e,t){`round`in t&&t.round!==void 0&&(t.round&&`interpolate`in t&&t.interpolate!==void 0?console.warn(`[visx/scale/applyRound] ignoring round: scale config contains round and interpolate. only applying interpolate. config:`,t):`round`in e?e.round(t.round):`interpolate`in e&&t.round&&e.interpolate(d4))}function i8(e,t){`unknown`in e&&`unknown`in t&&t.unknown!==void 0&&e.unknown(t.unknown)}function a8(e,t){if(`zero`in t&&t.zero===!0){let[t,n]=e.domain(),r=n<t,[i,a]=r?[n,t]:[t,n],o=[Math.min(0,i),Math.max(0,a)];e.domain(r?o.reverse():o)}}var o8=[`domain`,`nice`,`zero`,`interpolate`,`round`,`range`,`reverse`,`align`,`base`,`clamp`,`constant`,`exponent`,`padding`,`unknown`],s8={domain:z6,nice:e8,zero:a8,interpolate:J6,round:r8,align:V6,base:H6,clamp:U6,constant:W6,exponent:G6,padding:t8,range:B6,reverse:n8,unknown:i8};function c8(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let r=new Set(t),i=o8.filter(e=>r.has(e));return function(e,t){return t!==void 0&&i.forEach(n=>{s8[n](e,t)}),e}}var l8=c8(`domain`,`range`,`reverse`,`align`,`padding`,`round`);function u8(e){return l8(E0(),e)}var d8=c8(`domain`,`range`,`reverse`,`align`,`padding`,`round`);function f8(e){return d8(O0(),e)}function p8(e){if((typeof e==`function`||typeof e==`object`&&e)&&`valueOf`in e){let t=e.valueOf();if(typeof t==`number`)return t}return e}function m8(e,t){let n=e;return`ticks`in n?n.ticks(t):n.domain().filter((e,n,r)=>t==null||r.length<=t||n%Math.round((r.length-1)/t)===0)}function h8(e){return e?.toString()}function g8(e){return`bandwidth`in e?e.bandwidth():0}function _8(e){let{top:t=0,left:n=0,scale:r,width:i,stroke:a=`#eaf0f6`,strokeWidth:o=1,strokeDasharray:s,className:c,children:l,numTicks:u=10,lineStyle:d,offset:f,tickValues:p,...m}=e,h=p??m8(r,u),g=(f??0)+g8(r)/2,_=h.map((e,t)=>{let n=(p8(r(e))??0)+g;return{index:t,from:new R6({x:0,y:n}),to:new R6({x:i,y:n})}});return(0,F.jsx)(N6,{className:(0,M6.default)(`visx-rows`,c),top:t,left:n,children:l?l({lines:_}):_.map(e=>{let{from:t,to:n,index:r}=e;return(0,F.jsx)(P6,{from:t,to:n,stroke:a,strokeWidth:o,strokeDasharray:s,style:d,...m},`row-line-${r}`)})})}function v8(e){let{top:t=0,left:n=0,scale:r,height:i,stroke:a=`#eaf0f6`,strokeWidth:o=1,strokeDasharray:s,className:c,numTicks:l=10,lineStyle:u,offset:d,tickValues:f,children:p,...m}=e,h=f??m8(r,l),g=(d??0)+g8(r)/2,_=h.map((e,t)=>{let n=(p8(r(e))??0)+g;return{index:t,from:new R6({x:n,y:0}),to:new R6({x:n,y:i})}});return(0,F.jsx)(N6,{className:(0,M6.default)(`visx-columns`,c),top:t,left:n,children:p?p({lines:_}):_.map(e=>{let{from:t,to:n,index:r}=e;return(0,F.jsx)(P6,{from:t,to:n,stroke:a,strokeWidth:o,strokeDasharray:s,style:u,...m},`column-line-${r}`)})})}var y8=R(`g`)(()=>({stroke:Xl()})),b8=class extends P.Component{static propTypes={className:v.string,graphProps:x$.isRequired,xBand:v.func,columnTickValues:v.array,rowTickValues:v.array};static defaultProps={};render(){let{graphProps:e,xBand:t,rowTickValues:n,columnTickValues:r}=this.props,{scale:i={},size:a={},range:o={}}=e||{},{step:s=0,labelStep:c=0}=o,l=s&&c&&s<c,u=(e,t)=>{let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=10**Math.max(n,r);return e*i%(t*i)/i},{unlabeledLines:d,labeledLines:f}=(n||[]).reduce((e,t)=>(l&&u(t,c)!==0?e.unlabeledLines.push(t):e.labeledLines.push(t),e),{unlabeledLines:[],labeledLines:[]});return(0,F.jsxs)(y8,{children:[(0,F.jsx)(_8,{scale:i.y,width:a.width,tickValues:d,lineStyle:{stroke:$l(),strokeWidth:1}}),(0,F.jsx)(_8,{scale:i.y,width:a.width,tickValues:f,lineStyle:{stroke:d.length?Ru.GRIDLINES_COLOR:$l(),strokeWidth:1}}),(0,F.jsx)(v8,{scale:t,height:a.height,offset:t.bandwidth()/2,tickValues:r})]})}},x8=o(((e,t)=>{t.exports=n;function n(e,t,n){e instanceof RegExp&&(e=r(e,n)),t instanceof RegExp&&(t=r(t,n));var a=i(e,t,n);return a&&{start:a[0],end:a[1],pre:n.slice(0,a[0]),body:n.slice(a[0]+e.length,a[1]),post:n.slice(a[1]+t.length)}}function r(e,t){var n=t.match(e);return n?n[0]:null}n.range=i;function i(e,t,n){var r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){for(r=[],a=n.length;u>=0&&!s;)u==c?(r.push(u),c=n.indexOf(e,u+1)):r.length==1?s=[r.pop(),l]:(i=r.pop(),i<a&&(a=i,o=l),l=n.indexOf(t,u+1)),u=c<l&&c>=0?c:l;r.length&&(s=[a,o])}return s}})),S8=o(((e,t)=>{t.exports=n;function n(e,t,n){e instanceof RegExp&&(e=r(e,n)),t instanceof RegExp&&(t=r(t,n));var a=i(e,t,n);return a&&{start:a[0],end:a[1],pre:n.slice(0,a[0]),body:n.slice(a[0]+e.length,a[1]),post:n.slice(a[1]+t.length)}}function r(e,t){var n=t.match(e);return n?n[0]:null}n.range=i;function i(e,t,n){var r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){if(e===t)return[c,l];for(r=[],a=n.length;u>=0&&!s;)u==c?(r.push(u),c=n.indexOf(e,u+1)):r.length==1?s=[r.pop(),l]:(i=r.pop(),i<a&&(a=i,o=l),l=n.indexOf(t,u+1)),u=c<l&&c>=0?c:l;r.length&&(s=[a,o])}return s}})),C8=o(((e,t)=>{var n=S8();t.exports=r;function r(e,t,n){var r=e;return i(e,t).reduce(function(e,i){return e.replace(i.functionIdentifier+`(`+i.matches.body+`)`,a(i.matches.body,i.functionIdentifier,n,r,t))},e)}function i(e,t){var r=[],i=typeof t==`string`?RegExp(`\\b(`+t+`)\\(`):t;do{var a=i.exec(e);if(!a)return r;if(a[1]===void 0)throw Error(`Missing the first couple of parenthesis to get the function identifier in `+t);var o=a[1],s=a.index,c=n(`(`,`)`,e.substring(s));if(!c||c.start!==a[0].length-1)throw SyntaxError(o+`(): missing closing ')' in the value '`+e+`'`);r.push({matches:c,functionIdentifier:o}),e=c.post}while(i.test(e));return r}function a(e,t,n,i,a){return n(r(e,a,n),t,i)}})),w8=o(((e,t)=>{var n=function(e){this.value=e};n.math={isDegree:!0,acos:function(e){return n.math.isDegree?180/Math.PI*Math.acos(e):Math.acos(e)},add:function(e,t){return e+t},asin:function(e){return n.math.isDegree?180/Math.PI*Math.asin(e):Math.asin(e)},atan:function(e){return n.math.isDegree?180/Math.PI*Math.atan(e):Math.atan(e)},acosh:function(e){return Math.log(e+Math.sqrt(e*e-1))},asinh:function(e){return Math.log(e+Math.sqrt(e*e+1))},atanh:function(e){return Math.log((1+e)/(1-e))},C:function(e,t){var r=1,i=e-t,a=t;a<i&&(a=i,i=t);for(var o=a+1;o<=e;o++)r*=o;return r/n.math.fact(i)},changeSign:function(e){return-e},cos:function(e){return n.math.isDegree&&(e=n.math.toRadian(e)),Math.cos(e)},cosh:function(e){return(Math.E**+e+Math.E**(-1*e))/2},div:function(e,t){return e/t},fact:function(e){if(e%1!=0)return`NaN`;for(var t=1,n=2;n<=e;n++)t*=n;return t},inverse:function(e){return 1/e},log:function(e){return Math.log(e)/Math.log(10)},mod:function(e,t){return e%t},mul:function(e,t){return e*t},P:function(e,t){for(var n=1,r=Math.floor(e)-Math.floor(t)+1;r<=Math.floor(e);r++)n*=r;return n},Pi:function(e,t,n){for(var r=1,i=e;i<=t;i++)r*=Number(n.postfixEval({n:i}));return r},pow10x:function(e){for(var t=1;e--;)t*=10;return t},sigma:function(e,t,n){for(var r=0,i=e;i<=t;i++)r+=Number(n.postfixEval({n:i}));return r},sin:function(e){return n.math.isDegree&&(e=n.math.toRadian(e)),Math.sin(e)},sinh:function(e){return(Math.E**+e-Math.E**(-1*e))/2},sub:function(e,t){return e-t},tan:function(e){return n.math.isDegree&&(e=n.math.toRadian(e)),Math.tan(e)},tanh:function(e){return n.sinha(e)/n.cosha(e)},toRadian:function(e){return e*Math.PI/180},and:function(e,t){return e&t}},n.Exception=function(e){this.message=e},t.exports=n})),T8=o(((e,t)=>{var n=w8();function r(e,t){for(var n=0;n<e.length;n++)e[n]+=t;return e}for(var i=[{token:`sin`,show:`sin`,type:0,value:n.math.sin},{token:`cos`,show:`cos`,type:0,value:n.math.cos},{token:`tan`,show:`tan`,type:0,value:n.math.tan},{token:`pi`,show:`π`,type:3,value:`PI`},{token:`(`,show:`(`,type:4,value:`(`},{token:`)`,show:`)`,type:5,value:`)`},{token:`P`,show:`P`,type:10,value:n.math.P},{token:`C`,show:`C`,type:10,value:n.math.C},{token:` `,show:` `,type:14,value:` `.anchor},{token:`asin`,show:`asin`,type:0,value:n.math.asin},{token:`acos`,show:`acos`,type:0,value:n.math.acos},{token:`atan`,show:`atan`,type:0,value:n.math.atan},{token:`7`,show:`7`,type:1,value:`7`},{token:`8`,show:`8`,type:1,value:`8`},{token:`9`,show:`9`,type:1,value:`9`},{token:`int`,show:`Int`,type:0,value:Math.floor},{token:`cosh`,show:`cosh`,type:0,value:n.math.cosh},{token:`acosh`,show:`acosh`,type:0,value:n.math.acosh},{token:`ln`,show:` ln`,type:0,value:Math.log},{token:`^`,show:`^`,type:10,value:Math.pow},{token:`root`,show:`root`,type:0,value:Math.sqrt},{token:`4`,show:`4`,type:1,value:`4`},{token:`5`,show:`5`,type:1,value:`5`},{token:`6`,show:`6`,type:1,value:`6`},{token:`/`,show:`÷`,type:2,value:n.math.div},{token:`!`,show:`!`,type:7,value:n.math.fact},{token:`tanh`,show:`tanh`,type:0,value:n.math.tanh},{token:`atanh`,show:`atanh`,type:0,value:n.math.atanh},{token:`Mod`,show:` Mod `,type:2,value:n.math.mod},{token:`1`,show:`1`,type:1,value:`1`},{token:`2`,show:`2`,type:1,value:`2`},{token:`3`,show:`3`,type:1,value:`3`},{token:`*`,show:`×`,type:2,value:n.math.mul},{token:`sinh`,show:`sinh`,type:0,value:n.math.sinh},{token:`asinh`,show:`asinh`,type:0,value:n.math.asinh},{token:`e`,show:`e`,type:3,value:`E`},{token:`log`,show:` log`,type:0,value:n.math.log},{token:`0`,show:`0`,type:1,value:`0`},{token:`.`,show:`.`,type:6,value:`.`},{token:`+`,show:`+`,type:9,value:n.math.add},{token:`-`,show:`-`,type:9,value:n.math.sub},{token:`,`,show:`,`,type:11,value:`,`},{token:`Sigma`,show:`Σ`,type:12,value:n.math.sigma},{token:`n`,show:`n`,type:13,value:`n`},{token:`Pi`,show:`Π`,type:12,value:n.math.Pi},{token:`pow`,show:`pow`,type:8,value:Math.pow,numberOfArguments:2},{token:`&`,show:`&`,type:9,value:n.math.and}],a={0:11,1:0,2:3,3:0,4:0,5:0,6:0,7:11,8:11,9:1,10:10,11:0,12:11,13:0,14:-1,15:11},o=0;o<i.length;o++)i[o].precedence=a[i[o].type];var s={0:!0,1:!0,3:!0,4:!0,6:!0,8:!0,9:!0,12:!0,13:!0,14:!0,15:!0},c={0:!0,1:!0,2:!0,3:!0,4:!0,5:!0,6:!0,7:!0,8:!0,9:!0,10:!0,11:!0,12:!0,13:!0,15:!0},l={0:!0,3:!0,4:!0,8:!0,12:!0,13:!0,15:!0},u={},d={0:!0,1:!0,3:!0,4:!0,6:!0,8:!0,12:!0,13:!0,15:!0},f={1:!0},p=[[],`123789456+-*/()^!PCe0.,n &`.split(``),[`pi`,`ln`,`Pi`],[`sin`,`cos`,`tan`,`Del`,`int`,`Mod`,`log`,`pow`],[`asin`,`acos`,`atan`,`cosh`,`root`,`tanh`,`sinh`],[`acosh`,`atanh`,`asinh`,`Sigma`]];function m(e,t,n,r){for(var i=0;i<r;i++)if(e[n+i]!==t[i])return!1;return!0}n.tokenTypes={FUNCTION_WITH_ONE_ARG:0,NUMBER:1,BINARY_OPERATOR_HIGH_PRECENDENCE:2,CONSTANT:3,OPENING_PARENTHESIS:4,CLOSING_PARENTHESIS:5,DECIMAL:6,POSTFIX_FUNCTION_WITH_ONE_ARG:7,FUNCTION_WITH_N_ARGS:8,BINARY_OPERATOR_LOW_PRECENDENCE:9,BINARY_OPERATOR_PERMUTATION:10,COMMA:11,EVALUATED_FUNCTION:12,EVALUATED_FUNCTION_PARAMETER:13,SPACE:14},n.addToken=function(e){for(var t=0;t<e.length;t++){var r=e[t].token.length,o=-1;e[t].type===n.tokenTypes.FUNCTION_WITH_N_ARGS&&e[t].numberOfArguments===void 0&&(e[t].numberOfArguments=2),p[r]=p[r]||[];for(var s=0;s<p[r].length;s++)if(e[t].token===p[r][s]){o=h(p[r][s],i);break}o===-1?(i.push(e[t]),e[t].precedence=a[e[t].type],p.length<=e[t].token.length&&(p[e[t].token.length]=[]),p[e[t].token.length].push(e[t].token)):(i[o]=e[t],e[t].precedence=a[e[t].type])}};function h(e,t){for(var n=0;n<t.length;n++)if(t[n].token===e)return n;return-1}function g(e){for(var t=[],r=e.length,a,o,s,c=0;c<r;c++)if(!(c<r-1&&e[c]===` `&&e[c+1]===` `)){for(a=``,o=e.length-c>p.length-2?p.length-1:e.length-c;o>0;o--)if(p[o]!==void 0)for(s=0;s<p[o].length;s++)m(e,p[o][s],c,o)&&(a=p[o][s],s=p[o].length,o=0);if(c+=a.length-1,a===``)throw new n.Exception(`Can't understand after `+e.slice(c));t.push(i[h(a,i)])}return t}var _={value:n.math.changeSign,type:0,pre:21,show:`-`},v={value:`)`,show:`)`,type:5,pre:0},y={value:`(`,type:4,pre:0,show:`(`};n.lex=function(e,t){"use strict";var i=[y],a=[],o=e,p=s,m=0,h=u,b=``,x;t!==void 0&&n.addToken(t);var S={},C=g(o);for(x=0;x<C.length;x++){var w=C[x];if(w.type===14){if(x>0&&x<C.length-1&&C[x+1].type===1&&(C[x-1].type===1||C[x-1].type===6))throw new n.Exception(`Unexpected Space`);continue}var T=w.token,E=w.type,D=w.value,O=w.precedence,k=w.show,A=i[i.length-1],j;for(j=a.length;j--&&a[j]===0;)if([0,2,3,4,5,9,11,12,13].indexOf(E)!==-1){if(p[E]!==!0)throw new n.Exception(T+` is not allowed after `+b);i.push(v),p=c,h=d,a.pop()}if(p[E]!==!0)throw new n.Exception(T+` is not allowed after `+b);if(h[E]===!0&&(E=2,D=n.math.mul,k=`×`,O=3,--x),S={value:D,type:E,pre:O,show:k,numberOfArguments:w.numberOfArguments},E===0)p=s,h=u,r(a,2),i.push(S),C[x+1].type!==4&&(i.push(y),a.push(2));else if(E===1)A.type===1?(A.value+=D,r(a,1)):i.push(S),p=c,h=l;else if(E===2)p=s,h=u,r(a,2),i.push(S);else if(E===3)i.push(S),p=c,h=d;else if(E===4)r(a,1),m++,p=s,h=u,i.push(S);else if(E===5){if(!m)throw new n.Exception(`Closing parenthesis are more than opening one, wait What!!!`);m--,p=c,h=d,i.push(S),r(a,1)}else if(E===6){if(A.hasDec)throw new n.Exception(`Two decimals are not allowed in one number`);A.type!==1&&(A={value:0,type:1,pre:0},i.push(A)),p=f,r(a,1),h=u,A.value+=D,A.hasDec=!0}else E===7&&(p=c,h=d,r(a,1),i.push(S));E===8?(p=s,h=u,r(a,w.numberOfArguments+2),i.push(S),C[x+1].type!==4&&(i.push(y),a.push(w.numberOfArguments+2))):E===9?(A.type===9?A.value===n.math.add?(A.value=D,A.show=k,r(a,1)):A.value===n.math.sub&&k===`-`&&(A.value=n.math.add,A.show=`+`,r(a,1)):A.type!==5&&A.type!==7&&A.type!==1&&A.type!==3&&A.type!==13?T===`-`&&(p=s,h=u,r(a,2).push(2),i.push(_),i.push(y)):(i.push(S),r(a,2)),p=s,h=u):E===10?(p=s,h=u,r(a,2),i.push(S)):E===11?(p=s,h=u,i.push(S)):E===12?(p=s,h=u,r(a,6),i.push(S),C[x+1].type!==4&&(i.push(y),a.push(6))):E===13&&(p=c,h=d,i.push(S)),r(a,-1),b=T}for(j=a.length;j--;)i.push(v);if(p[5]!==!0)throw new n.Exception(`complete the expression`);for(;m--;)i.push(v);return i.push(v),new n(i)},t.exports=n})),E8=o(((e,t)=>{var n=T8();n.prototype.toPostfix=function(){"use strict";for(var e=[],t,r,i,a,o,s=[{value:`(`,type:4,pre:0}],c=this.value,l=1;l<c.length;l++)if(c[l].type===1||c[l].type===3||c[l].type===13)c[l].type===1&&(c[l].value=Number(c[l].value)),e.push(c[l]);else if(c[l].type===4)s.push(c[l]);else if(c[l].type===5)for(;(r=s.pop()).type!==4;)e.push(r);else if(c[l].type===11){for(;(r=s.pop()).type!==4;)e.push(r);s.push(r)}else{t=c[l],a=t.pre,o=s[s.length-1],i=o.pre;var u=o.value==`Math.pow`&&t.value==`Math.pow`;if(a>i)s.push(t);else{for(;i>=a&&!u||u&&a<i;)r=s.pop(),o=s[s.length-1],e.push(r),i=o.pre,u=t.value==`Math.pow`&&o.value==`Math.pow`;s.push(t)}}return new n(e)},t.exports=n})),D8=o(((e,t)=>{var n=E8();n.prototype.postfixEval=function(e){"use strict";e||={},e.PI=Math.PI,e.E=Math.E;for(var t=[],r,i,a,o=this.value,s=e.n!==void 0,c=0;c<o.length;c++)if(o[c].type===1)t.push({value:o[c].value,type:1});else if(o[c].type===3)t.push({value:e[o[c].value],type:1});else if(o[c].type===0)t[t.length-1].type===void 0?t[t.length-1].value.push(o[c]):t[t.length-1].value=o[c].value(t[t.length-1].value);else if(o[c].type===7)t[t.length-1].type===void 0?t[t.length-1].value.push(o[c]):t[t.length-1].value=o[c].value(t[t.length-1].value);else if(o[c].type===8){for(var l=[],u=0;u<o[c].numberOfArguments;u++)l.push(t.pop().value);t.push({type:1,value:o[c].value.apply(o[c],l.reverse())})}else o[c].type===10?(r=t.pop(),i=t.pop(),i.type===void 0?(i.value=i.concat(r),i.value.push(o[c]),t.push(i)):r.type===void 0?(r.unshift(i),r.push(o[c]),t.push(r)):t.push({type:1,value:o[c].value(i.value,r.value)})):o[c].type===2||o[c].type===9?(r=t.pop(),i=t.pop(),i.type===void 0?(i=i.concat(r),i.push(o[c]),t.push(i)):r.type===void 0?(r.unshift(i),r.push(o[c]),t.push(r)):t.push({type:1,value:o[c].value(i.value,r.value)})):o[c].type===12?(r=t.pop(),r.type!==void 0&&(r=[r]),i=t.pop(),a=t.pop(),t.push({type:1,value:o[c].value(a.value,i.value,new n(r))})):o[c].type===13&&(s?t.push({value:e[o[c].value],type:3}):t.push([o[c]]));if(t.length>1)throw new n.Exception(`Uncaught Syntax error`);return t[0].value>0x38d7ea4c68000?`Infinity`:parseFloat(t[0].value.toFixed(15))},n.eval=function(e,t,n){return t===void 0?this.lex(e).toPostfix().postfixEval():n===void 0?t.length===void 0?this.lex(e).toPostfix().postfixEval(t):this.lex(e,t).toPostfix().postfixEval():this.lex(e,t).toPostfix().postfixEval(n)},t.exports=n})),O8=o(((e,t)=>{var n=D8();n.prototype.formulaEval=function(){"use strict";for(var e,t,n,r=[],i=this.value,a=0;a<i.length;a++)i[a].type===1||i[a].type===3?r.push({value:i[a].type===3?i[a].show:i[a].value,type:1}):i[a].type===13?r.push({value:i[a].show,type:1}):i[a].type===0?r[r.length-1]={value:i[a].show+(i[a].show==`-`?``:`(`)+r[r.length-1].value+(i[a].show==`-`?``:`)`),type:0}:i[a].type===7?r[r.length-1]={value:(r[r.length-1].type==1?``:`(`)+r[r.length-1].value+(r[r.length-1].type==1?``:`)`)+i[a].show,type:7}:i[a].type===10?(e=r.pop(),t=r.pop(),i[a].show===`P`||i[a].show===`C`?r.push({value:`<sup>`+t.value+`</sup>`+i[a].show+`<sub>`+e.value+`</sub>`,type:10}):r.push({value:(t.type==1?``:`(`)+t.value+(t.type==1?``:`)`)+`<sup>`+e.value+`</sup>`,type:1})):i[a].type===2||i[a].type===9?(e=r.pop(),t=r.pop(),r.push({value:(t.type==1?``:`(`)+t.value+(t.type==1?``:`)`)+i[a].show+(e.type==1?``:`(`)+e.value+(e.type==1?``:`)`),type:i[a].type})):i[a].type===12&&(e=r.pop(),t=r.pop(),n=r.pop(),r.push({value:i[a].show+`(`+n.value+`,`+t.value+`,`+e.value+`)`,type:12}));return r[0].value},t.exports=n})),k8=o(((e,t)=>{var n=x8(),r=C8(),i=O8(),a=100,o=/(\+|\-|\*|\\|[^a-z]|)(\s*)(\()/g,s;t.exports=c;function c(e,t){s=0,t=10**(t===void 0?5:t),e=e.replace(/\n+/g,` `);function c(e,n,r){if(s++>a)throw s=0,Error(`Call stack overflow for `+r);if(e===``)throw Error(n+`(): '`+r+`' must contain a non-whitespace string`);e=u(e,r);var o=l(e);if(o.length>1||e.indexOf(`var(`)>-1)return n+`(`+e+`)`;var c=o[0]||``;c===`%`&&(e=e.replace(/\b[0-9\.]+%/g,function(e){return parseFloat(e.slice(0,-1))*.01}));var d=e.replace(new RegExp(c,`gi`),``),f;try{f=i.eval(d)}catch{return n+`(`+e+`)`}return c===`%`&&(f*=100),(n.length||c===`%`)&&(f=Math.round(f*t)/t),f+=c,f}function u(e,t){e=e.replace(/((?:\-[a-z]+\-)?calc)/g,``);for(var r=``,i=e,a;a=o.exec(i);){a[0].index>0&&(r+=i.substring(0,a[0].index));var s=n(`(`,`)`,i.substring([0].index));if(s.body===``)throw Error(`'`+e+`' must contain a non-whitespace string`);var l=c(s.body,``,t);r+=s.pre+l,i=s.post}return r+i}return r(e,/((?:\-[a-z]+\-)?calc)\(/,c)}function l(e){for(var t=[],n=[],r=/[\.0-9]([%a-z]+)/gi,i=r.exec(e);i;)!i||!i[1]||(n.indexOf(i[1].toLowerCase())===-1&&(t.push(i[1]),n.push(i[1].toLowerCase())),i=r.exec(e));return t}}));function A8(e,t){let n=new Map;return function(){for(var r=arguments.length,i=Array(r),a=0;a<r;a++)i[a]=arguments[a];let o=t(...i);if(n.has(o))return n.get(o);let s=e.apply(this,i);return n.set(o,s),s}}var j8=`__react_svg_text_measurement_id`;function M8(e,t){if(typeof document>`u`)return null;try{let n=document.getElementById(j8);if(!n){let e=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);e.setAttribute(`aria-hidden`,`true`),e.style.width=`0`,e.style.height=`0`,e.style.position=`absolute`,e.style.top=`-100%`,e.style.left=`-100%`,n=document.createElementNS(`http://www.w3.org/2000/svg`,`text`),n.setAttribute(`id`,j8),e.appendChild(n),document.body.appendChild(e)}return Object.assign(n.style,t),n.textContent=e,n.getComputedTextLength()}catch{return null}}var N8=A8(M8,(e,t)=>`${e}_${JSON.stringify(t)}`),P8=l(k8());function F8(e){return typeof e==`number`}function I8(e){return typeof e==`number`&&Number.isFinite(e)||typeof e==`string`}function L8(e){let{verticalAnchor:t=`end`,scaleToFit:n=!1,angle:r,width:i,lineHeight:a=`1em`,capHeight:o=`0.71em`,children:s,style:c,...l}=e,{x:u=0,y:d=0}=l,f=!I8(u)||!I8(d),{wordsWithWidth:p,spaceWidth:m}=(0,P.useMemo)(()=>({wordsWithWidth:(s==null?[]:s.toString().split(/(?:(?!\u00A0+)\s+)/)).map(e=>({word:e,wordWidth:N8(e,c)||0})),spaceWidth:N8(`\xA0`,c)||0}),[s,c]),h=(0,P.useMemo)(()=>f?[]:i||n?p.reduce((e,t)=>{let{word:r,wordWidth:a}=t,o=e[e.length-1];if(o&&(i==null||n||(o.width||0)+a+m<i))o.words.push(r),o.width=o.width||0,o.width+=a+m;else{let t={words:[r],width:a};e.push(t)}return e},[]):[{words:s==null?[]:s.toString().split(/(?:(?!\u00A0+)\s+)/)}],[f,i,n,s,p,m]);return{wordsByLines:h,startDy:(0,P.useMemo)(()=>f?``:t===`start`?(0,P8.default)(`calc(${o})`):t===`middle`?(0,P8.default)(`calc(${(h.length-1)/2} * -${a} + (${o} / 2))`):(0,P8.default)(`calc(${h.length-1} * -${a})`),[f,t,o,h.length,a]),transform:(0,P.useMemo)(()=>{let e=[];if(f)return``;if(F8(u)&&F8(d)&&F8(i)&&n&&h.length>0){let t=h[0].width||1,r=n===`shrink-only`?Math.min(i/t,1):i/t,a=r,o=u-r*u,s=d-a*d;e.push(`matrix(${r}, 0, 0, ${a}, ${o}, ${s})`)}return r&&e.push(`rotate(${r}, ${u}, ${d})`),e.length>0?e.join(` `):``},[f,u,d,i,n,h,r])}}var R8={overflow:`visible`};function z8(e){let{dx:t=0,dy:n=0,textAnchor:r=`start`,innerRef:i,innerTextRef:a,verticalAnchor:o,angle:s,lineHeight:c=`1em`,scaleToFit:l=!1,capHeight:u,width:d,...f}=e,{x:p=0,fontSize:m}=f,{wordsByLines:h,startDy:g,transform:_}=L8(e);return(0,F.jsx)(`svg`,{ref:i,x:t,y:n,fontSize:m,style:R8,children:h.length>0?(0,F.jsx)(`text`,{ref:a,transform:_,...f,textAnchor:r,children:h.map((e,t)=>(0,F.jsx)(`tspan`,{x:p,dy:t===0?g:c,children:e.words.join(` `)},t))}):null})}var B8={top:`top`,left:`left`,right:`right`,bottom:`bottom`};function V8(e){let{labelOffset:t,labelProps:n,orientation:r,range:i,tickLabelFontSize:a,tickLength:o}=e,s=r===B8.left||r===B8.top?-1:1,c,l,u;if(r===B8.top||r===B8.bottom){let e=r===B8.bottom&&typeof n.fontSize==`number`?n.fontSize:0;c=(Number(i[0])+Number(i[i.length-1]))/2,l=s*(o+t+a+e)}else c=s*((Number(i[0])+Number(i[i.length-1]))/2),l=-(o+t),u=`rotate(${s*90})`;return{x:c,y:l,transform:u}}function H8(e){let{hideTicks:t,horizontal:n,orientation:r,tickClassName:i,tickComponent:a,tickLabelProps:o,tickStroke:s=`#222`,tickTransform:c,ticks:l,strokeWidth:u,tickLineProps:d}=e;return l.map(e=>{let{value:l,index:f,from:p,to:m,formattedValue:h}=e,g=o[f]??{},_=Math.max(10,typeof g.fontSize==`number`&&g.fontSize||0),v=m.y+(n&&r!==B8.top?_:0);return(0,F.jsxs)(N6,{className:(0,M6.default)(`visx-axis-tick`,i),transform:c,children:[!t&&(0,F.jsx)(P6,{from:p,to:m,stroke:s,strokeWidth:u,strokeLinecap:`square`,...d}),a?a({...g,x:m.x,y:v,formattedValue:h}):(0,F.jsx)(z8,{x:m.x,y:v,...g,children:h})]},`visx-tick-${l}-${f}`)})}var U8={textAnchor:`middle`,fontFamily:`Arial`,fontSize:10,fill:`#222`};function W8(e){let{axisFromPoint:t,axisLineClassName:n,axisToPoint:r,hideAxisLine:i,hideTicks:a,horizontal:o,label:s=``,labelClassName:c,labelOffset:l=14,labelProps:u,orientation:d=B8.bottom,scale:f,stroke:p=`#222`,strokeDasharray:m,strokeWidth:h=1,tickClassName:g,tickComponent:_,tickLineProps:v,tickLabelProps:y,tickLength:b=8,tickStroke:x=`#222`,tickTransform:S,ticks:C,ticksComponent:w=H8}=e,T={...U8,...u},E={...U8,...typeof y==`object`?y:null},D=C.map(e=>{let{value:t,index:n}=e;return typeof y==`function`?y(t,n,C):E}),O=Math.max(10,...D.map(e=>typeof e.fontSize==`number`?e.fontSize:0));return(0,F.jsxs)(F.Fragment,{children:[w({hideTicks:a,horizontal:o,orientation:d,scale:f,tickClassName:g,tickComponent:_,tickLabelProps:D,tickStroke:x,tickTransform:S,ticks:C,strokeWidth:h,tickLineProps:v}),!i&&(0,F.jsx)(P6,{className:(0,M6.default)(`visx-axis-line`,n),from:t,to:r,stroke:p,strokeWidth:h,strokeDasharray:m}),s&&(0,F.jsx)(z8,{className:(0,M6.default)(`visx-axis-label`,c),...V8({labelOffset:l,labelProps:T,orientation:d,range:f.range(),tickLabelFontSize:O,tickLength:b}),...T,children:s})]})}function G8(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`center`,n=e;if(t!==`start`&&`bandwidth`in n){let e=n.bandwidth();return t===`center`&&(e/=2),n.round()&&(e=Math.round(e)),t=>{let r=n(t);return typeof r==`number`?r+e:r}}return e}function K8(e){let t=e;return`tickFormat`in t?t.tickFormat():h8}function q8(e,t){let{x:n,y:r}=e;return new R6(t?{x:n,y:r}:{x:r,y:n})}function J8(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return typeof e==`number`?{start:e,end:e}:{start:0,end:0,...e}}function Y8(e){let{children:t=W8,axisClassName:n,hideAxisLine:r=!1,hideTicks:i=!1,hideZero:a=!1,innerRef:o,left:s=0,numTicks:c=10,orientation:l=B8.bottom,rangePadding:u=0,scale:d,tickFormat:f,tickLength:p=8,tickValues:m,top:h=0,...g}=e,_=f??K8(d),v=l===B8.left,y=l===B8.top,b=y||l===B8.bottom,x=G8(d),S=v||y?-1:1,C=d.range(),w=J8(u),T=q8({x:Number(C[0])+.5-w.start,y:0},b),E=q8({x:Number(C[C.length-1])+.5+w.end,y:0},b),D=(m??m8(d,c)).filter(e=>!a||e!==0&&e!==`0`).map((e,t)=>({value:e,index:t})),O=D.map(e=>{let{value:t,index:n}=e,r=p8(x(t));return{value:t,index:n,from:q8({x:r,y:0},b),to:q8({x:r,y:p*S},b),formattedValue:_(t,n,D)}});return(0,F.jsx)(N6,{className:(0,M6.default)(`visx-axis`,n),innerRef:o,top:h,left:s,children:t({...g,axisFromPoint:T,axisToPoint:E,hideAxisLine:r,hideTicks:i,hideZero:a,horizontal:b,numTicks:c,orientation:l,rangePadding:u,scale:d,tickFormat:_,tickLength:p,tickPosition:x,tickSign:S,ticks:O})})}var X8={dx:`-0.25em`,dy:`0.25em`,fill:`#222`,fontFamily:`Arial`,fontSize:10,textAnchor:`end`};function Z8(e){let{axisClassName:t,labelOffset:n=36,tickLength:r=8,tickLabelProps:i,...a}=e,o=typeof i==`function`?i:{...X8,...i};return(0,F.jsx)(Y8,{axisClassName:(0,M6.default)(`visx-axis-left`,t),labelOffset:n,orientation:B8.left,tickLabelProps:o,tickLength:r,...a})}var Q8={dy:`0.25em`,fill:`#222`,fontFamily:`Arial`,fontSize:10,textAnchor:`middle`};function $8(e){let{axisClassName:t,labelOffset:n=8,tickLength:r=8,tickLabelProps:i,...a}=e,o=typeof i==`function`?i:{...Q8,...i};return(0,F.jsx)(Y8,{axisClassName:(0,M6.default)(`visx-axis-bottom`,t),labelOffset:n,orientation:B8.bottom,tickLabelProps:o,tickLength:r,...a})}var e5=ml((0,F.jsx)(`path`,{d:`M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z`}),`Close`),t5=R(pR)(({theme:e})=>({borderRadius:e.spacing(2),color:V.WHITE,fontSize:`16px`,width:`16px`,height:`16px`,padding:`2px`,border:`1px solid ${V.WHITE}`,stroke:`initial`,boxSizing:`unset`,backgroundColor:Bl(),display:`block`,"&.small":{fontSize:`10px`,width:`10px`,height:`10px`}})),n5=R(e5)(({theme:e})=>({borderRadius:e.spacing(2),color:V.WHITE,fontSize:`16px`,width:`16px`,height:`16px`,padding:`2px`,border:`1px solid ${V.WHITE}`,stroke:`initial`,boxSizing:`unset`,backgroundColor:Gl(),display:`block`,"&.small":{fontSize:`10px`,width:`10px`,height:`10px`}})),r5=({scale:e,x:t,y:n,correctness:r,interactive:i})=>{if(!r||!i)return null;let a=e?e.x(t):t,o=e?e.y(n):n,s=r.value===`correct`;return(0,F.jsx)(`foreignObject`,{x:a-11,y:o-11,width:22,height:22,children:s?(0,F.jsx)(t5,{title:r.label}):(0,F.jsx)(n5,{title:r.label})})},i5=({scale:e,x:t,correctness:n,correctData:r,label:i})=>{if(n&&n.value===`incorrect`){let a=parseFloat(r.find(e=>e.label===i)?.value);if(isNaN(a))return null;let o=e.y(a)-7.5;return(0,F.jsx)(`foreignObject`,{x:e.x(t)-7.5,y:o,width:15,height:15,children:(0,F.jsx)(t5,{className:`small`,title:n.label})})}return null},a5=({correctness:e,interactive:t})=>!e||!t?null:e.value===`correct`?(0,F.jsx)(t5,{title:e.label}):(0,F.jsx)(n5,{title:e.label});r5.propTypes={scale:v.shape({x:v.func,y:v.func}),x:v.number.isRequired,y:v.number.isRequired,correctness:v.shape({value:v.string,label:v.string}),interactive:v.bool},i5.propTypes={scale:v.shape({x:v.func,y:v.func}).isRequired,x:v.number.isRequired,correctness:v.shape({value:v.string,label:v.string}),correctData:v.arrayOf(v.shape({label:v.string,value:v.oneOfType([v.string,v.number])})),label:v.string},a5.propTypes={correctness:v.shape({value:v.string,label:v.string}),interactive:v.bool};var o5=(e,t)=>`${t}-${e.label||`-`}`,s5=(e,t,n,r)=>{let i=n||400,a=t&&t.length?t.map(o5):[`default`];switch(r){case`bar`:case`dotPlot`:case`linePlot`:return u8({range:[0,i],domain:a,padding:.2});case`histogram`:return u8({range:[0,i],domain:a,padding:0});case`lineCross`:case`lineDot`:return f8({domain:a,range:[0,i]});default:return u8({range:[0,i],domain:a,padding:0})}},c5=(e={})=>{let t=[],n=e.min;for(;n<=e.max;)t.push(n),n=Math.round((n+e.step)*1e4)/1e4;return t},l5=(e,t,n)=>{let{step:r,labelStep:i,min:a,max:o}=t||{};switch(a||=0,(!o||o<0)&&(o=t.min+1),r||=i||1,(!i||isNaN(i)&&r)&&(i=r||1),t.max=o,n){case`dotPlot`:case`linePlot`:{let n=Math.round(a),r=Math.round(o);return{domain:{...e,step:1,labelStep:1,min:0,max:1},range:{...t,min:n,max:n===r?n+1:r,labelStep:i,step:1}}}default:return{domain:{...e,step:1,labelStep:1,min:0,max:1},range:{...t,labelStep:i,step:r}}}},u5=(e,t)=>{switch(t){case`lineDot`:case`lineCross`:return{verticalLines:void 0,horizontalLines:c5(e),leftAxis:!0};case`dotPlot`:case`linePlot`:return{verticalLines:[],horizontalLines:[],leftAxis:!1};default:return{verticalLines:[],horizontalLines:c5(e),leftAxis:!0}}},d5=(e,t)=>t>=e*2?25:0,f5=e=>e<30?50:e<40?30:e<60?15:0,p5=e=>{let t,n;return e>91?(t=1.3,n=-55):e>45?(t=1.1,n=-45):e>40?(t=.5+(e-34)*.02,n=-25):e>30?(t=.5+(e-34)*.02,n=-20):(t=.5*.98**(34-e),n=-15),{scale:t,deltay:n}},m5=(e,t)=>(e-57*t)/2,h5=e=>{let t=Number.parseFloat(e);return Number.isFinite(t)?t:0},g5=(e,t)=>{let n=e??t;return typeof n==`number`?n:typeof n==`string`&&n.endsWith(`px`)?h5(n):1},_5=P.forwardRef(({className:e,inputClassName:t,inputRef:n,inputStyle:r,minWidth:i,placeholder:a,style:o,value:s,defaultValue:c,...l},u)=>{let d=(0,P.useRef)(null),f=(0,P.useRef)(n),p=(0,P.useRef)(u),m=(0,P.useRef)(null),[h,g]=(0,P.useState)(()=>g5(i,r?.minWidth));f.current=n,p.current=u;let _=(0,P.useCallback)(e=>{d.current=e,f.current?.(e);let t=p.current;typeof t==`function`?t(e):t&&(t.current=e)},[]);return(0,P.useLayoutEffect)(()=>{let e=d.current,t=m.current;if(!e||!t)return;let n=window.getComputedStyle(e);t.style.font=n.font,t.style.letterSpacing=n.letterSpacing,t.style.textTransform=n.textTransform,t.textContent=String(s??c??a??``)||` `;let o=h5(n.paddingLeft)+h5(n.paddingRight)+h5(n.borderLeftWidth)+h5(n.borderRightWidth),l=Math.ceil(t.getBoundingClientRect().width+2),u=n.boxSizing===`border-box`?l+o:l;g(Math.max(g5(i,r?.minWidth),u))},[c,t,r,i,a,s]),(0,F.jsxs)(`span`,{className:e,style:{display:`inline-block`,...o},children:[(0,F.jsx)(`input`,{...l,ref:_,className:t,placeholder:a,style:{width:h,...r},value:s,defaultValue:c}),(0,F.jsx)(`span`,{ref:m,"aria-hidden":`true`,style:{height:0,left:0,overflow:`hidden`,position:`absolute`,top:0,visibility:`hidden`,whiteSpace:`pre`}})]})});_5.displayName=`AutosizeInput`;var v5=(e=`fill`)=>({[e]:`var(--graph-disabled, ${Ll()})`,pointerEvents:`none`,border:`none`}),y5=(e=`fill`)=>({[e]:Bl(),pointerEvents:`none`,border:`solid 1px ${Bl()}`}),b5=(e=`fill`)=>({[e]:Wl(),pointerEvents:`none`,border:`solid 1px ${Wl()}`}),x5=R(`div`)({display:`flex`,flexDirection:`column`,alignItems:`center`}),S5=zl();R(`input`)(({theme:e})=>({float:`right`,fontFamily:e.typography.fontFamily,fontSize:e.typography.fontSize,border:`none`,"&.correct":y5(`color`),"&.incorrect":b5(`color`),"&.disabledMarkLabel":{backgroundColor:`transparent !important`},"&.error":{border:`2px solid ${e.palette.error.main}`}}));var C5=R(`div`)(({theme:e})=>({pointerEvents:`auto`,textAlign:`center`,fontSize:e.typography.fontSize+2,fontFamily:e.typography.fontFamily,color:Zl(),paddingTop:e.typography.fontSize/2,"&.disabledMarkLabel":{...v5(`color`),color:S5,backgroundColor:`transparent !important`},"&.error":{border:`2px solid ${e.palette.error.main}`},"&.correct":{...y5(`color`)},"&.incorrect":{...b5(`color`)}}));function w5(e){let t=e?.trim()||``;return new RegExp(/^[1-9]*[0-9]*\s?[1-9][0-9]*\/[1-9][0-9]*$/).test(t)}function T5(e){let t=e?.trim()||``,n,r=``,i=t.split(` `);n=i[1]&&i[1].includes(`/`)?i[1].split(`/`)||``:t?.split(`/`)||``;let a;if(w5(e))return i[0]&&i[1]&&(r=i[0]),a=`\\(${r}\\frac{${n[0]}}{${n[1]}}\\)`,a}var E5=e=>{let[t,n]=(0,P.useState)(null),r=(0,P.useCallback)(e=>n(e),null),{mark:i={},disabled:a,inputRef:o,barWidth:s,rotate:c,correctness:l,autoFocus:u,error:d,isHiddenLabel:f,limitCharacters:p,correctnessIndicator:m}=e,[h,g]=(0,P.useState)(i.label),[_,v]=(0,P.useState)(T5(i.label)),[y,b]=(0,P.useState)(!1),x=(0,P.useRef)(null),S=e=>{p&&e.target.value&&e.target.value.length>20||g(e.target.value)},C=()=>y===!1&&_!==void 0,w=t=>{v(T5(i.label)),b(!1),e.onChange(t.target.value)},T={};return c&&(T={width:`unset`,textAlign:`left`}),(0,P.useEffect)(()=>{g(i.label)},[i.label]),(0,P.useEffect)(()=>{let e=x.current;e&&_&&(e.innerHTML=_,hd(e))},[h,_]),(0,F.jsxs)(x5,{children:[m,C()?(0,F.jsx)(C5,{ref:e=>{x.current=e,typeof o==`function`&&o(e)},className:I({disabledMarkLabel:a,error:d,correct:i.editable&&l?.label===`correct`,incorrect:i.editable&&l?.label===`incorrect`}),onClick:()=>b(!0),style:{minWidth:s,position:`fixed`,transformOrigin:`left`,transform:`rotate(${c}deg)`,visibility:f?`hidden`:`unset`,marginTop:m?`24px`:`0`}}):(0,F.jsx)(_5,{inputRef:e=>{r(e),typeof o==`function`&&o(e)},name:`mark-label-input`,autoFocus:y||u,disabled:a,inputClassName:I(l&&i.editable?l.label:null,a&&`disabledMarkLabel`,d&&`error`),inputStyle:{minWidth:s,textAlign:`center`,background:`transparent`,boxSizing:`border-box`,paddingLeft:0,paddingRight:0,border:`none`,...a?{color:S5,WebkitTextFillColor:S5}:{},...T},value:h,style:{position:`fixed`,pointerEvents:`auto`,top:0,left:0,minWidth:s,transformOrigin:`left`,transform:`rotate(${c}deg)`,visibility:f?`hidden`:`unset`,marginTop:m?`24px`:`0`},onChange:S,onBlur:w})]})};E5.propTypes={autoFocus:v.bool,disabled:v.bool,error:v.any,onChange:v.func,graphProps:x$,inputRef:v.func,mark:v.object,barWidth:v.number,rotate:v.number,correctness:v.shape({value:v.string,label:v.string}),isHiddenLabel:v.bool,limitCharacters:v.bool,correctnessIndicator:v.node};var D5=new Set,O5=null;function k5(e){D5.add(e),!O5&&typeof document<`u`&&(O5=new MutationObserver(()=>{D5.forEach(e=>e())}),O5.observe(document.body,{childList:!0,subtree:!0}))}function A5(e){D5.delete(e),D5.size===0&&O5&&(O5.disconnect(),O5=null)}var j5=R(`text`)(({theme:e})=>({fontSize:e.typography.fontSize-2,fill:e.palette.error.main})),M5=R(i6)(()=>({color:`${lu()} !important`})),N5=R(`g`)(({theme:e})=>({"& .vx-axis-line":{stroke:Ru.AXIS_LINE_COLOR,strokeWidth:2},"& .vx-axis-tick":{fill:Ru.AXIS_TICK_COLOR,"& line":{stroke:Ru.AXIS_TICK_COLOR,strokeWidth:2},fontFamily:e.typography.body1?.fontFamily,fontSize:e.typography.fontSize,textAnchor:`middle`}})),P5=e=>({borderRadius:e.spacing(2),color:V.WHITE,fontSize:`16px`,width:`16px`,height:`16px`,padding:`2px`,border:`1px solid ${V.WHITE}`,boxSizing:`unset`}),F5={backgroundColor:Gl()},I5={backgroundColor:Bl()},L5=class extends P.Component{static propTypes={defineChart:v.bool,error:v.any};constructor(e){super(e),this.state={dialog:{open:!1}}}componentDidUpdate(e){this.props.autoFocus&&!e.autoFocus&&this.props.onAutoFocusUsed()}handleAlertDialog=(e,t)=>this.setState({dialog:{open:e}},t);changeCategory=(e,t)=>{let{categories:n,onChangeCategory:r}=this.props,i=n[e];r(e,{...i,label:t})};changeInteractive=(e,t)=>{let{categories:n,onChangeCategory:r}=this.props,i=n[e];t?r(e,{...i,interactive:!i.interactive}):this.setState({dialog:{open:!0,title:`Warning`,text:`This will remove the correct answer value that has been defined for this category.`,onConfirm:()=>this.handleAlertDialog(!1,r(e,{...i,interactive:!i.interactive})),onClose:()=>this.handleAlertDialog(!1)}})};changeEditable=(e,t)=>{let{categories:n,onChangeCategory:r}=this.props,i=n[e];t?r(e,{...i,editable:!i.editable||!1}):this.setState({dialog:{open:!0,title:`Warning`,text:`This will remove the correct answer category name that has been defined for this category.`,onConfirm:()=>this.handleAlertDialog(!1,r(e,{...i,editable:!i.editable||!1})),onClose:()=>this.handleAlertDialog(!1)}})};splitText=(e,t)=>{let n=[];for(;(e||``).length>0;){let r;e.length>t?(r=e.lastIndexOf(` `,t),r===-1&&(r=t)):r=e.length,n.push(e.substring(0,r)),e=e.substring(r).trim()}return n};render(){let{categories:e,xBand:t,bandWidth:n,barWidth:r,rotate:i,top:a,graphProps:o,defineChart:s,chartingOptions:c,x:l,y:u,formattedValue:d,changeInteractiveEnabled:f,changeEditableEnabled:p,error:m,autoFocus:h,hiddenLabelRef:g,showCorrectness:_}=this.props;if(!d)return null;let v={correctnessIcon:P5,incorrectIcon:F5,correctIcon:I5},{dialog:y}=this.state,{changeEditable:b,changeInteractive:x}=c||{},S=parseInt(d.split(`-`)[0],10),C=e[S],{editable:w,interactive:T,label:E,correctness:D}=C||{},O=t(o5({label:E},S)),k=(e||[]).reduce((e,t)=>(e&&e.label?e.label.length:0)>(t&&t.label?t.label.length:0)?e:t,{label:``}),A=m?[...new Set(Object.values(m))].join(` `):``;return(0,F.jsxs)(`g`,{children:[(0,F.jsxs)(`foreignObject`,{x:n?O:l-r/2,y:18,width:r,height:4,style:{pointerEvents:`none`,overflow:`visible`},children:[S===0&&(0,F.jsx)(E5,{isHiddenLabel:!0,inputRef:g,disabled:!0,mark:k,graphProps:o,barWidth:r}),(0,F.jsx)(E5,{autoFocus:s&&h,inputRef:e=>this.input=e,disabled:!s&&!w,mark:C,graphProps:o,onChange:e=>this.changeCategory(S,e),barWidth:r,rotate:i,correctness:D,error:m&&m[S],limitCharacters:!0,correctnessIndicator:_&&D&&(0,F.jsx)(a5,{correctness:D,interactive:T,classes:v})})]}),m&&S===0&&(0,F.jsx)(j5,{y:u+23,height:6,textAnchor:`start`,children:A}),s&&S===0&&(0,F.jsxs)(`svg`,{x:-55,style:{overflow:`visible`},children:[f&&(0,F.jsx)(`text`,{y:u+90+a,width:r,height:4,style:{position:`absolute`,pointerEvents:`none`,wordBreak:`break-word`,maxWidth:r,display:`inline-block`},children:this.splitText(x?.authoringLabel,20).map((e,t)=>(0,F.jsx)(`tspan`,{x:`0`,dy:`${t>0?`1.2em`:`.6em`}`,children:e},t))}),p&&(0,F.jsx)(`text`,{y:u+145+a,width:r,height:4,style:{position:`absolute`,pointerEvents:`none`,wordBreak:`break-word`,maxWidth:r,display:`inline-block`},children:this.splitText(b?.authoringLabel,20).map((e,t)=>(0,F.jsx)(`tspan`,{x:`0`,dy:`${t>0?`1.2em`:`.6em`}`,children:e},t))})]}),s&&f&&(0,F.jsx)(`foreignObject`,{x:l-24,y:u+80+a,width:r,height:4,style:{pointerEvents:`visible`,overflow:`visible`},children:(0,F.jsx)(M5,{style:{position:`fixed`},checked:T,onChange:e=>this.changeInteractive(S,e.target.checked)})}),s&&p&&(0,F.jsx)(`foreignObject`,{x:l-24,y:u+130+a,width:r,height:4,style:{pointerEvents:`visible`,overflow:`visible`},children:(0,F.jsx)(M5,{style:{position:`fixed`},checked:w,onChange:e=>this.changeEditable(S,e.target.checked)})}),(0,F.jsx)(`foreignObject`,{x:l-24,y:u+100+a,width:r,height:4,style:{pointerEvents:`visible`,overflow:`visible`},children:(0,F.jsx)(s6,{open:y.open,title:y.title,text:y.text,onClose:y.onClose,onConfirm:y.onConfirm})})]})}};L5.propTypes={categories:v.array,xBand:v.func,bandWidth:v.number,barWidth:v.number,rotate:v.number,top:v.number,x:v.number,y:v.number,graphProps:v.object,formattedValue:v.string,onChangeCategory:v.func,onChange:v.func,error:v.object,defineChart:v.bool,chartingOptions:v.object,changeInteractiveEnabled:v.bool,changeEditableEnabled:v.bool,autoFocus:v.bool,onAutoFocusUsed:v.func,showCorrectness:v.bool,hiddenLabelRef:v.oneOfType([v.func,v.shape({current:v.instanceOf(Element)})])};var R5=class extends P.Component{static propTypes={bottomScale:v.func,categories:v.array,defineChart:v.bool,error:v.any,graphProps:x$.isRequired,xBand:v.func,leftAxis:v.bool,onChange:v.func,onChangeCategory:v.func,top:v.number,theme:v.object,chartingOptions:v.object,changeInteractiveEnabled:v.bool,changeEditableEnabled:v.bool,autoFocus:v.bool,onAutoFocusUsed:v.func,showCorrectness:v.bool,hiddenLabelRef:v.oneOfType([v.func,v.shape({current:v.instanceOf(Element)})])};state={height:0,width:0};measureHiddenLabel=()=>{if(!this.hiddenLabelRef)return;let e=this.hiddenLabelRef.querySelector(`mjx-container`),t=this.hiddenLabelRef.querySelector(`input`),n=(e||t||this.hiddenLabelRef).getBoundingClientRect(),r=Math.floor(n.height),i=Math.floor(n.width);(r!==this.state.height||i!==this.state.width)&&this.setState({height:r,width:i})};_onDocMutation=()=>{this.hiddenLabelRef&&this.hiddenLabelRef.querySelector(`mjx-container`)&&this.measureHiddenLabel()};observeHiddenLabel=e=>{if(!e)return;let t=e.querySelector(`[data-latex], [data-raw]`);t&&hd(e),(e.querySelector(`mjx-container`)||!t)&&this.measureHiddenLabel(),k5(this._onDocMutation)};setHiddenLabelRef=e=>{e&&e!==this.hiddenLabelRef&&(this.hiddenLabelRef=e,this.observeHiddenLabel(e))};componentDidMount(){this.hiddenLabelRef&&this.observeHiddenLabel(this.hiddenLabelRef)}componentWillUnmount(){A5(this._onDocMutation),this._updateTimer&&clearTimeout(this._updateTimer)}componentDidUpdate(e){e.categories!==this.props.categories&&(this._updateTimer&&clearTimeout(this._updateTimer),this._updateTimer=setTimeout(()=>this.measureHiddenLabel(),50))}render(){let{graphProps:e,xBand:t,leftAxis:n,onChange:r,onChangeCategory:i,categories:a=[],top:o,defineChart:s,chartingOptions:c,changeInteractiveEnabled:l,changeEditableEnabled:u,theme:d,autoFocus:f,onAutoFocusUsed:p,error:m,showCorrectness:h}=this.props,{scale:g={},range:_={},domain:v={},size:y={}}=e||{},{height:b,width:x}=this.state,S=t&&typeof t.rangeRound==`function`&&t.rangeRound([0,y.width]),C=t&&typeof t.bandwidth==`function`&&t.bandwidth(),w=C||g.x&&g.x(v.max)/a.length,T=c5({..._,step:_.labelStep}),E=d5(d&&d.typography?d.typography.fontSize:14,b),D=x>w?25:0;return(0,F.jsxs)(N5,{children:[n&&(0,F.jsx)(Z8,{scale:g.y,tickLength:10,tickFormat:e=>e,tickValues:T,tickLabelProps:e=>({dy:4,dx:-10-(e.toLocaleString().length||1)*5})}),(0,F.jsx)($8,{scale:S,labelProps:{y:60+o},top:g.y&&g.y(_.min),textLabelProps:()=>({textAnchor:`middle`}),tickFormat:e=>e,tickComponent:n=>{let d={hiddenLabelRef:this.setHiddenLabelRef,categories:a,xBand:t,bandWidth:C,barWidth:w,rotate:E||D,top:o,defineChart:s,chartingOptions:c,autoFocus:f,onAutoFocusUsed:p,error:m,onChangeCategory:i,changeInteractiveEnabled:l,changeEditableEnabled:u,onChange:r,graphProps:e,x:n.x,y:n.y,formattedValue:n.formattedValue,showCorrectness:h};return(0,F.jsx)(L5,{...d})},autoFocus:f,onAutoFocusUsed:p})]})}},z5=({width:e,scaleValue:t,color:n})=>(0,F.jsx)(`svg`,{x:m5(e,t),y:p5(e)?.deltay,color:n,width:e,height:e,overflow:`visible`,viewBox:`0 0 ${e} ${e}`,style:{overflow:`visible !important`},children:(0,F.jsxs)(`g`,{xmlns:`http://www.w3.org/2000/svg`,fill:`currentColor`,stroke:`currentColor`,transform:`scale(${t})`,children:[(0,F.jsx)(`circle`,{cx:`28.5`,cy:`23.5`,r:`22`,fill:`white`,stroke:`currentColor`}),(0,F.jsx)(`path`,{d:`M33.5 21.25H23.4609C22.7578 21.25 22.4062 20.4297 22.9141 19.9219L27.9141 14.9219C28.2266 14.6094 28.7344 14.6094 29.0469 14.9219L34.0469 19.9219C34.5547 20.4297 34.2031 21.25 33.5 21.25Z`,fill:`currentColor`}),(0,F.jsx)(`path`,{d:`M23.5 25.75L33.5391 25.75C34.2422 25.75 34.5938 26.5703 34.0859 27.0781L29.0859 32.0781C28.7734 32.3906 28.2656 32.3906 27.9531 32.0781L22.9531 27.0781C22.4453 26.5703 22.7969 25.75 23.5 25.75Z`,fill:`currentColor`})]})});z5.propTypes={width:v.number.isRequired,scaleValue:v.number.isRequired,color:v.string};var B5=R(`svg`)(()=>({overflow:`visible !important`})),V5=R(`ellipse`)(()=>({fill:`transparent`,clipPath:`polygon(50% 0%, 100% 0%, 100% 50%, 0% 50%, 0% 0%)`})),H5=R(pR)(()=>({backgroundColor:Bl(),borderRadius:`16px`,color:V.WHITE,fontSize:`16px`,padding:`2px`,border:`4px solid ${V.WHITE}`,width:`16px`,height:`16px`,boxSizing:`unset`})),U5=R(e5)(()=>({backgroundColor:Gl(),borderRadius:`16px`,color:V.WHITE,fontSize:`16px`,padding:`2px`,border:`4px solid ${V.WHITE}`,width:`16px`,height:`16px`,boxSizing:`unset`})),W5=({x:e,y:t,width:n,graphProps:r,interactive:i,isHovered:a,correctness:o,isPlot:s,...c})=>{let{scale:l}=r,u=p5(n)?.scale;return(0,F.jsxs)(B5,{x:e,y:l.y(t)-10,width:n,overflow:`visible`,children:[a&&!o&&i&&(0,F.jsx)(z5,{width:n,scaleValue:u,color:V.BORDER_GRAY}),i&&!o&&(0,F.jsx)(V5,{cx:n/2,cy:10,rx:n/2,ry:66,...c}),(0,F.jsx)(`defs`,{children:(0,F.jsxs)(`filter`,{id:`bottomShadow`,x:`0`,y:`0`,width:`140%`,height:`140%`,children:[(0,F.jsx)(`feGaussianBlur`,{in:`SourceAlpha`,stdDeviation:`3`}),(0,F.jsx)(`feOffset`,{dx:`0`,dy:`5`,result:`offsetblur`}),(0,F.jsx)(`feFlood`,{floodColor:`#00000033`}),(0,F.jsx)(`feComposite`,{in2:`offsetblur`,operator:`in`}),(0,F.jsxs)(`feMerge`,{children:[(0,F.jsx)(`feMergeNode`,{}),(0,F.jsx)(`feMergeNode`,{in:`SourceGraphic`})]})]})}),o&&i&&!s&&(0,F.jsx)(`foreignObject`,{x:n/2-14,y:0,width:40,height:40,children:o.value===`correct`?(0,F.jsx)(H5,{title:o.label}):(0,F.jsx)(U5,{title:o.label})})]})};W5.propTypes={x:v.number.isRequired,y:v.number.isRequired,width:v.number,graphProps:x$.isRequired,interactive:v.bool,isHovered:v.bool,correctness:v.shape({value:v.string,label:v.string}),isPlot:v.bool};var G5=W5,K5=n0({axis:`y`,fromDelta:(e,t)=>(t.x=0,k$(e).add(k$(t)).y),bounds:(e,{domain:t,range:n})=>O$({left:0,top:e.y,bottom:e.y,right:0},t,n),anchorPoint:e=>({x:e.x,y:e.y})})(G5),q5=({dashColor:e})=>(0,F.jsxs)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,F.jsx)(`circle`,{cx:`12`,cy:`12`,r:`11`,fill:`white`,stroke:e||`#7E8494`,strokeWidth:`2`,strokeDasharray:`5 5`}),(0,F.jsxs)(`mask`,{id:`path-2-outside-1_3089_3799`,maskUnits:`userSpaceOnUse`,x:`2`,y:`3`,width:`19`,height:`18`,fill:`black`,children:[(0,F.jsx)(`rect`,{fill:`white`,x:`2`,y:`3`,width:`19`,height:`18`}),(0,F.jsx)(`path`,{d:`M12 20C9.125 20 6.5 18.5 5.0625 16C3.625 13.5312 3.625 10.5 5.0625 8C6.5 5.53125 9.125 4 12 4C14.8438 4 17.4688 5.53125 18.9062 8C20.3438 10.5 20.3438 13.5312 18.9062 16C17.4688 18.5 14.8438 20 12 20ZM15.5312 10.5312H15.5C15.8125 10.25 15.8125 9.78125 15.5 9.46875C15.2188 9.1875 14.75 9.1875 14.4688 9.46875L11 12.9688L9.53125 11.5C9.21875 11.1875 8.75 11.1875 8.46875 11.5C8.15625 11.7812 8.15625 12.25 8.46875 12.5312L10.4688 14.5312C10.75 14.8438 11.2188 14.8438 11.5312 14.5312L15.5312 10.5312Z`})]}),(0,F.jsx)(`path`,{d:`M12 20C9.125 20 6.5 18.5 5.0625 16C3.625 13.5312 3.625 10.5 5.0625 8C6.5 5.53125 9.125 4 12 4C14.8438 4 17.4688 5.53125 18.9062 8C20.3438 10.5 20.3438 13.5312 18.9062 16C17.4688 18.5 14.8438 20 12 20ZM15.5312 10.5312H15.5C15.8125 10.25 15.8125 9.78125 15.5 9.46875C15.2188 9.1875 14.75 9.1875 14.4688 9.46875L11 12.9688L9.53125 11.5C9.21875 11.1875 8.75 11.1875 8.46875 11.5C8.15625 11.7812 8.15625 12.25 8.46875 12.5312L10.4688 14.5312C10.75 14.8438 11.2188 14.8438 11.5312 14.5312L15.5312 10.5312Z`,fill:`#0EA449`}),(0,F.jsx)(`path`,{d:`M5.0625 16L5.92942 15.5015L5.92668 15.4968L5.0625 16ZM5.0625 8L4.19831 7.4968L4.19559 7.50153L5.0625 8ZM18.9062 8L19.7732 7.50152L19.7704 7.49681L18.9062 8ZM18.9062 16L18.0421 15.4968L18.0393 15.5015L18.9062 16ZM15.5312 10.5312L16.2384 11.2384L17.9455 9.53125H15.5312V10.5312ZM15.5 10.5312L14.831 9.78796L12.894 11.5312H15.5V10.5312ZM14.4688 9.46875L13.7616 8.76164L13.7585 8.76482L14.4688 9.46875ZM11 12.9688L10.2929 13.6759L11.0032 14.3861L11.7103 13.6727L11 12.9688ZM8.46875 11.5L9.13771 12.2433L9.17684 12.2081L9.21204 12.169L8.46875 11.5ZM8.46875 12.5312L9.17586 11.8241L9.15726 11.8055L9.13771 11.788L8.46875 12.5312ZM10.4688 14.5312L11.212 13.8623L11.1945 13.8427L11.1759 13.8241L10.4688 14.5312ZM12 20V19C9.479 19 7.18657 17.6879 5.92941 15.5015L5.0625 16L4.19559 16.4985C5.81343 19.3121 8.771 21 12 21V20ZM5.0625 16L5.92668 15.4968C4.6714 13.341 4.66824 10.6918 5.92941 8.49847L5.0625 8L4.19559 7.50153C2.58176 10.3082 2.5786 13.7215 4.19832 16.5032L5.0625 16ZM5.0625 8L5.92668 8.50319C7.18712 6.33851 9.48502 5 12 5V4V3C8.76498 3 5.81288 4.72399 4.19832 7.49681L5.0625 8ZM12 4V5C14.4816 5 16.7805 6.33661 18.0421 8.50319L18.9062 8L19.7704 7.49681C18.157 4.72589 15.2059 3 12 3V4ZM18.9062 8L18.0393 8.49847C19.3005 10.6918 19.2973 13.341 18.0421 15.4968L18.9062 16L19.7704 16.5032C21.3902 13.7215 21.387 10.3082 19.7732 7.50153L18.9062 8ZM18.9062 16L18.0393 15.5015C16.7811 17.6898 14.4876 19 12 19V20V21C15.1999 21 18.1564 19.3102 19.7732 16.4985L18.9062 16ZM15.5312 10.5312V9.53125H15.5V10.5312V11.5312H15.5312V10.5312ZM15.5 10.5312L16.169 11.2745C16.9447 10.5764 16.8883 9.44281 16.2071 8.76164L15.5 9.46875L14.7929 10.1759C14.7696 10.1525 14.7344 10.0966 14.7344 10.0117C14.7344 9.92377 14.7735 9.83972 14.831 9.78796L15.5 10.5312ZM15.5 9.46875L16.2071 8.76164C15.5353 8.08987 14.4334 8.08987 13.7616 8.76164L14.4688 9.46875L15.1759 10.1759C15.1167 10.235 15.0442 10.2578 14.9844 10.2578C14.9245 10.2578 14.8521 10.235 14.7929 10.1759L15.5 9.46875ZM14.4688 9.46875L13.7585 8.76482L10.2897 12.2648L11 12.9688L11.7103 13.6727L15.179 10.1727L14.4688 9.46875ZM11 12.9688L11.7071 12.2616L10.2384 10.7929L9.53125 11.5L8.82414 12.2071L10.2929 13.6759L11 12.9688ZM9.53125 11.5L10.2384 10.7929C9.55719 10.1117 8.42362 10.0553 7.72546 10.831L8.46875 11.5L9.21204 12.169C9.16028 12.2265 9.07623 12.2656 8.98828 12.2656C8.90344 12.2656 8.84748 12.2304 8.82414 12.2071L9.53125 11.5ZM8.46875 11.5L7.79979 10.7567C7.04591 11.4352 7.04591 12.5961 7.79979 13.2745L8.46875 12.5312L9.13771 11.788C9.19301 11.8377 9.23438 11.9208 9.23438 12.0156C9.23438 12.1105 9.19301 12.1935 9.13771 12.2433L8.46875 11.5ZM8.46875 12.5312L7.76164 13.2384L9.76164 15.2384L10.4688 14.5312L11.1759 13.8241L9.17586 11.8241L8.46875 12.5312ZM10.4688 14.5312L9.72546 15.2002C10.4236 15.976 11.5572 15.9195 12.2384 15.2384L11.5312 14.5312L10.8241 13.8241C10.8475 13.8008 10.9034 13.7656 10.9883 13.7656C11.0762 13.7656 11.1603 13.8048 11.212 13.8623L10.4688 14.5312ZM11.5312 14.5312L12.2384 15.2384L16.2384 11.2384L15.5312 10.5312L14.8241 9.82414L10.8241 13.8241L11.5312 14.5312Z`,fill:`white`,mask:`url(#path-2-outside-1_3089_3799)`})]});q5.propTypes={dashColor:v.string};var J5=Uu(`pie-lib:chart:bars`),Y5=[`#006699`,`#F59B00`,`#08916D`,`#529EE0`,`#52B7D8`,`#D9A6C2`,`#FFB03B`,`#54A77B`,`#E16032`,`#4FD2D2`,`#F0E442`,`#E287B2`],X5=[`#003754`,`#975616`,`#00503B`,`#225982`,`#1F687D`,`#825E6F`,`#996428`,`#255E44`,`#8A331F`,`#167A7A`,`#91862D`,`#894A65`],Z5=(e,t,n,r,i)=>e&&t&&i?r[n%r.length]:e&&i?Ru.ROLLOVER_FILL_BAR_COLOR:t||null,Q5=R(I6)(()=>({fill:V.TERTIARY})),$5=class extends P.Component{static propTypes={barColor:v.string,onChangeCategory:v.func,value:v.number,label:v.string,xBand:v.func,index:v.number.isRequired,graphProps:x$.isRequired,interactive:v.bool,correctness:v.shape({value:v.string,label:v.string}),correctData:v.array,defineChart:v.bool};constructor(e){super(e),this.state={dragValue:void 0,isHovered:!1},this.mouseX=0,this.mouseY=0}componentDidMount(){window.addEventListener(`mousemove`,this.handleMouseMove)}componentWillUnmount(){window.removeEventListener(`mousemove`,this.handleMouseMove)}handleMouseMove=e=>{this.mouseX=e.clientX,this.mouseY=e.clientY;let t=this.isMouseInsideSvgElement();this.setState({isHovered:t})};isMouseInsideSvgElement=()=>{let e=this.gRef.getBoundingClientRect();return this.mouseX>=e.left&&this.mouseX<=e.right&&this.mouseY>=e.top&&this.mouseY<=e.bottom};handleMouseEnter=()=>this.setState({isHovered:!0});handleMouseLeave=()=>this.setState({isHovered:!1});setDragValue=e=>this.setState({dragValue:e});dragStop=()=>{let{label:e,onChangeCategory:t}=this.props,{dragValue:n}=this.state;J5(`[dragStop]`,n),n!==void 0&&t({label:e,value:n}),this.setDragValue(void 0)};dragValue=(e,t)=>{J5(`[dragValue] next:`,t),this.setDragValue(t)};render(){let{graphProps:e,value:t,label:n,xBand:r,index:i,interactive:a,correctness:o,barColor:s,defineChart:c,correctData:l}=this.props,{scale:u,range:d}=e,{dragValue:f,isHovered:p}=this.state,m=Z5(p,s,i,X5,a&&!o),h=Number.isFinite(f)?f:t,g=r.bandwidth(),_=u.y(d.max-h),v=r(o5({label:n},i)),y=d.max-h,b=d.max-y,x=l?l.find(e=>e.label===n):null,S=a?K5:G5,C=!!s;return(0,F.jsxs)(`g`,{ref:e=>this.gRef=e,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,onTouchStart:this.handleMouseEnter,onTouchEnd:this.handleMouseLeave,children:[(0,F.jsx)(Q5,{x:v,y:u.y(b),width:g,height:_,style:{fill:m}}),o&&o.value===`incorrect`&&(()=>{let e=parseFloat(x&&x.value);if(isNaN(e))return null;let t=u.y(d.max-e),n=_,r=Math.abs(t-n),i=u.y(e),a=t>n?mu():V.WHITE,o=t>n?i:i-r;return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Q5,{x:v+2,y:o,width:g-4,height:r,style:{stroke:a,strokeWidth:2,strokeDasharray:`5,2`,fill:`none`}}),(0,F.jsx)(`foreignObject`,{x:v+g-(C?24:14),y:i-12,width:24,height:24,children:(0,F.jsx)(q5,{dashColor:a})})]})})(),(0,F.jsx)(S,{x:v,y:h,defineChart:c,interactive:a,width:g,onDrag:e=>this.dragValue(t,e),onDragStop:this.dragStop,graphProps:e,correctness:o,isHovered:p,color:m})]})}},e7=class extends P.Component{static propTypes={data:v.array,correctData:v.array,onChangeCategory:v.func,defineChart:v.bool,xBand:v.func,graphProps:x$.isRequired,histogram:v.bool};render(){let{data:e,graphProps:t,xBand:n,onChangeCategory:r,defineChart:i,histogram:a,correctData:o}=this.props;return(0,F.jsx)(N6,{children:(e||[]).map((e,s)=>(0,F.jsx)($5,{value:e.value,interactive:i||e.interactive,defineChart:i,label:e.label,xBand:n,index:s,onChangeCategory:e=>r(s,e),graphProps:t,correctness:e.correctness,correctData:o,barColor:a&&(Y5[s]?Y5[s]:Y5[s%Y5.length])},`bar-${e.label}-${e.value}-${s}`))})}},t7=class extends P.Component{static propTypes={data:v.array,onChange:v.func,graphProps:x$.isRequired};render(){let e=this.props,{data:t,graphProps:n}=e,{scale:r={},size:i={}}=n||{},a=s5(r.x,t,i.width,`bar`);return(0,F.jsx)(e7,{...e,xBand:a})}},n7=()=>({type:`bar`,Component:t7,name:`Bar`}),r7=class extends P.Component{static propTypes={data:v.array,onChange:v.func,graphProps:x$.isRequired};render(){let e=this.props,{data:t,graphProps:n}=e,{scale:r={},size:i={}}=n||{},a=s5(r.x,t,i.width,`histogram`);return(0,F.jsx)(e7,{...e,xBand:a,histogram:!0})}},i7=()=>({type:`histogram`,Component:r7,name:`Histogram`}),a7=R(`g`)(({theme:e})=>({color:`black`,"& .handle":{transition:`fill 200ms linear, height 200ms linear`,"&.non-interactive":v5(`fill`)},"& .transparentHandle":{height:`20px`,fill:`transparent`,stroke:`transparent`},"& .line":{stroke:V.TEXT,transition:`fill 200ms linear, height 200ms linear`,"&.non-interactive":v5(`stroke`)},"& .disabledPoint":{fill:V.BLACK+` !important`,stroke:V.BLACK+` !important`},"& .correctIcon":{backgroundColor:Bl()},"& .incorrectIcon":{backgroundColor:Gl()},"& .correctnessIcon":{borderRadius:e.spacing(2),color:V.WHITE,fontSize:`16px`,width:`16px`,height:`16px`,padding:`2px`,border:`1px solid ${V.WHITE}`,stroke:`initial`,boxSizing:`unset`},"& .smallIcon":{fontSize:`10px`,width:`10px`,height:`10px`}})),o7=class extends P.Component{static propTypes={x:v.number.isRequired,y:v.number.isRequired,width:v.number,graphProps:x$.isRequired,className:v.string,interactive:v.bool,CustomDraggableComponent:v.func,correctness:v.shape({value:v.string,label:v.string})};render(){let{x:e,y:t,graphProps:n,className:r,interactive:i,CustomDraggableComponent:a,correctness:o,...s}=this.props,{scale:c}=n;return a?(0,F.jsx)(a7,{children:(0,F.jsx)(a,{scale:c,x:e,y:t,className:I(r,!i&&`non-interactive`),correctness:o,interactive:i,...s})}):null}},s7=n0({axis:`y`,fromDelta:(e,t)=>(t.x=0,k$(e).add(k$(t)).y),bounds:(e,{domain:t,range:n})=>O$({left:0,top:e.y,bottom:e.y,right:0},t,n),anchorPoint:e=>({x:e.x,y:e.y})})(o7),c7=(e,t)=>{let{max:n}=t||{},r=e.length;return!n||!r?[]:e.map((e,t)=>({...e,x:r>1?t*(n/(r-1)):.5,y:e.value}))},l7=R(F6)(()=>({fill:`transparent`,stroke:V.TERTIARY,strokeWidth:3,transition:`stroke 200ms ease-in, stroke-width 200ms ease-in`})),u7=R(class extends P.Component{static propTypes={onChange:v.func,value:v.number,label:v.string,xBand:v.func,index:v.number.isRequired,graphProps:x$.isRequired,defineChart:v.bool,data:v.arrayOf(v.shape({label:v.string,value:v.number})),CustomDraggableComponent:v.func,correctData:v.array};static defaultProps={index:0};constructor(e){super(e),this.state={dragValue:void 0,line:c7(e.data,e.graphProps.domain)}}UNSAFE_componentWillReceiveProps(e){zp(this.props.data,e.data)||this.setState({line:c7(e.data,e.graphProps.domain)})}setDragValue=e=>this.setState({line:e});dragStop=e=>{let{onChange:t}=this.props;this.setState({dragging:!1},()=>{t(e,this.state.line[e])})};dragValue=(e,t,n)=>{let r=[...this.state.line];r[e].dragValue=n,this.setDragValue(r)};render(){let{graphProps:e,data:t,CustomDraggableComponent:n,defineChart:r,correctData:i}=this.props,{line:a,dragging:o}=this.state,{scale:s}=e,c=o?a:c7(t,e.domain);return(0,F.jsxs)(P.Fragment,{children:[(0,F.jsx)(l7,{data:c,x:e=>s.x(e.x),y:e=>s.y(e.dragValue===void 0?e.y:e.dragValue),className:`line`}),c&&c.map((t,a)=>{let o=r||t.interactive;return(0,F.jsx)(o?s7:o7,{x:t.x,y:t.dragValue===void 0?t.y:t.dragValue,interactive:o,r:6,onDragStart:()=>this.setState({dragging:!0}),onDrag:e=>this.dragValue(a,t.dragValue===void 0?t.y:t.dragValue,e),onDragStop:()=>this.dragStop(a),graphProps:e,CustomDraggableComponent:n,correctness:t.correctness,correctData:i,label:t.label},`point-${t.x}-${a}`)})]})}})(()=>({"& .line":{fill:`transparent`,stroke:V.TERTIARY,strokeWidth:3,transition:`stroke 200ms ease-in, stroke-width 200ms ease-in`}})),d7=class extends P.Component{static propTypes={data:v.array,onChange:v.func,xBand:v.func,graphProps:x$.isRequired,CustomDraggableComponent:v.func,defineChart:v.bool,correctData:v.array};changeLine=(e,t)=>{let{onChange:n}=this.props,r=[...this.props.data],{dragValue:i,value:a}=t;r[e].value=i>=0?i:a,n(r)};render(){let e=this.props;return(0,F.jsx)(N6,{children:(0,F.jsx)(u7,{...e,onChange:this.changeLine})})}},f7=R(`circle`)(()=>({})),p7=R(`circle`)(()=>({height:`20px`,fill:`transparent`,stroke:`none`,pointerEvents:`auto`})),m7=({scale:e,x:t,y:n,r,correctness:i,interactive:a,correctData:o,label:s,...c})=>{let[l,u]=P.useState(!1),d=!i&&a;return(0,F.jsxs)(`g`,{onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),onTouchStart:()=>u(!0),onTouchEnd:()=>u(!1),children:[(0,F.jsx)(p7,{cx:e.x(t),cy:e.y(n),r:r*3,onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),...c}),(0,F.jsx)(f7,{cx:e.x(t),cy:e.y(n),r,correctness:i,interactive:a,...c}),(0,F.jsx)(r5,{scale:e,x:t,y:n,r,correctness:i,interactive:a}),(0,F.jsx)(i5,{scale:e,x:t,r,correctness:i,correctData:o,label:s}),l&&d&&(0,F.jsx)(`rect`,{x:e.x(t)-r*2,y:e.y(n)-r*2,width:r*4,height:r*4,stroke:V.BORDER_GRAY,strokeWidth:`1`,fill:`none`})]})};m7.propTypes={scale:v.object,x:v.number,y:v.number,r:v.number,correctness:v.shape({value:v.string,label:v.string}),interactive:v.bool,correctData:v.array,label:v.string};var h7=class extends P.Component{static propTypes={data:v.array,onChange:v.func,graphProps:x$.isRequired};render(){let e=this.props,{data:t,graphProps:n}=e,{scale:r={},size:i={}}=n||{},a=s5(r.x,t,i.width,`lineDot`);return(0,F.jsx)(d7,{...e,xBand:a,CustomDraggableComponent:m7})}},g7=()=>({type:`lineDot`,Component:h7,name:`Line Dot`}),_7=R(F6)(()=>({stroke:V.TEXT,transition:`fill 200ms linear, height 200ms linear`,"&.non-interactive":{stroke:Ll?.()||`#ccc`}})),v7=R(N6)(({correctness:e,interactive:t})=>({stroke:V.TEXT,transition:`fill 200ms linear, height 200ms linear`,...e&&!t&&{fill:`${V.BLACK} !important`,stroke:`${V.BLACK} !important`},"&.non-interactive":{stroke:Ll?.()||`#ccc`}})),y7=R(`circle`)(()=>({height:`20px`,fill:`transparent`,stroke:`transparent`})),b7=e=>{let{className:t,scale:n,x:r,y:i,r:a,correctness:o,interactive:s,correctData:c,label:l,...u}=e,[d,f]=(0,P.useState)(!1),p=a*4,m=p/2,h=n.x(r),g=n.y(i);return(0,F.jsxs)(v7,{className:t,correctness:o,interactive:s,children:[(0,F.jsx)(_7,{data:[{x:n.x(r)-a,y:n.y(i)+a},{x:n.x(r)+a,y:n.y(i)-a}],x:e=>e.x,y:e=>e.y,strokeWidth:5,style:{pointerEvents:`none`}},`point-${r}-${i}-1`),(0,F.jsx)(_7,{data:[{x:n.x(r)-a,y:n.y(i)-a},{x:n.x(r)+a,y:n.y(i)+a}],x:e=>e.x,y:e=>e.y,strokeWidth:5,style:{pointerEvents:`none`}},`point-${r}-${i}-2`),d&&(0,F.jsx)(`rect`,{x:h-m,y:g-m,width:p,height:p,stroke:V.BORDER_GRAY,fill:`none`,strokeWidth:2,pointerEvents:`none`}),(0,F.jsx)(y7,{cx:h,cy:g,r:a*2,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),...u}),(0,F.jsx)(r5,{scale:n,x:r,y:i,r:a,correctness:o,interactive:s}),(0,F.jsx)(i5,{scale:n,x:r,r:a,correctness:o,correctData:c,label:l})]})};b7.propTypes={scale:v.object,x:v.number,y:v.number,r:v.number,className:v.string,correctness:v.shape({value:v.string,label:v.string}),interactive:v.bool,correctData:v.array,label:v.string};var x7=class extends P.Component{static propTypes={data:v.array,onChange:v.func,graphProps:x$.isRequired};render(){let e=this.props,{data:t,graphProps:n}=e,{scale:r={},size:i={}}=n||{},a=s5(r.x,t,i.width,`lineCross`);return(0,F.jsx)(d7,{...e,xBand:a,CustomDraggableComponent:b7})}},S7=()=>({type:`lineCross`,Component:x7,name:`Line Cross`}),C7=Uu(`pie-lib:chart:bars`),w7=16,T7=R(class extends P.Component{static propTypes={onChangeCategory:v.func,value:v.number,label:v.string,xBand:v.func,index:v.number.isRequired,graphProps:x$.isRequired,CustomBarElement:v.func,interactive:v.bool,correctness:v.shape({value:v.string,label:v.string}),defineChart:v.bool,correctData:v.arrayOf(v.shape({value:v.oneOfType([v.string,v.number]),label:v.string})),className:v.string};constructor(e){super(e),this.state={dragValue:void 0,isHovered:!1}}handleMouseEnter=()=>{this.setState({isHovered:!0})};handleMouseLeave=()=>{this.setState({isHovered:!1})};setDragValue=e=>this.setState({dragValue:e});dragStop=()=>{let{label:e,onChangeCategory:t}=this.props,{dragValue:n}=this.state;C7(`[dragStop]`,n),n!==void 0&&t({label:e,value:n}),this.setDragValue(void 0)};dragValue=(e,t)=>{C7(`[dragValue] next:`,t),this.setDragValue(t)};renderCorrectnessIcon=(e,t,n,r,i,a,o)=>{let s;if(n===0)s=i.y(0)-w7/2;else{let e=n-1;s=i.y(e)-(a-o)/2-o/2-w7/2}return(0,F.jsx)(`foreignObject`,{x:e+t/2-w7/2,y:s,width:w7,height:w7,children:(0,F.jsx)(pR,{className:`correctnessIcon correctIcon smallIcon`,title:r.label})})};render(){let{graphProps:e,value:t,label:n,xBand:r,index:i,CustomBarElement:a,interactive:o,correctness:s,defineChart:c,correctData:l,className:u}=this.props,{scale:d,range:f,size:p}=e,{max:m}=f||{},{dragValue:h,isHovered:g}=this.state,_=Number.isFinite(h)?h:t,v=r.bandwidth(),y=d.y(f.max-_),b=r(o5({label:n},i));C7(`label:`,n,`barX:`,b,`v: `,_,`barHeight:`,y,`barWidth: `,v);let x=[];for(let e=0;e<_;e++)x.push(e);let S=p.height/m,C=(S>v?v:S)*.8,w=o?K5:G5,T=o&&!s;return(0,F.jsx)(P.Fragment,{children:(0,F.jsxs)(`g`,{className:u,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,onTouchStart:this.handleMouseEnter,onTouchEnd:this.handleMouseLeave,children:[g&&T&&(0,F.jsx)(`rect`,{x:b,y:d.y(_),width:v,height:x?.length?S*x.length:0,stroke:V.BORDER_GRAY,strokeWidth:`4px`,fill:`transparent`}),x.map(e=>a({index:e,pointDiameter:C,barX:b,barWidth:v,pointHeight:S,label:n,value:t,scale:d})),s&&s.value===`incorrect`&&(()=>{let e=parseFloat(l[i]&&l[i].value);if(isNaN(e))return null;let o=_;if(e===0)return this.renderCorrectnessIcon(b,v,e,s,d,S,C);if(o>e){let o=[];for(let t=0;t<e;t++)o.push(t);let c=o[o.length-1],l=r(o5({label:n},i)),u=r.bandwidth(),f=p.height/m,h=(f>u?u:f)*.8;return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(a,{index:c,pointDiameter:h+10,barX:l,barWidth:u,pointHeight:f,label:n,value:t,scale:d,dottedOverline:!0}),this.renderCorrectnessIcon(l,u,e,s,d,f,h)]})}let c=[];for(let t=o;t<e;t++)c.push(t);return(0,F.jsxs)(F.Fragment,{children:[c.map(e=>a({index:e,pointDiameter:C,barX:b,barWidth:v,pointHeight:S,label:n,value:t,scale:d,dottedOverline:!0})),this.renderCorrectnessIcon(b,v,e,s,d,S,C)]})})(),(0,F.jsx)(w,{x:b,y:_,interactive:o,width:v,onDrag:e=>this.dragValue(t,e),onDragStop:this.dragStop,graphProps:e,correctness:s,isHovered:g,defineChart:c,color:Zl(),isPlot:!0})]})})}})(({theme:e})=>({"& .dot":{fill:Ru.PLOT_FILL_COLOR,"&.correct":y5(`stroke`),"&.incorrect":b5(`stroke`)},"& .dotColor":{fill:Ru.PLOT_FILL_COLOR,"&.correct":y5(`fill`),"&.incorrect":b5(`fill`)},"& .line":{stroke:Ru.PLOT_FILL_COLOR,"&.correct":y5(`stroke`),"&.incorrect":b5(`stroke`)},"& .correctIcon":{backgroundColor:Bl()},"& .incorrectIcon":{backgroundColor:Gl()},"& .correctnessIcon":{borderRadius:e.spacing(2),color:V.WHITE,fontSize:`16px`,width:`16px`,height:`16px`,padding:`2px`,border:`1px solid ${V.WHITE}`,stroke:`initial`,boxSizing:`unset`,display:`block`},"& .smallIcon":{fontSize:`10px`,width:`10px`,height:`10px`}})),E7=class extends P.Component{static propTypes={data:v.array,onChangeCategory:v.func,xBand:v.func,graphProps:x$.isRequired,defineChart:v.bool,CustomBarElement:v.func,correctData:v.arrayOf(v.shape({value:v.oneOfType([v.string,v.number]),label:v.string})),className:v.string};render(){let{data:e,graphProps:t,xBand:n,CustomBarElement:r,onChangeCategory:i,defineChart:a,correctData:o}=this.props;return(0,F.jsx)(N6,{children:(e||[]).map((e,s)=>(0,F.jsx)(T7,{value:e.value,label:e.label,interactive:a||e.interactive,defineChart:a,xBand:n,index:s,onChangeCategory:e=>i(s,e),graphProps:t,CustomBarElement:r,correctness:e.correctness,correctData:o},`bar-${e.label}-${e.value}-${s}`))})}},D7=R(L6)(()=>({fill:Ru.PLOT_FILL_COLOR,"&.correct":y5(`stroke`),"&.incorrect":b5(`stroke`)})),O7=e=>{let{index:t,pointDiameter:n,barX:r,barWidth:i,pointHeight:a,label:o,value:s,scale:c,dottedOverline:l}=e,u=n/2,d=r+(i-n)/2+u,f=c.y(t)-(a-n)/2-u;return l?(0,F.jsx)(L6,{cx:d,cy:f,r:u+2,strokeDasharray:`4,4`,stroke:V.BORDER_GRAY,fill:`none`},`point-${o}-${s}-${t}`):(0,F.jsx)(D7,{cx:d,cy:f,r:u},`point-${o}-${s}-${t}`)};O7.propTypes={index:v.number,pointDiameter:v.number,barX:v.number,barWidth:v.number,pointHeight:v.number,value:v.number,label:v.string,scale:v.object,dottedOverline:v.bool};var k7=class extends P.Component{static propTypes={data:v.array,onChange:v.func,graphProps:x$.isRequired};render(){let e=this.props,{data:t,graphProps:n}=e,{scale:r={},size:i={}}=n||{},a=s5(r.x,t,i.width,`dotPlot`);return(0,F.jsx)(E7,{...e,xBand:a,CustomBarElement:O7})}},A7=()=>({type:`dotPlot`,Component:k7,name:`Dot Plot`}),j7=R(F6)(()=>({stroke:Ru.PLOT_FILL_COLOR,"&.correct":y5(`stroke`),"&.incorrect":b5(`stroke`)})),M7=e=>{let{index:t,pointDiameter:n,barX:r,barWidth:i,pointHeight:a,label:o,value:s,scale:c,dottedOverline:l}=e,u=r+(i-n)/2,d=c.y(t)-(a-n)/2;return l?(0,F.jsx)(`rect`,{x:u-2,y:d-n-2,width:n+4,height:n+4,strokeDasharray:`4,4`,stroke:V.BORDER_GRAY,fill:`none`},`point-${o}-${s}-${t}`):(0,F.jsxs)(N6,{children:[(0,F.jsx)(j7,{data:[{x:u,y:d},{x:u+n,y:d-n}],className:`line`,x:e=>e.x,y:e=>e.y,strokeWidth:n/5},`point-${o}-${s}-${t}-1`),(0,F.jsx)(j7,{data:[{x:u,y:d-n},{x:u+n,y:d}],x:e=>e.x,y:e=>e.y,strokeWidth:n/5,className:`line`},`point-${o}-${s}-${t}-2`)]})};M7.propTypes={index:v.number,pointDiameter:v.number,barX:v.number,barWidth:v.number,pointHeight:v.number,value:v.number,label:v.string,scale:v.object,dottedOverline:v.bool};var N7=class extends P.Component{static propTypes={data:v.array,onChange:v.func,graphProps:x$.isRequired};render(){let e=this.props,{data:t,graphProps:n}=e,{scale:r={},size:i={}}=n||{},a=s5(r.x,t,i.width,`linePlot`);return(0,F.jsx)(E7,{...e,xBand:a,CustomBarElement:M7})}},P7={Bar:n7,Histogram:i7,LineDot:g7,DotPlot:A7,LinePlot:()=>({type:`linePlot`,Component:N7,name:`Line Plot`}),LineCross:S7},F7={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.`},mcPopulatedBlank:{answerChoices:`Answer choices`,blankLabel:`blank`,emptyBlank:`(blank)`,blankPreSelectionHint:`The answer you choose will appear on the blank line above.`,correctAnswerSelected:`Correct answer selected`,incorrectAnswerSelected:`Incorrect answer selected`,selectedAnswerImage:`Selected answer image`,choiceImage:`Choice {{id}}`,clickToEnableAutoplay:`Click to enable audio autoplay`,audioResourceUnavailable:`Audio is enabled but no playable audio URL is configured.`,listen:`Listen`,listenSilentAlt:`Repeat instructions`,listenPlayingAlt:`Instructions are playing`,printAudio:`Audio:`,printTranscript:`Transcript:`},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`},simpleCloze:{correctAnswerShown:`Correct answer`,correct:`Correct`,incorrect:`Incorrect`,unanswered:`No answer`,placeholder:`Enter your answer...`,answerInput:`Your answer`,printCorrectAnswer:`Correct answer:`,printAnswerBlank:`Answer blank`},vennClassification:{tray:`Tiles to classify`,unknownTarget:`unknown`,cancelled:`Cancelled`,returnedToTray:`{{name}} returned to tray`,placedIn:`{{name}} placed in {{target}}`,pickedUp:`Picked up {{name}}`,pickedUpWithKeyboard:`Picked up {{name}}, drop target: {{target}}. Use arrow keys to choose a drop target, Enter to drop, Escape to cancel.`,dropTarget:`Drop target: {{target}}`,unsupportedCircles_one:`This diagram cannot be shown: it has {{count}} circle, and only {{supported}} are supported.`,unsupportedCircles_other:`This diagram cannot be shown: it has {{count}} circles, and only {{supported}} are supported.`,setNumber:`Set {{number}}`,regionOnly:`{{set}} only`,regionNeither:`Neither {{first}} nor {{second}}`,regionNoneOf:`None of {{sets}}`,regionAndSeparator:` and `,tileFallbackName:`Tile`,tileNotPlaced:`not placed`,tileInRegion:`in {{region}}`,tileCorrect:`correct`,tileIncorrect:`incorrect`}},common:{undo:`Undo`,clearAll:`Clear all`,correct:`Correct`,incorrect:`Incorrect`,showCorrectAnswer:`Show correct answer`,hideCorrectAnswer:`Hide correct answer`,showTeacherInstructions:`Show Teacher Instructions`,hideTeacherInstructions:`Hide Teacher Instructions`,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`}},I7={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.`},mcPopulatedBlank:{answerChoices:`Opciones de respuesta`,blankLabel:`espacio en blanco`,emptyBlank:`(en blanco)`,blankPreSelectionHint:`La respuesta que elijas aparecerá en la línea en blanco de arriba.`,correctAnswerSelected:`Respuesta correcta seleccionada`,incorrectAnswerSelected:`Respuesta incorrecta seleccionada`,selectedAnswerImage:`Imagen de la respuesta seleccionada`,choiceImage:`Opción {{id}}`,clickToEnableAutoplay:`Haz clic para activar la reproducción automática del audio`,audioResourceUnavailable:`El audio está activado, pero no hay una URL de audio reproducible configurada.`,listen:`Escuchar`,listenSilentAlt:`Escuchar. Repetir las instrucciones.`,listenPlayingAlt:`Escuchar. Estas son las instrucciones.`,printAudio:`Audio:`,printTranscript:`Transcripción:`},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`},simpleCloze:{correctAnswerShown:`Respuesta correcta`,correct:`Correcto`,incorrect:`Incorrecto`,unanswered:`Sin respuesta`,placeholder:`Escribe tu respuesta...`,answerInput:`Tu respuesta`,printCorrectAnswer:`Respuesta correcta:`,printAnswerBlank:`Espacio para la respuesta`},vennClassification:{tray:`Fichas para clasificar`,unknownTarget:`desconocido`,cancelled:`Cancelado`,returnedToTray:`Se devolvió {{name}} a la bandeja`,placedIn:`Se colocó {{name}} en {{target}}`,pickedUp:`Se tomó {{name}}`,pickedUpWithKeyboard:`Se tomó {{name}}, destino: {{target}}. Usa las flechas para elegir un destino, Enter para soltar y Escape para cancelar.`,dropTarget:`Destino: {{target}}`,unsupportedCircles_one:`No se puede mostrar este diagrama: tiene {{count}} círculo, y solo se admiten {{supported}}.`,unsupportedCircles_other:`No se puede mostrar este diagrama: tiene {{count}} círculos, y solo se admiten {{supported}}.`,setNumber:`Conjunto {{number}}`,regionOnly:`Solo {{set}}`,regionNeither:`Ni {{first}} ni {{second}}`,regionNoneOf:`Ninguno de {{sets}}`,regionAndSeparator:` y `,tileFallbackName:`Ficha`,tileNotPlaced:`sin colocar`,tileInRegion:`en {{region}}`,tileCorrect:`correcta`,tileIncorrect:`incorrecta`}},common:{undo:`Deshacer`,clearAll:`Borrar todo`,correct:`Correcto`,incorrect:`Incorrecto`,showCorrectAnswer:`Mostrar respuesta correcta`,hideCorrectAnswer:`Ocultar respuesta correcta`,showTeacherInstructions:`Mostrar instrucciones para el maestro`,hideTeacherInstructions:`Ocultar instrucciones para el maestro`,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`}},L7=e=>typeof e==`string`,R7=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},z7=e=>e==null?``:``+e,B7=(e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})},V7=/###/g,H7=e=>e&&e.indexOf(`###`)>-1?e.replace(V7,`.`):e,U7=e=>!e||L7(e),W7=(e,t,n)=>{let r=L7(t)?t.split(`.`):t,i=0;for(;i<r.length-1;){if(U7(e))return{};let t=H7(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return U7(e)?{}:{obj:e,k:H7(r[i])}},G7=(e,t,n)=>{let{obj:r,k:i}=W7(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let a=t[t.length-1],o=t.slice(0,t.length-1),s=W7(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=W7(e,o,Object),s?.obj&&s.obj[`${s.k}.${a}`]!==void 0&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},K7=(e,t,n,r)=>{let{obj:i,k:a}=W7(e,t,Object);i[a]=i[a]||[],i[a].push(n)},q7=(e,t)=>{let{obj:n,k:r}=W7(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},J7=(e,t,n)=>{let r=q7(e,n);return r===void 0?q7(t,n):r},Y7=(e,t,n)=>{for(let r in t)r!==`__proto__`&&r!==`constructor`&&(r in e?L7(e[r])||e[r]instanceof String||L7(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):Y7(e[r],t[r],n):e[r]=t[r]);return e},X7=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`),Z7={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`,"/":`/`},Q7=e=>L7(e)?e.replace(/[&<>"'\/]/g,e=>Z7[e]):e,$7=class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(t!==void 0)return t;let 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}},e9=[` `,`,`,`?`,`!`,`;`],t9=new $7(20),n9=(e,t,n)=>{t||=``,n||=``;let r=e9.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(r.length===0)return!0;let i=t9.getRegExp(`(${r.map(e=>e===`?`?`\\?`:e).join(`|`)})`),a=!i.test(e);if(!a){let t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(a=!0)}return a},r9=(e,t,n=`.`)=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;let r=t.split(n),i=e;for(let e=0;e<r.length;){if(!i||typeof i!=`object`)return;let t,a=``;for(let o=e;o<r.length;++o)if(o!==e&&(a+=n),a+=r[o],t=i[a],t!==void 0){if([`string`,`number`,`boolean`].indexOf(typeof t)>-1&&o<r.length-1)continue;e+=o-e+1;break}i=t}return i},i9=e=>e?.replace(/_/g,`-`),a9={type:`logger`,log(e){this.output(`log`,e)},warn(e){this.output(`warn`,e)},error(e){this.output(`error`,e)},output(e,t){console?.[e]?.apply?.(console,t)}},o9=new class e{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||`i18next:`,this.logger=e||a9,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:(L7(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(t){return new e(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t||=this.options,t.prefix=t.prefix||this.prefix,new e(this.logger,t)}},s9=class{constructor(){this.observers={}}on(e,t){return e.split(` `).forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)}),this.observers[`*`]&&Array.from(this.observers[`*`].entries()).forEach(([n,r])=>{for(let i=0;i<r;i++)n.apply(n,[e,...t])})}},c9=class extends s9{constructor(e,t={ns:[`translation`],defaultNS:`translation`}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){let i=r.keySeparator===void 0?this.options.keySeparator:r.keySeparator,a=r.ignoreJSONStructure===void 0?this.options.ignoreJSONStructure:r.ignoreJSONStructure,o;e.indexOf(`.`)>-1?o=e.split(`.`):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):L7(n)&&i?o.push(...n.split(i)):o.push(n)));let s=q7(this.data,o);return!s&&!t&&!n&&e.indexOf(`.`)>-1&&(e=o[0],t=o[1],n=o.slice(2).join(`.`)),s||!a||!L7(n)?s:r9(this.data?.[e]?.[t],n,i)}addResource(e,t,n,r,i={silent:!1}){let a=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,o=[e,t];n&&(o=o.concat(a?n.split(a):n)),e.indexOf(`.`)>-1&&(o=e.split(`.`),r=t,t=o[1]),this.addNamespaces(t),G7(this.data,o,r),i.silent||this.emit(`added`,e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(let r in n)(L7(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,i,a={silent:!1,skipCopy:!1}){let o=[e,t];e.indexOf(`.`)>-1&&(o=e.split(`.`),r=n,n=t,t=o[1]),this.addNamespaces(t);let s=q7(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?Y7(s,n,i):s={...s,...n},G7(this.data,o,s),a.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 this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||=this.options.defaultNS,this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}},l9={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(e=>{t=this.processors[e]?.process(t,n,r,i)??t}),t}},u9=Symbol(`i18next/PATH_KEY`);function d9(){let e=[],t=Object.create(null),n;return t.get=(r,i)=>(n?.revoke?.(),i===u9?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function f9(e,t){let{[u9]:n}=e(d9()),r=t?.keySeparator??`.`,i=t?.nsSeparator??`:`;if(n.length>1&&i){let e=t?.ns,a=Array.isArray(e)?e:null;if(a&&a.length>1&&a.slice(1).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(r)}`}return n.join(r)}var p9={},m9=e=>!L7(e)&&typeof e!=`boolean`&&typeof e!=`number`,h9=class e extends s9{constructor(e,t={}){super(),B7([`resourceStore`,`languageUtils`,`pluralResolver`,`interpolator`,`backendConnector`,`i18nFormat`,`utils`],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.logger=o9.create(`translator`)}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let n={...t};if(e==null)return!1;let r=this.resolve(e,n);if(r?.res===void 0)return!1;let i=m9(r.res);return!(n.returnObjects===!1&&i)}extractFromKey(e,t){let n=t.nsSeparator===void 0?this.options.nsSeparator:t.nsSeparator;n===void 0&&(n=`:`);let r=t.keySeparator===void 0?this.options.keySeparator:t.keySeparator,i=t.ns||this.options.defaultNS||[],a=n&&e.indexOf(n)>-1,o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!n9(e,n,r);if(a&&!o){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:L7(i)?[i]:i};let a=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(a[0])>-1)&&(i=a.shift()),e=a.join(r)}return{key:e,namespaces:L7(i)?[i]:i}}translate(t,n,r){let i=typeof n==`object`?{...n}:n;if(typeof i!=`object`&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i==`object`&&(i={...i}),i||={},t==null)return``;typeof t==`function`&&(t=f9(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]),t=t.map(e=>typeof e==`function`?f9(e,{...this.options,...i}):String(e));let a=i.returnDetails===void 0?this.options.returnDetails:i.returnDetails,o=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,{key:s,namespaces:c}=this.extractFromKey(t[t.length-1],i),l=c[c.length-1],u=i.nsSeparator===void 0?this.options.nsSeparator:i.nsSeparator;u===void 0&&(u=`:`);let d=i.lng||this.language,f=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d?.toLowerCase()===`cimode`)return f?a?{res:`${l}${u}${s}`,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:`${l}${u}${s}`:a?{res:s,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:s;let p=this.resolve(t,i),m=p?.res,h=p?.usedKey||s,g=p?.exactUsedKey||s,_=[`[object Number]`,`[object Function]`,`[object RegExp]`],v=i.joinArrays===void 0?this.options.joinArrays:i.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,b=i.count!==void 0&&!L7(i.count),x=e.hasDefaultValue(i),S=b?this.pluralResolver.getSuffix(d,i.count,i):``,C=i.ordinal&&b?this.pluralResolver.getSuffix(d,i.count,{ordinal:!1}):``,w=b&&!i.ordinal&&i.count===0,T=w&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${S}`]||i[`defaultValue${C}`]||i.defaultValue,E=m;y&&!m&&x&&(E=T);let D=m9(E),O=Object.prototype.toString.apply(E);if(y&&E&&D&&_.indexOf(O)<0&&!(L7(v)&&Array.isArray(E))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,E,{...i,ns:c}):`key '${s} (${this.language})' returned an object instead of string.`;return a?(p.res=e,p.usedParams=this.getUsedParamsDetails(i),p):e}if(o){let e=Array.isArray(E),t=e?[]:{},n=e?g:h;for(let e in E)if(Object.prototype.hasOwnProperty.call(E,e)){let r=`${n}${o}${e}`;x&&!m?t[e]=this.translate(r,{...i,defaultValue:m9(T)?T[e]:void 0,joinArrays:!1,ns:c}):t[e]=this.translate(r,{...i,joinArrays:!1,ns:c}),t[e]===r&&(t[e]=E[e])}m=t}}else if(y&&L7(v)&&Array.isArray(m))m=m.join(v),m&&=this.extendTranslation(m,t,i,r);else{let e=!1,n=!1;!this.isValidLookup(m)&&x&&(e=!0,m=T),this.isValidLookup(m)||(n=!0,m=s);let a=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:m,c=x&&T!==m&&this.options.updateMissing;if(n||e||c){if(this.logger.log(c?`updateKey`:`missingKey`,d,l,s,c?T:m),o){let e=this.resolve(s,{...i,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=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo===`fallback`&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else this.options.saveMissingTo===`all`?e=this.languageUtils.toResolveHierarchy(i.lng||this.language):e.push(i.lng||this.language);let n=(e,t,n)=>{let r=x&&n!==m?n:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,r,c,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,r,c,i),this.emit(`missingKey`,e,l,t,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,i);w&&i[`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,i[`defaultValue${t}`]||T)})}):n(e,s,T))}m=this.extendTranslation(m,t,i,p,r),n&&m===s&&this.options.appendNamespaceToMissingKey&&(m=`${l}${u}${s}`),(n||e)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${s}`:s,e?m:void 0,i))}return a?(p.res=m,p.usedParams=this.getUsedParamsDetails(i),p):m}extendTranslation(e,t,n,r,i){if(this.i18nFormat?.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}});let a=L7(e)&&(n?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:n.interpolation.skipOnVariables),o;if(a){let t=e.match(this.interpolator.nestingRegexp);o=t&&t.length}let s=n.replace&&!L7(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||r.usedLng,n),a){let t=e.match(this.interpolator.nestingRegexp),r=t&&t.length;o<r&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...e)=>i?.[0]===e[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null):this.translate(...e,t),n)),n.interpolation&&this.interpolator.reset()}let a=n.postProcess||this.options.postProcess,o=L7(a)?[a]:a;return e!=null&&o?.length&&n.applyPostProcessor!==!1&&(e=l9.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,i,a,o;return L7(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>typeof e==`function`?f9(e,{...this.options,...t}):e)),e.forEach(e=>{if(this.isValidLookup(n))return;let s=this.extractFromKey(e,t),c=s.key;r=c;let l=s.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));let u=t.count!==void 0&&!L7(t.count),d=u&&!t.ordinal&&t.count===0,f=t.context!==void 0&&(L7(t.context)||typeof t.context==`number`)&&t.context!==``,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);l.forEach(e=>{this.isValidLookup(n)||(o=e,!p9[`${p[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&(p9[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${p.join(`, `)}" won't get resolved as namespace "${o}" 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!!!`)),p.forEach(r=>{if(this.isValidLookup(n))return;a=r;let o=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(o,c,r,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(r,t.count,t));let n=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(t.ordinal&&e.indexOf(i)===0&&o.push(c+e.replace(i,this.options.pluralSeparator)),o.push(c+e),d&&o.push(c+n)),f){let r=`${c}${this.options.contextSeparator||`_`}${t.context}`;o.push(r),u&&(t.ordinal&&e.indexOf(i)===0&&o.push(r+e.replace(i,this.options.pluralSeparator)),o.push(r+e),d&&o.push(r+n))}}let s;for(;s=o.pop();)this.isValidLookup(n)||(i=s,n=this.getResource(r,e,s,t))}))})}),{res:n,usedKey:r,exactUsedKey:i,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e===``)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){let t=[`defaultValue`,`ordinal`,`context`,`replace`,`lng`,`lngs`,`fallbackLng`,`ns`,`keySeparator`,`nsSeparator`,`returnObjects`,`returnDetails`,`joinArrays`,`postProcess`,`interpolation`],n=e.replace&&!L7(e.replace),r=n?e.replace:e;if(n&&e.count!==void 0&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(let e of t)delete r[e]}return r}static hasDefaultValue(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.substring(0,12)===`defaultValue`&&e[t]!==void 0)return!0;return!1}},g9=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=o9.create(`languageUtils`)}getScriptPartFromCode(e){if(e=i9(e),!e||e.indexOf(`-`)<0)return null;let t=e.split(`-`);return t.length===2||(t.pop(),t[t.length-1].toLowerCase()===`x`)?null:this.formatLanguageCode(t.join(`-`))}getLanguagePartFromCode(e){if(e=i9(e),!e||e.indexOf(`-`)<0)return e;let t=e.split(`-`);return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(L7(e)&&e.indexOf(`-`)>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}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(this.options.load===`languageOnly`||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;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;let r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>{if(e===r||!(e.indexOf(`-`)<0&&r.indexOf(`-`)<0)&&(e.indexOf(`-`)>0&&r.indexOf(`-`)<0&&e.substring(0,e.indexOf(`-`))===r||e.indexOf(r)===0&&r.length>1))return e})}),t||=this.getFallbackCodes(this.options.fallbackLng)[0],t}getFallbackCodes(e,t){if(!e)return[];if(typeof e==`function`&&(e=e(t)),L7(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||=e[this.getScriptPartFromCode(t)],n||=e[this.formatLanguageCode(t)],n||=e[this.getLanguagePartFromCode(t)],n||=e.default,n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),r=[],i=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return L7(e)&&(e.indexOf(`-`)>-1||e.indexOf(`_`)>-1)?(this.options.load!==`languageOnly`&&i(this.formatLanguageCode(e)),this.options.load!==`languageOnly`&&this.options.load!==`currentOnly`&&i(this.getScriptPartFromCode(e)),this.options.load!==`currentOnly`&&i(this.getLanguagePartFromCode(e))):L7(e)&&i(this.formatLanguageCode(e)),n.forEach(e=>{r.indexOf(e)<0&&i(this.formatLanguageCode(e))}),r}},_9={zero:0,one:1,two:2,few:3,many:4,other:5},v9={select:e=>e===1?`one`:`other`,resolvedOptions:()=>({pluralCategories:[`one`,`other`]})},y9=class{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=o9.create(`pluralResolver`),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n=i9(e===`dev`?`en`:e),r=t.ordinal?`ordinal`:`cardinal`,i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(n,{type:r})}catch{if(typeof Intl>`u`)return this.logger.error(`No Intl support, please use an Intl polyfill!`),v9;if(!e.match(/-|_/))return v9;let n=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(n,t)}return this.pluralRulesCache[i]=a,a}needsPlural(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?.resolvedOptions().pluralCategories.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||=this.getRule(`dev`,t),n?n.resolvedOptions().pluralCategories.sort((e,t)=>_9[e]-_9[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:``}${e}`):[]}getSuffix(e,t,n={}){let 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))}},b9=(e,t,n,r=`.`,i=!0)=>{let a=J7(e,t,n);return!a&&i&&L7(n)&&(a=r9(e,n,r),a===void 0&&(a=r9(t,n,r))),a},x9=e=>e.replace(/\$/g,`$$$$`),S9=class{constructor(e={}){this.logger=o9.create(`interpolator`),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||={escapeValue:!0};let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:a,suffix:o,suffixEscaped:s,formatSeparator:c,unescapeSuffix:l,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:m,nestingOptionsSeparator:h,maxReplaces:g,alwaysFormat:_}=e.interpolation;this.escape=t===void 0?Q7:t,this.escapeValue=n===void 0||n,this.useRawValueToEscape=r!==void 0&&r,this.prefix=i?X7(i):a||`{{`,this.suffix=o?X7(o):s||`}}`,this.formatSeparator=c||`,`,this.unescapePrefix=l?``:u||`-`,this.unescapeSuffix=this.unescapePrefix?``:l||``,this.nestingPrefix=d?X7(d):f||X7(`$t(`),this.nestingSuffix=p?X7(p):m||X7(`)`),this.nestingOptionsSeparator=h||`,`,this.maxReplaces=g||1e3,this.alwaysFormat=_!==void 0&&_,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>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 i,a,o,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(e.indexOf(this.formatSeparator)<0){let i=b9(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...r,...t,interpolationkey:e}):i}let i=e.split(this.formatSeparator),a=i.shift().trim(),o=i.join(this.formatSeparator).trim();return this.format(b9(t,s,a,this.options.keySeparator,this.options.ignoreJSONStructure),o,n,{...r,...t,interpolationkey:a})};this.resetRegExp();let l=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=r?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:r.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>x9(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?x9(this.escape(e)):x9(e)}].forEach(t=>{for(o=0;i=t.regex.exec(e);){let n=i[1].trim();if(a=c(n),a===void 0)if(typeof l==`function`){let t=l(e,i,r);a=L7(t)?t:``}else if(r&&Object.prototype.hasOwnProperty.call(r,n))a=``;else if(u){a=i[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),a=``;else!L7(a)&&!this.useRawValueToEscape&&(a=z7(a));let s=t.safeValue(a);if(e=e.replace(i[0],s),u?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,i,a,o=(e,t)=>{let n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;let r=e.split(RegExp(`${X7(n)}[ ]*{`)),i=`{${r[1]}`;e=r[0],i=this.interpolate(i,a);let o=i.match(/'/g),s=i.match(/"/g);((o?.length??0)%2==0&&!s||(s?.length??0)%2!=0)&&(i=i.replace(/'/g,`"`));try{a=JSON.parse(i),t&&(a={...t,...a})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];a={...n},a=a.replace&&!L7(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=/{.*}/.test(r[1])?r[1].lastIndexOf(`}`)+1:r[1].indexOf(this.formatSeparator);if(c!==-1&&(s=r[1].slice(c).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,c)),i=t(o.call(this,r[1].trim(),a),a),i&&r[0]===e&&!L7(i))return i;L7(i)||(i=z7(i)),i||=(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),``),s.length&&(i=s.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),i.trim())),e=e.replace(r[0],i),this.regexp.lastIndex=0}return e}},Fee=e=>{let t=e.toLowerCase().trim(),n={};if(e.indexOf(`(`)>-1){let r=e.split(`(`);t=r[0].toLowerCase().trim();let i=r[1].substring(0,r[1].length-1);t===`currency`&&i.indexOf(`:`)<0?n.currency||=i.trim():t===`relativetime`&&i.indexOf(`:`)<0?n.range||=i.trim():i.split(`;`).forEach(e=>{if(e){let[t,...r]=e.split(`:`),i=r.join(`:`).trim().replace(/^'+|'+$/g,``),a=t.trim();n[a]||(n[a]=i),i===`false`&&(n[a]=!1),i===`true`&&(n[a]=!0),isNaN(i)||(n[a]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}},C9=e=>{let t={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});let o=r+JSON.stringify(a),s=t[o];return s||(s=e(i9(r),i),t[o]=s),s(n)}},Iee=e=>(t,n,r)=>e(i9(n),r)(t),Lee=class{constructor(e={}){this.logger=o9.create(`formatter`),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||`,`;let n=t.cacheInBuiltFormats?C9:Iee;this.formats={number:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:`currency`});return e=>n.format(e)}),datetime:n((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||`day`)}),list:n((e,t)=>{let 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()]=C9(t)}format(e,t,n,r={}){let i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf(`(`)>1&&i[0].indexOf(`)`)<0&&i.find(e=>e.indexOf(`)`)>-1)){let e=i.findIndex(e=>e.indexOf(`)`)>-1);i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}return i.reduce((e,t)=>{let{formatName:i,formatOptions:a}=Fee(t);if(this.formats[i]){let t=e;try{let o=r?.formatParams?.[r.interpolationkey]||{},s=o.locale||o.lng||r.locale||r.lng||n;t=this.formats[i](e,s,{...a,...r,...o})}catch(e){this.logger.warn(e)}return t}else this.logger.warn(`there was no format function for ${i}`);return e},e)}},Ree=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},zee=class extends s9{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=o9.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=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){let i={},a={},o={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(this.state[o]===1?a[o]===void 0&&(a[o]=!0):(this.state[o]=1,r=!1,a[o]===void 0&&(a[o]=!0),i[o]===void 0&&(i[o]=!0),s[t]===void 0&&(s[t]=!0)))}),r||(o[e]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split(`|`),i=r[0],a=r[1];t&&this.emit(`failedLoading`,i,a,t),!t&&n&&this.store.addResourceBundle(i,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let o={};this.queue.forEach(n=>{K7(n.loaded,[i],a),Ree(n,e),t&&n.errors.push(t),n.pendingCount===0&&!n.done&&(Object.keys(n.loaded).forEach(e=>{o[e]||(o[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{o[e][t]===void 0&&(o[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit(`loaded`,o),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,i=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:a});return}this.readingCalls++;let o=(o,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}if(o&&s&&r<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,n,r+1,i*2,a)},i);return}a(o,s)},s=this.backend[n].bind(this.backend);if(s.length===2){try{let n=s(e,t);n&&typeof n.then==`function`?n.then(e=>o(null,e)).catch(o):o(null,n)}catch(e){o(e)}return}return s(e,t,o)}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();L7(e)&&(e=this.languageUtils.toResolveHierarchy(e)),L7(t)&&(t=[t]);let i=this.queueLoad(e,t,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.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=``){let n=e.split(`|`),r=n[0],i=n[1];this.read(r,i,`read`,void 0,void 0,(n,a)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,a),this.loaded(e,n,a)})}saveMissing(e,t,n,r,i,a={},o=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){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!!!`);return}if(!(n==null||n===``)){if(this.backend?.create){let s={...a,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let i;i=c.length===5?c(e,t,n,r,s):c(e,t,n,r),i&&typeof i.then==`function`?i.then(e=>o(null,e)).catch(o):o(null,i)}catch(e){o(e)}else c(e,t,n,r,o,s)}!e||!e[0]||this.store.addResource(e[0],t,n,r)}}},w9=()=>({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(typeof e[1]==`object`&&(t=e[1]),L7(e[1])&&(t.defaultValue=e[1]),L7(e[2])&&(t.tDescription=e[2]),typeof e[2]==`object`||typeof e[3]==`object`){let 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}),T9=e=>(L7(e.ns)&&(e.ns=[e.ns]),L7(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),L7(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.(`cimode`)<0&&(e.supportedLngs=e.supportedLngs.concat([`cimode`])),typeof e.initImmediate==`boolean`&&(e.initAsync=e.initImmediate),e),E9=()=>{},Bee=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]==`function`&&(e[t]=e[t].bind(e))})},D9=`__i18next_supportNoticeShown`,Vee=()=>!!(typeof globalThis<`u`&&globalThis[D9]||typeof process<`u`&&process.env&&process.env.I18NEXT_NO_SUPPORT_NOTICE||typeof process<`u`&&process.env),Hee=()=>{typeof globalThis<`u`&&(globalThis[D9]=!0)},Uee=e=>!!(e?.modules?.backend?.name?.indexOf(`Locize`)>0||e?.modules?.backend?.constructor?.name?.indexOf(`Locize`)>0||e?.options?.backend?.backends&&e.options.backend.backends.some(e=>e?.name?.indexOf(`Locize`)>0||e?.constructor?.name?.indexOf(`Locize`)>0)||e?.options?.backend?.projectId||e?.options?.backend?.backendOptions&&e.options.backend.backendOptions.some(e=>e?.projectId)),O9=class e extends s9{constructor(e={},t){if(super(),this.options=T9(e),this.services={},this.logger=o9,this.modules={external:[]},Bee(this),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,typeof e==`function`&&(t=e,e={}),e.defaultNS==null&&e.ns&&(L7(e.ns)?e.defaultNS=e.ns:e.ns.indexOf(`translation`)<0&&(e.defaultNS=e.ns[0]));let n=w9();this.options={...n,...this.options,...T9(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!=`function`&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!Uee(this)&&!Vee()&&(typeof console<`u`&&console.info!==void 0&&console.info(`🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙`),Hee());let r=e=>e?typeof e==`function`?new e:e:null;if(!this.options.isClone){this.modules.logger?o9.init(r(this.modules.logger),this.options):o9.init(null,this.options);let e;e=this.modules.formatter?this.modules.formatter:Lee;let t=new g9(this.options);this.store=new c9(this.options.resources,this.options);let i=this.services;i.logger=o9,i.resourceStore=this.store,i.languageUtils=t,i.pluralResolver=new y9(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)&&(i.formatter=r(e),i.formatter.init&&i.formatter.init(i,this.options),this.options.interpolation.format=i.formatter.format.bind(i.formatter)),i.interpolator=new S9(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new zee(r(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(i.languageDetector=r(this.modules.languageDetector),i.languageDetector.init&&i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=r(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new h9(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||=E9,this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&e[0]!==`dev`&&(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)});let i=R7(),a=()=>{let e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn(`init: i18next is already initialized. You should call init just once!`),this.isInitialized=!0,this.options.isClone||this.logger.log(`initialized`,this.options),this.emit(`initialized`,this.options),i.resolve(n),t(e,n)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),i}loadResources(e,t=E9){let n=t,r=L7(e)?e:this.language;if(typeof e==`function`&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r?.toLowerCase()===`cimode`&&(!this.options.preload||this.options.preload.length===0))return n();let e=[],t=t=>{t&&t!==`cimode`&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{t!==`cimode`&&e.indexOf(t)<0&&e.push(t)})};r?t(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(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){let r=R7();return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=void 0),e||=this.languages,t||=this.options.ns,n||=E9,this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);if(!e.type)throw Error(`You are passing a wrong module! Please check the object you are passing to i18next.use()`);return e.type===`backend`&&(this.modules.backend=e),(e.type===`logger`||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type===`languageDetector`&&(this.modules.languageDetector=e),e.type===`i18nFormat`&&(this.modules.i18nFormat=e),e.type===`postProcessor`&&l9.addPostProcessor(e),e.type===`formatter`&&(this.modules.formatter=e),e.type===`3rdParty`&&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++){let 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;let n=R7();this.emit(`languageChanging`,e);let r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(i,a)=>{a?this.isLanguageChangingTo===e&&(r(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit(`languageChanged`,a),this.logger.log(`languageChanged`,a)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(i,(...e)=>this.t(...e))},a=t=>{!e&&!t&&this.services.languageDetector&&(t=[]);let n=L7(t)?t:t&&t[0],a=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(L7(t)?[t]:t);a&&(this.language||r(a),this.translator.language||this.translator.changeLanguage(a),this.services.languageDetector?.cacheUserLanguage?.(a)),this.loadResources(a,e=>{i(e,a)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),n}getFixedT(e,t,n){let r=(e,t,...i)=>{let a;a=typeof t==`object`?{...t}:this.options.overloadTranslationOptionHandler([e,t].concat(i)),a.lng=a.lng||r.lng,a.lngs=a.lngs||r.lngs,a.ns=a.ns||r.ns,a.keyPrefix!==``&&(a.keyPrefix=a.keyPrefix||n||r.keyPrefix);let o={...this.options,...a};typeof a.keyPrefix==`function`&&(a.keyPrefix=f9(a.keyPrefix,o));let s=this.options.keySeparator||`.`,c;return a.keyPrefix&&Array.isArray(e)?c=e.map(e=>(typeof e==`function`&&(e=f9(e,o)),`${a.keyPrefix}${s}${e}`)):(typeof e==`function`&&(e=f9(e,o)),c=a.keyPrefix?`${a.keyPrefix}${s}${e}`:e),this.t(c,a)};return L7(e)?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=n,r}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...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;let n=t.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(n.toLowerCase()===`cimode`)return!0;let a=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return n===-1||n===0||n===2};if(t.precheck){let e=t.precheck(this,a);if(e!==void 0)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(n,e)&&(!r||a(i,e)))}loadNamespaces(e,t){let n=R7();return this.options.ns?(L7(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){let n=R7();L7(e)&&(e=[e]);let r=this.options.preload||[],i=e.filter(e=>r.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=r.concat(i),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language),!e)return`rtl`;try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch{}let t=`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`.split(`.`),n=this.services?.languageUtils||new g9(w9());return e.toLowerCase().indexOf(`-latn`)>1?`ltr`:t.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf(`-arab`)>1?`rtl`:`ltr`}static createInstance(t={},n){let r=new e(t,n);return r.createInstance=e.createInstance,r}cloneInstance(t={},n=E9){let r=t.forkResourceStore;r&&delete t.forkResourceStore;let i={...this.options,...t,isClone:!0},a=new e(i);if((t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),[`store`,`services`,`language`].forEach(e=>{a[e]=this[e]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new c9(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),{}),i),a.services.resourceStore=a.store),t.interpolation){let e={...w9().interpolation,...this.options.interpolation,...t.interpolation},n={...i,interpolation:e};a.services.interpolator=new S9(n)}return a.translator=new h9(a.services,i),a.translator.on(`*`,(e,...t)=>{a.emit(e,...t)}),a.init(i,n),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}.createInstance();O9.createInstance,O9.dir,O9.init,O9.loadResources,O9.reloadResources,O9.use,O9.changeLanguage,O9.getFixedT,O9.t,O9.exists,O9.setDefaultNamespace,O9.hasLoadedNamespace,O9.loadNamespaces,O9.loadLanguages,O9.init({fallbackLng:`en`,lng:`en`,showSupportNotice:!1,resources:{en:F7,es:I7}});var k9={translator:{...O9,t:(e,t)=>{let{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`;break;default:break}return O9.t(e,{lng:n,...t})}},languageOptions:[{value:`en_US`,label:`English (US)`},{value:`es_ES`,label:`Spanish`}]},{translator:A9}=k9,Wee=R(`div`)(()=>({alignSelf:`flex-end`})),Gee=R(`div`)(({theme:e})=>({cursor:`pointer`,fontSize:e.typography.fontSize,color:lu(),padding:e.spacing(1)})),Kee=R(cl)(({theme:e})=>({padding:e.spacing(1),display:`flex`,flexDirection:`column`,gap:e.spacing(1),"& button":{textTransform:`none`,fontSize:e.typography.fontSize,color:Il(),justifyContent:`flex-start`}})),qee=class extends P.Component{constructor(e){super(e),this.state={actionsAnchorEl:null}}componentWillUnmount(){this.setState({actionsAnchorEl:null})}static propTypes={addCategory:v.func.isRequired,deleteCategory:v.func.isRequired,language:v.string,categories:v.array};handleActionsClick=e=>{this.setState({actionsAnchorEl:e.currentTarget})};handleActionsClose=()=>{this.setState({actionsAnchorEl:null})};handleAddCategory=()=>{let{addCategory:e}=this.props;e(),this.handleActionsClose()};handleDeleteCategory=e=>{let{deleteCategory:t}=this.props;t(e),this.handleActionsClose()};render(){let{categories:e,language:t}=this.props,{actionsAnchorEl:n}=this.state;return(0,F.jsxs)(Wee,{children:[(0,F.jsx)(Gee,{role:`button`,tabIndex:0,onClick:this.handleActionsClick,children:`Actions`}),(0,F.jsx)(Al,{open:!!n,anchorEl:n,onClose:this.handleActionsClose,anchorOrigin:{vertical:`bottom`,horizontal:`left`},transformOrigin:{vertical:`top`,horizontal:`left`},children:(0,F.jsxs)(Kee,{children:[(0,F.jsxs)(ff,{onClick:()=>this.handleAddCategory(),children:[`+ `,A9.t(`charting.add`,{lng:t})]}),e.length>0&&e.map((e,n)=>e.deletable&&!e.correctness&&(0,F.jsx)(ff,{onClick:()=>this.handleDeleteCategory(n),children:`${A9.t(`charting.delete`,{lng:t})} <${e.label||A9.t(`charting.newLabel`,{lng:t})}>`},n))]})},`actions-popover-${Math.random()}`)]})}},{translator:j9}=k9,Jee=Uu(`pie-lib:charts:chart`),Yee=R(`div`)(()=>({width:`min-content`})),Xee=class extends P.Component{constructor(e){super(e),this.state={dialog:{open:!1},actionsAnchorEl:null},this.maskUid=this.generateMaskId()}static propTypes={className:v.string,chartType:v.string.isRequired,size:v.shape({width:v.number,height:v.number}),domain:v.shape({label:v.string,min:v.number,max:v.number,axisLabel:v.string}),data:v.arrayOf(v.shape({label:v.string,value:v.number})),range:v.shape({label:v.string,min:v.number,max:v.number,step:v.number,labelStep:v.number,axisLabel:v.string}),charts:v.array,labelsPlaceholders:v.object,title:v.string,titlePlaceholder:v.string,onDataChange:v.func,onChangeLabels:v.func,onChangeTitle:v.func,error:v.any,addCategoryEnabled:v.bool,showPixelGuides:v.bool,categoryDefaultLabel:v.string,categoryDefaults:v.object,defineChart:v.bool,theme:v.object,chartingOptions:v.object,changeInteractiveEnabled:v.bool,changeEditableEnabled:v.bool,language:v.string,mathMlOptions:v.object,labelsCharactersLimit:v.number,correctData:v.arrayOf(v.shape({label:v.string,value:v.number}))};static defaultProps={size:{width:480,height:480}};state={charts:[P7.Bar(),P7.Histogram(),P7.LineDot(),P7.LineCross(),P7.DotPlot(),P7.LinePlot()],autoFocus:!1};generateMaskId(){return`chart-`+(Math.random()*1e4).toFixed()}handleAlertDialog=(e,t)=>this.setState({dialog:{open:e}},t);getChart=()=>{let e=this.props.charts||this.state.charts,{chartType:t}=this.props,n=null,r=null;return t?(r=e&&e.find(e=>e.type===t),n=r&&r.Component):(r=e&&e[0],n=r&&r.Component,t=r&&r.type),{type:t,ChartComponent:n}};changeData=e=>{let{onDataChange:t}=this.props;t(e)};changeCategory=(e,t)=>{let n=parseInt(e,10);if(n>=0){let{data:e,onDataChange:r}=this.props;e[n]={...e[n],...t},r(e)}};addCategory=()=>{let{onDataChange:e,data:t,categoryDefaultLabel:n,defineChart:r,categoryDefaults:i,language:a}=this.props;(t||[]).length>19?this.setState({dialog:{open:!0,title:j9.t(`common:warning`,{lng:a}),text:j9.t(`charting.reachedLimit_other`,{count:20,lng:a}),onConfirm:()=>this.handleAlertDialog(!1)}}):(this.setState({autoFocus:!0}),e([...t,{inDefineChart:r,label:n||j9.t(`charting.newLabel`,{lng:a}),value:0,deletable:!0,editable:!i||i?.editable,interactive:!i||i?.interactive}]))};deleteCategory=e=>{let{data:t,onDataChange:n}=this.props;typeof e!=`number`||e<0||t&&t.length>0&&n(t.filter((t,n)=>n!==e))};getFilteredCategories=()=>{let{data:e,defineChart:t}=this.props;return e?e.map(e=>({...e,deletable:t||e.deletable})):[]};resetAutoFocus=()=>{this.setState({autoFocus:!1})};render(){let{domain:e={},range:t={},chartingOptions:n,size:r,title:i,onChangeTitle:a,onChangeLabels:o,labelsPlaceholders:s,titlePlaceholder:c,addCategoryEnabled:l,changeInteractiveEnabled:u,changeEditableEnabled:d,showPixelGuides:f,error:p,mathMlOptions:m={},language:h,labelsCharactersLimit:g,correctData:_}=this.props,{chartType:v}=this.props,{dialog:y}=this.state,b=this.props.defineChart||!1,{width:x,height:S}=r||{},C={left:t?.label||``,bottom:e?.label||``},{ChartComponent:w}=this.getChart(),T=this.getFilteredCategories(),E=l5(e,t,v),{verticalLines:D,horizontalLines:O,leftAxis:k}=u5(E.range,v),A={graphProps:H3(E.domain,E.range,r,()=>this.rootNode)};Jee(`[render] common:`,A);let j={x:-10,y:-75,width:x+20,height:S+130},{scale:M}=A.graphProps,ee=s5(M.x,T,x,v),N=ee.bandwidth()||M.x(E.domain.max)/T.length,te=b?160:60,ne=f5(N),re=Mp(A);return re.graphProps.size.height+=ne+te,(v===`dotPlot`||v===`linePlot`)&&_?.length&&C.bottom&&(re.graphProps.size.height+=25),(0,F.jsxs)(Yee,{children:[(0,F.jsxs)(c1,{title:i,onChangeTitle:a,disabledTitle:!b,showTitle:!0,showLabels:!0,labels:C,onChangeLabels:o,labelsPlaceholders:s,titlePlaceholder:c,defineChart:b,disabledLabels:!b,isChart:!0,showPixelGuides:f,rootRef:e=>this.rootNode=e,mathMlOptions:m,labelsCharactersLimit:g,...re,children:[(0,F.jsx)(b8,{...A,xBand:ee,rowTickValues:O,columnTickValues:D}),(0,F.jsx)(R5,{autoFocus:this.state.autoFocus,onAutoFocusUsed:this.resetAutoFocus,...A,defineChart:b,categories:T,xBand:ee,leftAxis:k,onChange:this.changeData,onChangeCategory:this.changeCategory,chartingOptions:n,changeInteractiveEnabled:u,changeEditableEnabled:d,top:ne,error:p,showCorrectness:v===`linePlot`||v===`dotPlot`}),l?(0,F.jsx)(`foreignObject`,{x,y:S-16,width:x,height:S,children:(0,F.jsx)(`div`,{xmlns:`http://www.w3.org/1999/xhtml`,style:{display:`flex`,justifyContent:`flex-start`},children:(0,F.jsx)(qee,{categories:T,addCategory:this.addCategory,deleteCategory:this.deleteCategory,language:h})})}):null,(0,F.jsx)(`mask`,{id:`${this.maskUid}`,children:(0,F.jsx)(`rect`,{...j,fill:`white`})}),(0,F.jsx)(`g`,{id:`marks`,mask:`url('#${this.maskUid}')`,children:w&&(0,F.jsx)(w,{...A,data:T,height:re.graphProps.size.height,defineChart:b,onChange:this.changeData,onChangeCategory:this.changeCategory,correctData:_})})]}),(0,F.jsx)(s6,{open:y.open,title:y.title,text:y.text,onClose:y.onClose,onConfirm:y.onConfirm})]})}},Zee=R(`div`)(({theme:e})=>({backgroundColor:V.WHITE,padding:e.spacing(2),width:`355px`,boxShadow:`inset 0px 1px 5px 0px #9297A6`,display:`flex`,flexDirection:`column`,gap:`16px`})),M9=R(`div`)(()=>({display:`flex`,alignItems:`center`,gap:`12px`})),Qee=R(`div`)(({theme:e})=>({fontSize:e.typography.h6.fontSize,fontWeight:`700`})),$ee=R(`div`)(()=>({marginLeft:`2px`})),N9=R(pR)(({theme:e})=>({backgroundColor:Bl(),borderRadius:e.spacing(2),color:V.WHITE})),ete=R(e5)(({theme:e})=>({backgroundColor:Gl(),borderRadius:e.spacing(2),color:V.WHITE})),tte=R(`div`)(()=>({marginLeft:`3px`,display:`flex`,alignItems:`center`,gap:`12px`})),{translator:P9}=k9,F9=({language:e})=>(0,F.jsxs)(Zee,{children:[(0,F.jsx)(Qee,{children:`Key`}),(0,F.jsxs)(M9,{children:[(0,F.jsx)(ete,{}),(0,F.jsx)(`div`,{children:P9.t(`charting.keyLegend.incorrectAnswer`,{lng:e})})]}),(0,F.jsxs)(M9,{children:[(0,F.jsx)(N9,{}),(0,F.jsx)(`div`,{children:P9.t(`charting.keyLegend.correctAnswer`,{lng:e})})]}),(0,F.jsxs)(tte,{children:[(0,F.jsx)(N9,{fontSize:`small`}),(0,F.jsx)($ee,{children:P9.t(`charting.keyLegend.correctKeyAnswer`,{lng:e})})]})]});F9.propTypes={language:v.string};var I9=`height ease-in 300ms, opacity ease-in 300ms`,nte=R(`div`)(()=>({position:`relative`,height:0,overflow:`hidden`,display:`flex`,visibility:`hidden`,width:0,"&.enter":{transition:I9,opacity:1,height:`auto`,width:`auto`,visibility:`visible`,minHeight:`25px`},"&.enter-done":{height:`auto`,visibility:`visible`,width:`auto`,minHeight:`25px`},"&.exit":{transition:I9,opacity:0,height:0,visibility:`visible`,width:0},"&.exit-done":{opacity:0,visibility:`hidden`,height:0,width:0}})),L9=e=>{let{show:t,children:n,className:r}=e,i=(0,P.useRef)(null);return(0,F.jsx)(Hs,{nodeRef:i,in:t,appear:!0,mountOnEnter:!1,timeout:300,classNames:{enter:`enter`,enterDone:`enter-done`,exit:`exit`,exitDone:`exit-done`},children:(0,F.jsx)(nte,{ref:i,className:r,children:n})})};L9.propTypes={show:v.bool.isRequired,className:v.string,children:v.oneOfType([v.arrayOf(v.node),v.node]).isRequired};function R9(e){return typeof e==`function`||typeof e==`object`&&!!e&&typeof e.$$typeof==`symbol`}function z9(e,t){return!e||R9(e)?e:R9(e.default)?e.default:t&&R9(e[t])?e[t]:t&&R9(e[t]?.default)?e[t].default:e}var rte=z9(ep,`Readable`)||z9(ite.Readable,`Readable`),B9=Op,V9=B9.default,ite=V9&&typeof V9==`object`?V9:B9,{translator:H9}=k9,ate={WebkitTouchCallout:`none`,WebkitUserSelect:`none`,KhtmlUserSelect:`none`,MozUserSelect:`none`,msUserSelect:`none`,userSelect:`none`},ote=R(`div`)(()=>({width:`100%`,cursor:`pointer`})),ste=R(`div`)(()=>({margin:`0 auto`,textAlign:`center`,display:`flex`})),cte=R(`div`)(()=>({width:`fit-content`,minWidth:`140px`,alignSelf:`center`,verticalAlign:`middle`,color:`var(--correct-answer-toggle-label-color, ${Il()})`,fontWeight:`normal`,...ate})),U9=R(`div`)(()=>({position:`absolute`,width:`25px`,"&.enter":{opacity:`0`},"&.enter-active":{opacity:`1`,transition:`opacity 0.3s ease-in`},"&.exit":{opacity:`1`},"&.exit-active":{opacity:`0`,transition:`opacity 0.3s ease-in`}})),lte=R(`div`)(()=>({width:`25px`,marginRight:`5px`,display:`flex`,alignItems:`center`})),ute=class e extends P.Component{static propTypes={onToggle:v.func,toggled:v.bool,show:v.bool,hideMessage:v.string,showMessage:v.string,className:v.string,language:v.string};static defaultProps={showMessage:`Show correct answer`,hideMessage:`Hide correct answer`,show:!1,toggled:!1};constructor(t){super(t),this.state={show:t.show},this.openIconRef=P.createRef(),this.closedIconRef=P.createRef(),e.defaultProps={...e.defaultProps,showMessage:H9.t(`common:showCorrectAnswer`,{lng:t.language}),hideMessage:H9.t(`common:hideCorrectAnswer`,{lng:t.language})}}onClick(){this.props.onToggle(!this.props.toggled)}onTouch(e){e.preventDefault(),this.props.onToggle(!this.props.toggled)}UNSAFE_componentWillReceiveProps(t){this.setState({show:t.show}),t.language!==this.props?.language&&(e.defaultProps={...e.defaultProps,showMessage:H9.t(`common:showCorrectAnswer`,{lng:t.language}),hideMessage:H9.t(`common:hideCorrectAnswer`,{lng:t.language})})}render(){let{className:e,toggled:t,hideMessage:n,showMessage:r}=this.props;return(0,F.jsx)(ote,{className:e,children:(0,F.jsx)(L9,{show:this.state.show,children:(0,F.jsxs)(ste,{onClick:this.onClick.bind(this),onTouchEnd:this.onTouch.bind(this),children:[(0,F.jsxs)(lte,{children:[(0,F.jsx)(Hs,{nodeRef:this.openIconRef,timeout:400,in:t,exit:!t,classNames:{enter:`enter`,enterActive:`enter-active`,exit:`exit`,exitActive:`exit-active`},children:(0,F.jsx)(U9,{ref:this.openIconRef,children:(0,F.jsx)(Ko,{open:t},`correct-open`)})}),(0,F.jsx)(Hs,{nodeRef:this.closedIconRef,timeout:5e3,in:!t,exit:t,classNames:{enter:`enter`,enterActive:`enter-active`,exit:`exit`,exitActive:`exit-active`},children:(0,F.jsx)(U9,{ref:this.closedIconRef,children:(0,F.jsx)(Ko,{open:t},`correct-closed`)})})]}),(0,F.jsx)(rte,{false:!0,children:(0,F.jsx)(cte,{"aria-hidden":!this.state.show,children:t?n:r})})]})})})}};function W9(e){return typeof e==`function`||typeof e==`object`&&!!e&&typeof e.$$typeof==`symbol`}function G9(e,t){return!e||W9(e)?e:W9(e.default)?e.default:t&&W9(e[t])?e[t]:t&&W9(e[t]?.default)?e[t].default:e}var dte=G9(Sf,`UiLayout`)||G9(X9.UiLayout,`UiLayout`),K9=G9($f,`PreviewPrompt`)||G9(X9.PreviewPrompt,`PreviewPrompt`),q9=G9(yd,`Collapsible`)||G9(X9.Collapsible,`Collapsible`),J9=Op,Y9=J9.default,X9=Y9&&typeof Y9==`object`?Y9:J9,fte=R(dte)({color:Il(),backgroundColor:iu(),overflowX:`scroll`,overflowY:`hidden`}),Z9=R(Xee)(({theme:e})=>({marginTop:e.spacing(2),marginBottom:e.spacing(2)})),pte=R(q9)(({theme:e})=>({marginBottom:e.spacing(2)})),mte=class extends P.Component{static propTypes={model:v.object.isRequired,onAnswersChange:v.func,categories:v.array};constructor(e){super(e),this.state={categories:e.categories||e.model.data,showingCorrect:!1}}componentDidUpdate(e){zp(e.categories,this.props.categories)?zp(e.model.data,this.props.model.data)||this.setState({categories:this.props.model.data}):this.setState({categories:this.props.categories})}changeData=e=>this.setState({categories:e},()=>this.props.onAnswersChange(e));toggleCorrect=e=>this.setState({showingCorrect:e});render(){let{categories:e,showingCorrect:t}=this.state,{model:n}=this.props,{teacherInstructions:r,prompt:i,chartType:a,size:o,domain:s,range:c,title:l,addCategoryEnabled:u,studentNewCategoryDefaultLabel:d,showToggle:f,rationale:p,correctAnswer:m,language:h,env:g,showKeyLegend:_}=n,{correctedAnswer:v,extraCSSRules:y}=n,b=(m?.data||[]).map(e=>({...e,interactive:!1,editable:!1})),{mode:x}=g||{};x===`view`&&(v=(v||[]).map(e=>({...e,editable:!1})));let S=n.rationale&&(ip(n.rationale)||op(n.rationale)),C=n.teacherInstructions&&(ip(n.teacherInstructions)||op(n.teacherInstructions));return(0,F.jsxs)(fte,{extraCSSRules:y,children:[C&&(0,F.jsx)(pte,{labels:{hidden:`Show Teacher Instructions`,visible:`Hide Teacher Instructions`},children:(0,F.jsx)(K9,{prompt:r})}),i&&(0,F.jsx)(K9,{className:`prompt`,prompt:i}),(0,F.jsx)(ute,{show:f,toggled:t,onToggle:this.toggleCorrect,language:h}),t&&f?(0,F.jsx)(Z9,{chartType:a,size:o,domain:s,range:c,charts:[P7.Bar(),P7.Histogram(),P7.LineDot(),P7.LineCross(),P7.DotPlot(),P7.LinePlot()],data:b||e,title:l,onDataChange:this.changeData,addCategoryEnabled:!1,categoryDefaultLabel:d,language:h,labelsPlaceholders:{}}):(0,F.jsx)(Z9,{chartType:a,size:o,domain:s,range:c,charts:[P7.Bar(),P7.Histogram(),P7.LineDot(),P7.LineCross(),P7.DotPlot(),P7.LinePlot()],data:v||e,title:l,onDataChange:this.changeData,addCategoryEnabled:u,categoryDefaultLabel:d,language:h,labelsPlaceholders:{},correctData:f?b:void 0}),!t&&_&&(0,F.jsx)(F9,{language:h}),S&&(0,F.jsx)(q9,{labels:{hidden:`Show Rationale`,visible:`Hide Rationale`},children:(0,F.jsx)(K9,{prompt:p})})]})}},Q9=class e extends CustomEvent{static{this.TYPE=`model-set`}constructor(t,n,r){super(e.TYPE,{bubbles:!0,composed:!0,detail:{complete:n,component:t,hasModel:r}}),this.component=t,this.complete=n}},hte=class e extends CustomEvent{static{this.TYPE=`session-changed`}constructor(t,n){super(e.TYPE,{bubbles:!0,composed:!0,detail:{complete:n,component:t}}),this.component=t,this.complete=n}},gte=g(),$9=class extends HTMLElement{constructor(){super(),this._root=null,this._mathObserver=null,this._mathRenderPending=!1}_scheduleMathRender=()=>{this._mathRenderPending||(this._mathRenderPending=!0,requestAnimationFrame(()=>{this._mathObserver&&this._mathObserver.disconnect(),hd(this),this._mathRenderPending=!1,setTimeout(()=>{this._mathObserver&&this._mathObserver.observe(this,{childList:!0,subtree:!0})},50)}))};_initMathObserver(){this._mathObserver||(this._mathObserver=new MutationObserver(this._scheduleMathRender),this._mathObserver.observe(this,{childList:!0,subtree:!0}))}_disconnectMathObserver(){this._mathObserver&&=(this._mathObserver.disconnect(),null)}set model(e){this._model=e,this._session&&this.isComplete(this._session.answer)?this.dispatchEvent(new Q9(this.tagName.toLowerCase(),!0,!!this._model)):this.dispatchEvent(new Q9(this.tagName.toLowerCase(),!1,!!this._model)),this._render()}set session(e){this._session=e,this._render()}get session(){return this._session}connectedCallback(){this._initMathObserver(),this._render()}isComplete=e=>Array.isArray(e)&&e.length>0;changeAnswers=e=>{this._session.answer=e,this.dispatchEvent(new hte(this.tagName.toLowerCase(),this.isComplete(this._session.answer))),this._render()};_render(){if(!this._model||!this._session)return;this._initMathObserver();let e={...this._model,data:this._model.data?[...this._model.data]:this._model.data},t=P.createElement(mte,{model:e,categories:this._session.answer,onAnswersChange:this.changeAnswers});this._root||=(0,gte.createRoot)(this),this._root.render(t)}disconnectedCallback(){this._disconnectMathObserver(),this._root&&=(this._root.unmount(),null)}};return typeof window<`u`&&!customElements.get(`charting-element`)&&customElements.define(`charting-element`,$9),$9})();
|