@pie-element/graphing 10.1.2-next.14 → 10.1.2-next.15
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/browser/author/index.js +1 -1
- package/dist/browser/{container-CWQ3I9xV.js → container-BjdwHm6g.js} +2 -2
- package/dist/browser/{container-CWQ3I9xV.js.map → container-BjdwHm6g.js.map} +1 -1
- package/dist/browser/delivery/index.js +1 -1
- package/dist/index.iife.js +1 -1
- package/package.json +2 -2
package/dist/index.iife.js
CHANGED
|
@@ -360,7 +360,7 @@ mid `,`∤`),Z.intercal=Z[`⊺`]=q($,`\\intercal `,`⊺`),Z.veebar=Z[`
|
|
|
360
360
|
`,Wq=e=>{let{classes:t,variant:n,color:r}=e;return va({root:[`root`,`color${Wd(r)}`,n],dashed:[`dashed`,`dashedColor${Wd(r)}`],bar1:[`bar`,`bar1`,`barColor${Wd(r)}`,(n===`indeterminate`||n===`query`)&&`bar1Indeterminate`,n===`determinate`&&`bar1Determinate`,n===`buffer`&&`bar1Buffer`],bar2:[`bar`,`bar2`,n!==`buffer`&&`barColor${Wd(r)}`,n===`buffer`&&`color${Wd(r)}`,(n===`indeterminate`||n===`query`)&&`bar2Indeterminate`,n===`buffer`&&`bar2Buffer`]},Iq,t)},Gq=(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),Kq=B(`span`,{name:`MuiLinearProgress`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[`color${Wd(n.color)}`],t[n.variant]]}})(pd(({theme:e})=>({position:`relative`,overflow:`hidden`,display:`block`,height:4,zIndex:0,"@media print":{colorAdjust:`exact`},variants:[...Object.entries(e.palette).filter(um()).map(([t])=>({props:{color:t},style:{backgroundColor:Gq(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)`}}]}))),qq=B(`span`,{name:`MuiLinearProgress`,slot:`Dashed`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.dashed,t[`dashedColor${Wd(n.color)}`]]}})(pd(({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(um()).map(([t])=>{let n=Gq(e,t);return{props:{color:t},style:{backgroundImage:`radial-gradient(${n} 0%, ${n} 16%, transparent 42%)`}}})]})),Uq||{animation:`${Hq} 3s infinite linear`}),Jq=B(`span`,{name:`MuiLinearProgress`,slot:`Bar1`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.bar,t.bar1,t[`barColor${Wd(n.color)}`],(n.variant===`indeterminate`||n.variant===`query`)&&t.bar1Indeterminate,n.variant===`determinate`&&t.bar1Determinate,n.variant===`buffer`&&t.bar1Buffer]}})(pd(({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(um()).map(([t])=>({props:{color:t},style:{backgroundColor:(e.vars||e).palette[t].main}})),{props:{variant:`determinate`},style:{transition:`transform .${Lq}s linear`}},{props:{variant:`buffer`},style:{zIndex:1,transition:`transform .${Lq}s linear`}},{props:({ownerState:e})=>e.variant===`indeterminate`||e.variant===`query`,style:{width:`auto`}},{props:({ownerState:e})=>e.variant===`indeterminate`||e.variant===`query`,style:zq||{animation:`${Rq} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite`}}]}))),Yq=B(`span`,{name:`MuiLinearProgress`,slot:`Bar2`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.bar,t.bar2,t[`barColor${Wd(n.color)}`],(n.variant===`indeterminate`||n.variant===`query`)&&t.bar2Indeterminate,n.variant===`buffer`&&t.bar2Buffer]}})(pd(({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(um()).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(um()).map(([t])=>({props:{color:t,variant:`buffer`},style:{backgroundColor:Gq(e,t),transition:`transform .${Lq}s linear`}})),{props:({ownerState:e})=>e.variant===`indeterminate`||e.variant===`query`,style:{width:`auto`}},{props:({ownerState:e})=>e.variant===`indeterminate`||e.variant===`query`,style:Vq||{animation:`${Bq} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite`}}]}))),Xq=I.forwardRef(function(e,t){let n=Hl({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=Wq(l),d=Li(),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,L.jsxs)(Kq,{className:R(u.root,r),ownerState:l,role:`progressbar`,...f,ref:t,...c,children:[s===`buffer`?(0,L.jsx)(qq,{className:u.dashed,ownerState:l}):null,(0,L.jsx)(Jq,{className:u.bar1,ownerState:l,style:p.bar1}),s===`determinate`?null:(0,L.jsx)(Yq,{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},Qq=()=>`img-${Date.now()}-${Math.random().toString(36).slice(2)}`,$q=Cp(`@pie-lib:editable-html:image:insert-image-handler`),eJ=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(){$q(`insert cancelled`);try{this.deleteNode(),this.onFinish(!1)}catch{}finally{this.editor._insertingImage=!1}}updateNode(e){let t=this.resolveNodePos();if(t===null){$q(`[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){$q(`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,$q(`[fileChosen] file: `,e);let t=new FileReader;t.onload=()=>{let e=t.result;this.updateNode({src:e})},t.readAsDataURL(e)}progress(e,t,n){$q(`progress: `,e,t,n),this.updateNode({percent:e})}getChosenFile(){return this.chosenFile}};function tJ(e){return Xr(`MuiDialogContent`,e)}Zr(`MuiDialogContent`,[`root`,`dividers`]);function nJ(e){return Xr(`MuiDialogTitle`,e)}var rJ=Zr(`MuiDialogTitle`,[`root`]),iJ=e=>{let{classes:t,dividers:n}=e;return va({root:[`root`,n&&`dividers`]},tJ,t)},aJ=B(`div`,{name:`MuiDialogContent`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.dividers&&t.dividers]}})(pd(({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:{[`.${rJ.root} + &`]:{paddingTop:0}}}]}))),oJ=I.forwardRef(function(e,t){let n=Hl({props:e,name:`MuiDialogContent`}),{className:r,dividers:i=!1,...a}=n,o={...n,dividers:i},s=iJ(o);return(0,L.jsx)(aJ,{className:R(s.root,r),ownerState:o,ref:t,...a})}),sJ=Yd((0,L.jsx)(`path`,{d:`M11.67 3.87 9.9 2.1 0 12l9.9 9.9 1.77-1.77L3.54 12z`}),`ArrowBackIos`);function cJ(e){return Xr(`MuiFormHelperText`,e)}var lJ=Zr(`MuiFormHelperText`,[`root`,`error`,`disabled`,`sizeSmall`,`sizeMedium`,`contained`,`focused`,`filled`,`required`]),uJ,dJ=e=>{let{classes:t,contained:n,size:r,disabled:i,error:a,filled:o,focused:s,required:c}=e;return va({root:[`root`,i&&`disabled`,a&&`error`,r&&`size${Wd(r)}`,n&&`contained`,s&&`focused`,o&&`filled`,c&&`required`]},cJ,t)},fJ=B(`p`,{name:`MuiFormHelperText`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.size&&t[`size${Wd(n.size)}`],n.contained&&t.contained,n.filled&&t.filled]}})(pd(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.caption,textAlign:`left`,marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${lJ.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${lJ.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}}]}))),pJ=I.forwardRef(function(e,t){let n=Hl({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=Jm({props:n,muiFormControl:Xm(),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=dJ(h);return(0,L.jsx)(fJ,{as:a,className:R(g.root,i),ref:t,...p,ownerState:h,children:r===` `?uJ||=(0,L.jsx)(`span`,{className:`notranslate`,"aria-hidden":!0,children:``}):r})});function mJ(e){return Xr(`MuiTextField`,e)}Zr(`MuiTextField`,[`root`]);var hJ={standard:CK,filled:kK,outlined:BK},gJ=e=>{let{classes:t}=e;return va({root:[`root`]},mJ,t)},_J=B(ph,{name:`MuiTextField`,slot:`Root`})({}),vJ=I.forwardRef(function(e,t){let n=Hl({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},P=gJ(ie),ae=Gi(m),oe=p&&ae?`${ae}-helper-text`:void 0,se=y&&ae?`${ae}-label`:void 0,ce=hJ[ne],le={slots:M,slotProps:{input:_,inputLabel:h,htmlInput:g,formHelperText:d,select:j,...ee}},ue={},de=le.slotProps.inputLabel;ne===`outlined`&&(de&&de.shrink!==void 0&&(ue.notched=de.shrink),ue.label=y),A&&((!j||!j.native)&&(ue.id=void 0),ue[`aria-describedby`]=void 0);let[fe,pe]=yd(`root`,{elementType:_J,shouldForwardComponentProp:!0,externalForwardedProps:{...le,...re},ownerState:ie,className:R(P.root,o),ref:t,additionalProps:{disabled:l,error:u,fullWidth:f,required:O,color:s,variant:ne}}),[me,he]=yd(`input`,{elementType:ce,externalForwardedProps:le,additionalProps:ue,ownerState:ie}),[ge,F]=yd(`inputLabel`,{elementType:oh,externalForwardedProps:le,ownerState:ie}),[_e,ve]=yd(`htmlInput`,{elementType:`input`,externalForwardedProps:le,ownerState:ie}),[ye,be]=yd(`formHelperText`,{elementType:pJ,externalForwardedProps:le,ownerState:ie}),[xe,Se]=yd(`select`,{elementType:KK,externalForwardedProps:le,ownerState:ie}),Ce=(0,L.jsx)(me,{"aria-describedby":oe,autoComplete:r,autoFocus:i,defaultValue:c,fullWidth:f,multiline:S,name:C,rows:k,maxRows:b,minRows:x,type:N,value:te,id:ae,inputRef:v,onBlur:w,onChange:T,onFocus:E,placeholder:D,inputProps:ve,slots:{input:M.htmlInput?_e:void 0},...he});return(0,L.jsxs)(fe,{...pe,children:[y!=null&&y!==``&&(0,L.jsx)(ge,{htmlFor:ae,id:se,...F,children:y}),A?(0,L.jsx)(xe,{"aria-describedby":oe,id:ae,labelId:se,value:te,input:Ce,...Se,children:a}):Ce,p&&(0,L.jsx)(ye,{id:oe,...be,children:p})]})});function yJ(e){return Xr(`MuiDialogActions`,e)}Zr(`MuiDialogActions`,[`root`,`spacing`]);var bJ=e=>{let{classes:t,disableSpacing:n}=e;return va({root:[`root`,!n&&`spacing`]},yJ,t)},xJ=B(`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}}}]}),SJ=I.forwardRef(function(e,t){let n=Hl({props:e,name:`MuiDialogActions`}),{className:r,disableSpacing:i=!1,...a}=n,o={...n,disableSpacing:i},s=bJ(o);return(0,L.jsx)(xJ,{className:R(s.root,r),ownerState:o,ref:t,...a})});function CJ(e){return Xr(`MuiDialog`,e)}var wJ=Zr(`MuiDialog`,[`root`,`backdrop`,`scrollPaper`,`scrollBody`,`container`,`paper`,`paperScrollPaper`,`paperScrollBody`,`paperWidthFalse`,`paperWidthXs`,`paperWidthSm`,`paperWidthMd`,`paperWidthLg`,`paperWidthXl`,`paperFullWidth`,`paperFullScreen`]),TJ=I.createContext({}),EJ=B(Ed,{name:`MuiDialog`,slot:`Backdrop`})({zIndex:-1}),DJ=e=>{let{classes:t,scroll:n,maxWidth:r,fullWidth:i,fullScreen:a}=e;return va({root:[`root`],backdrop:[`backdrop`],container:[`container`,`scroll${Wd(n)}`],paper:[`paper`,`paperScroll${Wd(n)}`,`paperWidth${Wd(String(r))}`,i&&`paperFullWidth`,a&&`paperFullScreen`]},CJ,t)},OJ=B(Rd,{name:`MuiDialog`,slot:`Root`})({"@media print":{position:`absolute !important`}}),kJ=B(`div`,{name:`MuiDialog`,slot:`Container`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.container,t[`scroll${Wd(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`}}}]}),AJ=B(Hd,{name:`MuiDialog`,slot:`Paper`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.paper,t[`scrollPaper${Wd(n.scroll)}`],t[`paperWidth${Wd(String(n.maxWidth))}`],n.fullWidth&&t.paperFullWidth,n.fullScreen&&t.paperFullScreen]}})(pd(({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)`,[`&.${wJ.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}`,[`&.${wJ.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,[`&.${wJ.paperScrollBody}`]:{margin:0,maxWidth:`100%`}}}]}))),jJ=I.forwardRef(function(e,t){let n=Hl({props:e,name:`MuiDialog`}),r=jo(),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=Hd,PaperProps:b={},role:x=`dialog`,scroll:S=`paper`,slots:C={},slotProps:w={},TransitionComponent:T=Sd,transitionDuration:E=i,TransitionProps:D,...O}=n,k={...n,disableEscapeKeyDown:f,fullScreen:p,fullWidth:m,maxWidth:h,scroll:S},A=DJ(k),j=I.useRef(),M=e=>{j.current=e.target===e.currentTarget},ee=e=>{g&&g(e),j.current&&(j.current=null,_&&_(e,`backdropClick`))},N=Gi(o),te=I.useMemo(()=>({titleId:N}),[N]),ne={slots:{transition:T,...C},slotProps:{transition:D,paper:b,backdrop:l,...w}},[re,ie]=yd(`root`,{elementType:OJ,shouldForwardComponentProp:!0,externalForwardedProps:ne,ownerState:k,className:R(A.root,d),ref:t}),[P,ae]=yd(`backdrop`,{elementType:EJ,shouldForwardComponentProp:!0,externalForwardedProps:ne,ownerState:k,className:A.backdrop}),[oe,se]=yd(`paper`,{elementType:AJ,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,[nd]:``}}),[ce,le]=yd(`container`,{elementType:kJ,externalForwardedProps:ne,ownerState:k,className:A.container}),[ue,de]=yd(`transition`,{elementType:Sd,externalForwardedProps:ne,ownerState:k,additionalProps:{appear:!0,in:v,timeout:E,role:`presentation`}});return(0,L.jsx)(re,{closeAfterTransition:!0,slots:{backdrop:P},slotProps:{backdrop:{transitionDuration:E,as:c,...ae}},disableEscapeKeyDown:f,onClose:_,open:v,onClick:ee,...ie,...O,children:(0,L.jsx)(ue,{...de,children:(0,L.jsx)(ce,{onMouseDown:M,...le,children:(0,L.jsx)(oe,{as:y,...se,children:(0,L.jsx)(TJ.Provider,{value:te,children:u})})})})})}),MJ=class extends I.Component{static propTypes={onDone:A.func.isRequired,alt:A.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,L.jsxs)(jJ,{open:!0,disablePortal:!0,onClose:this.closeDialog,id:`text-dialog`,hideBackdrop:!0,disableScrollLock:!0,onEntered:this.handleOverflow,children:[(0,L.jsx)(oJ,{children:(0,L.jsxs)(`div`,{style:{display:`flex`},children:[(0,L.jsx)(sJ,{style:{paddingTop:`6px`}}),(0,L.jsx)(vJ,{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,L.jsx)(SJ,{children:(0,L.jsx)(Pm,{onClick:this.onDone,children:`Done`})})]})}},NJ=B(`button`,{shouldForwardProp:e=>![`active`,`disabled`,`extraStyles`].includes(e)})(({active:e,disabled:t})=>({color:e?vf():yf(),display:`inline-flex`,padding:`2px`,background:`none`,border:`none`,cursor:t?`not-allowed`:`pointer`,"& svg":{width:`24px`,height:`24px`},"&:hover":{color:t?yf():vf()},"&:focus":{outline:`2px solid ${sp()}`},...t&&{opacity:.7}})),PJ=Cp(`pie-elements:editable-html:raw-button`);(class extends I.Component{static propTypes={onClick:A.func.isRequired,children:A.oneOfType([A.arrayOf(A.node),A.node]).isRequired,active:A.bool,disabled:A.bool,extraStyles:A.object};constructor(e){super(e)}onClick=e=>{PJ(`[onClick]`),e.preventDefault();let{onClick:t}=this.props;t(e)};onKeyDown=e=>{if(e.key===`Enter`||e.key===` `){PJ(`[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,L.jsx)(NJ,{style:r,active:e,disabled:n,onMouseDown:this.onClick,onKeyDown:this.onKeyDown,"aria-label":i,"aria-pressed":e,tabIndex:0,children:t})}});var FJ=class extends I.Component{static propTypes={onToggle:A.func.isRequired,mark:A.string,label:A.string.isRequired,children:A.oneOfType([A.arrayOf(A.node),A.node]).isRequired,active:A.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,L.jsx)(NJ,{active:t,onMouseDown:this.onToggle,"aria-pressed":t,onKeyDown:this.onKeyDown,"aria-label":n,tabIndex:0,children:e})}},IJ=Cp(`@pie-lib:editable-html:plugins:image:image-toolbar`),LJ=B(`div`)(({theme:e})=>({paddingLeft:e.spacing.unit,display:`flex`,alignItems:`center`})),RJ=B(`span`,{shouldForwardProp:e=>![`disabled`,`hasAlignmentButtons`].includes(e)})(({disabled:e,hasAlignmentButtons:t})=>({...e&&{opacity:.5},...t&&{borderLeft:`1px solid grey`,paddingLeft:8,marginLeft:4}})),zJ=({alignment:e,active:t,onClick:n})=>(0,L.jsx)(FJ,{active:t,onToggle:()=>n(e),label:e,children:e});zJ.propTypes={alignment:A.string.isRequired,active:A.bool.isRequired,onClick:A.func.isRequired};var BJ=class extends I.Component{static propTypes={onChange:A.func.isRequired,alignment:A.string,alt:A.string,imageLoaded:A.bool,disableImageAlignmentButtons:A.bool};onAltTextDone=e=>{IJ(`[onAltTextDone]: alt:`,e),this.props.onChange({alt:e},!0)};onAlignmentClick=e=>{IJ(`[onAlignmentClick]: alignment:`,e),this.props.onChange({alignment:e})};renderDialog=()=>{let{alt:e}=this.props,t=document.createElement(`div`),n=(0,L.jsx)(MJ,{alt:e,onDone:this.onAltTextDone});fu.render(n,t),document.body.appendChild(t)};render(){let{alignment:e,imageLoaded:t,disableImageAlignmentButtons:n}=this.props;return(0,L.jsxs)(LJ,{children:[!n&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(zJ,{alignment:`left`,active:e===`left`,onClick:this.onAlignmentClick}),(0,L.jsx)(zJ,{alignment:`center`,active:e===`center`,onClick:this.onAlignmentClick}),(0,L.jsx)(zJ,{alignment:`right`,active:e===`right`,onClick:this.onAlignmentClick})]}),(0,L.jsx)(RJ,{disabled:!t,hasAlignmentButtons:!n,onMouseDown:e=>t&&this.renderDialog(e),children:`Alt text`})]})}},VJ=B(Xq,{shouldForwardProp:e=>e!==`hideProgress`})(({hideProgress:e})=>({position:`absolute`,left:`0`,width:`fit-content`,top:`0%`,transition:`opacity 200ms linear`,...e&&{opacity:0}})),HJ=B(`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}})),UJ=B(`div`)(({theme:e})=>({position:`relative`,width:`fit-content`,display:`flex`,alignItems:`center`,"&&:hover > .resize":{display:`block`}})),WJ=B(`img`,{shouldForwardProp:e=>e!==`active`})(({theme:e,active:t})=>({border:t?`solid 1px ${e.palette.primary.main}`:`solid 1px transparent`})),GJ=B(`div`)(({theme:e})=>({backgroundColor:e.palette.primary.main,cursor:`col-resize`,height:`35px`,width:`5px`,borderRadius:8,marginLeft:`5px`,marginRight:`10px`,display:`none`})),KJ=e=>e?`${e}px`:`calc(20px)`;function qJ(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,I.useMemo)(()=>f+t.nodeSize===p,[f,p,t.nodeSize]),[h,g]=(0,I.useState)(!1),_=(0,I.useRef)(t),v=(0,I.useRef)(null),y=(0,I.useRef)(null),b=(0,I.useRef)(null),x=(0,I.useCallback)(e=>{let t=e/v.current.naturalWidth*4;return parseInt(t.toFixed(0)*25,10)},[]),S=(0,I.useCallback)(()=>{let e=Zq(n,_.current.attrs.nodeKey);return e?e[1]:null},[n]),C=(0,I.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,I.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,I.useEffect)(()=>{_.current={...t,pos:d}},[t,d]),(0,I.useEffect)(()=>{o?m&&n.isEditable&&(!String(t.attrs?.src??``).trim()&&s.imageHandling?.insertImageRequested&&s.imageHandling.insertImageRequested(n,[t,d],e=>new eJ(n,[t,d],e)),g(o)):g(o)},[m,o,n.isEditable]),(0,I.useEffect)(()=>{w();let e=y?.current;return e&&n.isEditable&&e.addEventListener(`mousedown`,A,!1),()=>{e&&e.removeEventListener(`mousedown`,A,!1)}},[]),(0,I.useEffect)(()=>{w()});let T=(0,I.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};ts(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,I.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,I.useCallback)(e=>{C(e)},[n,C]),k=(0,I.useCallback)(()=>{window.removeEventListener(`mousemove`,D),window.removeEventListener(`mouseup`,k)},[D]),A=(0,I.useCallback)(()=>{window.addEventListener(`mousemove`,D),window.addEventListener(`mouseup`,k)},[D,k]),j={width:KJ(t.attrs.width),height:KJ(t.attrs.height),objectFit:`contain`},M={left:`flex-start`,center:`center`,right:`flex-end`}[t.attrs.alignment]||`flex-start`;return(0,L.jsxs)(fk,{children:[(0,L.jsxs)(HJ,{onFocus:i,loading:!t.attrs.loaded,pendingDelete:t.attrs.deleteStatus===`pending`,style:{justifyContent:M},children:[(0,L.jsx)(VJ,{mode:`determinate`,value:t.attrs.percent||0,hideProgress:t.attrs.loaded}),(0,L.jsxs)(UJ,{onDragStart:e=>e.preventDefault(),children:[(0,L.jsx)(WJ,{...r,active:o&&t.attrs.loaded,draggable:!1,ref:v,src:t.attrs.src,style:j,onLoad:T,alt:t.attrs.alt}),(0,L.jsx)(GJ,{ref:y,className:`resize`,style:{display:n.isEditable?void 0:`none`}})]})]}),h&&n._tiptapContainerEl&&fu.createPortal((0,L.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,L.jsx)(fL,{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,L.jsx)(BJ,{disableImageAlignmentButtons:s.imageHandling?.disableImageAlignmentButtons,alt:t.attrs.alt,imageLoaded:t.attrs.loaded,alignment:t.attrs.alignment||`left`,onChange:O})})}),n._tiptapContainerEl)]})}qJ.propTypes={node:A.object.isRequired,editor:A.object.isRequired,attributes:A.object,onFocus:A.func,maxImageWidth:A.number,maxImageHeight:A.number};var JJ=KD.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`,GT(e,{"data-type":`image-upload-node`})]},addNodeView(){return Ek(e=>(0,L.jsx)(qJ,{...e,options:this.options}))},addCommands(){return{setImageUploadNode:()=>({commands:e})=>e.insertContent({type:this.name,attrs:{nodeKey:Qq()}})}},addProseMirrorPlugins(){let e=this.editor,t=this.options;return[new Gv({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=Qq(),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 eJ(e,n,e=>{e||r?.updateNode({loaded:!0}),t(e)},!0),r.fileChosen(a),r})},c.readAsDataURL(a),!0}}})]}});function YJ(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}function XJ(e,t,n,r={},i=()=>{}){let{ease:a=YJ,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 QJ(e){let{onChange:t,...n}=e,r=I.useRef(),i=I.useRef(null),a=()=>{r.current=i.current.offsetHeight-i.current.clientHeight};return Zd(()=>{let e=Wl(()=>{let e=r.current;a(),e!==r.current&&t(r.current)}),n=Jl(i.current);return n.addEventListener(`resize`,e),()=>{e.clear(),n.removeEventListener(`resize`,e)}},[t]),I.useEffect(()=>{a(),t(r.current)},[t]),(0,L.jsx)(`div`,{style:ZJ,...n,ref:i})}var $J=Yd((0,L.jsx)(`path`,{d:`M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z`}),`KeyboardArrowLeft`),eY=Yd((0,L.jsx)(`path`,{d:`M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z`}),`KeyboardArrowRight`);function tY(e){return Xr(`MuiTabScrollButton`,e)}var nY=Zr(`MuiTabScrollButton`,[`root`,`vertical`,`horizontal`,`disabled`]),rY=e=>{let{classes:t,orientation:n,disabled:r}=e;return va({root:[`root`,n,r&&`disabled`]},tY,t)},iY=B(om,{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,[`&.${nY.disabled}`]:{opacity:0},variants:[{props:{orientation:`vertical`},style:{width:`100%`,height:40,"& svg":{transform:`var(--TabScrollButton-svgRotate)`}}}]}),aY=I.forwardRef(function(e,t){let n=Hl({props:e,name:`MuiTabScrollButton`}),{className:r,slots:i={},slotProps:a={},direction:o,orientation:s,disabled:c,...l}=n,u=Li(),d={isRtl:u,...n},f=rY(d),p=i.StartScrollButtonIcon??$J,m=i.EndScrollButtonIcon??eY,h=jh({elementType:p,externalSlotProps:a.startScrollButtonIcon,additionalProps:{fontSize:`small`},ownerState:d}),g=jh({elementType:m,externalSlotProps:a.endScrollButtonIcon,additionalProps:{fontSize:`small`},ownerState:d});return(0,L.jsx)(iY,{component:`div`,className:R(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,L.jsx)(p,{...h}):(0,L.jsx)(m,{...g})})});function oY(e){return Xr(`MuiTabs`,e)}var sY=Zr(`MuiTabs`,[`root`,`vertical`,`list`,`flexContainer`,`flexContainerVertical`,`centered`,`scroller`,`fixed`,`scrollableX`,`scrollableY`,`hideScrollbar`,`scrollButtons`,`scrollButtonsHideMobile`,`indicator`]),cY=(e,t)=>e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:e.firstChild,lY=(e,t)=>e===t?e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:e.lastChild,uY=(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}}},dY=e=>{let{vertical:t,fixed:n,hideScrollbar:r,scrollableX:i,scrollableY:a,centered:o,scrollButtonsHideMobile:s,classes:c}=e;return va({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`]},oY,c)},fY=B(`div`,{name:`MuiTabs`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`& .${sY.scrollButtons}`]:t.scrollButtons},{[`& .${sY.scrollButtons}`]:n.scrollButtonsHideMobile&&t.scrollButtonsHideMobile},t.root,n.vertical&&t.vertical]}})(pd(({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:{[`& .${sY.scrollButtons}`]:{[e.breakpoints.down(`sm`)]:{display:`none`}}}}]}))),pY=B(`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`}}]}),mY=B(`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`}}]}),hY=B(`span`,{name:`MuiTabs`,slot:`Indicator`})(pd(({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}}]}))),gY=B(QJ)({overflowX:`auto`,overflowY:`hidden`,scrollbarWidth:`none`,"&::-webkit-scrollbar":{display:`none`}}),_Y={},vY=I.forwardRef(function(e,t){let n=Hl({props:e,name:`MuiTabs`}),r=jo(),i=Li(),{"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=dY(te),re=jh({elementType:y.StartScrollButtonIcon,externalSlotProps:b.startScrollButtonIcon,ownerState:te}),ie=jh({elementType:y.EndScrollButtonIcon,externalSlotProps:b.endScrollButtonIcon,ownerState:te}),[P,ae]=I.useState(!1),[oe,se]=I.useState(_Y),[ce,le]=I.useState(!1),[ue,de]=I.useState(!1),[fe,pe]=I.useState(!1),[me,he]=I.useState({overflow:`hidden`,scrollbarWidth:0}),ge=new Map,F=I.useRef(null),_e=I.useRef(null),ve={slots:y,slotProps:{indicator:x,scrollButtons:S,...b}},ye=()=>{let e=F.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=_e.current.children;if(e.length>0){let t=e[ge.get(w)];n=t?t.getBoundingClientRect():null}}return{tabsMeta:t,tabMeta:n}},be=tf(()=>{let{tabsMeta:e,tabMeta:t}=ye(),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 oe[r]!=`number`||typeof oe[N]!=`number`)se(a);else{let e=Math.abs(oe[r]-a[r]),t=Math.abs(oe[N]-a[N]);(e>=1||t>=1)&&se(a)}}),xe=(e,{animation:t=!0}={})=>{t?XJ(A,F.current,e,{duration:r.transitions.duration.standard}):F.current[A]=e},Se=e=>{let t=F.current[A];k?t+=e:t+=e*(i?-1:1),xe(t)},Ce=()=>{let e=F.current[ee],t=0,n=Array.from(_e.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},we=()=>{Se(-1*Ce())},Te=()=>{Se(Ce())},[Ee,{onChange:De,...Oe}]=yd(`scrollbar`,{className:R(ne.scrollableX,ne.hideScrollbar),elementType:gY,shouldForwardComponentProp:!0,externalForwardedProps:ve,ownerState:te}),ke=I.useCallback(e=>{De?.(e),he({overflow:null,scrollbarWidth:e})},[De]),[Ae,je]=yd(`scrollButtons`,{className:R(ne.scrollButtons,S.className),elementType:aY,externalForwardedProps:ve,ownerState:te,additionalProps:{orientation:h,slots:{StartScrollButtonIcon:y.startScrollButtonIcon||y.StartScrollButtonIcon,EndScrollButtonIcon:y.endScrollButtonIcon||y.EndScrollButtonIcon},slotProps:{startScrollButtonIcon:re,endScrollButtonIcon:ie}}}),Me=()=>{let e={};e.scrollbarSizeListener=O?(0,L.jsx)(Ee,{...Oe,onChange:ke}):null;let t=O&&(_===`auto`&&(ce||ue)||_===!0);return e.scrollButtonStart=t?(0,L.jsx)(Ae,{direction:i?`right`:`left`,onClick:we,disabled:!ce,...je}):null,e.scrollButtonEnd=t?(0,L.jsx)(Ae,{direction:i?`left`:`right`,onClick:Te,disabled:!ue,...je}):null,e},Ne=tf(e=>{let{tabsMeta:t,tabMeta:n}=ye();if(!(!n||!t)){if(n[j]<t[j]){let r=t[A]+(n[j]-t[j]);xe(r,{animation:e})}else if(n[M]>t[M]){let r=t[A]+(n[M]-t[M]);xe(r,{animation:e})}}}),Pe=tf(()=>{O&&_!==!1&&pe(!fe)});I.useEffect(()=>{let e=Wl(()=>{F.current&&be()}),t,n=n=>{n.forEach(e=>{e.removedNodes.forEach(e=>{t?.unobserve(e)}),e.addedNodes.forEach(e=>{t?.observe(e)})}),e(),Pe()},r=Jl(F.current);r.addEventListener(`resize`,e);let i;return typeof ResizeObserver<`u`&&(t=new ResizeObserver(e),Array.from(_e.current.children).forEach(e=>{t.observe(e)})),typeof MutationObserver<`u`&&(i=new MutationObserver(n),i.observe(_e.current,{childList:!0})),()=>{e.clear(),r.removeEventListener(`resize`,e),i?.disconnect(),t?.disconnect()}},[be,Pe]),I.useEffect(()=>{let e=Array.from(_e.current.children),t=e.length;if(typeof IntersectionObserver<`u`&&t>0&&O&&_!==!1){let n=e[0],r=e[t-1],i={root:F.current,threshold:.99},a=new IntersectionObserver(e=>{le(!e[0].isIntersecting)},i);a.observe(n);let o=new IntersectionObserver(e=>{de(!e[0].isIntersecting)},i);return o.observe(r),()=>{a.disconnect(),o.disconnect()}}},[O,_,fe,l?.length]),I.useEffect(()=>{ae(!0)},[]),I.useEffect(()=>{be()}),I.useEffect(()=>{Ne(_Y!==oe)},[Ne,oe]),I.useImperativeHandle(s,()=>({updateIndicator:be,updateScrollButtons:Pe}),[be,Pe]);let[Fe,Ie]=yd(`indicator`,{className:R(ne.indicator,x.className),elementType:hY,externalForwardedProps:ve,ownerState:te,additionalProps:{style:oe}}),Le=(0,L.jsx)(Fe,{...Ie}),Re=0,ze=I.Children.map(l,e=>{if(!I.isValidElement(e))return null;let t=e.props.value===void 0?Re:e.props.value;ge.set(t,Re);let n=t===w;return Re+=1,I.cloneElement(e,{fullWidth:T===`fullWidth`,indicator:n&&!P&&Le,selected:n,selectionFollowsFocus:v,onChange:m,textColor:C,value:t,...Re===1&&w===!1&&!e.props.tabIndex?{tabIndex:0}:{}})}),Be=e=>{if(e.altKey||e.shiftKey||e.ctrlKey||e.metaKey)return;let t=_e.current,n=td(Kl(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(),uY(t,n,lY);break;case a:e.preventDefault(),uY(t,n,cY);break;case`Home`:e.preventDefault(),uY(t,null,cY);break;case`End`:e.preventDefault(),uY(t,null,lY);break;default:break}},Ve=Me(),[He,Ue]=yd(`root`,{ref:t,className:R(ne.root,u),elementType:fY,externalForwardedProps:{...ve,...D,component:d},ownerState:te}),[We,Ge]=yd(`scroller`,{ref:F,className:ne.scroller,elementType:pY,externalForwardedProps:ve,ownerState:te,additionalProps:{style:{overflow:me.overflow,[k?`margin${i?`Left`:`Right`}`:`marginBottom`]:E?void 0:-me.scrollbarWidth}}}),[Ke,qe]=yd(`list`,{ref:_e,className:R(ne.list,ne.flexContainer),elementType:mY,externalForwardedProps:ve,ownerState:te,getSlotProps:e=>({...e,onKeyDown:t=>{Be(t),e.onKeyDown?.(t)}})});return(0,L.jsxs)(He,{...Ue,children:[Ve.scrollButtonStart,Ve.scrollbarSizeListener,(0,L.jsxs)(We,{...Ge,children:[(0,L.jsx)(Ke,{"aria-label":a,"aria-labelledby":o,"aria-orientation":h===`vertical`?`vertical`:null,role:`tablist`,...qe,children:ze}),P&&Le]}),Ve.scrollButtonEnd]})});function yY(e){return Xr(`MuiTab`,e)}var bY=Zr(`MuiTab`,[`root`,`labelIcon`,`textColorInherit`,`textColorPrimary`,`textColorSecondary`,`selected`,`disabled`,`fullWidth`,`wrapped`,`iconWrapper`,`icon`]),xY=e=>{let{classes:t,textColor:n,fullWidth:r,wrapped:i,icon:a,label:o,selected:s,disabled:c}=e;return va({root:[`root`,a&&o&&`labelIcon`,`textColor${Wd(n)}`,r&&`fullWidth`,i&&`wrapped`,s&&`selected`,c&&`disabled`],icon:[`iconWrapper`,`icon`]},yY,t)},SY=B(om,{name:`MuiTab`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.label&&n.icon&&t.labelIcon,t[`textColor${Wd(n.textColor)}`],n.fullWidth&&t.fullWidth,n.wrapped&&t.wrapped,{[`& .${bY.iconWrapper}`]:t.iconWrapper},{[`& .${bY.icon}`]:t.icon}]}})(pd(({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:{[`& > .${bY.icon}`]:{marginBottom:6}}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&t===`bottom`,style:{[`& > .${bY.icon}`]:{marginTop:6}}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&t===`start`,style:{[`& > .${bY.icon}`]:{marginRight:e.spacing(1)}}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&t===`end`,style:{[`& > .${bY.icon}`]:{marginLeft:e.spacing(1)}}},{props:{textColor:`inherit`},style:{color:`inherit`,opacity:.6,[`&.${bY.selected}`]:{opacity:1},[`&.${bY.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity}}},{props:{textColor:`primary`},style:{color:(e.vars||e).palette.text.secondary,[`&.${bY.selected}`]:{color:(e.vars||e).palette.primary.main},[`&.${bY.disabled}`]:{color:(e.vars||e).palette.text.disabled}}},{props:{textColor:`secondary`},style:{color:(e.vars||e).palette.text.secondary,[`&.${bY.selected}`]:{color:(e.vars||e).palette.secondary.main},[`&.${bY.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)}}]}))),CY=I.forwardRef(function(e,t){let n=Hl({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=xY(b),S=s&&u&&I.isValidElement(s)?I.cloneElement(s,{className:R(x.icon,s.props.className)}):s;return(0,L.jsxs)(SY,{focusRipple:!a,className:R(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,L.jsxs)(I.Fragment,{children:[S,u]}):(0,L.jsxs)(I.Fragment,{children:[u,S]}),l]})}),wY=e=>{let{classes:t}=e;return va({root:[`root`]},nJ,t)},TY=B(OG,{name:`MuiDialogTitle`,slot:`Root`})({padding:`16px 24px`,flex:`0 0 auto`}),EY=I.forwardRef(function(e,t){let n=Hl({props:e,name:`MuiDialogTitle`}),{className:r,id:i,...a}=n,o=n,s=wY(o),{titleId:c=i}=I.useContext(TJ);return(0,L.jsx)(TY,{component:`h2`,className:R(s.root,r),ownerState:o,ref:t,variant:`h6`,id:i??c,...a})});function DY(e){return Xr(`MuiDialogContentText`,e)}Zr(`MuiDialogContentText`,[`root`]);var OY=e=>{let{classes:t}=e,n=va({root:[`root`]},DY,t);return{...t,...n}},kY=B(OG,{shouldForwardProp:e=>No(e)||e===`classes`,name:`MuiDialogContentText`,slot:`Root`})({}),AY=I.forwardRef(function(e,t){let n=Hl({props:e,name:`MuiDialogContentText`}),{children:r,className:i,...a}=n,o=OY(a);return(0,L.jsx)(kY,{component:`p`,variant:`body1`,color:`textSecondary`,ref:t,ownerState:a,className:R(o.root,i),...n,classes:o})}),jY=Cp(`@pie-lib:editable-html:plugins:media:dialog`),MY=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},NY=e=>e&&/(http|https)?:\/\/(www\.)?(player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|)(video\/)?(\d+)(?:|\/\?)/.test(e),PY=e=>e&&/^https:\/\/drive\.google\.com\/(?:file\/d\/|drive\/(?:u\/\d+\/)?folders\/|uc\?id=)([a-zA-Z0-9_-]+)/.test(e),FY=e=>{if(!e)return!1;let t=/^https?:\/\/(soundcloud\.com|snd\.sc)\/(.*)$/;return e.match(t)&&e.match(t)[2]},IY=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(``),jY(e)})}catch{t(``)}}),LY={video:`Video`,audio:`Audio`},RY={uploadFile:`upload-file`,insertUrl:`insert-url`},zY=B(jJ)(({theme:e})=>({"& .MuiDialog-paper":{minWidth:`500px`}})),BY=B(oJ)(({theme:e})=>({padding:0})),VY=B(`div`)(({theme:e})=>({display:`flex`,flexDirection:`space-between`})),HY=B(`div`)(({theme:e})=>({marginTop:e.spacing(1.5)})),UY=B(`input`)(({theme:e})=>({})),WY=B(OG)(({theme:e})=>({marginTop:e.spacing(1.5),color:e.palette.error.main})),GY=B(oL)(({theme:e})=>({marginLeft:e.spacing(1.5)})),KY=class extends I.Component{static propTypes={open:A.bool,edit:A.bool,disablePortal:A.bool,handleClose:A.func,uploadSoundSupport:A.shape({add:A.func,delete:A.func}),type:A.string,src:A.string,url:A.string,urlToUse:A.string,starts:A.number,ends:A.number,height:A.number,width:A.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?RY.uploadFile:RY.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=MY(e),a=NY(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=>{FY(e)&&IY(e).then(t=>{this.handleStateChange({urlToUse:t,invalid:!t,url:e})}).catch(jY)};checkVideo=e=>{if(MY(e)){let t=`https://youtube.com/embed/${e.match(/^.*(youtu\.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/)[2]}`;jY(`is youtube`),this.handleStateChange({urlToUse:t,url:e,invalid:!1})}if(NY(e)){let t=`https://player.vimeo.com/video/${e.replace(/.*vimeo.com\/(.*)/g,`$1`)}`;jY(`is vimeo`),this.handleStateChange({urlToUse:t,url:e,ends:null,invalid:!1})}if(PY(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`;jY(`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===RY.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(jY(`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=MY(u),_=m===RY.insertUrl,v=m===RY.uploadFile,y=_?s||u==null:!h.url||h.scheduled,b=i?.add&&i?.delete&&n!==`video`;return(0,L.jsxs)(zY,{disablePortal:t,open:e,onClose:()=>this.handleDone(!1),"aria-labelledby":`form-dialog-title`,children:[(0,L.jsxs)(EY,{id:`form-dialog-title`,children:[`Insert `,LY[n]]}),(0,L.jsx)(oJ,{children:(0,L.jsxs)(`div`,{children:[(0,L.jsx)(VY,{children:(0,L.jsxs)(vY,{indicatorColor:`primary`,value:m,onChange:(e,t)=>{this.setState({tabValue:t})},children:[b?(0,L.jsx)(CY,{value:RY.uploadFile,label:`Upload file`}):null,(0,L.jsx)(CY,{value:RY.insertUrl,label:n===`video`?`Insert YouTube, Vimeo, or Google Drive URL`:`Insert SoundCloud URL`})]})}),_&&(0,L.jsxs)(`div`,{children:[(0,L.jsx)(vJ,{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,L.jsxs)(BY,{children:[(0,L.jsx)(AY,{children:`Video Properties`}),(0,L.jsx)(vJ,{autoFocus:!0,margin:`dense`,id:`width`,label:`Width`,type:`number`,placeholder:`Width`,value:l,onChange:this.changeHandler(`width`)}),(0,L.jsx)(vJ,{autoFocus:!0,margin:`dense`,id:`height`,label:`Height`,type:`number`,placeholder:`Height`,value:o,onChange:this.changeHandler(`height`)})]}),f&&(0,L.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,L.jsx)(I.Fragment,{children:(0,L.jsxs)(BY,{children:[(0,L.jsx)(vJ,{autoFocus:!0,margin:`dense`,id:`starts`,label:`Starts`,type:`number`,placeholder:`Starts`,value:c,onChange:this.changeHandler(`starts`)}),g&&(0,L.jsx)(vJ,{autoFocus:!0,margin:`dense`,id:`ends`,label:`Ends`,type:`number`,placeholder:`Ends`,value:a,onChange:this.changeHandler(`ends`)})]})})]}),v&&(0,L.jsx)(HY,{children:(0,L.jsxs)(`div`,{children:[h.url?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(VY,{children:[(0,L.jsx)(`audio`,{controls:`controls`,controlsList:`nodownload`,children:(0,L.jsx)(`source`,{type:d,src:h.url})}),(0,L.jsx)(GY,{"aria-label":`delete`,onClick:this.handleRemoveFile,children:(0,L.jsx)(sL,{})})]}),!h.scheduled&&h.loading?(0,L.jsx)(OG,{variant:`subheading`,children:`Loading...`}):null,h.scheduled?(0,L.jsx)(OG,{variant:`subheading`,children:`Waiting for Upload to finish, then inserting item...`}):null]}):h.loading?null:(0,L.jsx)(UY,{accept:`audio/*`,onChange:this.handleUploadFile,type:`file`}),!!h.error&&(0,L.jsx)(WY,{variant:`caption`,children:h.error})]})})]})}),(0,L.jsxs)(SJ,{children:[(0,L.jsx)(Pm,{onClick:()=>this.handleDone(!1),color:`primary`,children:`Cancel`}),(0,L.jsx)(Pm,{disabled:y,onClick:()=>this.handleDone(!0),color:`primary`,children:r?`Update`:`Insert`})]})]})}},qY=B(`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)`})),JY=B(`span`)(({theme:e})=>({cursor:`pointer`,flex:3,border:`solid ${e.palette.common.black}`,textAlign:`right`,borderWidth:`0 2px 0 0`,marginRight:`5px`,paddingRight:`5px`})),YY=B(`span`)({cursor:`pointer`}),XY=class extends I.Component{static propTypes={onEdit:A.func,hideEdit:A.bool,onRemove:A.func};render(){let{hideEdit:e,onEdit:t,onRemove:n}=this.props;return(0,L.jsxs)(qY,{children:[e?null:(0,L.jsx)(JY,{onClick:t,children:`Edit Settings`}),(0,L.jsx)(YY,{onClick:n,children:`Remove`})]})}},ZY=KD.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`,GT({"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 Ek(e=>(0,L.jsx)(eX,{...e,options:this.options}))}}),QY=()=>{document.querySelectorAll(`.insert-media-dialog`).forEach(e=>e.remove())},$Y=e=>{let t=document.createElement(`div`),{type:n,callback:r,options:i,...a}=e,o=document.body.style.overflow;QY(),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,L.jsx)(KY,{...a,uploadSoundSupport:i.uploadSoundSupport,type:n,disablePortal:!0,open:!0,handleClose:s});fu.render(c,t),document.body.appendChild(t)};function eX({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,I.useEffect)(()=>{o||$Y({...t.attrs,options:i,edit:!0,callback:(t,i)=>{t?n(i):r(),e.chain().focus().run()}})},[]),(0,L.jsxs)(fk,{"data-type":a,style:{width:s,height:c},children:[l===`audio`?(0,L.jsx)(`audio`,{controls:!0,controlsList:`nodownload`,children:(0,L.jsx)(`source`,{type:`audio/mp3`,src:o})}):(0,L.jsx)(`iframe`,{src:o,allowFullScreen:!0,frameBorder:`0`,width:s,height:c}),(0,L.jsx)(XY,{onEdit:()=>{$Y({...t.attrs,options:i,edit:!0,callback:(t,r)=>{t&&n(r),e.chain().focus().run()}})},onRemove:r})]})}function tX(e){return Xr(`MuiListItem`,e)}Zr(`MuiListItem`,[`root`,`container`,`dense`,`alignItemsFlexStart`,`divider`,`gutters`,`padding`,`secondaryAction`]);var nX=Zr(`MuiListItemButton`,[`root`,`focusVisible`,`dense`,`alignItemsFlexStart`,`disabled`,`divider`,`gutters`,`selected`]);function rX(e){return Xr(`MuiListItemSecondaryAction`,e)}Zr(`MuiListItemSecondaryAction`,[`root`,`disableGutters`]);var iX=e=>{let{disableGutters:t,classes:n}=e;return va({root:[`root`,t&&`disableGutters`]},rX,n)},aX=B(`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}}]}),oX=I.forwardRef(function(e,t){let n=Hl({props:e,name:`MuiListItemSecondaryAction`}),{className:r,...i}=n,a=I.useContext(Mh),o={...n,disableGutters:a.disableGutters},s=iX(o);return(0,L.jsx)(aX,{className:R(s.root,r),ownerState:o,ref:t,...i})});oX.muiName=`ListItemSecondaryAction`;var sX=(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]},cX=e=>{let{alignItems:t,classes:n,dense:r,disableGutters:i,disablePadding:a,divider:o,hasSecondaryAction:s}=e;return va({root:[`root`,r&&`dense`,!i&&`gutters`,!a&&`padding`,o&&`divider`,t===`flex-start`&&`alignItemsFlexStart`,s&&`secondaryAction`],container:[`container`],secondaryAction:[`secondaryAction`]},tX,n)},lX=B(`div`,{name:`MuiListItem`,slot:`Root`,overridesResolver:sX})(pd(({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:{[`& > .${nX.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}}]}))),uX=B(`li`,{name:`MuiListItem`,slot:`Container`})({position:`relative`}),dX=I.forwardRef(function(e,t){let n=Hl({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=I.useContext(Mh),x=I.useMemo(()=>({dense:f||b.dense||!1,alignItems:r,disableGutters:p}),[r,b.dense,f,p]),S=I.useRef(null),C=I.Children.toArray(i),w=C.length&&Xd(C[C.length-1],[`ListItemSecondaryAction`]),T={...n,alignItems:r,dense:x.dense,disableGutters:p,disablePadding:m,divider:h,hasSecondaryAction:w},E=cX(T),D=Lu(S,t),[O,k]=yd(`secondaryAction`,{elementType:oX,externalForwardedProps:{slots:v,slotProps:_},ownerState:T,className:E.secondaryAction}),A=v.root||s.Root||lX,j=_.root||c.root||{},M={className:R(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,L.jsx)(Mh.Provider,{value:x,children:(0,L.jsxs)(uX,{as:l,className:R(E.container,u),ref:D,ownerState:T,...d,children:[(0,L.jsx)(A,{...j,...!Rl(A)&&{as:ee,ownerState:{...T,...j.ownerState}},...M,children:C}),C.pop()]})})):(0,L.jsx)(Mh.Provider,{value:x,children:(0,L.jsxs)(A,{...j,as:ee,ref:D,...!Rl(A)&&{ownerState:{...T,...j.ownerState}},...M,children:[C,g&&(0,L.jsx)(O,{...k,children:g})]})})}),fX=()=>{document.querySelectorAll(`.insert-css-dialog`).forEach(e=>e.remove())},pX=({editor:e,callback:t,opts:n,selectedText:r,parentNode:i})=>{let a=e.options.element,o=document.createElement(`div`),{selection:s}=e.state;fX(),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,L.jsxs)(`div`,{style:{background:`white`,height:500,padding:20,overflow:`hidden`,display:`flex`,flexFlow:`column`},children:[(0,L.jsx)(`h2`,{children:`Please choose a css class`}),f&&(0,L.jsxs)(`div`,{children:[`The current parent has this class `,f]}),(0,L.jsx)(Ih,{component:`nav`,style:{overflow:`scroll`},children:n.names.map((e,t)=>(0,L.jsxs)(dX,{button:!0,onClick:()=>d(e),children:[(0,L.jsx)(`div`,{style:{marginRight:20},children:e}),(0,L.jsx)(`div`,{dangerouslySetInnerHTML:{__html:p(e)}})]},`rule-${t}`))})]});fu.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)}})},mX=hD.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`,GT(e),0]},addCommands(){return{setCSSClass:e=>({commands:t})=>t.setMark(this.name,{class:e}),unsetCSSClass:()=>({commands:e})=>e.unsetMark(this.name),openCSSClassDialog:()=>({editor:e})=>{pX({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()}})}}}}),hX=iN.extend({content:`(div | paragraph | heading | bulletList | orderedList | blockquote | codeBlock | horizontalRule | image | imageUploadNode)+`}),gX=KD.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`,GT(e),0]},addCommands(){return{toggleHeadingParagraph:()=>({commands:e,editor:t})=>t.isActive(`headingParagraph`)?e.setNode(`paragraph`):e.setNode(`headingParagraph`,{"data-heading":`heading1`})}}}),_X=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`},vX=Yd((0,L.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`),yX=Yd((0,L.jsx)(`path`,{d:`M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4z`}),`FormatItalic`),bX=Yd((0,L.jsx)(`path`,{d:`M10 19h4v-3h-4zM5 4v3h5v3h4V7h5V4zM3 14h18v-2H3z`}),`FormatStrikethrough`),xX=Yd((0,L.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`),SX=Yd((0,L.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`),CX=Yd((0,L.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`),wX=Yd((0,L.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`),TX=Yd((0,L.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`),EX=Yd((0,L.jsx)(`path`,{d:`M18 4H6v2l6.5 6L6 18v2h12v-3h-7l5-5-5-5h7z`}),`Functions`),DX=Yd((0,L.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`),OX=Yd((0,L.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`),kX=Yd((0,L.jsx)(`path`,{d:`M6 17h3l2-4V7H5v6h3zm8 0h3l2-4V7h-6v6h3z`}),`FormatQuote`),AX=Yd((0,L.jsx)(`path`,{d:`M18 3v2h-2V3H8v2H6V3H4v18h2v-2h2v2h8v-2h2v2h2V3zM8 17H6v-2h2zm0-4H6v-2h2zm0-4H6V7h2zm10 8h-2v-2h2zm0-4h-2v-2h2zm0-4h-2V7h2z`}),`Theaters`),jX=Yd((0,L.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`),MX=Yd((0,L.jsx)(`path`,{d:`M3 3v18h18V3zm8 16H5v-6h6zm0-8H5V5h6zm8 8h-6v-6h6zm0-8h-6V5h6z`}),`BorderAll`),NX=B(`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`})),PX=()=>(0,L.jsx)(NX,{children:`+ Response Area`}),FX={characters:[[`á`,`é`,`í`,`ó`,`ú`],[`Á`,`É`,`Í`,`Ó`,`Ú`],[`—`,`«`,`»`,`ñ`,`ü`],[`-`,`¿`,`¡`,`Ñ`,`Ü`]]},IX={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:`—`}]]},LX=()=>(0,L.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,L.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`})}),RX=()=>(0,L.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,L.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`})}),zX=()=>(0,L.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,L.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`})}),BX=()=>(0,L.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,L.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`})}),VX=({editor:e,onChange:t})=>{let[n,r]=(0,I.useState)(!1),i;switch(!0){case e.isActive({textAlign:`right`}):i=(0,L.jsx)(RX,{});break;case e.isActive({textAlign:`center`}):i=(0,L.jsx)(zX,{});break;case e.isActive({textAlign:`justify`}):i=(0,L.jsx)(BX,{});break;default:i=(0,L.jsx)(LX,{});break}let a=t=>{let n=t.currentTarget?.getAttribute(`value`);n&&e.commands.setTextAlign(n),r(!1)};return(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`},onClick:e=>{e.preventDefault(),e.stopPropagation(),r(!n)},children:[i,(0,L.jsx)(`span`,{style:{marginLeft:`5px`,fontSize:`8px`},"aria-hidden":`true`,children:`▼`})]}),(0,L.jsx)(zp,{in:n,timeout:`auto`,unmountOnExit:!0,style:{position:`absolute`},children:(0,L.jsxs)(Ih,{component:`div`,disablePadding:!0,style:{background:`#fff`,display:`flex`,flexDirection:`row`,padding:0},children:[(0,L.jsx)(dX,{button:!0,type:`submit`,value:`left`,"aria-label":`Align text left`,onClick:a,children:(0,L.jsx)(LX,{})}),(0,L.jsx)(dX,{button:!0,type:`submit`,value:`center`,"aria-label":`Align text center`,onClick:a,children:(0,L.jsx)(zX,{})}),(0,L.jsx)(dX,{button:!0,type:`submit`,value:`right`,"aria-label":`Align text right`,onClick:a,children:(0,L.jsx)(RX,{})}),(0,L.jsx)(dX,{button:!0,type:`submit`,value:`justify`,"aria-label":`Justify text`,onClick:a,children:(0,L.jsx)(BX,{})})]})})]})},HX=B(`div`)(({theme:e})=>({fontFamily:`Cerebri Sans, Arial, sans-serif`,fontSize:e.typography.fontSize,fontWeight:`bold`,lineHeight:`14px`,position:`relative`,whiteSpace:`nowrap`})),UX=()=>(0,L.jsx)(HX,{children:`CSS`}),WX=B(`path`)({fill:`grey`,"&:hover":{fill:`black`}}),GX=e=>t=>(0,L.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,L.jsx)(e,{...t})}),KX=GX(e=>(0,L.jsx)(WX,{...e,d:`M22,10A2,2 0 0,1 20,12H4A2,2 0 0,1 2,10V3H4V5H8V3H10V5H14V3H16V5H20V3H22V10M4,10H8V7H4V10M10,10H14V7H10V10M20,10V7H16V10H20M11,14H13V17H16V19H13V22H11V19H8V17H11V14Z`})),qX=GX(e=>(0,L.jsx)(WX,{...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`})),JX=GX(e=>(0,L.jsx)(WX,{...e,d:`M11,2A2,2 0 0,1 13,4V20A2,2 0 0,1 11,22H2V2H11M4,10V14H11V10H4M4,16V20H11V16H4M4,4V8H11V4H4M15,11H18V8H20V11H23V13H20V16H18V13H15V11Z`})),YX=GX(e=>(0,L.jsx)(WX,{...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`})),XX=GX(e=>(0,L.jsx)(WX,{...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`,QX=`right`,$X=`left`,eZ=`auto`,tZ=[`top`,ZX,QX,$X],nZ=`start`,rZ=`clippingParents`,iZ=`viewport`,aZ=`popper`,oZ=`reference`,sZ=tZ.reduce(function(e,t){return e.concat([t+`-`+nZ,t+`-end`])},[]),cZ=[].concat(tZ,[eZ]).reduce(function(e,t){return e.concat([t,t+`-`+nZ,t+`-end`])},[]),lZ=[`beforeRead`,`read`,`afterRead`,`beforeMain`,`main`,`afterMain`,`beforeWrite`,`write`,`afterWrite`];function uZ(e){return e?(e.nodeName||``).toLowerCase():null}function dZ(e){if(e==null)return window;if(e.toString()!==`[object Window]`){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function fZ(e){return e instanceof dZ(e).Element||e instanceof Element}function pZ(e){return e instanceof dZ(e).HTMLElement||e instanceof HTMLElement}function mZ(e){return typeof ShadowRoot>`u`?!1:e instanceof dZ(e).ShadowRoot||e instanceof ShadowRoot}function hZ(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];!pZ(i)||!uZ(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 gZ(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},{});!pZ(r)||!uZ(r)||(Object.assign(r.style,a),Object.keys(i).forEach(function(e){r.removeAttribute(e)}))})}}var _Z={name:`applyStyles`,enabled:!0,phase:`write`,fn:hZ,effect:gZ,requires:[`computeStyles`]};function vZ(e){return e.split(`-`)[0]}var yZ=Math.max,bZ=Math.min,xZ=Math.round;function SZ(){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 CZ(){return!/^((?!chrome|android).)*safari/i.test(SZ())}function wZ(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,a=1;t&&pZ(e)&&(i=e.offsetWidth>0&&xZ(r.width)/e.offsetWidth||1,a=e.offsetHeight>0&&xZ(r.height)/e.offsetHeight||1);var o=(fZ(e)?dZ(e):window).visualViewport,s=!CZ()&&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 TZ(e){var t=wZ(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 EZ(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&mZ(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function DZ(e){return dZ(e).getComputedStyle(e)}function OZ(e){return[`table`,`td`,`th`].indexOf(uZ(e))>=0}function kZ(e){return((fZ(e)?e.ownerDocument:e.document)||window.document).documentElement}function AZ(e){return uZ(e)===`html`?e:e.assignedSlot||e.parentNode||(mZ(e)?e.host:null)||kZ(e)}function jZ(e){return!pZ(e)||DZ(e).position===`fixed`?null:e.offsetParent}function MZ(e){var t=/firefox/i.test(SZ());if(/Trident/i.test(SZ())&&pZ(e)&&DZ(e).position===`fixed`)return null;var n=AZ(e);for(mZ(n)&&(n=n.host);pZ(n)&&[`html`,`body`].indexOf(uZ(n))<0;){var r=DZ(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 NZ(e){for(var t=dZ(e),n=jZ(e);n&&OZ(n)&&DZ(n).position===`static`;)n=jZ(n);return n&&(uZ(n)===`html`||uZ(n)===`body`&&DZ(n).position===`static`)?t:n||MZ(e)||t}function PZ(e){return[`top`,`bottom`].indexOf(e)>=0?`x`:`y`}function FZ(e,t,n){return yZ(e,bZ(t,n))}function IZ(e,t,n){var r=FZ(e,t,n);return r>n?n:r}function LZ(){return{top:0,right:0,bottom:0,left:0}}function RZ(e){return Object.assign({},LZ(),e)}function zZ(e,t){return t.reduce(function(t,n){return t[n]=e,t},{})}var BZ=function(e,t){return e=typeof e==`function`?e(Object.assign({},t.rects,{placement:t.placement})):e,RZ(typeof e==`number`?zZ(e,tZ):e)};function VZ(e){var t,n=e.state,r=e.name,i=e.options,a=n.elements.arrow,o=n.modifiersData.popperOffsets,s=vZ(n.placement),c=PZ(s),l=[`left`,`right`].indexOf(s)>=0?`height`:`width`;if(!(!a||!o)){var u=BZ(i.padding,n),d=TZ(a),f=c===`y`?`top`:$X,p=c===`y`?ZX:QX,m=n.rects.reference[l]+n.rects.reference[c]-o[c]-n.rects.popper[l],h=o[c]-n.rects.reference[c],g=NZ(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=FZ(y,x,b),C=c;n.modifiersData[r]=(t={},t[C]=S,t.centerOffset=S-x,t)}}function HZ(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)||EZ(t.elements.popper,r)&&(t.elements.arrow=r))}var UZ={name:`arrow`,enabled:!0,phase:`main`,fn:VZ,effect:HZ,requires:[`popperOffsets`],requiresIfExists:[`preventOverflow`]};function WZ(e){return e.split(`-`)[1]}var GZ={top:`auto`,right:`auto`,bottom:`auto`,left:`auto`};function KZ(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:xZ(n*i)/i||0,y:xZ(r*i)/i||0}}function qZ(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=$X,b=`top`,x=window;if(l){var S=NZ(n),C=`clientHeight`,w=`clientWidth`;if(S===dZ(n)&&(S=kZ(n),DZ(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=QX;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&&GZ),O=u===!0?KZ({x:p,y:h},dZ(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 JZ(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:vZ(t.placement),variation:WZ(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,qZ(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,qZ(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 YZ={name:`computeStyles`,enabled:!0,phase:`beforeWrite`,fn:JZ,data:{}},XZ={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=dZ(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&l.forEach(function(e){e.addEventListener(`scroll`,n.update,XZ)}),s&&c.addEventListener(`resize`,n.update,XZ),function(){a&&l.forEach(function(e){e.removeEventListener(`scroll`,n.update,XZ)}),s&&c.removeEventListener(`resize`,n.update,XZ)}}var QZ={name:`eventListeners`,enabled:!0,phase:`write`,fn:function(){},effect:ZZ,data:{}},$Z={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function eQ(e){return e.replace(/left|right|bottom|top/g,function(e){return $Z[e]})}var tQ={start:`end`,end:`start`};function nQ(e){return e.replace(/start|end/g,function(e){return tQ[e]})}function rQ(e){var t=dZ(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function iQ(e){return wZ(kZ(e)).left+rQ(e).scrollLeft}function aQ(e,t){var n=dZ(e),r=kZ(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;var l=CZ();(l||!l&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}return{width:a,height:o,x:s+iQ(e),y:c}}function oQ(e){var t=kZ(e),n=rQ(e),r=e.ownerDocument?.body,i=yZ(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=yZ(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),o=-n.scrollLeft+iQ(e),s=-n.scrollTop;return DZ(r||t).direction===`rtl`&&(o+=yZ(t.clientWidth,r?r.clientWidth:0)-i),{width:i,height:a,x:o,y:s}}function sQ(e){var t=DZ(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function cQ(e){return[`html`,`body`,`#document`].indexOf(uZ(e))>=0?e.ownerDocument.body:pZ(e)&&sQ(e)?e:cQ(AZ(e))}function lQ(e,t){t===void 0&&(t=[]);var n=cQ(e),r=n===e.ownerDocument?.body,i=dZ(n),a=r?[i].concat(i.visualViewport||[],sQ(n)?n:[]):n,o=t.concat(a);return r?o:o.concat(lQ(AZ(a)))}function uQ(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function dQ(e,t){var n=wZ(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 fQ(e,t,n){return t===`viewport`?uQ(aQ(e,n)):fZ(t)?dQ(t,n):uQ(oQ(kZ(e)))}function pQ(e){var t=lQ(AZ(e)),n=[`absolute`,`fixed`].indexOf(DZ(e).position)>=0&&pZ(e)?NZ(e):e;return fZ(n)?t.filter(function(e){return fZ(e)&&EZ(e,n)&&uZ(e)!==`body`}):[]}function mQ(e,t,n,r){var i=t===`clippingParents`?pQ(e):[].concat(t),a=[].concat(i,[n]),o=a[0],s=a.reduce(function(t,n){var i=fQ(e,n,r);return t.top=yZ(i.top,t.top),t.right=bZ(i.right,t.right),t.bottom=bZ(i.bottom,t.bottom),t.left=yZ(i.left,t.left),t},fQ(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 hQ(e){var t=e.reference,n=e.element,r=e.placement,i=r?vZ(r):null,a=r?WZ(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 QX:c={x:t.x+t.width,y:s};break;case $X:c={x:t.x-n.width,y:s};break;default:c={x:t.x,y:t.y}}var l=i?PZ(i):null;if(l!=null){var u=l===`y`?`height`:`width`;switch(a){case nZ: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 gQ(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?rZ:s,l=n.rootBoundary,u=l===void 0?iZ:l,d=n.elementContext,f=d===void 0?aZ:d,p=n.altBoundary,m=p!==void 0&&p,h=n.padding,g=h===void 0?0:h,_=RZ(typeof g==`number`?zZ(g,tZ):g),v=f===`popper`?oZ:aZ,y=e.rects.popper,b=e.elements[m?v:f],x=mQ(fZ(b)?b:b.contextElement||kZ(e.elements.popper),c,u,o),S=wZ(e.elements.reference),C=hQ({reference:S,element:y,strategy:`absolute`,placement:i}),w=uQ(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 _Q(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?cZ:c,u=WZ(r),d=u?s?sZ:sZ.filter(function(e){return WZ(e)===u}):tZ,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]=gQ(e,{placement:n,boundary:i,rootBoundary:a,padding:o})[vZ(n)],t},{});return Object.keys(p).sort(function(e,t){return p[e]-p[t]})}function vQ(e){if(vZ(e)===`auto`)return[];var t=eQ(e);return[nQ(e),t,nQ(t)]}function yQ(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,_=vZ(g)===g,v=c||(_||!m?[eQ(g)]:vQ(g)),y=[g].concat(v).reduce(function(e,n){return e.concat(vZ(n)===`auto`?_Q(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=vZ(E),O=WZ(E)===nZ,k=[`top`,ZX].indexOf(D)>=0,A=k?`width`:`height`,j=gQ(t,{placement:E,boundary:u,rootBoundary:d,altBoundary:f,padding:l}),M=k?O?QX:$X:O?ZX:`top`;b[A]>x[A]&&(M=eQ(M));var ee=eQ(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 bQ={name:`flip`,enabled:!0,phase:`main`,fn:yQ,requiresIfExists:[`offset`],data:{_skip:!1}};function xQ(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 SQ(e){return[`top`,QX,ZX,$X].some(function(t){return e[t]>=0})}function CQ(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,a=t.modifiersData.preventOverflow,o=gQ(t,{elementContext:`reference`}),s=gQ(t,{altBoundary:!0}),c=xQ(o,r),l=xQ(s,i,a),u=SQ(c),d=SQ(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 wQ={name:`hide`,enabled:!0,phase:`main`,requiresIfExists:[`preventOverflow`],fn:CQ};function TQ(e,t,n){var r=vZ(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 EQ(e){var t=e.state,n=e.options,r=e.name,i=n.offset,a=i===void 0?[0,0]:i,o=cZ.reduce(function(e,n){return e[n]=TQ(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 DQ={name:`offset`,enabled:!0,phase:`main`,requires:[`popperOffsets`],fn:EQ};function OQ(e){var t=e.state,n=e.name;t.modifiersData[n]=hQ({reference:t.rects.reference,element:t.rects.popper,strategy:`absolute`,placement:t.placement})}var kQ={name:`popperOffsets`,enabled:!0,phase:`read`,fn:OQ,data:{}};function AQ(e){return e===`x`?`y`:`x`}function jQ(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=gQ(t,{boundary:c,rootBoundary:l,padding:d,altBoundary:u}),_=vZ(t.placement),v=WZ(t.placement),y=!v,b=PZ(_),x=AQ(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`:$X,A=b===`y`?ZX:QX,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,P=p&&ie?TZ(ie):{width:0,height:0},ae=t.modifiersData[`arrow#persistent`]?t.modifiersData[`arrow#persistent`].padding:LZ(),oe=ae[k],se=ae[A],ce=FZ(0,C[j],P[j]),le=y?C[j]/2-te-ce-oe-E.mainAxis:ne-ce-oe-E.mainAxis,ue=y?-C[j]/2+te+ce+se+E.mainAxis:re+ce+se+E.mainAxis,de=t.elements.arrow&&NZ(t.elements.arrow),fe=de?b===`y`?de.clientTop||0:de.clientLeft||0:0,pe=D?.[b]??0,me=M+le-pe-fe,he=M+ue-pe,ge=FZ(p?bZ(ee,me):ee,M,p?yZ(N,he):N);S[b]=ge,O[b]=ge-M}if(s){var F=b===`x`?`top`:$X,_e=b===`x`?ZX:QX,ve=S[x],ye=x===`y`?`height`:`width`,be=ve+g[F],xe=ve-g[_e],Se=[`top`,$X].indexOf(_)!==-1,Ce=D?.[x]??0,we=Se?be:ve-C[ye]-w[ye]-Ce+E.altAxis,Te=Se?ve+C[ye]+w[ye]-Ce-E.altAxis:xe,Ee=p&&Se?IZ(we,ve,Te):FZ(p?we:be,ve,p?Te:xe);S[x]=Ee,O[x]=Ee-ve}t.modifiersData[r]=O}}var MQ={name:`preventOverflow`,enabled:!0,phase:`main`,fn:jQ,requiresIfExists:[`offset`]};function NQ(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function PQ(e){return e===dZ(e)||!pZ(e)?rQ(e):NQ(e)}function FQ(e){var t=e.getBoundingClientRect(),n=xZ(t.width)/e.offsetWidth||1,r=xZ(t.height)/e.offsetHeight||1;return n!==1||r!==1}function IQ(e,t,n){n===void 0&&(n=!1);var r=pZ(t),i=pZ(t)&&FQ(t),a=kZ(t),o=wZ(e,i,n),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&((uZ(t)!==`body`||sQ(a))&&(s=PQ(t)),pZ(t)?(c=wZ(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):a&&(c.x=iQ(a))),{x:o.left+s.scrollLeft-c.x,y:o.top+s.scrollTop-c.y,width:o.width,height:o.height}}function LQ(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 RQ(e){var t=LQ(e);return lZ.reduce(function(e,n){return e.concat(t.filter(function(e){return e.phase===n}))},[])}function zQ(e){var t;return function(){return t||=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})}),t}}function BQ(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 VQ={placement:`bottom`,modifiers:[],strategy:`absolute`};function HQ(){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 UQ(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,a=i===void 0?VQ:i;return function(e,t,n){n===void 0&&(n=a);var i={placement:`bottom`,orderedModifiers:[],options:Object.assign({},VQ,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:fZ(e)?lQ(e):e.contextElement?lQ(e.contextElement):[],popper:lQ(t)};var s=RQ(BQ([].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(HQ(t,n)){i.rects={reference:IQ(t,NZ(n),i.options.strategy===`fixed`),popper:TZ(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:zQ(function(){return new Promise(function(e){c.forceUpdate(),e(i)})}),destroy:function(){u(),s=!0}};if(!HQ(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 WQ=UQ({defaultModifiers:[QZ,kQ,YZ,_Z,DQ,bQ,MQ,UZ,wQ]});function GQ(e){return Xr(`MuiPopper`,e)}Zr(`MuiPopper`,[`root`]);function KQ(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 qQ(e){return typeof e==`function`?e():e}function JQ(e){return e.nodeType!==void 0}var YQ=e=>{let{classes:t}=e;return va({root:[`root`]},GQ,t)},XQ={},ZQ=I.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=I.useRef(null),_=Iu(g,t),v=I.useRef(null),y=Iu(v,u),b=I.useRef(y);di(()=>{b.current=y},[y]),I.useImperativeHandle(u,()=>v.current,[]);let x=KQ(c,i),[S,C]=I.useState(x),[w,T]=I.useState(qQ(n));I.useEffect(()=>{v.current&&v.current.forceUpdate()}),I.useEffect(()=>{n&&T(qQ(n))},[n]),di(()=>{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=WQ(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=YQ(e),O=f.root??`div`;return(0,L.jsx)(O,{...jh({elementType:O,externalSlotProps:d.root,externalForwardedProps:h,additionalProps:{role:`tooltip`,ref:_},ownerState:e,className:D.root}),children:typeof r==`function`?r(E):r})}),QQ=B(I.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=XQ,popperRef:f,style:p,transition:m=!1,slotProps:h={},slots:g={},..._}=e,[v,y]=I.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=qQ(n);S=e&&JQ(e)?Gl(e).body:Gl(null).body}let C=!l&&s&&(!m||v)?`none`:void 0,w=m?{in:l,onEnter:b,onExited:x}:void 0;return(0,L.jsx)(fd,{disablePortal:o,container:S,children:(0,L.jsx)(ZQ,{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`})({}),$Q=B(I.forwardRef(function(e,t){let n=Li(),{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}=Hl({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,L.jsx)(QQ,{as:i,direction:n?`rtl`:`ltr`,slots:{root:y},slotProps:_??o,...b,ref:t})}))({background:`#fff`,padding:`10px`,pointerEvents:`none`,zIndex:99999}),e$=B(OG)({fontSize:50,textAlign:`center`}),t$=({children:e,...t})=>(0,L.jsx)($Q,{id:`mouse-over-popover`,open:!0,anchorOrigin:{vertical:`bottom`,horizontal:`left`},transformOrigin:{vertical:`top`,horizontal:`left`},disableRestoreFocus:!0,disableAutoFocus:!0,...t,children:(0,L.jsx)(e$,{children:e})}),n$=({letter:e})=>(0,L.jsx)(`div`,{style:{fontSize:`24px`,lineHeight:`24px`},children:e});n$.propTypes={letter:A.string};function r$({editor:e,opts:t,onClose:n}){if(!t?.characters?.length)return null;let r=(0,I.useRef)(null),i=(0,I.useRef)(n),[a,o]=(0,I.useState)({top:0,left:0}),[s,c]=(0,I.useState)(null);i.current=n;let l=(0,I.useMemo)(()=>{if(!t)return FX;switch(!0){case t.language===`spanish`:return FX;case t.language===`special`:return IX;default:return t}},[t]),u=(0,I.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,I.useEffect)(()=>()=>{d()},[]),(0,I.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,L.jsxs)(L.Fragment,{children:[fu.createPortal((0,L.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,L.jsx)(`div`,{children:(0,L.jsx)(Oq,{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:Xo(e,`name`)||e,write:Xo(e,`write`)||e,label:Xo(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&&fu.createPortal((0,L.jsxs)(t$,{onClose:d,anchorEl:s.anchorEl,children:[(0,L.jsx)(`div`,{children:s.el.label}),(0,L.jsx)(`div`,{style:{fontSize:20,lineHeight:`20px`},children:s.el.description}),(0,L.jsx)(`div`,{style:{fontSize:20,lineHeight:`20px`},children:s.el.unicode})]}),document.body)]})}r$.propTypes={editor:A.object,opts:A.object,onClose:A.func.isRequired};var i$=()=>(0,L.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,L.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`})}),a$=()=>(0,L.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,L.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`})}),o$=()=>(0,L.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,L.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 s$({editor:e,classes:t,activePlugins:n,toolbarOpts:r,responseAreaProps:i,onChange:a,autoWidthToolbar:o}){let[s,c]=(0,I.useState)(!1),l=r??{},u=ik({editor:e,selector:e=>{let{selection:t}=e.editor?.state||{},n;if(!e.editor?.commandManager)return{};t instanceof kv&&(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=R(t.toolbar,cL,{[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,I.useMemo)(()=>[{icon:(0,L.jsx)(SX,{}),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,L.jsx)(KX,{}),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,L.jsx)(qX,{}),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,L.jsx)(JX,{}),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,L.jsx)(YX,{}),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,L.jsx)(XX,{}),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,L.jsx)(MX,{}),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,L.jsx)(vX,{}),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,L.jsx)(yX,{}),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,L.jsx)(bX,{}),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,L.jsx)(xX,{}),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,L.jsx)(TX,{}),label:`Underline`,toggle:!0,onClick:e=>e.chain().focus().toggleUnderline().run(),hidden:()=>!n?.includes(`underline`),isActive:e=>e.isUnderline},{icon:(0,L.jsx)(a$,{}),label:`Subscript`,toggle:!0,onClick:e=>e.chain().focus().toggleSubscript().run(),hidden:()=>!n?.includes(`subscript`),isActive:e=>e.isSubScript},{icon:(0,L.jsx)(i$,{}),label:`Superscript`,toggle:!0,onClick:e=>e.chain().focus().toggleSuperscript().run(),hidden:()=>!n?.includes(`superscript`),isActive:e=>e.isSuperScript},{icon:(0,L.jsx)(DX,{}),label:`Insert image`,hidden:()=>!n?.includes(`image`),onClick:e=>e.chain().focus().setImageUploadNode().run()},{icon:(0,L.jsx)(AX,{}),label:`Insert video`,hidden:()=>!n?.includes(`video`),onClick:e=>e.chain().focus().insertMedia({type:`video`}).run()},{icon:(0,L.jsx)(jX,{}),label:`Insert audio`,hidden:()=>!n?.includes(`audio`),onClick:e=>e.chain().focus().insertMedia({type:`audio`,tag:`audio`}).run()},{icon:(0,L.jsx)(UX,{}),label:`CSS classes`,hidden:()=>!n?.includes(`css`),onClick:e=>e.commands.openCSSClassDialog()},{icon:(0,L.jsx)(kX,{}),label:`Blockquote`,toggle:!0,hidden:()=>!n?.includes(`blockquote`),onClick:e=>e.chain().focus().toggleBlockquote().run(),isActive:e=>e.isBlockquote},{icon:(0,L.jsx)(o$,{}),label:`Heading`,toggle:!0,hidden:()=>!n?.includes(`h3`),onClick:e=>e.chain().focus().toggleHeadingParagraph().run(),isActive:e=>e.isHeadingParagraph},{icon:(0,L.jsx)(EX,{}),label:`Insert math`,hidden:()=>!n?.includes(`math`),onClick:e=>e.chain().focus().insertMath(``).run()},{icon:(0,L.jsx)(n$,{letter:`ñ`}),label:`Spanish characters (ñ)`,hidden:()=>!n?.includes(`languageCharacters`),onClick:()=>c(FX)},{icon:(0,L.jsx)(n$,{letter:`€`}),label:`Special characters (€)`,hidden:()=>n?.filter(e=>e===`languageCharacters`).length!==2,onClick:()=>c(IX)},{icon:(0,L.jsx)(VX,{editor:e}),label:`Text alignment`,hidden:()=>!n?.includes(`text-align`),onClick:()=>{}},{icon:(0,L.jsx)(CX,{}),label:`Bulleted list`,toggle:!0,hidden:()=>!n?.includes(`bulleted-list`),onClick:e=>e.chain().focus().toggleBulletList().run(),isActive:e=>e.isBulletList},{icon:(0,L.jsx)(wX,{}),label:`Numbered list`,toggle:!0,hidden:()=>!n?.includes(`numbered-list`),onClick:e=>e.chain().focus().toggleOrderedList().run(),isActive:e=>e.isOrderedList},{icon:(0,L.jsx)(Im,{}),label:`Undo`,hidden:()=>!n?.includes(`undo`),onClick:e=>e.chain().focus().undo().run(),isDisabled:e=>!e.canUndo},{icon:(0,L.jsx)(OX,{}),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,L.jsxs)(`div`,{className:f,style:{...p},onMouseDown:m,children:[g&&(0,L.jsx)(`div`,{className:t.defaultToolbar,tabIndex:`1`,children:(0,L.jsx)(`div`,{className:t.buttonsContainer,children:(0,L.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,L.jsx)(sL,{})})})}),!u.hideDefaultToolbar&&(0,L.jsxs)(`div`,{className:t.defaultToolbar,tabIndex:`1`,children:[(0,L.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,L.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:R(t.button,{[t.active]:a}),children:n.icon},r)})}),n?.includes(`responseArea`)&&(0,L.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,L.jsx)(PX,{})}),l.showDone&&(0,L.jsx)(dL,{onClick:()=>{a?.(e.getHTML()),e.commands.blur()}})]}),s&&(0,L.jsx)(r$,{editor:e,opts:{...s,renderPopOver:(e,t)=>console.log(`Show popover`,t),closePopOver:()=>console.log(`Close popover`)},onClose:()=>c(!1)})]})}var c$=e=>{jo();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,L.jsx)(l$,{children:(0,L.jsx)(s$,{...e,classes:t})})},l$=B(`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:vf()},"&:focus":{outline:`2px solid ${sp()}`}},"& .active":{color:vf()},"& .disabled":{opacity:.7,cursor:`not-allowed`,"& :hover":{color:yf()}},"& .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`}})),u$=B(`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:vf(),backgroundColor:Bf()},'& table:not([border="1"]) tr':{borderTop:`1px solid ${Qf()}`},"& td, th":{padding:`.6em 1em`,textAlign:`center`},'& table:not([border="1"]) td, th':{border:`1px solid ${Qf()}`},...n&&{border:`2px solid ${e.palette.error.main} !important`}})),d$=B(`div`,{shouldForwardProp:e=>![`disableScrollbar`,`highlightShape`].includes(e)})(({theme:e,disableScrollbar:t,highlightShape:n})=>({position:`relative`,padding:`0px`,overflowY:`auto`,color:vf(),backgroundColor:n?e.palette.action.selected:Bf(),...t&&{"&::-webkit-scrollbar":{display:`none`},scrollbarWidth:`none`,"-ms-overflow-style":`none`}})),f$=B(`div`,{shouldForwardProp:e=>e!==`noPadding`})(({noPadding:e})=>({padding:e?0:`10px 8px`}));function p$(e){let[t,n]=(0,I.useState)(null),r=(0,I.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,I.useEffect)(()=>{i&&r.current&&(i._tiptapContainerEl=r.current)},[i,r.current]),(0,I.useEffect)(()=>{i&&d&&Promise.resolve().then(()=>{i.commands.focus(`end`)})},[i,d]),(0,I.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,I.useMemo)(()=>({width:_X(t||p),minWidth:_X(f),maxWidth:_X(m),height:_X(g),minHeight:_X(h),maxHeight:_X(_)}),[t,f,p,m,h,g,_]);return(0,L.jsxs)(u$,{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,L.jsx)(d$,{disableScrollbar:s,highlightShape:v,children:(0,L.jsx)(f$,{noPadding:l&&l.noPadding,children:o})}),i&&(0,L.jsx)(c$,{editor:i,responseAreaProps:u,toolbarOpts:l,activePlugins:c,onChange:e.onChange,autoWidthToolbar:e.autoWidthToolbar})]})}var m$=Cp(`@pie-lib:editable-html:plugins`),h$=[`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`],g$={"text-align":`textAlign`,"bulleted-list":`ul_list`,"numbered-list":`ol_list`},_$=h$.filter(e=>![`responseArea`,`h3`,`blockquote`].includes(e)),v$=(e,t,n)=>{m$(`[buildPlugins] opts: `,n),e||=_$;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=!$o(n.extraCSSRules),c=n?.languageCharacters||[];return Ko([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)])},y$={position:`bottom`,alignment:`left`,alwaysVisible:!1,showDone:!0,doneOn:`blur`},b$={options:{},respAreaToolbar:()=>{},onHandleAreaChange:()=>{}},x$=[`bold`,`italic`,`underline`,`strikethrough`,`code`,`bulleted-list`,`numbered-list`,`image`,`math`,`languageCharacters`,`text-align`,`table`,`video`,`audio`,`responseArea`,`superscript`,`subscript`,`css`,`h3`,`undo`,`redo`],S$={"--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),
|
|
361
361
|
0px 3.618px 9.949px 0px rgba(0, 0, 0, .04)`},C$=e=>({role:`textbox`,"data-pie-editor":`true`,spellcheck:e?`true`:`false`,autocorrect:e?`on`:`off`,autocapitalize:e?`on`:`off`}),w$=e=>{let{showParagraphs:t,separateParagraphs:n}=e.pluginProps||{},[r,i]=(0,I.useState)([]),[a,o]=(0,I.useState)(!1),{toolbarOpts:s}=e,c=(0,I.useCallback)(e=>{i(t=>{let n=t.filter(t=>t.pos!==e);return n.length===0&&o(!1),n})},[i]),l={...y$,...s},u=(0,I.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,I.useMemo)(()=>({...b$,...e.responseAreaProps,onInlineDropdownToolbarClose:u}),[e.responseAreaProps,u]),f=(0,I.useMemo)(()=>{let{customPlugins:t,...n}=e.pluginProps||{};t||=[];let r=(e.activePlugins||x$)?.filter(e=>{let t=g$[e]||e,r=n[t]||{};return!r||!r.disabled});return v$(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=[mF.configure({types:[`heading`,`paragraph`,`div`,`headingParagraph`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`td`,`th`],alignments:[`left`,`right`,`center`,`justify`]}),dF,DP.configure({limit:e.charactersLimit||1e6}),tF.configure({trailingNode:{node:`paragraph`,notAfter:[`paragraph`,`div`]},link:{autolink:!1,linkOnPaste:!1}}),hX,Bte,gX,Vte,Hte,_F.configure({placeholder:e.placeholder,showOnlyWhenEditable:!0,showOnlyCurrent:!1,includeChildren:!0}),Lte,YI,zte,Rte,hG.configure(d),gG.configure(d),vG.configure(d),yG.configure(d),_G.configure(d),Pq.configure({toolbarOpts:l,math:e.pluginProps?.math||{}}),pF,fF,gF,JJ.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=Jo(()=>{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}),mX.configure({extraCSSRules:e.extraCSSRules})],m=e.spellCheck!==!1,h=ck({extensions:p,immediatelyRender:!1,editorProps:{attributes:C$(m),handleKeyDown(t,n){return e.onKeyDown?e.onKeyDown(n):!1}},editable:!e.disabled,content:bF(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,I.useEffect)(()=>{e.editorRef&&e.editorRef(h)},[e.editorRef,h]),(0,I.useEffect)(()=>{h?.setEditable(!e.disabled)},[e.disabled,h]),(0,I.useEffect)(()=>{if(!h)return;let e=h.options?.editorProps,t={...e?.attributes,...C$(m)};e?.attributes?.spellcheck!==t.spellcheck&&h.setOptions({editorProps:{...e,attributes:t}})},[m,h]),(0,I.useEffect)(()=>{if(!h)return;let t=bF(e.markup);t!==h.getHTML()&&h.commands.setContent(t,{emitUpdate:!1})},[e.markup,h]),(0,I.useEffect)(()=>{Object.entries(S$).forEach(([e,t])=>{document.documentElement.style.setProperty(e,t)})},[]);let g=ik({editor:h,selector:e=>({isFocused:e.editor?.isFocused})}),_=(0,I.useMemo)(()=>{let{minWidth:t,width:n,maxWidth:r,minHeight:i,height:a,maxHeight:o}=e;return{width:_X(n),minWidth:_X(t),maxWidth:_X(r),height:_X(a),minHeight:_X(i),maxHeight:_X(o)}},[e]);return(0,L.jsx)(p$,{...e,activePlugins:f,toolbarOpts:l,editorState:g,editor:h,children:h&&(0,L.jsx)(T$,{style:{minHeight:_.minHeight,height:_.height,maxHeight:_.maxHeight},showParagraph:t&&!t.disabled,separateParagraph:n&&!n.disabled,editor:h})})},T$=B(tk,{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`}}}})),E$=w$,D$={min:A.number.isRequired,max:A.number.isRequired,step:A.number},O$=A.shape(D$),k$=A.shape(D$),A$=A.shape({width:A.number.isRequired,height:A.number.isRequired}),j$=A.shape({x:A.number.isRequired,y:A.number.isRequired}),M$=A.oneOfType([A.arrayOf(A.node),A.node]).isRequired,N$=A.shape({x:A.func.isRequired,y:A.func.isRequired}),P$=A.shape({x:A.func.isRequired,y:A.func.isRequired}),F$=A.shape({scale:N$.isRequired,snap:P$.isRequired,domain:O$.isRequired,range:k$.isRequired,size:A$.isRequired}),I$={graphProps:F$.isRequired,mark:A.object,onChange:A.func,onDelete:A.func,onClick:A.func};A.shape(I$);var L$=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 R$(e,t){this.x=e,this.y=t}R$.prototype={clone(){return new R$(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:R$},R$.convert=function(e){if(e instanceof R$)return e;if(Array.isArray(e))return new R$(+e[0],+e[1]);if(e.x!==void 0&&e.y!==void 0)return new R$(+e.x,+e.y);throw Error(`Expected [x, y] or {x, y} point format`)};var z$=l(L$(),1),B$=(e,t)=>({x:e,y:t}),V$=(e,t,n)=>{let r=as(e,t,n);return r.splice(r.length,1,t),r};function H$(e,t,n,r){if(r>=t)return t;if(r<=e)return e;let i=V$(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 U$=(e,t)=>({left:Math.min(e.x,t.x),top:Math.max(e.y,t.y),bottom:Math.min(e.y,t.y),right:Math.max(e.x,t.x)}),W$=(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}),G$=e=>new R$(e.x,e.y),K$=(e,t)=>G$(t).sub(G$(e)),q$=(e,t)=>ts(e.domain,t.domain)&&ts(e.range,t.range),J$=e=>(new DOMParser()?.parseFromString(e,`text/html`))?.body?.textContent||``,Y$=e=>e&&Object.keys(e).length===0&&e.constructor===Object,X$=e=>typeof e==`string`&&e.trim()===``;function Z$(e){return typeof e==`function`||typeof e==`object`&&!!e&&typeof e.$$typeof==`symbol`}function Q$(e,t){return!e||Z$(e)?e:Z$(e.default)?e.default:t&&Z$(e[t])?e[t]:t&&Z$(e[t]?.default)?e[t].default:e}var $$=Q$(Sh,`Readable`)||Q$(n1.Readable,`Readable`),e1=Qh,t1=e1.default,n1=t1&&typeof t1==`object`?t1:e1,r1={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`}}},i1=B(`div`)({...r1.centerPlaceholder}),a1=B(`div`)({...r1.disabledLabel,"& p":{margin:0}}),o1=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,I.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,L.jsx)($$,{false:!0,children:(0,L.jsx)(i1,{onClick:C,style:{...g?S:x,...y?r1.chartLabel:r1.axisLabel,...u===`left`&&!g?r1.rotateLeftLabel:{},...u===`right`&&!g?r1.rotateRightLabel:{},...g?r1.editLabel:{},...i||a?r1.customBottom:{},...t&&!y&&X$(J$(l))&&r1.displayNone},children:t?(0,L.jsx)(a1,{dangerouslySetInnerHTML:{__html:l||``}}):(0,L.jsx)(E$,{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})})})};o1.propTypes={disabledLabel:A.bool,graphHeight:A.number,graphWidth:A.number,isChartBottomLabel:A.bool,isDefineChartBottomLabel:A.bool,isChartLeftLabel:A.bool,isDefineChartLeftLabel:A.bool,placeholder:A.string,text:A.string,side:A.string,onChange:A.func,mathMlOptions:A.object,charactersLimit:A.number,titleHeight:A.number};function s1(e){return typeof e==`function`||typeof e==`object`&&!!e&&typeof e.$$typeof==`symbol`}function c1(e,t){return!e||s1(e)?e:s1(e.default)?e.default:t&&s1(e[t])?e[t]:t&&s1(e[t]?.default)?e[t].default:e}var l1=c1(Sh,`Readable`)||c1(f1.Readable,`Readable`),u1=Qh,d1=u1.default,f1=d1&&typeof d1==`object`?d1:u1,p1={"& .ProseMirror p.is-editor-empty::before, & .ProseMirror div.is-editor-empty::before":{left:0,right:0,width:`100%`,textAlign:`center`}},m1=B(`div`)(({theme:e})=>({border:`solid 1px ${Mf()}`,color:H.TEXT,backgroundColor:e.palette.common.white,touchAction:`none`,position:`relative`,boxSizing:`unset`})),h1=B(`div`)({display:`flex`,position:`relative`}),g1=B(`svg`)({paddingLeft:`50px`,overflow:`visible`,boxSizing:`content-box`}),_1=B(`svg`)({overflow:`visible`,boxSizing:`content-box`}),v1=B(`g`)({cursor:`pointer`,userSelect:`none`}),y1=B(`div`)(({theme:e})=>({color:H.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},...p1})),b1=B(`div`)(({theme:e})=>({color:H.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},...p1})),x1=B(`div`)({display:`flex`,paddingTop:`6px`}),S1=B(`div`)({display:`flex`,flexDirection:`column`,alignItems:`center`,width:`100px`,pointerEvents:`none`,userSelect:`none`}),C1=B(`div`)({width:`70px`,display:`flex`,flexDirection:`column`,marginRight:`6px`}),w1=B(`div`)({textAlign:`right`,height:`20px`,pointerEvents:`none`,userSelect:`none`,"&:not(:last-child)":{marginBottom:`80px`}}),T1=class extends I.Component{constructor(e){super(e),this.state={titleHeight:0},this.resizeObserver=null}static propTypes={title:A.string,children:M$,defineChart:A.bool,disabledLabels:A.bool,disabledTitle:A.bool,graphProps:F$.isRequired,isChart:A.bool,labels:A.object,labelsPlaceholders:A.object,onChangeTitle:A.func,onMouseMove:A.func,showLabels:A.bool,showTitle:A.bool,showPixelGuides:A.bool,rootRef:A.func,onChangeLabels:A.func,titlePlaceholder:A.string,mathMlOptions:A.object,labelsCharactersLimit:A.number};mouseMove=(e,t)=>{let{graphProps:n,onMouseMove:r}=this.props;if(!r)return;let{scale:i,snap:a}=n,o=dl(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=ll(this.g);e.on(`mousemove`,this.mouseMove.bind(this,e)),this.measureTitleHeight(),this.setupVisibilityObserver()}componentWillUnmount(){ll(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=X$(J$(n?.left))&&Y$(r)?48:70,S=X$(J$(n?.right))&&Y$(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,L.jsxs)(m1,{children:[d&&(0,L.jsx)(x1,{style:{marginLeft:l?80:u?30:10},children:[...Array(D+1).keys()].map(e=>(0,L.jsx)(l1,{false:!0,children:(0,L.jsxs)(S1,{children:[(0,L.jsxs)(`div`,{children:[e*100,`px`]}),(0,L.jsx)(`div`,{children:`|`})]})},`top-guide-${e}`))}),f&&(e?(0,L.jsx)(`div`,{ref:e=>this.titleRef=e,style:{...l&&{width:C},...X$(J$(p))&&{display:`none`}},children:l?(0,L.jsx)(b1,{className:`disabledTitle`,dangerouslySetInnerHTML:{__html:p||``}}):(0,L.jsx)(y1,{className:`disabledTitle`,dangerouslySetInnerHTML:{__html:p||``}})}):(0,L.jsx)(`div`,{ref:e=>this.titleRef=e,children:l?(0,L.jsx)(b1,{className:d?`rightMargin`:``,children:(0,L.jsx)(E$,{...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,L.jsx)(y1,{className:d?`rightMargin`:``,children:(0,L.jsx)(E$,{...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,L.jsx)(o1,{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,L.jsxs)(h1,{children:[u&&(0,L.jsx)(o1,{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,L.jsx)(g1,{width:C,height:w,children:(0,L.jsx)(v1,{ref:e=>{this.g=e,m&&m(e)},transform:`translate(${x+(y.padding||0)}, ${40+(b.padding||0)})`,children:o})}):(0,L.jsx)(_1,{width:C,height:w,children:(0,L.jsx)(v1,{ref:e=>{this.g=e,m&&m(e)},transform:`translate(${x+(y.padding||0)}, ${40+(b.padding||0)})`,children:o})}),u&&!l&&(0,L.jsx)(o1,{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,L.jsx)(C1,{style:{paddingTop:k,marginTop:31},children:[...Array(O+1).keys()].reverse().map(e=>(0,L.jsx)(l1,{false:!0,children:(0,L.jsxs)(w1,{children:[`━ `,e*100,`px`]})},`top-guide-${e}`))})]}),u&&(0,L.jsx)(o1,{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 E1(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function D1(e){return typeof e==`function`||Object.prototype.toString.call(e)===`[object Function]`}function O1(e){return typeof e==`number`&&!isNaN(e)}function k1(e){return parseInt(e,10)}function A1(e,t,n){if(e[t])return Error(`Invalid prop ${t} passed to ${n} - do not set this, set it on the child.`)}var j1=[`Moz`,`Webkit`,`O`,`ms`];function M1(e=`transform`){if(typeof window>`u`)return``;let t=window.document?.documentElement?.style;if(!t||e in t)return``;for(let n=0;n<j1.length;n++)if(N1(e,j1[n])in t)return j1[n];return``}function N1(e,t){return t?`${t}${P1(e)}`:e}function P1(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 F1=M1(),I1=``;function L1(e,t){I1||=E1([`matches`,`webkitMatchesSelector`,`mozMatchesSelector`,`msMatchesSelector`,`oMatchesSelector`],function(t){return D1(e[t])})??``;let n=e[I1];return D1(n)?!!n.call(e,t):!1}function R1(e,t,n){let r=e;do{if(L1(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function z1(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 B1(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 V1(e){let t=e.clientHeight,n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=k1(n.borderTopWidth),t+=k1(n.borderBottomWidth),t}function H1(e){let t=e.clientWidth,n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=k1(n.borderLeftWidth),t+=k1(n.borderRightWidth),t}function U1(e){let t=e.clientHeight,n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=k1(n.paddingTop),t-=k1(n.paddingBottom),t}function W1(e){let t=e.clientWidth,n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=k1(n.paddingLeft),t-=k1(n.paddingRight),t}function G1(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{[N1(`transform`,F1)]:n}}function q1(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 Y1(e,t){return e.targetTouches&&E1(e.targetTouches,e=>t===e.identifier)||e.changedTouches&&E1(e.changedTouches,e=>t===e.identifier)}function X1(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function Z1(){return typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0}function Q1(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??Z1();r&&n.setAttribute(`nonce`,r),n.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
362
362
|
`,n.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
363
|
-
`,e.getElementsByTagName(`head`)[0].appendChild(n)}e.body&&t0(e.body,`react-draggable-transparent-selection`)}function $1(e){window.requestAnimationFrame?window.requestAnimationFrame(()=>{e0(e)}):e0(e)}function e0(e){if(e)try{e.body&&n0(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 t0(e,t){e.classList?e.classList.add(t):e.className.match(RegExp(`(?:^|\\s)${t}(?!\\S)`))||(e.className+=` ${t}`)}function n0(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(RegExp(`(?:^|\\s)${t}(?!\\S)`,`g`),``)}function r0(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r==`string`?r:u0(r);let i=d0(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+k1(s.paddingLeft)+k1(o.marginLeft),top:-i.offsetTop+k1(s.paddingTop)+k1(o.marginTop),right:W1(a)-H1(i)-i.offsetLeft+k1(s.paddingRight)-k1(o.marginRight),bottom:U1(a)-V1(i)-i.offsetTop+k1(s.paddingBottom)-k1(o.marginBottom)}}return O1(r.right)&&(t=Math.min(t,r.right)),O1(r.bottom)&&(n=Math.min(n,r.bottom)),O1(r.left)&&(t=Math.max(t,r.left)),O1(r.top)&&(n=Math.max(n,r.top)),[t,n]}function i0(e,t,n){return[Math.round(t/e[0])*e[0],Math.round(n/e[1])*e[1]]}function a0(e){return e.props.axis===`both`||e.props.axis===`x`}function o0(e){return e.props.axis===`both`||e.props.axis===`y`}function s0(e,t,n){let r=typeof t==`number`?Y1(e,t):null;if(typeof t==`number`&&!r)return null;let i=d0(n),a=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return G1(r||e,a,n.props.scale)}function c0(e,t,n){let r=!O1(e.lastX),i=d0(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 l0(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 u0(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function d0(e){let t=e.findDOMNode();if(!t)throw Error(`<DraggableCore>: Unmounted during event!`);return t}var f0=typeof process<`u`&&process.env.DRAGGABLE_DEBUG?console.log.bind(console):function(){},p0={touch:{start:`touchstart`,move:`touchmove`,stop:`touchend`},mouse:{start:`mousedown`,move:`mousemove`,stop:`mouseup`}},m0=p0.mouse,h0=class extends I.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&&!R1(e.target,this.props.handle,t)||this.props.cancel&&R1(e.target,this.props.cancel,t))return;e.type===`touchstart`&&!this.props.allowMobileScroll&&e.preventDefault();let r=X1(e);this.touchIdentifier=r;let i=s0(e,r,this);if(i==null)return;let{x:a,y:o}=i,s=c0(this,a,o);f0(`DraggableCore: handleDragStart: %j`,s),f0(`calling`,this.props.onStart),!(this.props.onStart(e,s)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&Q1(n,this.props.nonce),this.dragging=!0,this.lastX=a,this.lastY=o,z1(n,m0.move,this.handleDrag),z1(n,m0.stop,this.handleDragStop))},this.handleDrag=e=>{let t=s0(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]=i0(this.props.grid,e,t),!e&&!t)return;n=this.lastX+e,r=this.lastY+t}let i=c0(this,n,r);if(f0(`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=s0(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]=i0(this.props.grid,e,t),n=this.lastX+e,r=this.lastY+t}let i=c0(this,n,r);if(this.props.onStop(e,i)===!1||this.mounted===!1)return!1;let a=this.findDOMNode();a&&this.props.enableUserSelectHack&&$1(a.ownerDocument),f0(`DraggableCore: handleDragStop: %j`,i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&(f0(`DraggableCore: Removing handlers`),B1(a.ownerDocument,m0.move,this.handleDrag),B1(a.ownerDocument,m0.stop,this.handleDragStop))},this.onMouseDown=e=>(m0=p0.mouse,this.handleDragStart(e)),this.onMouseUp=e=>(m0=p0.mouse,this.handleDragStop(e)),this.onTouchStart=e=>(m0=p0.touch,this.handleDragStart(e)),this.onTouchEnd=e=>(m0=p0.touch,this.handleDragStop(e))}componentDidMount(){this.mounted=!0;let e=this.findDOMNode();e&&z1(e,p0.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let e=this.findDOMNode();if(e){let{ownerDocument:t}=e;B1(t,p0.mouse.move,this.handleDrag),B1(t,p0.touch.move,this.handleDrag),B1(t,p0.mouse.stop,this.handleDragStop),B1(t,p0.touch.stop,this.handleDragStop),B1(e,p0.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&$1(t)}}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=fu.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):(f0(`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 I.cloneElement(I.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};h0.displayName=`DraggableCore`,h0.propTypes={allowAnyClick:A.bool,allowMobileScroll:A.bool,children:A.node.isRequired,disabled:A.bool,enableUserSelectHack:A.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw Error(`Draggable's offsetParent must be a DOM Node.`)},grid:A.arrayOf(A.number),handle:A.string,cancel:A.string,nodeRef:A.object,nonce:A.string,onStart:A.func,onDrag:A.func,onStop:A.func,onMouseDown:A.func,scale:A.number,className:A1,style:A1,transform:A1},h0.defaultProps={allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1};var g0=class extends I.Component{constructor(e){super(e),this.onDragStart=(e,t)=>{if(f0(`Draggable: onDragStart: %j`,t),this.props.onStart(e,l0(this,t))===!1)return!1;this.setState({dragging:!0,dragged:!0})},this.onDrag=(e,t)=>{if(!this.state.dragging)return!1;f0(`Draggable: onDrag: %j`,t);let n=l0(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]=r0(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,l0(this,t))===!1)return!1;f0(`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)?(f0(`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=fu.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:a0(this)&&p?this.state.x:m.x,y:o0(this)&&p?this.state.y:m.y};this.state.isElementSVG?f=q1(h,c):d=K1(h,c);let g=I.Children.only(n),_=R(g.props.className||``,i,{[a]:this.state.dragging,[o]:this.state.dragged});return I.createElement(h0,{...u,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop},I.cloneElement(g,{className:_,style:{...g.props.style,...d},transform:f}))}};g0.displayName=`Draggable`,g0.propTypes={...h0.propTypes,axis:A.oneOf([`both`,`x`,`y`,`none`]),bounds:A.oneOfType([A.shape({left:A.number,right:A.number,top:A.number,bottom:A.number}),A.string,A.oneOf([!1])]),defaultClassName:A.string,defaultClassNameDragging:A.string,defaultClassNameDragged:A.string,defaultPosition:A.shape({x:A.number,y:A.number}),positionOffset:A.shape({x:A.oneOfType([A.number,A.string]),y:A.oneOfType([A.number,A.string])}),position:A.shape({x:A.number,y:A.number}),className:A1,style:A1,transform:A1},g0.defaultProps={...h0.defaultProps,axis:`both`,bounds:!1,defaultClassName:`react-draggable`,defaultClassNameDragging:`react-draggable-dragging`,defaultClassNameDragged:`react-draggable-dragged`,defaultPosition:{x:0,y:0},scale:1};var _0=Cp(`pie-lib:plot:grid-draggable`),v0=(e,t,n)=>r=>{let i=r+e(0);return t(n+e.invert(i)).toFixed(4)*1e3/1e3},y0=e=>t=>((0,z$.default)(!!e&&ns(e.fromDelta)&&ns(e.bounds)&&ns(e.anchorPoint),`You must supply an object with: { anchorPoint: Function, fromDelta: Function, bounds: Function }`),class extends I.Component{static propTypes={disabled:A.bool,onDragStart:A.func,onDrag:A.func,onDragStop:A.func,onClick:A.func,onMove:A.func,graphProps:F$.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:v0(i.x,a.x,t),y:v0(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 _0(`[tiny] key: `,e,`delta: `,r,`out: `,i),i};getScaledBounds=()=>{let t=e.bounds(this.props,this.props.graphProps);_0(`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},_0(`[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 K$(t.anchorPoint,n)};applyDelta=t=>{let n=this.getDelta(t);return _0(`[applyDelta] delta:`,n),e.fromDelta(this.props,n)};onStop=(e,t)=>{_0(`[onStop] dd:`,t);let{onDragStop:n,onClick:r,disabled:i}=this.props;if(n&&!i&&n(),_0(`[onStop] lastX/Y: `,t.lastX,t.lastY),!this._didDrag){if(!i&&typeof e?.stopPropagation==`function`&&e.stopPropagation(),r){_0(`call onClick`),this.setState({startX:null,startY:null});let{graphProps:t}=this.props,{scale:n,snap:i}=t;try{let[t,a]=dl(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,L.jsx)(h0,{onMouseDown:o,onStart:this.onStart,onDrag:this.onDrag,onStop:this.onStop,axis:e.axis||`both`,grid:[a.x,a.y],children:(0,L.jsx)(t,{...i,disabled:n,isDragging:s,onClick:s?void 0:r})})}}),b0=Cp(`pie-lib:plot:trig`),x0=e=>180/Math.PI*e,S0=e=>Math.PI/180*e,C0=(e,t)=>{let n=t.y-e.y,r=t.x-e.x;b0(e,t,`vd: `,n,`hd: `,r);let i=Math.atan2(n,r);return i<0?i+Math.PI*2:i},w0=Math.PI/2;Math.PI+w0;var T0=(e,t)=>Math.abs(e/Math.sin(t)),E0=(e,t)=>(n,r)=>[k0(B$(n.x<r.x?e.max:e.min,n.y<r.y?t.max:t.min),n,r),k0(B$(r.x<n.x?e.max:e.min,r.y<n.y?t.max:t.min),r,n)],D0=(e,t)=>(b0(`[getOpposingSide] hyp: `,e,`angle:`,t),Math.abs(e*Math.sin(t))),O0=(e,t)=>{if(Number.isFinite(e)&&Number.isFinite(t))return e===0&&t>0?`y`:t===0&&e>0||e<t?`x`:`y`;if(isNaN(e)&&!isNaN(t))return`y`;if(!isNaN(e)&&isNaN(t))return`x`;if(e===1/0)return`y`;if(t===1/0)return`x`;console.warn(`hypotenuse - which is shorter? x:`,e,`y:`,t)},k0=(e,t,n)=>{let r=b0.enabled?b0.bind(b0,`diffEdge: [${t.x},${t.y} -> ${n.x},${n.y}]`):()=>{},i=C0(t,n);r(`x angle`,x0(i));let a=Math.abs(i-S0(90));r(`y angle`,x0(a));let o=Math.abs(t.x-e.x),s=T0(o,a),c=Math.abs(t.y-e.y),l=T0(c,i);r(`x: side`,o,`h:`,s),r(`y: side`,c,`h:`,l);let u=O0(s,l);if(u!==`x`&&u!==`y`)throw Error(`Cant decide which hypotenuse to use`);let d=u===`x`?new R$(o,D0(s,i)):new R$(D0(l,a),c);r(`point:`,d);let f=new R$(n.x<t.x?-1:1,n.y<t.y?-1:1);r(`multiplier:`,f);let p=d.multByPoint(f);r(`out:`,p);let m=p.add(new R$(t.x,t.y));return r(`normalized:`,m),m};function A0(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function j0(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function M0(e){let t,n,r;e.length===2?(t=e===A0||e===j0?e:N0,n=e,r=e):(t=A0,n=(t,n)=>A0(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 N0(){return 0}function P0(e){return e===null?NaN:+e}var F0=M0(A0),I0=F0.right;F0.left,M0(P0).center;var L0=Math.sqrt(50),R0=Math.sqrt(10),z0=Math.sqrt(2);function B0(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=L0?10:a>=R0?5:a>=z0?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?B0(e,t,n*2):[s,c,l]}function V0(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?B0(t,e,n):B0(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 H0(e,t,n){return t=+t,e=+e,n=+n,B0(e,t,n)[2]}function U0(e,t,n){t=+t,e=+e,n=+n;let r=t<e,i=r?H0(t,e,n):H0(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function W0(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function G0(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function K0(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function q0(){}var J0=.7,Y0=1/J0,X0=`\\s*([+-]?\\d+)\\s*`,Z0=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,Q0=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,$0=/^#([0-9a-f]{3,8})$/,e2=RegExp(`^rgb\\(${X0},${X0},${X0}\\)$`),t2=RegExp(`^rgb\\(${Q0},${Q0},${Q0}\\)$`),n2=RegExp(`^rgba\\(${X0},${X0},${X0},${Z0}\\)$`),r2=RegExp(`^rgba\\(${Q0},${Q0},${Q0},${Z0}\\)$`),i2=RegExp(`^hsl\\(${Z0},${Q0},${Q0}\\)$`),a2=RegExp(`^hsla\\(${Z0},${Q0},${Q0},${Z0}\\)$`),o2={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};G0(q0,d2,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:s2,formatHex:s2,formatHex8:c2,formatHsl:l2,formatRgb:u2,toString:u2});function s2(){return this.rgb().formatHex()}function c2(){return this.rgb().formatHex8()}function l2(){return w2(this).formatHsl()}function u2(){return this.rgb().formatRgb()}function d2(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=$0.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?f2(t):n===3?new g2(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?p2(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?p2(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=e2.exec(e))?new g2(t[1],t[2],t[3],1):(t=t2.exec(e))?new g2(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=n2.exec(e))?p2(t[1],t[2],t[3],t[4]):(t=r2.exec(e))?p2(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=i2.exec(e))?C2(t[1],t[2]/100,t[3]/100,1):(t=a2.exec(e))?C2(t[1],t[2]/100,t[3]/100,t[4]):o2.hasOwnProperty(e)?f2(o2[e]):e===`transparent`?new g2(NaN,NaN,NaN,0):null}function f2(e){return new g2(e>>16&255,e>>8&255,e&255,1)}function p2(e,t,n,r){return r<=0&&(e=t=n=NaN),new g2(e,t,n,r)}function m2(e){return e instanceof q0||(e=d2(e)),e?(e=e.rgb(),new g2(e.r,e.g,e.b,e.opacity)):new g2}function h2(e,t,n,r){return arguments.length===1?m2(e):new g2(e,t,n,r??1)}function g2(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}G0(g2,h2,K0(q0,{brighter(e){return e=e==null?Y0:Y0**+e,new g2(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?J0:J0**+e,new g2(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new g2(x2(this.r),x2(this.g),x2(this.b),b2(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:_2,formatHex:_2,formatHex8:v2,formatRgb:y2,toString:y2}));function _2(){return`#${S2(this.r)}${S2(this.g)}${S2(this.b)}`}function v2(){return`#${S2(this.r)}${S2(this.g)}${S2(this.b)}${S2((isNaN(this.opacity)?1:this.opacity)*255)}`}function y2(){let e=b2(this.opacity);return`${e===1?`rgb(`:`rgba(`}${x2(this.r)}, ${x2(this.g)}, ${x2(this.b)}${e===1?`)`:`, ${e})`}`}function b2(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function x2(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function S2(e){return e=x2(e),(e<16?`0`:``)+e.toString(16)}function C2(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new E2(e,t,n,r)}function w2(e){if(e instanceof E2)return new E2(e.h,e.s,e.l,e.opacity);if(e instanceof q0||(e=d2(e)),!e)return new E2;if(e instanceof E2)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 E2(o,s,c,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.h=+e,this.s=+t,this.l=+n,this.opacity=+r}G0(E2,T2,K0(q0,{brighter(e){return e=e==null?Y0:Y0**+e,new E2(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?J0:J0**+e,new E2(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 g2(k2(e>=240?e-240:e+120,i,r),k2(e,i,r),k2(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new E2(D2(this.h),O2(this.s),O2(this.l),b2(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=b2(this.opacity);return`${e===1?`hsl(`:`hsla(`}${D2(this.h)}, ${O2(this.s)*100}%, ${O2(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function D2(e){return e=(e||0)%360,e<0?e+360:e}function O2(e){return Math.max(0,Math.min(1,e||0))}function k2(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 A2=e=>()=>e;function j2(e,t){return function(n){return e+n*t}}function M2(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function N2(e){return(e=+e)==1?P2:function(t,n){return n-t?M2(t,n,e):A2(isNaN(t)?n:t)}}function P2(e,t){var n=t-e;return n?j2(e,n):A2(isNaN(e)?t:e)}var F2=(function e(t){var n=N2(t);function r(e,t){var r=n((e=h2(e)).r,(t=h2(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=P2(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 I2(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 L2(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function R2(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]=q2(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 z2(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function B2(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function V2(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]=q2(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var H2=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,U2=new RegExp(H2.source,`g`);function W2(e){return function(){return e}}function G2(e){return function(t){return e(t)+``}}function K2(e,t){var n=H2.lastIndex=U2.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=H2.exec(e))&&(i=U2.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:B2(r,i)})),n=U2.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?G2(c[0].x):W2(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 q2(e,t){var n=typeof t,r;return t==null||n===`boolean`?A2(t):(n===`number`?B2:n===`string`?(r=d2(t))?(t=r,F2):K2:t instanceof d2?F2:t instanceof Date?z2:L2(t)?I2:Array.isArray(t)?R2:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?V2:B2)(e,t)}function J2(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Y2(e){return function(){return e}}function X2(e){return+e}var Z2=[0,1];function Q2(e){return e}function $2(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Y2(isNaN(t)?NaN:.5)}function e4(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}function t4(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=$2(i,r),a=n(o,a)):(r=$2(r,i),a=n(a,o)),function(e){return a(r(e))}}function n4(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]=$2(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(t){var n=I0(e,t,1,r)-1;return a[n](i[n](t))}}function r4(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function i4(){var e=Z2,t=Z2,n=q2,r,i,a,o=Q2,s,c,l;function u(){var n=Math.min(e.length,t.length);return o!==Q2&&(o=e4(e[0],e[n-1])),s=n>2?n4:t4,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),B2))(n)))},d.domain=function(t){return arguments.length?(e=Array.from(t,X2),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=J2,u()},d.clamp=function(e){return arguments.length?(o=e?!0:Q2,u()):o!==Q2},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 a4(){return i4()(Q2,Q2)}function o4(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}function s4(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 c4(e){return e=s4(Math.abs(e)),e?e[1]:NaN}function l4(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 u4(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}var d4=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function f4(e){if(!(t=d4.exec(e)))throw Error(`invalid format: `+e);var t;return new p4({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]})}f4.prototype=p4.prototype;function p4(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+``}p4.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 m4(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 g4(e,t){var n=s4(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`)+s4(e,Math.max(0,t+a-1))[0]}function _4(e,t){var n=s4(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 v4={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+``,d:o4,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)=>_4(e*100,t),r:_4,s:g4,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function y4(e){return e}var b4=Array.prototype.map,x4=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`];function S4(e){var t=e.grouping===void 0||e.thousands===void 0?y4:l4(b4.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?y4:u4(b4.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=f4(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`):v4[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=v4[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=m4(e)),w&&+e==0&&f!==`+`&&(w=!1),n=(w?f===`(`?f:s:f===`-`||f===`(`?``:f)+n,r=(y===`s`&&!isNaN(e)&&h4!==void 0?x4[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(c4(t)/3)))*3,r=10**-n,i=l((e=f4(e),e.type=`f`,e),{suffix:x4[8+n/3]});return function(e){return i(r*e)}}return{format:l,formatPrefix:u}}var C4,w4,T4;E4({thousands:`,`,grouping:[3],currency:[`$`,``]});function E4(e){return C4=S4(e),w4=C4.format,T4=C4.formatPrefix,C4}function D4(e){return Math.max(0,-c4(Math.abs(e)))}function O4(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(c4(t)/3)))*3-c4(Math.abs(e)))}function k4(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,c4(t)-c4(e))+1}function A4(e,t,n,r){var i=U0(e,t,n),a;switch(r=f4(r??`,f`),r.type){case`s`:var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=O4(i,o))&&(r.precision=a),T4(r,o);case``:case`e`:case`g`:case`p`:case`r`:r.precision==null&&!isNaN(a=k4(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type===`e`));break;case`f`:case`%`:r.precision==null&&!isNaN(a=D4(i))&&(r.precision=a-(r.type===`%`)*2);break}return w4(r)}function j4(e){var t=e.domain;return e.ticks=function(e){var n=t();return V0(n[0],n[n.length-1],e??10)},e.tickFormat=function(e,n){var r=t();return A4(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=H0(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 M4(){var e=a4();return e.copy=function(){return r4(e,M4())},W0.apply(e,arguments),j4(e)}var N4=({min:e,max:t,step:n})=>({step:n,min:parseInt(e/n)*n,max:parseInt(t/n)*n}),P4=(e,t,n,r)=>{(0,z$.default)(e.min<e.max,`domain: min must be less than max`),(0,z$.default)(t.min<t.max,`range: min must be less than max`);let i=N4(e),a=N4(t);return{scale:{x:M4().domain([e.min,e.max]).range([0,n.width]),y:M4().domain([t.max,t.min]).range([0,n.height])},snap:{x:H$.bind(null,i.min,i.max,i.step),y:H$.bind(null,a.min,a.max,a.step)},domain:e,range:t,size:n,getRootNode:r}},F4=l(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 I4(e){let{top:t=0,left:n=0,transform:r,className:i,children:a,innerRef:o,...s}=e;return(0,L.jsx)(`g`,{ref:o,className:(0,F4.default)(`visx-group`,i),transform:r||`translate(${n}, ${t})`,...s,children:a})}function L4(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 R4(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 z4(e){return e?.toString()}function B4(e){return function(){return e}}var V4=Math.PI,H4=2*V4,U4=1e-6,W4=H4-U4;function G4(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function K4(e){let t=Math.floor(e);if(!(t>=0))throw Error(`invalid digits: ${e}`);if(t>15)return G4;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 q4=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._=``,this._append=e==null?G4:K4(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>U4)if(!(Math.abs(u*s-c*l)>U4)||!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((V4-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>U4&&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)>U4||Math.abs(this._y1-l)>U4)&&this._append`L${c},${l}`,n&&(d<0&&(d=d%H4+H4),d>W4?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>U4&&this._append`A${n},${n},0,${+(d>=V4)},${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 J4(){return new q4}J4.prototype=q4.prototype;function Y4(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 q4(t)}Array.prototype.slice;function X4(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function Z4(e){this._context=e}Z4.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 Q4(e){return new Z4(e)}function $4(e){return e[0]}function e3(e){return e[1]}function t3(e,t){var n=B4(!0),r=null,i=Q4,a=null,o=Y4(s);e=typeof e==`function`?e:e===void 0?$4:B4(e),t=typeof t==`function`?t:t===void 0?e3:B4(t);function s(s){var c,l=(s=X4(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:B4(+t),s):e},s.y=function(e){return arguments.length?(t=typeof e==`function`?e:B4(+e),s):t},s.defined=function(e){return arguments.length?(n=typeof e==`function`?e:B4(!!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 n3(e){return e<0?-1:1}function r3(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(n3(a)+n3(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function i3(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function a3(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function o3(e){this._context=e}o3.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:a3(this,this._t0,i3(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(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;break;case 2:this._point=3,a3(this,i3(this,n=r3(this,e,t)),n);break;default:a3(this,this._t0,n=r3(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function s3(e){this._context=new c3(e)}(s3.prototype=Object.create(o3.prototype)).point=function(e,t){o3.prototype.point.call(this,t,e)};function c3(e){this._context=e}c3.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function l3(e){return new o3(e)}function u3(e,t){e(t)}function d3(){let{x:e,y:t,defined:n,curve:r}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=t3();return e&&u3(i.x,e),t&&u3(i.y,t),n&&i.defined(n),r&&i.curve(r),i}function f3(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,L.jsx)(`line`,{ref:a,className:(0,F4.default)(`visx-line`,i),x1:t.x,y1:t.y,x2:n.x,y2:n.y,fill:r,shapeRendering:s?`crispEdges`:`auto`,...o})}function p3(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=d3({x:r,y:i,defined:l,curve:s});return t?(0,L.jsx)(L.Fragment,{children:t({path:d})}):(0,L.jsx)(`path`,{ref:c,className:(0,F4.default)(`visx-linepath`,o),d:d(n)||``,fill:a,strokeLinecap:`round`,...u})}var m3=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}})),h3=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}})),g3=o(((e,t)=>{var n=h3();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)}})),_3=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})),v3=o(((e,t)=>{var n=_3();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})),y3=o(((e,t)=>{var n=v3();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})),b3=o(((e,t)=>{var n=y3();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})),x3=o(((e,t)=>{var n=b3();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})),S3=o(((e,t)=>{var n=m3(),r=g3(),i=x3(),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 C3(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 w3=`__react_svg_text_measurement_id`;function T3(e,t){if(typeof document>`u`)return null;try{let n=document.getElementById(w3);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`,w3),e.appendChild(n),document.body.appendChild(e)}return Object.assign(n.style,t),n.textContent=e,n.getComputedTextLength()}catch{return null}}var E3=C3(T3,(e,t)=>`${e}_${JSON.stringify(t)}`),D3=l(S3());function O3(e){return typeof e==`number`}function k3(e){return typeof e==`number`&&Number.isFinite(e)||typeof e==`string`}function A3(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=!k3(u)||!k3(d),{wordsWithWidth:p,spaceWidth:m}=(0,I.useMemo)(()=>({wordsWithWidth:(s==null?[]:s.toString().split(/(?:(?!\u00A0+)\s+)/)).map(e=>({word:e,wordWidth:E3(e,c)||0})),spaceWidth:E3(`\xA0`,c)||0}),[s,c]),h=(0,I.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,I.useMemo)(()=>f?``:t===`start`?(0,D3.default)(`calc(${o})`):t===`middle`?(0,D3.default)(`calc(${(h.length-1)/2} * -${a} + (${o} / 2))`):(0,D3.default)(`calc(${h.length-1} * -${a})`),[f,t,o,h.length,a]),transform:(0,I.useMemo)(()=>{let e=[];if(f)return``;if(O3(u)&&O3(d)&&O3(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 j3={overflow:`visible`};function M3(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:_}=A3(e);return(0,L.jsx)(`svg`,{ref:i,x:t,y:n,fontSize:m,style:j3,children:h.length>0?(0,L.jsx)(`text`,{ref:a,transform:_,...f,textAnchor:r,children:h.map((e,t)=>(0,L.jsx)(`tspan`,{x:p,dy:t===0?g:c,children:e.words.join(` `)},t))}):null})}var N3={top:`top`,left:`left`,right:`right`,bottom:`bottom`};function P3(e){let{labelOffset:t,labelProps:n,orientation:r,range:i,tickLabelFontSize:a,tickLength:o}=e,s=r===N3.left||r===N3.top?-1:1,c,l,u;if(r===N3.top||r===N3.bottom){let e=r===N3.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 F3(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!==N3.top?_:0);return(0,L.jsxs)(I4,{className:(0,F4.default)(`visx-axis-tick`,i),transform:c,children:[!t&&(0,L.jsx)(f3,{from:p,to:m,stroke:s,strokeWidth:u,strokeLinecap:`square`,...d}),a?a({...g,x:m.x,y:v,formattedValue:h}):(0,L.jsx)(M3,{x:m.x,y:v,...g,children:h})]},`visx-tick-${l}-${f}`)})}var I3={textAnchor:`middle`,fontFamily:`Arial`,fontSize:10,fill:`#222`};function L3(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=N3.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=F3}=e,T={...I3,...u},E={...I3,...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,L.jsxs)(L.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,L.jsx)(f3,{className:(0,F4.default)(`visx-axis-line`,n),from:t,to:r,stroke:p,strokeWidth:h,strokeDasharray:m}),s&&(0,L.jsx)(M3,{className:(0,F4.default)(`visx-axis-label`,c),...P3({labelOffset:l,labelProps:T,orientation:d,range:f.range(),tickLabelFontSize:O,tickLength:b}),...T,children:s})]})}function R3(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 z3(e){let t=e;return`tickFormat`in t?t.tickFormat():z4}var B3=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 V3(e,t){let{x:n,y:r}=e;return new B3(t?{x:n,y:r}:{x:r,y:n})}function H3(){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 U3(e){let{children:t=L3,axisClassName:n,hideAxisLine:r=!1,hideTicks:i=!1,hideZero:a=!1,innerRef:o,left:s=0,numTicks:c=10,orientation:l=N3.bottom,rangePadding:u=0,scale:d,tickFormat:f,tickLength:p=8,tickValues:m,top:h=0,...g}=e,_=f??z3(d),v=l===N3.left,y=l===N3.top,b=y||l===N3.bottom,x=R3(d),S=v||y?-1:1,C=d.range(),w=H3(u),T=V3({x:Number(C[0])+.5-w.start,y:0},b),E=V3({x:Number(C[C.length-1])+.5+w.end,y:0},b),D=(m??R4(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=L4(x(t));return{value:t,index:n,from:V3({x:r,y:0},b),to:V3({x:r,y:p*S},b),formattedValue:_(t,n,D)}});return(0,L.jsx)(I4,{className:(0,F4.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 W3=B(`path`)(({theme:e})=>({fill:`var(--arrow-color, ${e.palette.common.black})`})),G3=class extends I.Component{render(){let{x:e,y:t,className:n,scale:r}=this.props,i=this.props.direction||`left`,a=r.x(e),o=r.y(t),s=``,c=(e,t,n)=>`translate(${e}, ${t}) rotate(${n})`;return i===`left`&&(s=c(a-15,o,0)),i===`right`&&(s=c(a+15,o,180)),i===`up`&&(s=c(a,o-15,90)),i===`down`&&(s=c(a,o+15,270)),(0,L.jsx)(W3,{d:`m 0,0 8,-5 0,10 -8,-5`,transform:s,className:n})}};G3.propTypes={y:A.number,x:A.number,direction:A.oneOf([`left`,`right`,`up`,`down`]),className:A.string,scale:N$.isRequired},G3.defaultProps={y:0,x:0,direction:`left`};var K3=e=>e?.label===``?is(e,`label`):e,q3=W$,J3=G$,Y3=()=>0,X3=()=>0,Z3=e=>{let t=[],n=0;for(;n>=e.min&&t.indexOf(n)<0;)t.push(n),n=Math.round((n-e.step)*1e4)/1e4;for(n=Math.round(e.step*1e4)/1e4;n<=e.max&&t.indexOf(n)<0;)t.push(n),n=Math.round((n+e.step)*1e4)/1e4;return t?t.filter(t=>t>=e.min&&t<=e.max):[]},Q3=e=>e==null||$o(e)?1:e.split(` `).length,$3=e=>(e||``).replace(/<[^>]+>/g,``).split(` `).sort((e,t)=>t.length-e.length)[0].length,e6=e=>e?e*10:0,t6=e=>{let t=Zo(e),n={left:t.x,top:t.y,bottom:t.y,right:t.x};return cs(e).reduce((e,t)=>(e.left=Math.min(e.left,t.x),e.top=Math.max(e.top,t.y),e.bottom=Math.min(e.bottom,t.y),e.right=Math.max(e.right,t.x),e),n)},n6=(e,t)=>r6(e,t),r6=(e,t)=>((0,z$.default)(!!e&&!!t,`a or b is undefined`),{left:Math.min(e.x,t.x),top:Math.max(e.y,t.y),bottom:Math.min(e.y,t.y),right:Math.max(e.x,t.x)}),i6=e=>{let t=Go(e);return t.sort((e,t)=>t.x-e.x),{a:t[0],b:t[1]}},a6=(e,t)=>({x:(e.x+t.x)/2,y:(e.y+t.y)/2}),o6=e=>parseFloat(e.toFixed(4)),s6=(e,t)=>e&&t&&(o6(e.x)===o6(t.x)||o6(e.y)===o6(t.y)),c6=(e,t)=>e&&t&&ts({x:o6(e.x),y:o6(e.y)},{x:o6(t.x),y:o6(t.y)}),l6=(e,t)=>{let{min:n,max:r,step:i}=e;return t/((r-n)/i)},u6=e=>{let{domain:t,range:n,size:{width:r,height:i}}=e;return l6(t,r)<14||l6(n,i)<14},d6=e=>{let{domain:t,range:n,size:{width:r,height:i}}=e,a=l6(t,r),o=l6(n,i),s=t.step/(a/15),c=n.step/(o/15);return{domain:{min:t.min-s,max:t.max+s},range:{min:n.min-c,max:n.max+c}}},f6=(e,t)=>Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y)),p6=e=>(e||[]).sort((e,t)=>e.x-t.x||e.y-t.y),m6=(e,t,n)=>(e.x-t.x)*(n.y-t.y)===(n.x-t.x)*(e.y-t.y),h6=(e,t)=>m6(e.from,t.from,t.to)&&m6(e.to,t.from,t.to),g6=(e,t)=>c6(e.root,t.root)&&f6(t.root,t.edge)===f6(e.root,e.edge),_6=(e,t,n)=>{let{type:r,building:i}=e;if(i)return!1;let a=(t||[]).filter(e=>e.type===r&&!e.building),o=a.findIndex(e=>ts(e,n));return o!==-1&&a.splice(o,1),!!a.find(t=>{if(r===`circle`||r===`parabola`||r===`sine`||r===`absolute`||r===`exponential`){let{root:n,edge:i}=e;return c6(n,t.root)&&c6(i,t.edge)||r===`circle`&&g6(t,e)}else if(r===`line`||r===`ray`||r===`segment`||r===`vector`){let{from:n,to:i}=e;return c6(n,t.from)&&c6(i,t.to)||c6(n,t.to)&&c6(i,t.from)||r===`line`&&h6(t,e)}else if(r===`polygon`)return ts(p6(Go(e.points)),p6(Go(t.points)));else if(r===`point`)return c6(t,e)})};function v6(e){return typeof e==`function`||typeof e==`object`&&!!e&&typeof e.$$typeof==`symbol`}function y6(e,t){return!e||v6(e)?e:v6(e.default)?e.default:t&&v6(e[t])?e[t]:t&&v6(e[t]?.default)?e[t].default:e}var b6=y6(Sh,`Readable`)||y6(C6.Readable,`Readable`),x6=Qh,S6=x6.default,C6=S6&&typeof S6==`object`?S6:x6,w6={includeArrows:A.object,graphProps:A.object},T6={includeArrows:{left:!0,right:!0,up:!0,down:!0}},E6=B(G3)(()=>({fill:H.PRIMARY})),D6=B(`div`)(({theme:e,centered:t})=>({padding:0,margin:0,"* > *":{margin:0,padding:0},"& p":{margin:0},fontSize:e.typography.fontSize,...t&&{textAlign:`center`}})),O6=B(`g`)(()=>({"& .visx-axis-line":{stroke:H.PRIMARY,strokeWidth:3},"& .visx-axis-tick":{fill:H.PRIMARY,"& line":{stroke:H.PRIMARY}}})),k6={fontFamily:`Roboto`,fontSize:`14px`,cursor:`inherit`},A6=(e,t,n,r,i,a)=>{let o=[];return e===t&&n-i<r&&r<n+i&&n-i<a&&a<n+i&&o.push(e),o},j6=e=>(e||[]).find(e=>e<0),M6=class extends I.Component{static propTypes={...w6,graphProps:F$.isRequired};static defaultProps=T6;render(){let{includeArrows:e,graphProps:t,columnTicksValues:n,skipValues:r,distanceFromOriginToFirstNegativeY:i,dy:a}=this.props,{scale:o,domain:s,size:c,range:l}=t||{},u=e=>{let t=r&&r[0]===e?i+4:a;return{...k6,textAnchor:`middle`,y:t,dx:e===0?-10:0,dy:e===0?-7:0}},d=Q3(s.axisLabel),f=e6($3(s.axisLabel))+2;return(0,L.jsxs)(O6,{children:[(0,L.jsx)(U3,{scale:o.x,top:o.y(0),left:0,label:s.label,rangePadding:8,tickFormat:e=>e,tickLabelProps:u,tickValues:n,hideZero:!(s.labelStep||l.labelStep)&&s.min<=0}),e&&e.left&&(0,L.jsx)(E6,{direction:`left`,x:s.min,y:0,scale:o}),e&&e.right&&(0,L.jsx)(E6,{direction:`right`,x:s.max,y:0,scale:o}),s.axisLabel&&(0,L.jsx)(`foreignObject`,{x:c.width+17,y:o.y(0)-9,width:f,height:20*d,children:(0,L.jsx)(b6,{false:!0,children:(0,L.jsx)(D6,{dangerouslySetInnerHTML:{__html:s.axisLabel}})})})]})}},N6=class extends I.Component{static propTypes={...w6,graphProps:F$.isRequired};static defaultProps=T6;render(){let{includeArrows:e,graphProps:t,skipValues:n,rowTickValues:r}=this.props,{scale:i,range:a,size:o}=t||{},s=a.axisLabel?e6(a.axisLabel.length):0;return(0,L.jsxs)(O6,{children:[(0,L.jsx)(U3,{orientation:`left`,scale:i.y,top:0,height:o.height,left:i.x(0),label:a.label,labelProps:{"data-pie-readable":!1},rangePadding:8,tickLength:10,tickFormat:e=>n&&n.indexOf(e)>=0?``:e,tickLabelProps:e=>{let t=e.toLocaleString().replace(/[.-]/g,``).length||1;return{...k6,dy:4,dx:-10-t*9,"data-pie-readable":!1}},hideZero:!0,tickTextAnchor:`bottom`,tickValues:r}),e&&e.down&&(0,L.jsx)(E6,{direction:`down`,x:0,y:a.min,scale:i}),e&&e.up&&(0,L.jsx)(E6,{direction:`up`,x:0,y:a.max,scale:i}),a.axisLabel&&(0,L.jsx)(`foreignObject`,{x:i.x(0)-s/2,y:-33,width:s,height:`20`,children:(0,L.jsx)(b6,{false:!0,children:(0,L.jsx)(D6,{centered:!0,dangerouslySetInnerHTML:{__html:a.axisLabel}})})})]})}},P6=class extends I.Component{static propTypes={...w6,graphProps:F$.isRequired};static defaultProps=T6;xValues=()=>{let{graphProps:e}=this.props,{scale:t,domain:n}=e||{};if(!n||!t)return;let r=Z3({...n,step:n.labelStep}),i=j6(r);return{columnTicksValues:r,firstNegativeX:i,distanceFromOriginToFirstNegativeX:Math.abs(t.y(0)-t.y(i))}};yValues=()=>{let{graphProps:e}=this.props,{scale:t,range:n}=e||{};if(!n||!t)return;let r=Z3({...n,step:n.labelStep}),i=j6(r);return{rowTickValues:r,firstNegativeY:i,distanceFromOriginToFirstNegativeY:Math.abs(t.x(0)-t.x(i))}};render(){let{graphProps:e}=this.props,{domain:t,range:n}=e||{},{columnTicksValues:r,firstNegativeX:i,distanceFromOriginToFirstNegativeX:a}=this.xValues(),{rowTickValues:o,firstNegativeY:s,distanceFromOriginToFirstNegativeY:c}=this.yValues(),l=A6(i,s,a,c,6,25);return(0,L.jsxs)(O6,{children:[n.min<=0?(0,L.jsx)(M6,{...this.props,skipValues:l,columnTicksValues:r,distanceFromOriginToFirstNegativeY:c,dy:25}):null,t.min<=0?(0,L.jsx)(N6,{...this.props,skipValues:l,rowTickValues:o,distanceFromOriginToFirstNegativeX:a}):null]})}};function F6(e){return`bandwidth`in e?e.bandwidth():0}function I6(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??R4(r,u),g=(f??0)+F6(r)/2,_=h.map((e,t)=>{let n=(L4(r(e))??0)+g;return{index:t,from:new B3({x:0,y:n}),to:new B3({x:i,y:n})}});return(0,L.jsx)(I4,{className:(0,F4.default)(`visx-rows`,c),top:t,left:n,children:l?l({lines:_}):_.map(e=>{let{from:t,to:n,index:r}=e;return(0,L.jsx)(f3,{from:t,to:n,stroke:a,strokeWidth:o,strokeDasharray:s,style:d,...m},`row-line-${r}`)})})}function L6(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??R4(r,l),g=(d??0)+F6(r)/2,_=h.map((e,t)=>{let n=(L4(r(e))??0)+g;return{index:t,from:new B3({x:n,y:0}),to:new B3({x:n,y:i})}});return(0,L.jsx)(I4,{className:(0,F4.default)(`visx-columns`,c),top:t,left:n,children:p?p({lines:_}):_.map(e=>{let{from:t,to:n,index:r}=e;return(0,L.jsx)(f3,{from:t,to:n,stroke:a,strokeWidth:o,strokeDasharray:s,style:u,...m},`column-line-${r}`)})})}function R6(e){let{top:t,left:n,xScale:r,yScale:i,width:a,height:o,className:s,stroke:c,strokeWidth:l,strokeDasharray:u,numTicksRows:d,numTicksColumns:f,rowLineStyle:p,columnLineStyle:m,xOffset:h,yOffset:g,rowTickValues:_,columnTickValues:v,...y}=e;return(0,L.jsxs)(I4,{className:(0,F4.default)(`visx-grid`,s),top:t,left:n,children:[(0,L.jsx)(I6,{className:s,scale:i,width:a,stroke:c,strokeWidth:l,strokeDasharray:u,numTicks:d,lineStyle:p,offset:g,tickValues:_,...y}),(0,L.jsx)(L6,{className:s,scale:r,height:o,stroke:c,strokeWidth:l,strokeDasharray:u,numTicks:f,lineStyle:m,offset:h,tickValues:v,...y})]})}var z6=class extends I.Component{static propTypes={disabled:A.bool,disabledAdditionalGrid:A.bool,graphProps:F$.isRequired};getAdditionalGridProps=(e,t)=>{let{graphProps:{scale:n,size:{width:r,height:i},domain:a,range:o}}=this.props,s=Z3({...o,step:o.labelStep}).filter(t=>e.includes(t)),c=Z3({...a,step:a.labelStep}).filter(e=>t.includes(e)),l=s.length&&Math.min(...s).toString().replace(/[.-]/g,``).length||1,u=s.length&&Math.max(...s).toString().replace(/[.-]/g,``).length||1,d=Math.max(l,u)*9+22,f=n.x(0),p=n.y(0),m=`${f-d} ${d} ${r}`,h=`${p} 28 ${i}`,g=a.labelStep>0&&o.labelStep>0&&s&&c&&s.length>1&&c.length>1&&(s.length!==e.length||c.length!==t.length),_=c.filter(e=>e>=0||f-n.x(e)>d);return{rowTickLabelValues:s.filter(e=>e>=0||n.y(e)-p>28),columnTickLabelValues:_,rowStrokeDasharray:m,columnStrokeDasharray:h,displayAdditionalGrid:g}};render(){let{graphProps:e}=this.props,{scale:t,size:{height:n,width:r},domain:i,range:a}=e,o=Z3(a),s=Z3(i),{rowTickLabelValues:c,columnTickLabelValues:l,rowStrokeDasharray:u,columnStrokeDasharray:d,displayAdditionalGrid:f}=this.getAdditionalGridProps(o,s),p=i.labelStep*2===i.step||a.labelStep*2===a.step?`#9FA8DA`:`#7985CB`;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(R6,{innerRef:e=>this.grid=e,xScale:t.x,yScale:t.y,width:r,height:n,stroke:`#E1E6EC`,rowTickValues:o,columnTickValues:s}),f&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(I6,{scale:t.y,width:r,tickValues:c,stroke:p,strokeDasharray:u}),(0,L.jsx)(L6,{scale:t.x,height:n,tickValues:l,stroke:p,strokeDasharray:d})]})]})}};function B6(e){return typeof e==`function`||typeof e==`object`&&!!e&&typeof e.$$typeof==`symbol`}function V6(e,t){return!e||B6(e)?e:B6(e.default)?e.default:t&&B6(e[t])?e[t]:t&&B6(e[t]?.default)?e[t].default:e}var H6=V6(Sh,`Readable`)||V6(G6.Readable,`Readable`),U6=Qh,W6=U6.default,G6=W6&&typeof W6==`object`?W6:U6,K6={left:-90,top:0,bottom:0,right:90},q6=(e,t,n)=>{let r=(e,t,n)=>`translate(${e}, ${t}), rotate(${n})`;if(e===`left`)return r(-20,n/2,K6[e]);if(e===`right`)return r(t+30,n/2,K6[e]);if(e===`top`)return r(t/2,-20,K6[e]);if(e===`bottom`)return r(t/2,n+30,K6[e])},J6=(e,t)=>{switch(e){case`left`:return-t;case`top`:return-t;case`right`:return-t-10;default:return-t+10}},Y6=B(E$,{shouldForwardProp:e=>![`side`,`disabledLabel`].includes(e)})(({theme:e,side:t,disabledLabel:n})=>({fontSize:e.typography.fontSize-2,textAlign:`center`,padding:`0 4px`,...t===`bottom`&&{marginTop:`44px`},...n&&{pointerEvents:`none`}})),X6=class extends I.Component{static propTypes={text:A.string,side:A.string,disabledLabel:A.bool,placeholder:A.string,graphProps:F$.isRequired,onChange:A.func,mathMlOptions:A.object};static defaultProps={onChange:()=>{}};render(){let{disabledLabel:e,placeholder:t,text:n,side:r,graphProps:i,onChange:a,mathMlOptions:o={}}=this.props,{size:s,domain:c,range:l}=i,u=(s.height||500)+(l.padding||0)*2,d=(s.width||500)+(c.padding||0)*2,f=q6(r,d,u),p=r===`left`||r===`right`?u:d,m=J6(r,36),h=r===`bottom`?58:54;return(0,L.jsx)(`foreignObject`,{x:-(p/2),y:m,width:p,height:h,transform:f,textAnchor:`middle`,children:(0,L.jsx)(H6,{false:!0,children:(0,L.jsx)(Y6,{side:r,disabledLabel:e,markup:n||``,onChange:a,placeholder:!e&&t,toolbarOpts:{position:r===`bottom`?`top`:`bottom`,noPadding:!0,noBorder:!0},activePlugins:[`bold`,`italic`,`underline`,`strikethrough`,`math`],mathMlOptions:o})})})}},Z6={left:A.string,top:A.string,bottom:A.string,right:A.string};(class extends I.Component{static propTypes={className:A.string,disabledLabels:A.bool,placeholders:A.object,value:A.shape(Z6),graphProps:A.object,onChange:A.object,mathMlOptions:A.object};static defaultProps={};onChangeLabel=(e,t)=>{let{value:n,onChange:r}=this.props;r({...n,[t]:e})};render(){let{disabledLabels:e,placeholders:t={},value:n={},graphProps:r,mathMlOptions:i={}}=this.props;return(0,L.jsxs)(I.Fragment,{children:[(0,L.jsx)(X6,{side:`left`,text:n.left,disabledLabel:e,placeholder:t.left,graphProps:r,onChange:e=>this.onChangeLabel(e,`left`),mathMlOptions:i},`left`),(0,L.jsx)(X6,{side:`top`,text:n.top,disabledLabel:e,placeholder:t.top,graphProps:r,onChange:e=>this.onChangeLabel(e,`top`),mathMlOptions:i},`top`),(0,L.jsx)(X6,{side:`bottom`,text:n.bottom,disabledLabel:e,placeholder:t.bottom,graphProps:r,onChange:e=>this.onChangeLabel(e,`bottom`),mathMlOptions:i},`bottom`),(0,L.jsx)(X6,{side:`right`,text:n.right,disabledLabel:e,placeholder:t.right,graphProps:r,onChange:e=>this.onChangeLabel(e,`right`),mathMlOptions:i},`right`)]})}});var Q6=class extends I.Component{static propTypes={width:A.number.isRequired,height:A.number.isRequired,onClick:A.func.isRequired,graphProps:F$.isRequired};static defaultProps={};componentDidMount(){let e=ll(this.rect);e.on(`click`,t=>this.onRectClick(e,t))}shouldComponentUpdate(e){return!q$(this.props.graphProps,e.graphProps)||this.props.width!==e.width||this.props.height!==e.height}getRectPadding=()=>{let{graphProps:e}=this.props;return u6(e)?6:10};onRectClick=(e,t)=>{let{onClick:n,graphProps:r}=this.props,{scale:i}=r,a=this.getRectPadding(),o=dl(t,e.node()),s=i.x.invert(o[0]-a),c=i.y.invert(o[1]-a),l=Z3(r.range),u=Z3(r.domain),d=(e,t)=>e.length&&e.reduce((e,n)=>Math.abs(n-t)<=Math.abs(e-t)?n:e),f={};u.indexOf(s)>=0&&l.indexOf(c)>=0?(f.x=s,f.y=c):(f.x=d(u,s),f.y=d(l,c)),n(f)};render(){let{width:e,height:t}=this.props,n=this.getRectPadding();return(0,L.jsx)(`rect`,{ref:e=>this.rect=e,transform:`translate(-${n}, -${n})`,fill:`red`,fillOpacity:`0.0`,width:e+n*2,height:t+n*2})}},$6=Cp(`pie-lib:graphing:graph`),e8={axesSettings:A.shape(w6),backgroundMarks:A.array,className:A.string,collapsibleToolbar:A.bool,collapsibleToolbarTitle:A.string,disabledLabels:A.bool,disabledTitle:A.bool,domain:O$,labels:A.shape(Z6),labelModeEnabled:A.bool,coordinatesOnHover:A.bool,marks:A.array,onChangeLabels:A.func,onChangeMarks:A.func,onChangeTitle:A.func,range:O$,size:A.shape({width:A.number.isRequired,height:A.number.isRequired}),showLabels:A.bool,showPixelGuides:A.bool,showTitle:A.bool,title:A.string,tools:A.array,limitLabeling:A.bool},t8=e=>({x:-23,y:-23,width:e.width+46,height:e.height+46}),n8=({marks:e,currentTool:t,onChangeMarks:n,removeIncompleteTool:r})=>{let i=e.filter(e=>e.building)[0],a=Go(e);if(i&&t&&i.type!==t.type){let e=a.findIndex(e=>ts(e,i));e>=0&&a.splice(e,1)}return r&&!ts(a,e)&&n(a),a},r8=class extends I.Component{constructor(e){super(e),this.maskUid=this.generateMaskId()}static propTypes={...e8,currentTool:A.object};static defaultProps={onChangeMarks:()=>{},disabledLabels:!1,disabledTitle:!1};state={};_justDragged=!1;startDrag=()=>{this._justDragged=!1};stopDrag=()=>{this._justDragged=!0,setTimeout(()=>{this._justDragged=!1},300)};generateMaskId(){return`graph-`+(Math.random()*1e4).toFixed()}componentDidMount=()=>this.setState({labelNode:this.labelNode});changeMark=(e,t)=>{let{onChangeMarks:n,marks:r}=this.props,i=Go(r),a=i.findIndex(t=>ts(t,e));a>=0&&!_6(t,r,e)&&(i.splice(a,1,t),n(i))};completeMark=e=>{let{currentTool:t,marks:n}=this.props,r=n.filter(e=>e.building)[0];if(!r||!t)return;let i=t.complete(r,e);this.updateMarks(r,i)};updateMarks=(e,t,n=!1)=>{let{onChangeMarks:r,marks:i}=this.props,a=Go(i);if(!t||!t.building&&_6(t,i))return;let o=a.findIndex(t=>ts(t,e));o>=0?(a.splice(o,1,t),r(a)):n&&r([...a,t])};getComponent=e=>{if(!e)return null;let t=(this.props.tools||[]).find(t=>t.type===e.type);return t&&t.Component||null};onBgClick=e=>{let{x:t,y:n}=e||{},{labelModeEnabled:r,currentTool:i,marks:a}=this.props;if(this._justDragged||r||!i||[null,void 0].includes(t)||[null,void 0].includes(n))return;$6(`[onBgClick] x,y: `,t,n);let o=a.filter(e=>e.building)[0],s;s=o&&i&&o.type===i.type?i.addPoint({x:t,y:n},{...o}):i.addPoint({x:t,y:n},void 0),this.updateMarks(o,s,!0)};render(){let{axesSettings:e,currentTool:t,coordinatesOnHover:n,size:r,disabledLabels:i,disabledTitle:a,domain:o,backgroundMarks:s,range:c,title:l,labels:u,labelModeEnabled:d,labelsPlaceholders:f,limitLabeling:p,showLabels:m,showPixelGuides:h,showTitle:g,titlePlaceholder:_,onChangeLabels:v,onChangeTitle:y,mathMlOptions:b={},onChangeMarks:x,removeIncompleteTool:S}=this.props,{marks:C}=this.props,w=P4(o,c,r,()=>this.rootNode),T=t8(r),E={graphProps:w,labelModeEnabled:d,limitLabeling:p};return C=n8({marks:C||[],currentTool:t,onChangeMarks:x,removeIncompleteTool:S}),(0,L.jsx)(T1,{rootRef:e=>this.rootNode=e,disabledTitle:a,disabledLabels:i,labels:u,labelsPlaceholders:f||{},showPixelGuides:h,showLabels:m,showTitle:g,title:l,titlePlaceholder:_,onChangeTitle:y,onChangeLabels:v,mathMlOptions:b,...E,children:(0,L.jsxs)(`g`,{transform:o&&o.padding&&o.range?`translate(${o.padding}, ${c.padding})`:void 0,children:[(0,L.jsx)(z6,{...E}),(0,L.jsx)(P6,{...e,...E}),(0,L.jsx)(Q6,{...r,onClick:this.onBgClick,...E}),(0,L.jsxs)(`mask`,{id:`${this.maskUid}`,children:[(0,L.jsx)(`rect`,{...T,fill:`white`}),` `]}),(0,L.jsxs)(`g`,{id:`marks`,mask:`url('#${this.maskUid}')`,children:[(s||[]).map((e,t)=>{let n=this.getComponent(e),r=e.type;return(0,L.jsx)(n,{mark:{...e,disabled:!0,isBackground:!0},labelNode:this.state.labelNode,onClick:this.onBgClick,...E},`${r}-${t}-bg`)}),C.map((e,r)=>{let i=this.getComponent(e),a=e.type;return(0,L.jsx)(i,{mark:e,coordinatesOnHover:n,onChange:this.changeMark,onComplete:this.completeMark,onClick:this.onBgClick,onDragStart:this.startDrag,onDragStop:this.stopDrag,labelNode:this.state.labelNode,isToolActive:t&&a===t.type,...E},`${a}-${r}`)}),(0,L.jsx)(`foreignObject`,{ref:e=>this.labelNode=e,x:`0`,y:`0`,...r,style:{pointerEvents:`none`,fontSize:`14px`}})]})]})})}},i8=o((e=>{var t=d();t.useSyncExternalStore,t.useRef,t.useEffect,t.useMemo,t.useDebugValue}));o(((e,t)=>{t.exports=i8()}))();var a8=Symbol.for(`react.element`),o8=Symbol.for(`react.portal`),s8=Symbol.for(`react.fragment`),c8=Symbol.for(`react.strict_mode`),l8=Symbol.for(`react.profiler`),u8=Symbol.for(`react.consumer`),d8=Symbol.for(`react.context`),f8=Symbol.for(`react.forward_ref`),p8=Symbol.for(`react.suspense`),m8=Symbol.for(`react.suspense_list`),h8=Symbol.for(`react.memo`),g8=Symbol.for(`react.lazy`),_8=f8,v8=h8;function y8(e){if(typeof e==`object`&&e){let{$$typeof:t}=e;switch(t){case a8:switch(e=e.type,e){case s8:case l8:case c8:case p8:case m8:return e;default:switch(e&&=e.$$typeof,e){case d8:case f8:case g8:case h8:return e;case u8:return e;default:return t}}case o8:return t}}}function b8(e){return y8(e)===h8}function x8(e,t,n,r,{areStatesEqual:i,areOwnPropsEqual:a,areStatePropsEqual:o}){let s=!1,c,l,u,d,f;function p(i,a){return c=i,l=a,u=e(c,l),d=t(r,l),f=n(u,d,l),s=!0,f}function m(){return u=e(c,l),t.dependsOnOwnProps&&(d=t(r,l)),f=n(u,d,l),f}function h(){return e.dependsOnOwnProps&&(u=e(c,l)),t.dependsOnOwnProps&&(d=t(r,l)),f=n(u,d,l),f}function g(){let t=e(c,l),r=!o(t,u);return u=t,r&&(f=n(u,d,l)),f}function _(e,t){let n=!a(t,l),r=!i(e,c,t,l);return c=e,l=t,n&&r?m():n?h():r?g():f}return function(e,t){return s?_(e,t):p(e,t)}}function S8(e,{initMapStateToProps:t,initMapDispatchToProps:n,initMergeProps:r,...i}){return x8(t(e,i),n(e,i),r(e,i),e,i)}function C8(e,t){let n={};for(let r in e){let i=e[r];typeof i==`function`&&(n[r]=(...e)=>t(i(...e)))}return n}function w8(e){return function(t){let n=e(t);function r(){return n}return r.dependsOnOwnProps=!1,r}}function T8(e){return e.dependsOnOwnProps?!!e.dependsOnOwnProps:e.length!==1}function E8(e,t){return function(t,{displayName:n}){let r=function(e,t){return r.dependsOnOwnProps?r.mapToProps(e,t):r.mapToProps(e,void 0)};return r.dependsOnOwnProps=!0,r.mapToProps=function(t,n){r.mapToProps=e,r.dependsOnOwnProps=T8(e);let i=r(t,n);return typeof i==`function`&&(r.mapToProps=i,r.dependsOnOwnProps=T8(i),i=r(t,n)),i},r}}function D8(e,t){return(n,r)=>{throw Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${r.wrappedComponentName}.`)}}function O8(e){return e&&typeof e==`object`?w8(t=>C8(e,t)):e?typeof e==`function`?E8(e,`mapDispatchToProps`):D8(e,`mapDispatchToProps`):w8(e=>({dispatch:e}))}function k8(e){return e?typeof e==`function`?E8(e,`mapStateToProps`):D8(e,`mapStateToProps`):w8(()=>({}))}function A8(e,t,n){return{...n,...e,...t}}function j8(e){return function(t,{displayName:n,areMergedPropsEqual:r}){let i=!1,a;return function(t,n,o){let s=e(t,n,o);return i?r(s,a)||(a=s):(i=!0,a=s),a}}}function M8(e){return e?typeof e==`function`?j8(e):D8(e,`mergeProps`):()=>A8}function N8(e){e()}function P8(){let e=null,t=null;return{clear(){e=null,t=null},notify(){N8(()=>{let t=e;for(;t;)t.callback(),t=t.next})},get(){let t=[],n=e;for(;n;)t.push(n),n=n.next;return t},subscribe(n){let r=!0,i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var F8={notify(){},get:()=>[]};function I8(e,t){let n,r=F8,i=0,a=!1;function o(e){u();let t=r.subscribe(e),n=!1;return()=>{n||(n=!0,t(),d())}}function s(){r.notify()}function c(){m.onStateChange&&m.onStateChange()}function l(){return a}function u(){i++,n||(n=t?t.addNestedSub(c):e.subscribe(c),r=P8())}function d(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=F8)}function f(){a||(a=!0,u())}function p(){a&&(a=!1,d())}let m={addNestedSub:o,notifyNestedSubs:s,handleChangeWrapper:c,isSubscribed:l,trySubscribe:f,tryUnsubscribe:p,getListeners:()=>r};return m}var L8=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,R8=typeof navigator<`u`&&navigator.product===`ReactNative`,z8=L8||R8?I.useLayoutEffect:I.useEffect;function B8(e,t){return e===t?e!==0||t!==0||1/e==1/t:e!==e&&t!==t}function V8(e,t){if(B8(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!B8(e[n[r]],t[n[r]]))return!1;return!0}var H8={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},U8={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},W8={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},G8={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},K8={[_8]:W8,[v8]:G8};function q8(e){return b8(e)?G8:K8[e.$$typeof]||H8}var J8=Object.defineProperty,Y8=Object.getOwnPropertyNames,X8=Object.getOwnPropertySymbols,Z8=Object.getOwnPropertyDescriptor,Q8=Object.getPrototypeOf,$8=Object.prototype;function e5(e,t){if(typeof t!=`string`){if($8){let n=Q8(t);n&&n!==$8&&e5(e,n)}let n=Y8(t);X8&&(n=n.concat(X8(t)));let r=q8(e),i=q8(t);for(let a=0;a<n.length;++a){let o=n[a];if(!U8[o]&&!(i&&i[o])&&!(r&&r[o])){let n=Z8(t,o);try{J8(e,o,n)}catch{}}}}return e}var t5=Symbol.for(`react-redux-context`),n5=typeof globalThis<`u`?globalThis:{};function r5(){if(!I.createContext)return{};let e=n5[t5]??=new Map,t=e.get(I.createContext);return t||(t=I.createContext(null),e.set(I.createContext,t)),t}var i5=r5(),a5=[null,null];function o5(e,t,n){z8(()=>e(...t),n)}function s5(e,t,n,r,i,a){e.current=r,n.current=!1,i.current&&(i.current=null,a())}function c5(e,t,n,r,i,a,o,s,c,l,u){if(!e)return()=>{};let d=!1,f=null,p=()=>{if(d||!s.current)return;let e=t.getState(),n,p;try{n=r(e,i.current)}catch(e){p=e,f=e}p||(f=null),n===a.current?o.current||l():(a.current=n,c.current=n,o.current=!0,u())};return n.onStateChange=p,n.trySubscribe(),p(),()=>{if(d=!0,n.tryUnsubscribe(),n.onStateChange=null,f)throw f}}function l5(e,t){return e===t}function u5(e,t,n,{pure:r,areStatesEqual:i=l5,areOwnPropsEqual:a=V8,areStatePropsEqual:o=V8,areMergedPropsEqual:s=V8,forwardRef:c=!1,context:l=i5}={}){let u=l,d=k8(e),f=O8(t),p=M8(n),m=!!e;return e=>{let t=e.displayName||e.name||`Component`,n=`Connect(${t})`,r={shouldHandleStateChanges:m,displayName:n,wrappedComponentName:t,WrappedComponent:e,initMapStateToProps:d,initMapDispatchToProps:f,initMergeProps:p,areStatesEqual:i,areStatePropsEqual:o,areOwnPropsEqual:a,areMergedPropsEqual:s};function l(t){let[n,i,a]=I.useMemo(()=>{let{reactReduxForwardedRef:e,...n}=t;return[t.context,e,n]},[t]),o=I.useMemo(()=>{let e=u;return n?.Consumer,e},[n,u]),s=I.useContext(o),c=!!t.store&&!!t.store.getState&&!!t.store.dispatch,l=!!s&&!!s.store,d=c?t.store:s.store,f=l?s.getServerState:d.getState,p=I.useMemo(()=>S8(d.dispatch,r),[d]),[h,g]=I.useMemo(()=>{if(!m)return a5;let e=I8(d,c?void 0:s.subscription);return[e,e.notifyNestedSubs.bind(e)]},[d,c,s]),_=I.useMemo(()=>c?s:{...s,subscription:h},[c,s,h]),v=I.useRef(void 0),y=I.useRef(a),b=I.useRef(void 0),x=I.useRef(!1),S=I.useRef(!1),C=I.useRef(void 0);z8(()=>(S.current=!0,()=>{S.current=!1}),[]);let w=I.useMemo(()=>()=>b.current&&a===y.current?b.current:p(d.getState(),a),[d,a]),T=I.useMemo(()=>e=>h?c5(m,d,h,p,y,v,x,S,b,g,e):()=>{},[h]);o5(s5,[y,v,x,a,b,g]);let E;try{E=I.useSyncExternalStore(T,w,f?()=>p(f(),a):w)}catch(e){throw C.current&&(e.message+=`
|
|
363
|
+
`,e.getElementsByTagName(`head`)[0].appendChild(n)}e.body&&t0(e.body,`react-draggable-transparent-selection`)}function $1(e){window.requestAnimationFrame?window.requestAnimationFrame(()=>{e0(e)}):e0(e)}function e0(e){if(e)try{e.body&&n0(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 t0(e,t){e.classList?e.classList.add(t):e.className.match(RegExp(`(?:^|\\s)${t}(?!\\S)`))||(e.className+=` ${t}`)}function n0(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(RegExp(`(?:^|\\s)${t}(?!\\S)`,`g`),``)}function r0(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r==`string`?r:u0(r);let i=d0(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+k1(s.paddingLeft)+k1(o.marginLeft),top:-i.offsetTop+k1(s.paddingTop)+k1(o.marginTop),right:W1(a)-H1(i)-i.offsetLeft+k1(s.paddingRight)-k1(o.marginRight),bottom:U1(a)-V1(i)-i.offsetTop+k1(s.paddingBottom)-k1(o.marginBottom)}}return O1(r.right)&&(t=Math.min(t,r.right)),O1(r.bottom)&&(n=Math.min(n,r.bottom)),O1(r.left)&&(t=Math.max(t,r.left)),O1(r.top)&&(n=Math.max(n,r.top)),[t,n]}function i0(e,t,n){return[Math.round(t/e[0])*e[0],Math.round(n/e[1])*e[1]]}function a0(e){return e.props.axis===`both`||e.props.axis===`x`}function o0(e){return e.props.axis===`both`||e.props.axis===`y`}function s0(e,t,n){let r=typeof t==`number`?Y1(e,t):null;if(typeof t==`number`&&!r)return null;let i=d0(n),a=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return G1(r||e,a,n.props.scale)}function c0(e,t,n){let r=!O1(e.lastX),i=d0(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 l0(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 u0(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function d0(e){let t=e.findDOMNode();if(!t)throw Error(`<DraggableCore>: Unmounted during event!`);return t}var f0=typeof process<`u`&&process.env.DRAGGABLE_DEBUG?console.log.bind(console):function(){},p0={touch:{start:`touchstart`,move:`touchmove`,stop:`touchend`},mouse:{start:`mousedown`,move:`mousemove`,stop:`mouseup`}},m0=p0.mouse,h0=class extends I.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&&!R1(e.target,this.props.handle,t)||this.props.cancel&&R1(e.target,this.props.cancel,t))return;e.type===`touchstart`&&!this.props.allowMobileScroll&&e.preventDefault();let r=X1(e);this.touchIdentifier=r;let i=s0(e,r,this);if(i==null)return;let{x:a,y:o}=i,s=c0(this,a,o);f0(`DraggableCore: handleDragStart: %j`,s),f0(`calling`,this.props.onStart),!(this.props.onStart(e,s)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&Q1(n,this.props.nonce),this.dragging=!0,this.lastX=a,this.lastY=o,z1(n,m0.move,this.handleDrag),z1(n,m0.stop,this.handleDragStop))},this.handleDrag=e=>{let t=s0(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]=i0(this.props.grid,e,t),!e&&!t)return;n=this.lastX+e,r=this.lastY+t}let i=c0(this,n,r);if(f0(`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=s0(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]=i0(this.props.grid,e,t),n=this.lastX+e,r=this.lastY+t}let i=c0(this,n,r);if(this.props.onStop(e,i)===!1||this.mounted===!1)return!1;let a=this.findDOMNode();a&&this.props.enableUserSelectHack&&$1(a.ownerDocument),f0(`DraggableCore: handleDragStop: %j`,i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&(f0(`DraggableCore: Removing handlers`),B1(a.ownerDocument,m0.move,this.handleDrag),B1(a.ownerDocument,m0.stop,this.handleDragStop))},this.onMouseDown=e=>(m0=p0.mouse,this.handleDragStart(e)),this.onMouseUp=e=>(m0=p0.mouse,this.handleDragStop(e)),this.onTouchStart=e=>(m0=p0.touch,this.handleDragStart(e)),this.onTouchEnd=e=>(m0=p0.touch,this.handleDragStop(e))}componentDidMount(){this.mounted=!0;let e=this.findDOMNode();e&&z1(e,p0.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let e=this.findDOMNode();if(e){let{ownerDocument:t}=e;B1(t,p0.mouse.move,this.handleDrag),B1(t,p0.touch.move,this.handleDrag),B1(t,p0.mouse.stop,this.handleDragStop),B1(t,p0.touch.stop,this.handleDragStop),B1(e,p0.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&$1(t)}}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=fu.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):(f0(`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 I.cloneElement(I.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};h0.displayName=`DraggableCore`,h0.propTypes={allowAnyClick:A.bool,allowMobileScroll:A.bool,children:A.node.isRequired,disabled:A.bool,enableUserSelectHack:A.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw Error(`Draggable's offsetParent must be a DOM Node.`)},grid:A.arrayOf(A.number),handle:A.string,cancel:A.string,nodeRef:A.object,nonce:A.string,onStart:A.func,onDrag:A.func,onStop:A.func,onMouseDown:A.func,scale:A.number,className:A1,style:A1,transform:A1},h0.defaultProps={allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1};var g0=class extends I.Component{constructor(e){super(e),this.onDragStart=(e,t)=>{if(f0(`Draggable: onDragStart: %j`,t),this.props.onStart(e,l0(this,t))===!1)return!1;this.setState({dragging:!0,dragged:!0})},this.onDrag=(e,t)=>{if(!this.state.dragging)return!1;f0(`Draggable: onDrag: %j`,t);let n=l0(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]=r0(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,l0(this,t))===!1)return!1;f0(`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)?(f0(`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=fu.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:a0(this)&&p?this.state.x:m.x,y:o0(this)&&p?this.state.y:m.y};this.state.isElementSVG?f=q1(h,c):d=K1(h,c);let g=I.Children.only(n),_=R(g.props.className||``,i,{[a]:this.state.dragging,[o]:this.state.dragged});return I.createElement(h0,{...u,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop},I.cloneElement(g,{className:_,style:{...g.props.style,...d},transform:f}))}};g0.displayName=`Draggable`,g0.propTypes={...h0.propTypes,axis:A.oneOf([`both`,`x`,`y`,`none`]),bounds:A.oneOfType([A.shape({left:A.number,right:A.number,top:A.number,bottom:A.number}),A.string,A.oneOf([!1])]),defaultClassName:A.string,defaultClassNameDragging:A.string,defaultClassNameDragged:A.string,defaultPosition:A.shape({x:A.number,y:A.number}),positionOffset:A.shape({x:A.oneOfType([A.number,A.string]),y:A.oneOfType([A.number,A.string])}),position:A.shape({x:A.number,y:A.number}),className:A1,style:A1,transform:A1},g0.defaultProps={...h0.defaultProps,axis:`both`,bounds:!1,defaultClassName:`react-draggable`,defaultClassNameDragging:`react-draggable-dragging`,defaultClassNameDragged:`react-draggable-dragged`,defaultPosition:{x:0,y:0},scale:1};var _0=Cp(`pie-lib:plot:grid-draggable`),v0=(e,t,n)=>r=>{let i=r+e(0);return t(n+e.invert(i)).toFixed(4)*1e3/1e3},y0=e=>t=>((0,z$.default)(!!e&&ns(e.fromDelta)&&ns(e.bounds)&&ns(e.anchorPoint),`You must supply an object with: { anchorPoint: Function, fromDelta: Function, bounds: Function }`),class extends I.Component{static propTypes={disabled:A.bool,onDragStart:A.func,onDrag:A.func,onDragStop:A.func,onClick:A.func,onMove:A.func,graphProps:F$.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:v0(i.x,a.x,t),y:v0(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 _0(`[tiny] key: `,e,`delta: `,r,`out: `,i),i};getScaledBounds=()=>{let t=e.bounds(this.props,this.props.graphProps);_0(`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},_0(`[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 K$(t.anchorPoint,n)};applyDelta=t=>{let n=this.getDelta(t);return _0(`[applyDelta] delta:`,n),e.fromDelta(this.props,n)};onStop=(e,t)=>{_0(`[onStop] dd:`,t);let{onDragStop:n,onClick:r,disabled:i}=this.props;if(n&&!i&&n(),_0(`[onStop] lastX/Y: `,t.lastX,t.lastY),!this._didDrag){if(!i&&typeof e?.stopPropagation==`function`&&e.stopPropagation(),r){_0(`call onClick`),this.setState({startX:null,startY:null});let{graphProps:t}=this.props,{scale:n,snap:i}=t;try{let[t,a]=dl(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||e).preventDefault(),s=this.state?!!this.state.startX:!1;return(0,L.jsx)(h0,{onMouseDown:o,onStart:this.onStart,onDrag:this.onDrag,onStop:this.onStop,axis:e.axis||`both`,grid:[a.x,a.y],children:(0,L.jsx)(t,{...i,disabled:n,isDragging:s,onClick:s?void 0:r})})}}),b0=Cp(`pie-lib:plot:trig`),x0=e=>180/Math.PI*e,S0=e=>Math.PI/180*e,C0=(e,t)=>{let n=t.y-e.y,r=t.x-e.x;b0(e,t,`vd: `,n,`hd: `,r);let i=Math.atan2(n,r);return i<0?i+Math.PI*2:i},w0=Math.PI/2;Math.PI+w0;var T0=(e,t)=>Math.abs(e/Math.sin(t)),E0=(e,t)=>(n,r)=>[k0(B$(n.x<r.x?e.max:e.min,n.y<r.y?t.max:t.min),n,r),k0(B$(r.x<n.x?e.max:e.min,r.y<n.y?t.max:t.min),r,n)],D0=(e,t)=>(b0(`[getOpposingSide] hyp: `,e,`angle:`,t),Math.abs(e*Math.sin(t))),O0=(e,t)=>{if(Number.isFinite(e)&&Number.isFinite(t))return e===0&&t>0?`y`:t===0&&e>0||e<t?`x`:`y`;if(isNaN(e)&&!isNaN(t))return`y`;if(!isNaN(e)&&isNaN(t))return`x`;if(e===1/0)return`y`;if(t===1/0)return`x`;console.warn(`hypotenuse - which is shorter? x:`,e,`y:`,t)},k0=(e,t,n)=>{let r=b0.enabled?b0.bind(b0,`diffEdge: [${t.x},${t.y} -> ${n.x},${n.y}]`):()=>{},i=C0(t,n);r(`x angle`,x0(i));let a=Math.abs(i-S0(90));r(`y angle`,x0(a));let o=Math.abs(t.x-e.x),s=T0(o,a),c=Math.abs(t.y-e.y),l=T0(c,i);r(`x: side`,o,`h:`,s),r(`y: side`,c,`h:`,l);let u=O0(s,l);if(u!==`x`&&u!==`y`)throw Error(`Cant decide which hypotenuse to use`);let d=u===`x`?new R$(o,D0(s,i)):new R$(D0(l,a),c);r(`point:`,d);let f=new R$(n.x<t.x?-1:1,n.y<t.y?-1:1);r(`multiplier:`,f);let p=d.multByPoint(f);r(`out:`,p);let m=p.add(new R$(t.x,t.y));return r(`normalized:`,m),m};function A0(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function j0(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function M0(e){let t,n,r;e.length===2?(t=e===A0||e===j0?e:N0,n=e,r=e):(t=A0,n=(t,n)=>A0(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 N0(){return 0}function P0(e){return e===null?NaN:+e}var F0=M0(A0),I0=F0.right;F0.left,M0(P0).center;var L0=Math.sqrt(50),R0=Math.sqrt(10),z0=Math.sqrt(2);function B0(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=L0?10:a>=R0?5:a>=z0?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?B0(e,t,n*2):[s,c,l]}function V0(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?B0(t,e,n):B0(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 H0(e,t,n){return t=+t,e=+e,n=+n,B0(e,t,n)[2]}function U0(e,t,n){t=+t,e=+e,n=+n;let r=t<e,i=r?H0(t,e,n):H0(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function W0(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function G0(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function K0(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function q0(){}var J0=.7,Y0=1/J0,X0=`\\s*([+-]?\\d+)\\s*`,Z0=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,Q0=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,$0=/^#([0-9a-f]{3,8})$/,e2=RegExp(`^rgb\\(${X0},${X0},${X0}\\)$`),t2=RegExp(`^rgb\\(${Q0},${Q0},${Q0}\\)$`),n2=RegExp(`^rgba\\(${X0},${X0},${X0},${Z0}\\)$`),r2=RegExp(`^rgba\\(${Q0},${Q0},${Q0},${Z0}\\)$`),i2=RegExp(`^hsl\\(${Z0},${Q0},${Q0}\\)$`),a2=RegExp(`^hsla\\(${Z0},${Q0},${Q0},${Z0}\\)$`),o2={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};G0(q0,d2,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:s2,formatHex:s2,formatHex8:c2,formatHsl:l2,formatRgb:u2,toString:u2});function s2(){return this.rgb().formatHex()}function c2(){return this.rgb().formatHex8()}function l2(){return w2(this).formatHsl()}function u2(){return this.rgb().formatRgb()}function d2(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=$0.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?f2(t):n===3?new g2(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?p2(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?p2(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=e2.exec(e))?new g2(t[1],t[2],t[3],1):(t=t2.exec(e))?new g2(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=n2.exec(e))?p2(t[1],t[2],t[3],t[4]):(t=r2.exec(e))?p2(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=i2.exec(e))?C2(t[1],t[2]/100,t[3]/100,1):(t=a2.exec(e))?C2(t[1],t[2]/100,t[3]/100,t[4]):o2.hasOwnProperty(e)?f2(o2[e]):e===`transparent`?new g2(NaN,NaN,NaN,0):null}function f2(e){return new g2(e>>16&255,e>>8&255,e&255,1)}function p2(e,t,n,r){return r<=0&&(e=t=n=NaN),new g2(e,t,n,r)}function m2(e){return e instanceof q0||(e=d2(e)),e?(e=e.rgb(),new g2(e.r,e.g,e.b,e.opacity)):new g2}function h2(e,t,n,r){return arguments.length===1?m2(e):new g2(e,t,n,r??1)}function g2(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}G0(g2,h2,K0(q0,{brighter(e){return e=e==null?Y0:Y0**+e,new g2(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?J0:J0**+e,new g2(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new g2(x2(this.r),x2(this.g),x2(this.b),b2(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:_2,formatHex:_2,formatHex8:v2,formatRgb:y2,toString:y2}));function _2(){return`#${S2(this.r)}${S2(this.g)}${S2(this.b)}`}function v2(){return`#${S2(this.r)}${S2(this.g)}${S2(this.b)}${S2((isNaN(this.opacity)?1:this.opacity)*255)}`}function y2(){let e=b2(this.opacity);return`${e===1?`rgb(`:`rgba(`}${x2(this.r)}, ${x2(this.g)}, ${x2(this.b)}${e===1?`)`:`, ${e})`}`}function b2(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function x2(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function S2(e){return e=x2(e),(e<16?`0`:``)+e.toString(16)}function C2(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new E2(e,t,n,r)}function w2(e){if(e instanceof E2)return new E2(e.h,e.s,e.l,e.opacity);if(e instanceof q0||(e=d2(e)),!e)return new E2;if(e instanceof E2)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 E2(o,s,c,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.h=+e,this.s=+t,this.l=+n,this.opacity=+r}G0(E2,T2,K0(q0,{brighter(e){return e=e==null?Y0:Y0**+e,new E2(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?J0:J0**+e,new E2(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 g2(k2(e>=240?e-240:e+120,i,r),k2(e,i,r),k2(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new E2(D2(this.h),O2(this.s),O2(this.l),b2(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=b2(this.opacity);return`${e===1?`hsl(`:`hsla(`}${D2(this.h)}, ${O2(this.s)*100}%, ${O2(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function D2(e){return e=(e||0)%360,e<0?e+360:e}function O2(e){return Math.max(0,Math.min(1,e||0))}function k2(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 A2=e=>()=>e;function j2(e,t){return function(n){return e+n*t}}function M2(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function N2(e){return(e=+e)==1?P2:function(t,n){return n-t?M2(t,n,e):A2(isNaN(t)?n:t)}}function P2(e,t){var n=t-e;return n?j2(e,n):A2(isNaN(e)?t:e)}var F2=(function e(t){var n=N2(t);function r(e,t){var r=n((e=h2(e)).r,(t=h2(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=P2(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 I2(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 L2(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function R2(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]=q2(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 z2(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function B2(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function V2(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]=q2(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var H2=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,U2=new RegExp(H2.source,`g`);function W2(e){return function(){return e}}function G2(e){return function(t){return e(t)+``}}function K2(e,t){var n=H2.lastIndex=U2.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=H2.exec(e))&&(i=U2.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:B2(r,i)})),n=U2.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?G2(c[0].x):W2(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 q2(e,t){var n=typeof t,r;return t==null||n===`boolean`?A2(t):(n===`number`?B2:n===`string`?(r=d2(t))?(t=r,F2):K2:t instanceof d2?F2:t instanceof Date?z2:L2(t)?I2:Array.isArray(t)?R2:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?V2:B2)(e,t)}function J2(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Y2(e){return function(){return e}}function X2(e){return+e}var Z2=[0,1];function Q2(e){return e}function $2(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Y2(isNaN(t)?NaN:.5)}function e4(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}function t4(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=$2(i,r),a=n(o,a)):(r=$2(r,i),a=n(a,o)),function(e){return a(r(e))}}function n4(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]=$2(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(t){var n=I0(e,t,1,r)-1;return a[n](i[n](t))}}function r4(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function i4(){var e=Z2,t=Z2,n=q2,r,i,a,o=Q2,s,c,l;function u(){var n=Math.min(e.length,t.length);return o!==Q2&&(o=e4(e[0],e[n-1])),s=n>2?n4:t4,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),B2))(n)))},d.domain=function(t){return arguments.length?(e=Array.from(t,X2),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=J2,u()},d.clamp=function(e){return arguments.length?(o=e?!0:Q2,u()):o!==Q2},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 a4(){return i4()(Q2,Q2)}function o4(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}function s4(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 c4(e){return e=s4(Math.abs(e)),e?e[1]:NaN}function l4(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 u4(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}var d4=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function f4(e){if(!(t=d4.exec(e)))throw Error(`invalid format: `+e);var t;return new p4({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]})}f4.prototype=p4.prototype;function p4(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+``}p4.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 m4(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 g4(e,t){var n=s4(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`)+s4(e,Math.max(0,t+a-1))[0]}function _4(e,t){var n=s4(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 v4={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+``,d:o4,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)=>_4(e*100,t),r:_4,s:g4,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function y4(e){return e}var b4=Array.prototype.map,x4=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`];function S4(e){var t=e.grouping===void 0||e.thousands===void 0?y4:l4(b4.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?y4:u4(b4.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=f4(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`):v4[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=v4[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=m4(e)),w&&+e==0&&f!==`+`&&(w=!1),n=(w?f===`(`?f:s:f===`-`||f===`(`?``:f)+n,r=(y===`s`&&!isNaN(e)&&h4!==void 0?x4[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(c4(t)/3)))*3,r=10**-n,i=l((e=f4(e),e.type=`f`,e),{suffix:x4[8+n/3]});return function(e){return i(r*e)}}return{format:l,formatPrefix:u}}var C4,w4,T4;E4({thousands:`,`,grouping:[3],currency:[`$`,``]});function E4(e){return C4=S4(e),w4=C4.format,T4=C4.formatPrefix,C4}function D4(e){return Math.max(0,-c4(Math.abs(e)))}function O4(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(c4(t)/3)))*3-c4(Math.abs(e)))}function k4(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,c4(t)-c4(e))+1}function A4(e,t,n,r){var i=U0(e,t,n),a;switch(r=f4(r??`,f`),r.type){case`s`:var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=O4(i,o))&&(r.precision=a),T4(r,o);case``:case`e`:case`g`:case`p`:case`r`:r.precision==null&&!isNaN(a=k4(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type===`e`));break;case`f`:case`%`:r.precision==null&&!isNaN(a=D4(i))&&(r.precision=a-(r.type===`%`)*2);break}return w4(r)}function j4(e){var t=e.domain;return e.ticks=function(e){var n=t();return V0(n[0],n[n.length-1],e??10)},e.tickFormat=function(e,n){var r=t();return A4(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=H0(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 M4(){var e=a4();return e.copy=function(){return r4(e,M4())},W0.apply(e,arguments),j4(e)}var N4=({min:e,max:t,step:n})=>({step:n,min:parseInt(e/n)*n,max:parseInt(t/n)*n}),P4=(e,t,n,r)=>{(0,z$.default)(e.min<e.max,`domain: min must be less than max`),(0,z$.default)(t.min<t.max,`range: min must be less than max`);let i=N4(e),a=N4(t);return{scale:{x:M4().domain([e.min,e.max]).range([0,n.width]),y:M4().domain([t.max,t.min]).range([0,n.height])},snap:{x:H$.bind(null,i.min,i.max,i.step),y:H$.bind(null,a.min,a.max,a.step)},domain:e,range:t,size:n,getRootNode:r}},F4=l(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 I4(e){let{top:t=0,left:n=0,transform:r,className:i,children:a,innerRef:o,...s}=e;return(0,L.jsx)(`g`,{ref:o,className:(0,F4.default)(`visx-group`,i),transform:r||`translate(${n}, ${t})`,...s,children:a})}function L4(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 R4(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 z4(e){return e?.toString()}function B4(e){return function(){return e}}var V4=Math.PI,H4=2*V4,U4=1e-6,W4=H4-U4;function G4(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function K4(e){let t=Math.floor(e);if(!(t>=0))throw Error(`invalid digits: ${e}`);if(t>15)return G4;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 q4=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._=``,this._append=e==null?G4:K4(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>U4)if(!(Math.abs(u*s-c*l)>U4)||!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((V4-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>U4&&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)>U4||Math.abs(this._y1-l)>U4)&&this._append`L${c},${l}`,n&&(d<0&&(d=d%H4+H4),d>W4?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>U4&&this._append`A${n},${n},0,${+(d>=V4)},${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 J4(){return new q4}J4.prototype=q4.prototype;function Y4(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 q4(t)}Array.prototype.slice;function X4(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function Z4(e){this._context=e}Z4.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 Q4(e){return new Z4(e)}function $4(e){return e[0]}function e3(e){return e[1]}function t3(e,t){var n=B4(!0),r=null,i=Q4,a=null,o=Y4(s);e=typeof e==`function`?e:e===void 0?$4:B4(e),t=typeof t==`function`?t:t===void 0?e3:B4(t);function s(s){var c,l=(s=X4(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:B4(+t),s):e},s.y=function(e){return arguments.length?(t=typeof e==`function`?e:B4(+e),s):t},s.defined=function(e){return arguments.length?(n=typeof e==`function`?e:B4(!!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 n3(e){return e<0?-1:1}function r3(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(n3(a)+n3(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function i3(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function a3(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function o3(e){this._context=e}o3.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:a3(this,this._t0,i3(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(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;break;case 2:this._point=3,a3(this,i3(this,n=r3(this,e,t)),n);break;default:a3(this,this._t0,n=r3(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function s3(e){this._context=new c3(e)}(s3.prototype=Object.create(o3.prototype)).point=function(e,t){o3.prototype.point.call(this,t,e)};function c3(e){this._context=e}c3.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function l3(e){return new o3(e)}function u3(e,t){e(t)}function d3(){let{x:e,y:t,defined:n,curve:r}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=t3();return e&&u3(i.x,e),t&&u3(i.y,t),n&&i.defined(n),r&&i.curve(r),i}function f3(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,L.jsx)(`line`,{ref:a,className:(0,F4.default)(`visx-line`,i),x1:t.x,y1:t.y,x2:n.x,y2:n.y,fill:r,shapeRendering:s?`crispEdges`:`auto`,...o})}function p3(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=d3({x:r,y:i,defined:l,curve:s});return t?(0,L.jsx)(L.Fragment,{children:t({path:d})}):(0,L.jsx)(`path`,{ref:c,className:(0,F4.default)(`visx-linepath`,o),d:d(n)||``,fill:a,strokeLinecap:`round`,...u})}var m3=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}})),h3=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}})),g3=o(((e,t)=>{var n=h3();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)}})),_3=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})),v3=o(((e,t)=>{var n=_3();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})),y3=o(((e,t)=>{var n=v3();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})),b3=o(((e,t)=>{var n=y3();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})),x3=o(((e,t)=>{var n=b3();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})),S3=o(((e,t)=>{var n=m3(),r=g3(),i=x3(),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 C3(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 w3=`__react_svg_text_measurement_id`;function T3(e,t){if(typeof document>`u`)return null;try{let n=document.getElementById(w3);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`,w3),e.appendChild(n),document.body.appendChild(e)}return Object.assign(n.style,t),n.textContent=e,n.getComputedTextLength()}catch{return null}}var E3=C3(T3,(e,t)=>`${e}_${JSON.stringify(t)}`),D3=l(S3());function O3(e){return typeof e==`number`}function k3(e){return typeof e==`number`&&Number.isFinite(e)||typeof e==`string`}function A3(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=!k3(u)||!k3(d),{wordsWithWidth:p,spaceWidth:m}=(0,I.useMemo)(()=>({wordsWithWidth:(s==null?[]:s.toString().split(/(?:(?!\u00A0+)\s+)/)).map(e=>({word:e,wordWidth:E3(e,c)||0})),spaceWidth:E3(`\xA0`,c)||0}),[s,c]),h=(0,I.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,I.useMemo)(()=>f?``:t===`start`?(0,D3.default)(`calc(${o})`):t===`middle`?(0,D3.default)(`calc(${(h.length-1)/2} * -${a} + (${o} / 2))`):(0,D3.default)(`calc(${h.length-1} * -${a})`),[f,t,o,h.length,a]),transform:(0,I.useMemo)(()=>{let e=[];if(f)return``;if(O3(u)&&O3(d)&&O3(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 j3={overflow:`visible`};function M3(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:_}=A3(e);return(0,L.jsx)(`svg`,{ref:i,x:t,y:n,fontSize:m,style:j3,children:h.length>0?(0,L.jsx)(`text`,{ref:a,transform:_,...f,textAnchor:r,children:h.map((e,t)=>(0,L.jsx)(`tspan`,{x:p,dy:t===0?g:c,children:e.words.join(` `)},t))}):null})}var N3={top:`top`,left:`left`,right:`right`,bottom:`bottom`};function P3(e){let{labelOffset:t,labelProps:n,orientation:r,range:i,tickLabelFontSize:a,tickLength:o}=e,s=r===N3.left||r===N3.top?-1:1,c,l,u;if(r===N3.top||r===N3.bottom){let e=r===N3.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 F3(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!==N3.top?_:0);return(0,L.jsxs)(I4,{className:(0,F4.default)(`visx-axis-tick`,i),transform:c,children:[!t&&(0,L.jsx)(f3,{from:p,to:m,stroke:s,strokeWidth:u,strokeLinecap:`square`,...d}),a?a({...g,x:m.x,y:v,formattedValue:h}):(0,L.jsx)(M3,{x:m.x,y:v,...g,children:h})]},`visx-tick-${l}-${f}`)})}var I3={textAnchor:`middle`,fontFamily:`Arial`,fontSize:10,fill:`#222`};function L3(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=N3.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=F3}=e,T={...I3,...u},E={...I3,...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,L.jsxs)(L.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,L.jsx)(f3,{className:(0,F4.default)(`visx-axis-line`,n),from:t,to:r,stroke:p,strokeWidth:h,strokeDasharray:m}),s&&(0,L.jsx)(M3,{className:(0,F4.default)(`visx-axis-label`,c),...P3({labelOffset:l,labelProps:T,orientation:d,range:f.range(),tickLabelFontSize:O,tickLength:b}),...T,children:s})]})}function R3(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 z3(e){let t=e;return`tickFormat`in t?t.tickFormat():z4}var B3=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 V3(e,t){let{x:n,y:r}=e;return new B3(t?{x:n,y:r}:{x:r,y:n})}function H3(){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 U3(e){let{children:t=L3,axisClassName:n,hideAxisLine:r=!1,hideTicks:i=!1,hideZero:a=!1,innerRef:o,left:s=0,numTicks:c=10,orientation:l=N3.bottom,rangePadding:u=0,scale:d,tickFormat:f,tickLength:p=8,tickValues:m,top:h=0,...g}=e,_=f??z3(d),v=l===N3.left,y=l===N3.top,b=y||l===N3.bottom,x=R3(d),S=v||y?-1:1,C=d.range(),w=H3(u),T=V3({x:Number(C[0])+.5-w.start,y:0},b),E=V3({x:Number(C[C.length-1])+.5+w.end,y:0},b),D=(m??R4(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=L4(x(t));return{value:t,index:n,from:V3({x:r,y:0},b),to:V3({x:r,y:p*S},b),formattedValue:_(t,n,D)}});return(0,L.jsx)(I4,{className:(0,F4.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 W3=B(`path`)(({theme:e})=>({fill:`var(--arrow-color, ${e.palette.common.black})`})),G3=class extends I.Component{render(){let{x:e,y:t,className:n,scale:r}=this.props,i=this.props.direction||`left`,a=r.x(e),o=r.y(t),s=``,c=(e,t,n)=>`translate(${e}, ${t}) rotate(${n})`;return i===`left`&&(s=c(a-15,o,0)),i===`right`&&(s=c(a+15,o,180)),i===`up`&&(s=c(a,o-15,90)),i===`down`&&(s=c(a,o+15,270)),(0,L.jsx)(W3,{d:`m 0,0 8,-5 0,10 -8,-5`,transform:s,className:n})}};G3.propTypes={y:A.number,x:A.number,direction:A.oneOf([`left`,`right`,`up`,`down`]),className:A.string,scale:N$.isRequired},G3.defaultProps={y:0,x:0,direction:`left`};var K3=e=>e?.label===``?is(e,`label`):e,q3=W$,J3=G$,Y3=()=>0,X3=()=>0,Z3=e=>{let t=[],n=0;for(;n>=e.min&&t.indexOf(n)<0;)t.push(n),n=Math.round((n-e.step)*1e4)/1e4;for(n=Math.round(e.step*1e4)/1e4;n<=e.max&&t.indexOf(n)<0;)t.push(n),n=Math.round((n+e.step)*1e4)/1e4;return t?t.filter(t=>t>=e.min&&t<=e.max):[]},Q3=e=>e==null||$o(e)?1:e.split(` `).length,$3=e=>(e||``).replace(/<[^>]+>/g,``).split(` `).sort((e,t)=>t.length-e.length)[0].length,e6=e=>e?e*10:0,t6=e=>{let t=Zo(e),n={left:t.x,top:t.y,bottom:t.y,right:t.x};return cs(e).reduce((e,t)=>(e.left=Math.min(e.left,t.x),e.top=Math.max(e.top,t.y),e.bottom=Math.min(e.bottom,t.y),e.right=Math.max(e.right,t.x),e),n)},n6=(e,t)=>r6(e,t),r6=(e,t)=>((0,z$.default)(!!e&&!!t,`a or b is undefined`),{left:Math.min(e.x,t.x),top:Math.max(e.y,t.y),bottom:Math.min(e.y,t.y),right:Math.max(e.x,t.x)}),i6=e=>{let t=Go(e);return t.sort((e,t)=>t.x-e.x),{a:t[0],b:t[1]}},a6=(e,t)=>({x:(e.x+t.x)/2,y:(e.y+t.y)/2}),o6=e=>parseFloat(e.toFixed(4)),s6=(e,t)=>e&&t&&(o6(e.x)===o6(t.x)||o6(e.y)===o6(t.y)),c6=(e,t)=>e&&t&&ts({x:o6(e.x),y:o6(e.y)},{x:o6(t.x),y:o6(t.y)}),l6=(e,t)=>{let{min:n,max:r,step:i}=e;return t/((r-n)/i)},u6=e=>{let{domain:t,range:n,size:{width:r,height:i}}=e;return l6(t,r)<14||l6(n,i)<14},d6=e=>{let{domain:t,range:n,size:{width:r,height:i}}=e,a=l6(t,r),o=l6(n,i),s=t.step/(a/15),c=n.step/(o/15);return{domain:{min:t.min-s,max:t.max+s},range:{min:n.min-c,max:n.max+c}}},f6=(e,t)=>Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y)),p6=e=>(e||[]).sort((e,t)=>e.x-t.x||e.y-t.y),m6=(e,t,n)=>(e.x-t.x)*(n.y-t.y)===(n.x-t.x)*(e.y-t.y),h6=(e,t)=>m6(e.from,t.from,t.to)&&m6(e.to,t.from,t.to),g6=(e,t)=>c6(e.root,t.root)&&f6(t.root,t.edge)===f6(e.root,e.edge),_6=(e,t,n)=>{let{type:r,building:i}=e;if(i)return!1;let a=(t||[]).filter(e=>e.type===r&&!e.building),o=a.findIndex(e=>ts(e,n));return o!==-1&&a.splice(o,1),!!a.find(t=>{if(r===`circle`||r===`parabola`||r===`sine`||r===`absolute`||r===`exponential`){let{root:n,edge:i}=e;return c6(n,t.root)&&c6(i,t.edge)||r===`circle`&&g6(t,e)}else if(r===`line`||r===`ray`||r===`segment`||r===`vector`){let{from:n,to:i}=e;return c6(n,t.from)&&c6(i,t.to)||c6(n,t.to)&&c6(i,t.from)||r===`line`&&h6(t,e)}else if(r===`polygon`)return ts(p6(Go(e.points)),p6(Go(t.points)));else if(r===`point`)return c6(t,e)})};function v6(e){return typeof e==`function`||typeof e==`object`&&!!e&&typeof e.$$typeof==`symbol`}function y6(e,t){return!e||v6(e)?e:v6(e.default)?e.default:t&&v6(e[t])?e[t]:t&&v6(e[t]?.default)?e[t].default:e}var b6=y6(Sh,`Readable`)||y6(C6.Readable,`Readable`),x6=Qh,S6=x6.default,C6=S6&&typeof S6==`object`?S6:x6,w6={includeArrows:A.object,graphProps:A.object},T6={includeArrows:{left:!0,right:!0,up:!0,down:!0}},E6=B(G3)(()=>({fill:H.PRIMARY})),D6=B(`div`)(({theme:e,centered:t})=>({padding:0,margin:0,"* > *":{margin:0,padding:0},"& p":{margin:0},fontSize:e.typography.fontSize,...t&&{textAlign:`center`}})),O6=B(`g`)(()=>({"& .visx-axis-line":{stroke:H.PRIMARY,strokeWidth:3},"& .visx-axis-tick":{fill:H.PRIMARY,"& line":{stroke:H.PRIMARY}}})),k6={fontFamily:`Roboto`,fontSize:`14px`,cursor:`inherit`},A6=(e,t,n,r,i,a)=>{let o=[];return e===t&&n-i<r&&r<n+i&&n-i<a&&a<n+i&&o.push(e),o},j6=e=>(e||[]).find(e=>e<0),M6=class extends I.Component{static propTypes={...w6,graphProps:F$.isRequired};static defaultProps=T6;render(){let{includeArrows:e,graphProps:t,columnTicksValues:n,skipValues:r,distanceFromOriginToFirstNegativeY:i,dy:a}=this.props,{scale:o,domain:s,size:c,range:l}=t||{},u=e=>{let t=r&&r[0]===e?i+4:a;return{...k6,textAnchor:`middle`,y:t,dx:e===0?-10:0,dy:e===0?-7:0}},d=Q3(s.axisLabel),f=e6($3(s.axisLabel))+2;return(0,L.jsxs)(O6,{children:[(0,L.jsx)(U3,{scale:o.x,top:o.y(0),left:0,label:s.label,rangePadding:8,tickFormat:e=>e,tickLabelProps:u,tickValues:n,hideZero:!(s.labelStep||l.labelStep)&&s.min<=0}),e&&e.left&&(0,L.jsx)(E6,{direction:`left`,x:s.min,y:0,scale:o}),e&&e.right&&(0,L.jsx)(E6,{direction:`right`,x:s.max,y:0,scale:o}),s.axisLabel&&(0,L.jsx)(`foreignObject`,{x:c.width+17,y:o.y(0)-9,width:f,height:20*d,children:(0,L.jsx)(b6,{false:!0,children:(0,L.jsx)(D6,{dangerouslySetInnerHTML:{__html:s.axisLabel}})})})]})}},N6=class extends I.Component{static propTypes={...w6,graphProps:F$.isRequired};static defaultProps=T6;render(){let{includeArrows:e,graphProps:t,skipValues:n,rowTickValues:r}=this.props,{scale:i,range:a,size:o}=t||{},s=a.axisLabel?e6(a.axisLabel.length):0;return(0,L.jsxs)(O6,{children:[(0,L.jsx)(U3,{orientation:`left`,scale:i.y,top:0,height:o.height,left:i.x(0),label:a.label,labelProps:{"data-pie-readable":!1},rangePadding:8,tickLength:10,tickFormat:e=>n&&n.indexOf(e)>=0?``:e,tickLabelProps:e=>{let t=e.toLocaleString().replace(/[.-]/g,``).length||1;return{...k6,dy:4,dx:-10-t*9,"data-pie-readable":!1}},hideZero:!0,tickTextAnchor:`bottom`,tickValues:r}),e&&e.down&&(0,L.jsx)(E6,{direction:`down`,x:0,y:a.min,scale:i}),e&&e.up&&(0,L.jsx)(E6,{direction:`up`,x:0,y:a.max,scale:i}),a.axisLabel&&(0,L.jsx)(`foreignObject`,{x:i.x(0)-s/2,y:-33,width:s,height:`20`,children:(0,L.jsx)(b6,{false:!0,children:(0,L.jsx)(D6,{centered:!0,dangerouslySetInnerHTML:{__html:a.axisLabel}})})})]})}},P6=class extends I.Component{static propTypes={...w6,graphProps:F$.isRequired};static defaultProps=T6;xValues=()=>{let{graphProps:e}=this.props,{scale:t,domain:n}=e||{};if(!n||!t)return;let r=Z3({...n,step:n.labelStep}),i=j6(r);return{columnTicksValues:r,firstNegativeX:i,distanceFromOriginToFirstNegativeX:Math.abs(t.y(0)-t.y(i))}};yValues=()=>{let{graphProps:e}=this.props,{scale:t,range:n}=e||{};if(!n||!t)return;let r=Z3({...n,step:n.labelStep}),i=j6(r);return{rowTickValues:r,firstNegativeY:i,distanceFromOriginToFirstNegativeY:Math.abs(t.x(0)-t.x(i))}};render(){let{graphProps:e}=this.props,{domain:t,range:n}=e||{},{columnTicksValues:r,firstNegativeX:i,distanceFromOriginToFirstNegativeX:a}=this.xValues(),{rowTickValues:o,firstNegativeY:s,distanceFromOriginToFirstNegativeY:c}=this.yValues(),l=A6(i,s,a,c,6,25);return(0,L.jsxs)(O6,{children:[n.min<=0?(0,L.jsx)(M6,{...this.props,skipValues:l,columnTicksValues:r,distanceFromOriginToFirstNegativeY:c,dy:25}):null,t.min<=0?(0,L.jsx)(N6,{...this.props,skipValues:l,rowTickValues:o,distanceFromOriginToFirstNegativeX:a}):null]})}};function F6(e){return`bandwidth`in e?e.bandwidth():0}function I6(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??R4(r,u),g=(f??0)+F6(r)/2,_=h.map((e,t)=>{let n=(L4(r(e))??0)+g;return{index:t,from:new B3({x:0,y:n}),to:new B3({x:i,y:n})}});return(0,L.jsx)(I4,{className:(0,F4.default)(`visx-rows`,c),top:t,left:n,children:l?l({lines:_}):_.map(e=>{let{from:t,to:n,index:r}=e;return(0,L.jsx)(f3,{from:t,to:n,stroke:a,strokeWidth:o,strokeDasharray:s,style:d,...m},`row-line-${r}`)})})}function L6(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??R4(r,l),g=(d??0)+F6(r)/2,_=h.map((e,t)=>{let n=(L4(r(e))??0)+g;return{index:t,from:new B3({x:n,y:0}),to:new B3({x:n,y:i})}});return(0,L.jsx)(I4,{className:(0,F4.default)(`visx-columns`,c),top:t,left:n,children:p?p({lines:_}):_.map(e=>{let{from:t,to:n,index:r}=e;return(0,L.jsx)(f3,{from:t,to:n,stroke:a,strokeWidth:o,strokeDasharray:s,style:u,...m},`column-line-${r}`)})})}function R6(e){let{top:t,left:n,xScale:r,yScale:i,width:a,height:o,className:s,stroke:c,strokeWidth:l,strokeDasharray:u,numTicksRows:d,numTicksColumns:f,rowLineStyle:p,columnLineStyle:m,xOffset:h,yOffset:g,rowTickValues:_,columnTickValues:v,...y}=e;return(0,L.jsxs)(I4,{className:(0,F4.default)(`visx-grid`,s),top:t,left:n,children:[(0,L.jsx)(I6,{className:s,scale:i,width:a,stroke:c,strokeWidth:l,strokeDasharray:u,numTicks:d,lineStyle:p,offset:g,tickValues:_,...y}),(0,L.jsx)(L6,{className:s,scale:r,height:o,stroke:c,strokeWidth:l,strokeDasharray:u,numTicks:f,lineStyle:m,offset:h,tickValues:v,...y})]})}var z6=class extends I.Component{static propTypes={disabled:A.bool,disabledAdditionalGrid:A.bool,graphProps:F$.isRequired};getAdditionalGridProps=(e,t)=>{let{graphProps:{scale:n,size:{width:r,height:i},domain:a,range:o}}=this.props,s=Z3({...o,step:o.labelStep}).filter(t=>e.includes(t)),c=Z3({...a,step:a.labelStep}).filter(e=>t.includes(e)),l=s.length&&Math.min(...s).toString().replace(/[.-]/g,``).length||1,u=s.length&&Math.max(...s).toString().replace(/[.-]/g,``).length||1,d=Math.max(l,u)*9+22,f=n.x(0),p=n.y(0),m=`${f-d} ${d} ${r}`,h=`${p} 28 ${i}`,g=a.labelStep>0&&o.labelStep>0&&s&&c&&s.length>1&&c.length>1&&(s.length!==e.length||c.length!==t.length),_=c.filter(e=>e>=0||f-n.x(e)>d);return{rowTickLabelValues:s.filter(e=>e>=0||n.y(e)-p>28),columnTickLabelValues:_,rowStrokeDasharray:m,columnStrokeDasharray:h,displayAdditionalGrid:g}};render(){let{graphProps:e}=this.props,{scale:t,size:{height:n,width:r},domain:i,range:a}=e,o=Z3(a),s=Z3(i),{rowTickLabelValues:c,columnTickLabelValues:l,rowStrokeDasharray:u,columnStrokeDasharray:d,displayAdditionalGrid:f}=this.getAdditionalGridProps(o,s),p=i.labelStep*2===i.step||a.labelStep*2===a.step?`#9FA8DA`:`#7985CB`;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(R6,{innerRef:e=>this.grid=e,xScale:t.x,yScale:t.y,width:r,height:n,stroke:`#E1E6EC`,rowTickValues:o,columnTickValues:s}),f&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(I6,{scale:t.y,width:r,tickValues:c,stroke:p,strokeDasharray:u}),(0,L.jsx)(L6,{scale:t.x,height:n,tickValues:l,stroke:p,strokeDasharray:d})]})]})}};function B6(e){return typeof e==`function`||typeof e==`object`&&!!e&&typeof e.$$typeof==`symbol`}function V6(e,t){return!e||B6(e)?e:B6(e.default)?e.default:t&&B6(e[t])?e[t]:t&&B6(e[t]?.default)?e[t].default:e}var H6=V6(Sh,`Readable`)||V6(G6.Readable,`Readable`),U6=Qh,W6=U6.default,G6=W6&&typeof W6==`object`?W6:U6,K6={left:-90,top:0,bottom:0,right:90},q6=(e,t,n)=>{let r=(e,t,n)=>`translate(${e}, ${t}), rotate(${n})`;if(e===`left`)return r(-20,n/2,K6[e]);if(e===`right`)return r(t+30,n/2,K6[e]);if(e===`top`)return r(t/2,-20,K6[e]);if(e===`bottom`)return r(t/2,n+30,K6[e])},J6=(e,t)=>{switch(e){case`left`:return-t;case`top`:return-t;case`right`:return-t-10;default:return-t+10}},Y6=B(E$,{shouldForwardProp:e=>![`side`,`disabledLabel`].includes(e)})(({theme:e,side:t,disabledLabel:n})=>({fontSize:e.typography.fontSize-2,textAlign:`center`,padding:`0 4px`,...t===`bottom`&&{marginTop:`44px`},...n&&{pointerEvents:`none`}})),X6=class extends I.Component{static propTypes={text:A.string,side:A.string,disabledLabel:A.bool,placeholder:A.string,graphProps:F$.isRequired,onChange:A.func,mathMlOptions:A.object};static defaultProps={onChange:()=>{}};render(){let{disabledLabel:e,placeholder:t,text:n,side:r,graphProps:i,onChange:a,mathMlOptions:o={}}=this.props,{size:s,domain:c,range:l}=i,u=(s.height||500)+(l.padding||0)*2,d=(s.width||500)+(c.padding||0)*2,f=q6(r,d,u),p=r===`left`||r===`right`?u:d,m=J6(r,36),h=r===`bottom`?58:54;return(0,L.jsx)(`foreignObject`,{x:-(p/2),y:m,width:p,height:h,transform:f,textAnchor:`middle`,children:(0,L.jsx)(H6,{false:!0,children:(0,L.jsx)(Y6,{side:r,disabledLabel:e,markup:n||``,onChange:a,placeholder:!e&&t,toolbarOpts:{position:r===`bottom`?`top`:`bottom`,noPadding:!0,noBorder:!0},activePlugins:[`bold`,`italic`,`underline`,`strikethrough`,`math`],mathMlOptions:o})})})}},Z6={left:A.string,top:A.string,bottom:A.string,right:A.string};(class extends I.Component{static propTypes={className:A.string,disabledLabels:A.bool,placeholders:A.object,value:A.shape(Z6),graphProps:A.object,onChange:A.object,mathMlOptions:A.object};static defaultProps={};onChangeLabel=(e,t)=>{let{value:n,onChange:r}=this.props;r({...n,[t]:e})};render(){let{disabledLabels:e,placeholders:t={},value:n={},graphProps:r,mathMlOptions:i={}}=this.props;return(0,L.jsxs)(I.Fragment,{children:[(0,L.jsx)(X6,{side:`left`,text:n.left,disabledLabel:e,placeholder:t.left,graphProps:r,onChange:e=>this.onChangeLabel(e,`left`),mathMlOptions:i},`left`),(0,L.jsx)(X6,{side:`top`,text:n.top,disabledLabel:e,placeholder:t.top,graphProps:r,onChange:e=>this.onChangeLabel(e,`top`),mathMlOptions:i},`top`),(0,L.jsx)(X6,{side:`bottom`,text:n.bottom,disabledLabel:e,placeholder:t.bottom,graphProps:r,onChange:e=>this.onChangeLabel(e,`bottom`),mathMlOptions:i},`bottom`),(0,L.jsx)(X6,{side:`right`,text:n.right,disabledLabel:e,placeholder:t.right,graphProps:r,onChange:e=>this.onChangeLabel(e,`right`),mathMlOptions:i},`right`)]})}});var Q6=class extends I.Component{static propTypes={width:A.number.isRequired,height:A.number.isRequired,onClick:A.func.isRequired,graphProps:F$.isRequired};static defaultProps={};componentDidMount(){let e=ll(this.rect);e.on(`click`,t=>this.onRectClick(e,t))}shouldComponentUpdate(e){return!q$(this.props.graphProps,e.graphProps)||this.props.width!==e.width||this.props.height!==e.height}getRectPadding=()=>{let{graphProps:e}=this.props;return u6(e)?6:10};onRectClick=(e,t)=>{let{onClick:n,graphProps:r}=this.props,{scale:i}=r,a=this.getRectPadding(),o=dl(t,e.node()),s=i.x.invert(o[0]-a),c=i.y.invert(o[1]-a),l=Z3(r.range),u=Z3(r.domain),d=(e,t)=>e.length&&e.reduce((e,n)=>Math.abs(n-t)<=Math.abs(e-t)?n:e),f={};u.indexOf(s)>=0&&l.indexOf(c)>=0?(f.x=s,f.y=c):(f.x=d(u,s),f.y=d(l,c)),n(f)};render(){let{width:e,height:t}=this.props,n=this.getRectPadding();return(0,L.jsx)(`rect`,{ref:e=>this.rect=e,transform:`translate(-${n}, -${n})`,fill:`red`,fillOpacity:`0.0`,width:e+n*2,height:t+n*2})}},$6=Cp(`pie-lib:graphing:graph`),e8={axesSettings:A.shape(w6),backgroundMarks:A.array,className:A.string,collapsibleToolbar:A.bool,collapsibleToolbarTitle:A.string,disabledLabels:A.bool,disabledTitle:A.bool,domain:O$,labels:A.shape(Z6),labelModeEnabled:A.bool,coordinatesOnHover:A.bool,marks:A.array,onChangeLabels:A.func,onChangeMarks:A.func,onChangeTitle:A.func,range:O$,size:A.shape({width:A.number.isRequired,height:A.number.isRequired}),showLabels:A.bool,showPixelGuides:A.bool,showTitle:A.bool,title:A.string,tools:A.array,limitLabeling:A.bool},t8=e=>({x:-23,y:-23,width:e.width+46,height:e.height+46}),n8=({marks:e,currentTool:t,onChangeMarks:n,removeIncompleteTool:r})=>{let i=e.filter(e=>e.building)[0],a=Go(e);if(i&&t&&i.type!==t.type){let e=a.findIndex(e=>ts(e,i));e>=0&&a.splice(e,1)}return r&&!ts(a,e)&&n(a),a},r8=class extends I.Component{constructor(e){super(e),this.maskUid=this.generateMaskId()}static propTypes={...e8,currentTool:A.object};static defaultProps={onChangeMarks:()=>{},disabledLabels:!1,disabledTitle:!1};state={};_justDragged=!1;startDrag=()=>{this._justDragged=!1};stopDrag=()=>{this._justDragged=!0,setTimeout(()=>{this._justDragged=!1},300)};generateMaskId(){return`graph-`+(Math.random()*1e4).toFixed()}componentDidMount=()=>this.setState({labelNode:this.labelNode});changeMark=(e,t)=>{let{onChangeMarks:n,marks:r}=this.props,i=Go(r),a=i.findIndex(t=>ts(t,e));a>=0&&!_6(t,r,e)&&(i.splice(a,1,t),n(i))};completeMark=e=>{let{currentTool:t,marks:n}=this.props,r=n.filter(e=>e.building)[0];if(!r||!t)return;let i=t.complete(r,e);this.updateMarks(r,i)};updateMarks=(e,t,n=!1)=>{let{onChangeMarks:r,marks:i}=this.props,a=Go(i);if(!t||!t.building&&_6(t,i))return;let o=a.findIndex(t=>ts(t,e));o>=0?(a.splice(o,1,t),r(a)):n&&r([...a,t])};getComponent=e=>{if(!e)return null;let t=(this.props.tools||[]).find(t=>t.type===e.type);return t&&t.Component||null};onBgClick=e=>{let{x:t,y:n}=e||{},{labelModeEnabled:r,currentTool:i,marks:a}=this.props;if(this._justDragged||r||!i||[null,void 0].includes(t)||[null,void 0].includes(n))return;$6(`[onBgClick] x,y: `,t,n);let o=a.filter(e=>e.building)[0],s;s=o&&i&&o.type===i.type?i.addPoint({x:t,y:n},{...o}):i.addPoint({x:t,y:n},void 0),this.updateMarks(o,s,!0)};render(){let{axesSettings:e,currentTool:t,coordinatesOnHover:n,size:r,disabledLabels:i,disabledTitle:a,domain:o,backgroundMarks:s,range:c,title:l,labels:u,labelModeEnabled:d,labelsPlaceholders:f,limitLabeling:p,showLabels:m,showPixelGuides:h,showTitle:g,titlePlaceholder:_,onChangeLabels:v,onChangeTitle:y,mathMlOptions:b={},onChangeMarks:x,removeIncompleteTool:S}=this.props,{marks:C}=this.props,w=P4(o,c,r,()=>this.rootNode),T=t8(r),E={graphProps:w,labelModeEnabled:d,limitLabeling:p};return C=n8({marks:C||[],currentTool:t,onChangeMarks:x,removeIncompleteTool:S}),(0,L.jsx)(T1,{rootRef:e=>this.rootNode=e,disabledTitle:a,disabledLabels:i,labels:u,labelsPlaceholders:f||{},showPixelGuides:h,showLabels:m,showTitle:g,title:l,titlePlaceholder:_,onChangeTitle:y,onChangeLabels:v,mathMlOptions:b,...E,children:(0,L.jsxs)(`g`,{transform:o&&o.padding&&o.range?`translate(${o.padding}, ${c.padding})`:void 0,children:[(0,L.jsx)(z6,{...E}),(0,L.jsx)(P6,{...e,...E}),(0,L.jsx)(Q6,{...r,onClick:this.onBgClick,...E}),(0,L.jsxs)(`mask`,{id:`${this.maskUid}`,children:[(0,L.jsx)(`rect`,{...T,fill:`white`}),` `]}),(0,L.jsxs)(`g`,{id:`marks`,mask:`url('#${this.maskUid}')`,children:[(s||[]).map((e,t)=>{let n=this.getComponent(e),r=e.type;return(0,L.jsx)(n,{mark:{...e,disabled:!0,isBackground:!0},labelNode:this.state.labelNode,onClick:this.onBgClick,...E},`${r}-${t}-bg`)}),C.map((e,r)=>{let i=this.getComponent(e),a=e.type;return(0,L.jsx)(i,{mark:e,coordinatesOnHover:n,onChange:this.changeMark,onComplete:this.completeMark,onClick:this.onBgClick,onDragStart:this.startDrag,onDragStop:this.stopDrag,labelNode:this.state.labelNode,isToolActive:t&&a===t.type,...E},`${a}-${r}`)}),(0,L.jsx)(`foreignObject`,{ref:e=>this.labelNode=e,x:`0`,y:`0`,...r,style:{pointerEvents:`none`,fontSize:`14px`}})]})]})})}},i8=o((e=>{var t=d();t.useSyncExternalStore,t.useRef,t.useEffect,t.useMemo,t.useDebugValue}));o(((e,t)=>{t.exports=i8()}))();var a8=Symbol.for(`react.element`),o8=Symbol.for(`react.portal`),s8=Symbol.for(`react.fragment`),c8=Symbol.for(`react.strict_mode`),l8=Symbol.for(`react.profiler`),u8=Symbol.for(`react.consumer`),d8=Symbol.for(`react.context`),f8=Symbol.for(`react.forward_ref`),p8=Symbol.for(`react.suspense`),m8=Symbol.for(`react.suspense_list`),h8=Symbol.for(`react.memo`),g8=Symbol.for(`react.lazy`),_8=f8,v8=h8;function y8(e){if(typeof e==`object`&&e){let{$$typeof:t}=e;switch(t){case a8:switch(e=e.type,e){case s8:case l8:case c8:case p8:case m8:return e;default:switch(e&&=e.$$typeof,e){case d8:case f8:case g8:case h8:return e;case u8:return e;default:return t}}case o8:return t}}}function b8(e){return y8(e)===h8}function x8(e,t,n,r,{areStatesEqual:i,areOwnPropsEqual:a,areStatePropsEqual:o}){let s=!1,c,l,u,d,f;function p(i,a){return c=i,l=a,u=e(c,l),d=t(r,l),f=n(u,d,l),s=!0,f}function m(){return u=e(c,l),t.dependsOnOwnProps&&(d=t(r,l)),f=n(u,d,l),f}function h(){return e.dependsOnOwnProps&&(u=e(c,l)),t.dependsOnOwnProps&&(d=t(r,l)),f=n(u,d,l),f}function g(){let t=e(c,l),r=!o(t,u);return u=t,r&&(f=n(u,d,l)),f}function _(e,t){let n=!a(t,l),r=!i(e,c,t,l);return c=e,l=t,n&&r?m():n?h():r?g():f}return function(e,t){return s?_(e,t):p(e,t)}}function S8(e,{initMapStateToProps:t,initMapDispatchToProps:n,initMergeProps:r,...i}){return x8(t(e,i),n(e,i),r(e,i),e,i)}function C8(e,t){let n={};for(let r in e){let i=e[r];typeof i==`function`&&(n[r]=(...e)=>t(i(...e)))}return n}function w8(e){return function(t){let n=e(t);function r(){return n}return r.dependsOnOwnProps=!1,r}}function T8(e){return e.dependsOnOwnProps?!!e.dependsOnOwnProps:e.length!==1}function E8(e,t){return function(t,{displayName:n}){let r=function(e,t){return r.dependsOnOwnProps?r.mapToProps(e,t):r.mapToProps(e,void 0)};return r.dependsOnOwnProps=!0,r.mapToProps=function(t,n){r.mapToProps=e,r.dependsOnOwnProps=T8(e);let i=r(t,n);return typeof i==`function`&&(r.mapToProps=i,r.dependsOnOwnProps=T8(i),i=r(t,n)),i},r}}function D8(e,t){return(n,r)=>{throw Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${r.wrappedComponentName}.`)}}function O8(e){return e&&typeof e==`object`?w8(t=>C8(e,t)):e?typeof e==`function`?E8(e,`mapDispatchToProps`):D8(e,`mapDispatchToProps`):w8(e=>({dispatch:e}))}function k8(e){return e?typeof e==`function`?E8(e,`mapStateToProps`):D8(e,`mapStateToProps`):w8(()=>({}))}function A8(e,t,n){return{...n,...e,...t}}function j8(e){return function(t,{displayName:n,areMergedPropsEqual:r}){let i=!1,a;return function(t,n,o){let s=e(t,n,o);return i?r(s,a)||(a=s):(i=!0,a=s),a}}}function M8(e){return e?typeof e==`function`?j8(e):D8(e,`mergeProps`):()=>A8}function N8(e){e()}function P8(){let e=null,t=null;return{clear(){e=null,t=null},notify(){N8(()=>{let t=e;for(;t;)t.callback(),t=t.next})},get(){let t=[],n=e;for(;n;)t.push(n),n=n.next;return t},subscribe(n){let r=!0,i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var F8={notify(){},get:()=>[]};function I8(e,t){let n,r=F8,i=0,a=!1;function o(e){u();let t=r.subscribe(e),n=!1;return()=>{n||(n=!0,t(),d())}}function s(){r.notify()}function c(){m.onStateChange&&m.onStateChange()}function l(){return a}function u(){i++,n||(n=t?t.addNestedSub(c):e.subscribe(c),r=P8())}function d(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=F8)}function f(){a||(a=!0,u())}function p(){a&&(a=!1,d())}let m={addNestedSub:o,notifyNestedSubs:s,handleChangeWrapper:c,isSubscribed:l,trySubscribe:f,tryUnsubscribe:p,getListeners:()=>r};return m}var L8=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,R8=typeof navigator<`u`&&navigator.product===`ReactNative`,z8=L8||R8?I.useLayoutEffect:I.useEffect;function B8(e,t){return e===t?e!==0||t!==0||1/e==1/t:e!==e&&t!==t}function V8(e,t){if(B8(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!B8(e[n[r]],t[n[r]]))return!1;return!0}var H8={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},U8={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},W8={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},G8={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},K8={[_8]:W8,[v8]:G8};function q8(e){return b8(e)?G8:K8[e.$$typeof]||H8}var J8=Object.defineProperty,Y8=Object.getOwnPropertyNames,X8=Object.getOwnPropertySymbols,Z8=Object.getOwnPropertyDescriptor,Q8=Object.getPrototypeOf,$8=Object.prototype;function e5(e,t){if(typeof t!=`string`){if($8){let n=Q8(t);n&&n!==$8&&e5(e,n)}let n=Y8(t);X8&&(n=n.concat(X8(t)));let r=q8(e),i=q8(t);for(let a=0;a<n.length;++a){let o=n[a];if(!U8[o]&&!(i&&i[o])&&!(r&&r[o])){let n=Z8(t,o);try{J8(e,o,n)}catch{}}}}return e}var t5=Symbol.for(`react-redux-context`),n5=typeof globalThis<`u`?globalThis:{};function r5(){if(!I.createContext)return{};let e=n5[t5]??=new Map,t=e.get(I.createContext);return t||(t=I.createContext(null),e.set(I.createContext,t)),t}var i5=r5(),a5=[null,null];function o5(e,t,n){z8(()=>e(...t),n)}function s5(e,t,n,r,i,a){e.current=r,n.current=!1,i.current&&(i.current=null,a())}function c5(e,t,n,r,i,a,o,s,c,l,u){if(!e)return()=>{};let d=!1,f=null,p=()=>{if(d||!s.current)return;let e=t.getState(),n,p;try{n=r(e,i.current)}catch(e){p=e,f=e}p||(f=null),n===a.current?o.current||l():(a.current=n,c.current=n,o.current=!0,u())};return n.onStateChange=p,n.trySubscribe(),p(),()=>{if(d=!0,n.tryUnsubscribe(),n.onStateChange=null,f)throw f}}function l5(e,t){return e===t}function u5(e,t,n,{pure:r,areStatesEqual:i=l5,areOwnPropsEqual:a=V8,areStatePropsEqual:o=V8,areMergedPropsEqual:s=V8,forwardRef:c=!1,context:l=i5}={}){let u=l,d=k8(e),f=O8(t),p=M8(n),m=!!e;return e=>{let t=e.displayName||e.name||`Component`,n=`Connect(${t})`,r={shouldHandleStateChanges:m,displayName:n,wrappedComponentName:t,WrappedComponent:e,initMapStateToProps:d,initMapDispatchToProps:f,initMergeProps:p,areStatesEqual:i,areStatePropsEqual:o,areOwnPropsEqual:a,areMergedPropsEqual:s};function l(t){let[n,i,a]=I.useMemo(()=>{let{reactReduxForwardedRef:e,...n}=t;return[t.context,e,n]},[t]),o=I.useMemo(()=>{let e=u;return n?.Consumer,e},[n,u]),s=I.useContext(o),c=!!t.store&&!!t.store.getState&&!!t.store.dispatch,l=!!s&&!!s.store,d=c?t.store:s.store,f=l?s.getServerState:d.getState,p=I.useMemo(()=>S8(d.dispatch,r),[d]),[h,g]=I.useMemo(()=>{if(!m)return a5;let e=I8(d,c?void 0:s.subscription);return[e,e.notifyNestedSubs.bind(e)]},[d,c,s]),_=I.useMemo(()=>c?s:{...s,subscription:h},[c,s,h]),v=I.useRef(void 0),y=I.useRef(a),b=I.useRef(void 0),x=I.useRef(!1),S=I.useRef(!1),C=I.useRef(void 0);z8(()=>(S.current=!0,()=>{S.current=!1}),[]);let w=I.useMemo(()=>()=>b.current&&a===y.current?b.current:p(d.getState(),a),[d,a]),T=I.useMemo(()=>e=>h?c5(m,d,h,p,y,v,x,S,b,g,e):()=>{},[h]);o5(s5,[y,v,x,a,b,g]);let E;try{E=I.useSyncExternalStore(T,w,f?()=>p(f(),a):w)}catch(e){throw C.current&&(e.message+=`
|
|
364
364
|
The error may be correlated with this previous error:
|
|
365
365
|
${C.current.stack}
|
|
366
366
|
|