From c39493d3daffb567d657fdcca25aec8d28e1a9fb Mon Sep 17 00:00:00 2001 From: Spaaaacccee Date: Mon, 4 Mar 2024 10:41:51 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20path-vis?= =?UTF-8?q?ualiser/app@845a7ecc9cbbba2dc506b96f827c3da74680e956=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/{index-8025715e.js => index-e599979f.js} | 4 ++-- index.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) rename assets/{index-8025715e.js => index-e599979f.js} (99%) diff --git a/assets/index-8025715e.js b/assets/index-e599979f.js similarity index 99% rename from assets/index-8025715e.js rename to assets/index-e599979f.js index 9501999f..e69fea10 100644 --- a/assets/index-8025715e.js +++ b/assets/index-e599979f.js @@ -563,7 +563,7 @@ https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof _e.getDerivedSta fill: none; stroke: #000; } -`;let Tree$1=class Lu extends React.Component{constructor(){super(...arguments),this.state={dataRef:this.props.data,data:Lu.assignInternalProperties(clone$1(this.props.data)),d3:Lu.calculateD3Geometry(this.props),isTransitioning:!1,isInitialRenderForDataset:!0,dataKey:this.props.dataKey},this.internalState={targetNode:null,isTransitioning:!1},this.svgInstanceRef=`rd3t-svg-${v4()}`,this.gInstanceRef=`rd3t-g-${v4()}`,this.handleNodeToggle=lt=>{const Rt=clone$1(this.state.data),Pt=this.findNodesById(lt,Rt,[])[0];this.props.collapsible&&!this.state.isTransitioning&&(Pt.__rd3t.collapsed?(Lu.expandNode(Pt),this.props.shouldCollapseNeighborNodes&&this.collapseNeighborNodes(Pt,Rt)):Lu.collapseNode(Pt),this.props.enableLegacyTransitions?(this.setState({data:Rt,isTransitioning:!0}),setTimeout(()=>this.setState({isTransitioning:!1}),this.props.transitionDuration+10)):this.setState({data:Rt}),this.internalState.targetNode=Pt)},this.handleAddChildrenToNode=(lt,Rt)=>{const At=clone$1(this.state.data),Pt=this.findNodesById(lt,At,[]);if(Pt.length>0){const Dt=Pt[0],Lt=Dt.__rd3t.depth,Bt=clone$1(Rt).map(Nt=>Lu.assignInternalProperties([Nt],Lt+1));Dt.children.push(...Bt.flat()),this.setState({data:At})}},this.handleOnNodeClickCb=(lt,Rt)=>{const{onNodeClick:At}=this.props;At&&typeof At=="function"&&(Rt.persist(),At(clone$1(lt),Rt))},this.handleOnLinkClickCb=(lt,Rt,At)=>{const{onLinkClick:Pt}=this.props;Pt&&typeof Pt=="function"&&(At.persist(),Pt(clone$1(lt),clone$1(Rt),At))},this.handleOnNodeMouseOverCb=(lt,Rt)=>{const{onNodeMouseOver:At}=this.props;At&&typeof At=="function"&&(Rt.persist(),At(clone$1(lt),Rt))},this.handleOnLinkMouseOverCb=(lt,Rt,At)=>{const{onLinkMouseOver:Pt}=this.props;Pt&&typeof Pt=="function"&&(At.persist(),Pt(clone$1(lt),clone$1(Rt),At))},this.handleOnNodeMouseOutCb=(lt,Rt)=>{const{onNodeMouseOut:At}=this.props;At&&typeof At=="function"&&(Rt.persist(),At(clone$1(lt),Rt))},this.handleOnLinkMouseOutCb=(lt,Rt,At)=>{const{onLinkMouseOut:Pt}=this.props;Pt&&typeof Pt=="function"&&(At.persist(),Pt(clone$1(lt),clone$1(Rt),At))},this.centerNode=lt=>{const{dimensions:Rt,orientation:At,zoom:Pt,centeringTransitionDuration:Dt}=this.props;if(Rt){const Lt=select(`.${this.gInstanceRef}`),Bt=select(`.${this.svgInstanceRef}`),Nt=this.state.d3.scale;let jt,Ut;At==="horizontal"?(Ut=-lt.x*Nt+Rt.height/2,jt=-lt.y*Nt+Rt.width/2):(jt=-lt.x*Nt+Rt.width/2,Ut=-lt.y*Nt+Rt.height/2),Lt.transition().duration(Dt).attr("transform","translate("+jt+","+Ut+")scale("+Nt+")"),Bt.call(d3zoom().transform,identity$2.translate(jt,Ut).scale(Pt))}},this.getNodeClassName=(lt,Rt)=>{const{rootNodeClassName:At,branchNodeClassName:Pt,leafNodeClassName:Dt}=this.props;return lt!=null?Rt.children?Pt:Dt:At}}static getDerivedStateFromProps(lt,Rt){let At=null;const Pt=!lt.dataKey||Rt.dataKey!==lt.dataKey;lt.data!==Rt.dataRef&&Pt&&(At={dataRef:lt.data,data:Lu.assignInternalProperties(clone$1(lt.data)),isInitialRenderForDataset:!0,dataKey:lt.dataKey});const Dt=Lu.calculateD3Geometry(lt);return dequal(Dt,Rt.d3)||(At=At||{},At.d3=Dt),At}componentDidMount(){this.bindZoomListener(this.props),this.setState({isInitialRenderForDataset:!1})}componentDidUpdate(lt){this.props.data!==lt.data&&this.setState({isInitialRenderForDataset:!1}),(!dequal(this.props.translate,lt.translate)||!dequal(this.props.scaleExtent,lt.scaleExtent)||this.props.zoomable!==lt.zoomable||this.props.draggable!==lt.draggable||this.props.zoom!==lt.zoom||this.props.enableLegacyTransitions!==lt.enableLegacyTransitions)&&this.bindZoomListener(this.props),typeof this.props.onUpdate=="function"&&this.props.onUpdate({node:this.internalState.targetNode?clone$1(this.internalState.targetNode):null,zoom:this.state.d3.scale,translate:this.state.d3.translate}),this.internalState.targetNode=null}setInitialTreeDepth(lt,Rt){lt.forEach(At=>{At.data.__rd3t.collapsed=At.depth>=Rt})}bindZoomListener(lt){const{zoomable:Rt,scaleExtent:At,translate:Pt,zoom:Dt,onUpdate:Lt,hasInteractiveNodes:Bt}=lt,Nt=select(`.${this.svgInstanceRef}`),jt=select(`.${this.gInstanceRef}`);Nt.call(d3zoom().transform,identity$2.translate(Pt.x,Pt.y).scale(Dt)),Nt.call(d3zoom().scaleExtent(Rt?[At.min,At.max]:[Dt,Dt]).filter(Ut=>Bt?Ut.target.classList.contains(this.svgInstanceRef)||Ut.target.classList.contains(this.gInstanceRef)||Ut.shiftKey:!0).on("zoom",Ut=>{!this.props.draggable&&["mousemove","touchmove","dblclick"].includes(Ut.sourceEvent.type)||(jt.attr("transform",Ut.transform),typeof Lt=="function"&&(Lt({node:null,zoom:Ut.transform.k,translate:{x:Ut.transform.x,y:Ut.transform.y}}),this.state.d3.scale=Ut.transform.k,this.state.d3.translate={x:Ut.transform.x,y:Ut.transform.y}))}))}static assignInternalProperties(lt,Rt=0){return(Array.isArray(lt)?lt:[lt]).map(Pt=>{const Dt=Pt;return Dt.__rd3t={id:null,depth:null,collapsed:!1},Dt.__rd3t.id=v4(),Dt.__rd3t.depth=Rt,Dt.children&&Dt.children.length>0&&(Dt.children=Lu.assignInternalProperties(Dt.children,Rt+1)),Dt})}findNodesById(lt,Rt,At){return At.length>0||(At=At.concat(Rt.filter(Pt=>Pt.__rd3t.id===lt)),Rt.forEach(Pt=>{Pt.children&&Pt.children.length>0&&(At=this.findNodesById(lt,Pt.children,At))})),At}findNodesAtDepth(lt,Rt,At){return At=At.concat(Rt.filter(Pt=>Pt.__rd3t.depth===lt)),Rt.forEach(Pt=>{Pt.children&&Pt.children.length>0&&(At=this.findNodesAtDepth(lt,Pt.children,At))}),At}static collapseNode(lt){lt.__rd3t.collapsed=!0,lt.children&<.children.length>0&<.children.forEach(Rt=>{Lu.collapseNode(Rt)})}static expandNode(lt){lt.__rd3t.collapsed=!1}collapseNeighborNodes(lt,Rt){this.findNodesAtDepth(lt.__rd3t.depth,Rt,[]).filter(Pt=>Pt.__rd3t.id!==lt.__rd3t.id).forEach(Pt=>Lu.collapseNode(Pt))}generateTree(){const{initialDepth:lt,depthFactor:Rt,separation:At,nodeSize:Pt,orientation:Dt}=this.props,{isInitialRenderForDataset:Lt}=this.state,Nt=d3tree().nodeSize(Dt==="horizontal"?[Pt.y,Pt.x]:[Pt.x,Pt.y]).separation((Gt,qt)=>Gt.parent.data.__rd3t.id===qt.parent.data.__rd3t.id?At.siblings:At.nonSiblings)(hierarchy(this.state.data[0],Gt=>Gt.__rd3t.collapsed?null:Gt.children));let jt=Nt.descendants();const Ut=Nt.links();return lt!==void 0&&Lt&&this.setInitialTreeDepth(jt,lt),Rt&&jt.forEach(Gt=>{Gt.y=Gt.depth*Rt}),{nodes:jt,links:Ut}}static calculateD3Geometry(lt){let Rt;return lt.zoom>lt.scaleExtent.max?Rt=lt.scaleExtent.max:lt.zoomReact.createElement(Link,{key:"link-"+en,orientation:Pt,pathFunc:Dt,pathClassFunc:Xt,linkData:Jt,onClick:this.handleOnLinkClickCb,onMouseOver:this.handleOnLinkMouseOverCb,onMouseOut:this.handleOnLinkMouseOutCb,enableLegacyTransitions:Gt,transitionDuration:Lt})),lt.map((Jt,en)=>{const{data:tn,x:an,y:cn,parent:un}=Jt;return React.createElement(Node$5,{key:"node-"+en,data:tn,position:{x:an,y:cn},hierarchyPointNode:Jt,parent:un,nodeClassName:this.getNodeClassName(un,tn),renderCustomNodeElement:At,nodeSize:Bt,orientation:Pt,enableLegacyTransitions:Gt,transitionDuration:Lt,onNodeToggle:this.handleNodeToggle,onNodeClick:this.handleOnNodeClickCb,onNodeMouseOver:this.handleOnNodeMouseOverCb,onNodeMouseOut:this.handleOnNodeMouseOutCb,handleAddChildrenToNode:this.handleAddChildrenToNode,subscriptions:Qt,centerNode:this.centerNode})}))))}};Tree$1.defaultProps={onNodeClick:void 0,onNodeMouseOver:void 0,onNodeMouseOut:void 0,onLinkClick:void 0,onLinkMouseOver:void 0,onLinkMouseOut:void 0,onUpdate:void 0,orientation:"horizontal",translate:{x:0,y:0},pathFunc:"diagonal",pathClassFunc:void 0,transitionDuration:500,depthFactor:void 0,collapsible:!0,initialDepth:void 0,zoomable:!0,draggable:!0,zoom:1,scaleExtent:{min:.1,max:1},nodeSize:{x:140,y:140},separation:{siblings:1,nonSiblings:2},shouldCollapseNeighborNodes:!1,svgClassName:"",rootNodeClassName:"",branchNodeClassName:"",leafNodeClassName:"",renderCustomNodeElement:void 0,enableLegacyTransitions:!1,hasInteractiveNodes:!1,dimensions:void 0,centeringTransitionDuration:800,dataKey:void 0};const divider$4=jsxRuntimeExports.jsx(Divider$1,{orientation:"vertical",flexItem:!0,sx:{m:1}}),Tree=Tree$1;function useCache(_e,lt=!1){const[Rt,At]=reactExports.useState();return reactExports.useEffect(()=>{lt||_e&&At(_e)},[_e,lt]),Rt}const radius2={small:{value:0,name:"Current",description:"Show the current node and its parents"},medium:{value:4,name:"Nearby",description:"Show nodes with ≤4 degrees of separation"},infinite:{value:void 0,name:"All",description:"Show all nodes, may impact performance"}},orientationOptions={horizontal:{value:"horizontal"},vertical:{value:"vertical"}};function TreePage({template:_e}){var cn,un,rn,sn,pn;const{palette:lt}=useTheme(),{key:Rt,setKey:At,layer:Pt,setLayer:Dt,layers:Lt}=useLayer(),Bt=useThrottle$1(((cn=Pt==null?void 0:Pt.source)==null?void 0:cn.step)??0,600),{controls:Nt,onChange:jt,state:Ut,dragHandle:Gt}=useViewTreeContext(),[qt,Xt]=reactExports.useState("small"),[Kt,Zt]=reactExports.useState("horizontal"),Qt=useCss$1({"&.rd3t-link":{stroke:alpha(lt.text.primary,lt.action.disabledOpacity)}}),{result:Jt,loading:en}=useTreeMemo({trace:(rn=(un=Pt==null?void 0:Pt.source)==null?void 0:un.trace)==null?void 0:rn.content,step:Bt,radius:radius2[qt].value},[Bt,Pt,qt]),tn=useCache(Jt,en),an=reactExports.useCallback(()=>Qt,[Qt]);return jsxRuntimeExports.jsxs(_e,{onChange:jt,stack:Ut,children:[jsxRuntimeExports.jsx(_e.Title,{children:"Tree"}),jsxRuntimeExports.jsx(_e.Handle,{children:Gt}),jsxRuntimeExports.jsx(_e.Content,{children:jsxRuntimeExports.jsx(Flex,{children:(pn=(sn=Pt==null?void 0:Pt.source)==null?void 0:sn.trace)!=null&&pn.content&&(tn!=null&&tn.tree)?jsxRuntimeExports.jsx(AutoSizer,{children:({width:bn,height:gn})=>jsxRuntimeExports.jsx(Box$1,{width:bn,height:gn,children:jsxRuntimeExports.jsx(Tree,{scaleExtent:{max:10,min:.01},orientation:Kt,translate:{x:bn/2,y:bn/2},data:tn.tree,dimensions:{width:bn,height:gn},separation:{siblings:1,nonSiblings:1},pathClassFunc:an,renderCustomNodeElement:({nodeDatum:_n,onNodeClick:xn})=>{var ln;return jsxRuntimeExports.jsx(Node$4,{node:_n,onClick:()=>xn==null?void 0:xn({}),step:(ln=Pt==null?void 0:Pt.source)==null?void 0:ln.step,onStep:Mn=>Dt(produce(Pt,Tn=>{lodashExports$1.set(Tn,"source.step",Mn)}))})}})})}):jsxRuntimeExports.jsx(Placeholder$2,{icon:jsxRuntimeExports.jsx(TreeIcon,{}),label:"Tree",secondary:"When you load a trace that has tree-like data, you'll see it here as a decision tree."})})})," ",jsxRuntimeExports.jsxs(_e.Options,{children:[jsxRuntimeExports.jsx(FeaturePicker,{icon:jsxRuntimeExports.jsx(LayersIcon,{}),label:"Layer",value:Rt,items:lodashExports$1.map(Lt,bn=>({id:bn.key,name:inferLayerName(bn)})),onChange:At,arrow:!0,ellipsis:12}),divider$4,jsxRuntimeExports.jsx(FeaturePicker,{icon:jsxRuntimeExports.jsx(VisibilityOutlined,{}),label:"Radius",value:qt,onChange:bn=>Xt(bn),items:lodashExports$1.map(lodashExports$1.entries(radius2),([bn,gn])=>({id:bn,...gn})),arrow:!0}),divider$4,jsxRuntimeExports.jsx(FeaturePicker,{icon:jsxRuntimeExports.jsx(RotateIcon,{}),label:"Orientation",value:Kt,onChange:bn=>Zt(bn),items:lodashExports$1.entries(orientationOptions).map(([bn,gn])=>({id:bn,name:lodashExports$1.startCase(gn.value)})),arrow:!0})]}),jsxRuntimeExports.jsx(_e.Extras,{children:Nt})]})}const width=16,height=4;function Node$4({onClick:_e,node:lt,step:Rt=0,onStep:At}){var Ut;const{palette:Pt,spacing:Dt,shape:Lt}=useTheme(),Bt=lodashExports$1.findLast(lt==null?void 0:lt.events,Gt=>Gt.step<=Rt),Nt=!!lodashExports$1.find(lt==null?void 0:lt.events,Gt=>Gt.step===Rt),jt=getColorHex((Ut=Bt==null?void 0:Bt.data)==null?void 0:Ut.type);return jsxRuntimeExports.jsx(PopupState,{variant:"popover",children:Gt=>{var qt,Xt;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Tooltip$1,{title:`f: ${((qt=Bt==null?void 0:Bt.data)==null?void 0:qt.f)??"unknown"}, g: ${((Xt=Bt==null?void 0:Bt.data)==null?void 0:Xt.g)??"unknown"}`,children:jsxRuntimeExports.jsxs("g",{onClick:Kt=>{Gt.open(Kt)},children:[jsxRuntimeExports.jsx("clipPath",{id:"clipPath",children:jsxRuntimeExports.jsx("rect",{y:Dt(-height/2),x:Dt(-.25),strokeWidth:0,width:Dt(width),height:Dt(height),rx:Lt.borderRadius})}),jsxRuntimeExports.jsx("rect",{y:Dt(-height/2),x:Dt(-.25),strokeWidth:0,fill:Pt.background.default,width:Dt(width),height:Dt(height),clipPath:"url(#clipPath)"}),Nt&&jsxRuntimeExports.jsx("rect",{y:Dt(-height/2),x:Dt(-.25),strokeWidth:0,fill:alpha(Pt.primary.main,Pt.action.selectedOpacity),width:Dt(width),height:Dt(height),clipPath:"url(#clipPath)"}),jsxRuntimeExports.jsx("rect",{x:Dt(-.25),y:Dt(-height/2),height:Dt(height),width:Dt(.5),fill:jt,strokeWidth:0,clipPath:"url(#clipPath)"}),jsxRuntimeExports.jsx("text",{strokeWidth:0,height:Dt(4),fill:Pt.text.primary,y:0,fontWeight:500,fontSize:"0.875rem",x:Dt(2-.25),alignmentBaseline:"central",children:lt==null?void 0:lt.name}),!!(lt!=null&<.cumulativeChildCount)&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("text",{strokeWidth:0,height:Dt(4),fill:Pt.text.secondary,y:0,x:Dt(width-2.25-1),textAnchor:"end",fontWeight:400,fontSize:"0.875rem",alignmentBaseline:"central",children:lt==null?void 0:lt.cumulativeChildCount}),jsxRuntimeExports.jsx(NextIcon,{width:Dt(2),height:Dt(2),x:Dt(width-2-1),y:Dt(-height/2+1),strokeWidth:0,fill:Pt.text.primary,opacity:Pt.action.disabledOpacity})]})]})}),jsxRuntimeExports.jsx(Menu$1,{anchorOrigin:{horizontal:"center",vertical:"bottom"},transformOrigin:{horizontal:"center",vertical:"top"},...bindMenu(Gt),children:jsxRuntimeExports.jsx(MenuList$1,{dense:!0,sx:{p:0},children:lodashExports$1.map(lt==null?void 0:lt.events,Kt=>jsxRuntimeExports.jsx(MenuItem$1,{selected:Kt.step===Rt,sx:{borderLeft:`4px solid ${getColorHex(Kt.data.type)}`},onClick:()=>{Gt.close(),_e==null||_e(),lodashExports$1.delay(()=>At==null?void 0:At(Kt.step),150)},children:jsxRuntimeExports.jsx(Label$1,{primary:lodashExports$1.startCase(Kt.data.type),secondary:`Step ${Kt.step}`})}))})})]})}})}function SelectionMenu({selection:_e,onClose:lt}){const Rt=useSelectionMenu(),At=useCache(_e),{client:Pt}=_e??{};return jsxRuntimeExports.jsx(Menu$1,{open:!!_e,anchorReference:"anchorPosition",anchorPosition:{top:(Pt==null?void 0:Pt.y)??0,left:(Pt==null?void 0:Pt.x)??0},onClose:lt,keepMounted:!0,children:jsxRuntimeExports.jsx(MenuList$1,{dense:!0,sx:{py:0},children:jsxRuntimeExports.jsx(Rt,{event:At,children:Dt=>{const Lt=lodashExports$1.entries(Dt);return Lt.length?lodashExports$1.chain(Lt).sortBy(([,Bt])=>Bt.index).map(([,{items:Bt,primary:Nt}],jt)=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[!!jt&&jsxRuntimeExports.jsx(Divider$1,{sx:{my:1,mx:2}}),Nt&&jsxRuntimeExports.jsx(ListItem$1,{sx:{py:0},children:jsxRuntimeExports.jsx(Type$1,{color:"text.secondary",variant:"overline",children:Nt})}),lodashExports$1.chain(Bt).entries().sortBy(([,Ut])=>Ut.index).map(([Ut,{action:Gt,icon:qt,primary:Xt,secondary:Kt}])=>Gt?jsxRuntimeExports.jsxs(MenuItem$1,{onClick:()=>{Gt(),lt==null||lt()},children:[qt&&jsxRuntimeExports.jsx(ListItemIcon$1,{children:qt}),jsxRuntimeExports.jsx(ListItemText$1,{primary:Xt,sx:{mr:4}}),jsxRuntimeExports.jsx(Type$1,{variant:"body2",color:"text.secondary",children:Kt})]},Ut):jsxRuntimeExports.jsxs(ListItem$1,{children:[qt&&jsxRuntimeExports.jsx(ListItemIcon$1,{children:qt}),jsxRuntimeExports.jsx(ListItemText$1,{primary:Xt,sx:{mr:4}}),jsxRuntimeExports.jsx(Type$1,{variant:"body2",color:"text.secondary",children:Kt})]},Ut)).value()]})).value():jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(ListItem$1,{children:jsxRuntimeExports.jsx(Type$1,{children:"No info to show."})})})}})})})}const identity$1=({children:_e})=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:_e==null?void 0:_e({})});function useSelectionMenu(){const[{layers:_e}]=useLayers();return reactExports.useMemo(()=>lodashExports$1.chain(_e).reduce((lt,Rt)=>{var Pt;const At=((Pt=getLayerHandler(Rt))==null?void 0:Pt.provideSelectionInfo)??identity$1;return({children:Dt,event:Lt})=>jsxRuntimeExports.jsx(At,{layer:Rt.key,event:Lt,children:Bt=>jsxRuntimeExports.jsx(lt,{event:Lt,children:Nt=>Dt==null?void 0:Dt(lodashExports$1.merge(Bt,Nt))})})},identity$1).value(),[_e])}const TILE_RESOLUTION=128,tileSize=(_e=!1)=>(_e?.75:devicePixelRatio*2)*TILE_RESOLUTION,rendererOptions={tileSubdivision:2,workerCount:lodashExports$1.clamp(navigator.hardwareConcurrency-1,1,12),tileResolution:{width:tileSize(),height:tileSize()}},TraceRendererContext=reactExports.createContext({});function useRendererInstance(){return reactExports.useContext(TraceRendererContext)}function useRenderer(_e,{width:lt,height:Rt}={}){const At=useTheme(),[Pt]=useRenderers(),Dt=reactExports.useRef(null),[Lt,Bt]=reactExports.useState(""),[Nt,jt]=reactExports.useState();return reactExports.useEffect(()=>{if(Bt(""),Dt.current&<&&Rt&&_e){const Ut=lodashExports$1.find(Pt,Gt=>Gt.renderer.meta.id===_e);if(Ut){const Gt=new Ut.renderer.constructor;return Gt.setup({...rendererOptions,screenSize:{width:lt,height:Rt},backgroundColor:At.palette.background.paper,accentColor:At.palette.primary.main}),Dt.current.append(Gt.getView()),jt(Gt),()=>{var qt,Xt;try{(Xt=(qt=Dt.current)==null?void 0:qt.removeChild)==null||Xt.call(qt,Gt.getView()),jt(void 0)}catch(Kt){console.warn(Kt)}finally{Gt.destroy()}}}}},[Dt.current,lodashExports$1.map,_e,Pt,At,Bt,jt]),useDebounce(()=>{Nt&<&&Rt&&Nt.setOptions({screenSize:{width:lt,height:Rt}})},At.transitions.duration.standard,[Nt,lt,Rt]),{instance:Nt,ref:Dt,error:Lt}}function TraceRendererCircularProgress(){const[{map:_e,specimen:lt}]=useLoading();return!!(_e||lt)&&jsxRuntimeExports.jsx(CircularProgress$1,{sx:{position:"absolute",top:Rt=>Rt.spacing(6+2),right:Rt=>Rt.spacing(2)}})}const VIEWPORT_PAGE_DESCRIPTION="When you create a layer, you'll see it visualised here.";function TraceRenderer({width:_e,height:lt,renderer:Rt,rendererRef:At,layers:Pt}){const Dt=reactExports.useMemo(nanoid$1,[]),{instance:Lt,error:Bt,ref:Nt}=useRenderer(Rt,{width:_e,height:lt}),{playing:jt}=usePlaybackState(),[,Ut]=useScreenshots(),[Gt,qt]=reactExports.useState();reactExports.useEffect(()=>{if(Lt){const Kt=(Zt,Qt)=>{const Jt=Zt;qt({client:{x:Jt.clientX,y:Jt.clientY},world:Qt.world,info:{point:Qt.world,components:Qt.components}})};return Lt.on("click",Kt),()=>void Lt.off("click",Kt)}},[Lt]);const Xt=reactExports.useMemo(()=>({renderer:Lt}),[Lt]);return reactExports.useEffect(()=>At==null?void 0:At(Lt),[Lt,At]),reactExports.useEffect(()=>{const Kt=async()=>{var Zt;return await((Zt=Lt==null?void 0:Lt.toDataUrl)==null?void 0:Zt.call(Lt))};return Ut(()=>({[Dt]:Kt})),()=>Ut(()=>({[Dt]:void 0}))},[Dt,Lt]),reactExports.useEffect(()=>{Lt&&Lt.setOptions({tileResolution:{width:tileSize(jt),height:tileSize(jt)}})},[Lt,jt]),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(TraceRendererCircularProgress,{}),jsxRuntimeExports.jsx(TraceRendererContext.Provider,{value:Xt,children:Pt!=null&&Pt.length?Bt?jsxRuntimeExports.jsxs(Box$1,{sx:{display:"flex",flexDirection:"column",width:_e,height:lt,alignItems:"center",justifyContent:"center",color:"text.secondary"},children:[jsxRuntimeExports.jsx(DisabledIcon,{sx:{mb:2},fontSize:"large"}),Bt]}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Box$1,{ref:Nt,children:Pt.map((Kt,Zt)=>jsxRuntimeExports.jsx(RenderLayer,{index:Zt,layer:Kt},Kt.key))})}):jsxRuntimeExports.jsx(Placeholder$2,{icon:jsxRuntimeExports.jsx(ViewportIcon,{}),label:"Viewport",width:_e,height:lt,secondary:VIEWPORT_PAGE_DESCRIPTION})}),jsxRuntimeExports.jsx(SelectionMenu,{selection:Gt,onClose:()=>qt(void 0)})]})}function NodeList({nodes:_e}){const{renderer:lt}=useRendererInstance();return reactExports.useEffect(()=>{if(lt&&(_e!=null&&_e.length))return lt.add(_e.flat())},[lt,_e]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})}function LazyNodeList({nodes:_e,step:lt}){const At=lodashExports$1.floor((lt??0)/200)*200,Pt=reactExports.useMemo(()=>lodashExports$1.slice(_e,0,At),[_e,At]),Dt=reactExports.useMemo(()=>lodashExports$1.slice(_e,At,(lt??0)+1),[_e,At,lt]);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[!!At&&jsxRuntimeExports.jsx(NodeList,{nodes:Pt}),jsxRuntimeExports.jsx(NodeList,{nodes:Dt})]})}function useConnectionResolver(){const[_e]=useConnections();return reactExports.useCallback(lt=>lodashExports$1.find(_e,lt),[_e])}function useConnection(_e){return useConnectionResolver()({url:_e})}function useMapContent(_e){const lt=useSnackbar(),Rt=useLoadingState("map"),At=useConnectionResolver(),Pt=reactExports.useMemo(()=>memo(async({source:Nt,id:jt}={})=>{if(Nt&&jt){const Ut=At({url:Nt});if(Ut){lt("Fetching map...");const Gt=await Ut.transport().call("features/map",{id:jt});return Gt==null?void 0:Gt.content}}},{normalizer:JSON.stringify}),[At,lt]),{content:Dt,source:Lt,id:Bt}=_e??{};return useAsync(()=>Rt(async()=>{if(Bt)return{..._e,content:Dt||await Pt({source:Lt,id:Bt})}}),[Pt,Dt,Lt,Bt])}const noop$4=()=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{});function useMapOptions(_e){const{format:lt}=_e??{};return useAsync(async()=>{var Rt,At;return await((At=(Rt=getParser(lt))==null?void 0:Rt.editor)==null?void 0:At.call(Rt,_e==null?void 0:_e.content))??noop$4},[_e])}function useParsedMap(_e,lt){const Rt=useSnackbar(),At=useTheme(),Pt=useLoadingState("map"),{format:Dt,content:Lt}=_e??{};return useAsync(()=>Pt(async()=>{var Bt,Nt;if(Dt&&Lt){Rt("Processing map...");try{const jt=await((Nt=(Bt=getParser(Dt))==null?void 0:Bt.parse)==null?void 0:Nt.call(Bt,Lt,{color:At.palette.text.primary,background:At.palette.background.paper,...lt}))??{nodes:[]};return Rt("Map loaded",`${jt.nodes.length} elements, ${jt.log.join(", ")}`),jt}catch(jt){return console.error(jt),Rt("Error parsing",lodashExports$1.get(jt,"message")),{error:lodashExports$1.get(jt,"message")}}}}),[Dt,Lt,At,lt])}const controller$2={key:"map",icon:jsxRuntimeExports.jsx(MapTwoTone,{}),inferName:_e=>{var lt;return(lt=_e==null?void 0:_e.source)!=null&<.map?`${_e.source.map.name} (${lodashExports$1.startCase(_e.source.map.format)})`:"Untitled Map"},error:_e=>{var lt,Rt;return(Rt=(lt=_e==null?void 0:_e.source)==null?void 0:lt.parsedMap)==null?void 0:Rt.error},claimImportedFile:async _e=>lodashExports$1.keys(mapParsers).includes(ext(_e.name))?{claimed:!0,layer:async lt=>{lt("Opening map...");try{return{map:{...await readUploadedMap(_e,lodashExports$1.entries(mapParsers).map(([At])=>({id:At}))).read()}}}catch(Rt){return console.error(Rt),lt(`Error opening, ${lodashExports$1.get(Rt,"message")}`),{map:{key:nanoid$1(),id:custom$1().id,error:lodashExports$1.get(Rt,"message"),name:lodashExports$1.startCase(name$2(_e.name))}}}}}:{claimed:!1},editor:withProduce(({value:_e,produce:lt})=>{var At,Pt,Dt,Lt,Bt,Nt,jt,Ut;const{result:Rt}=useMapOptions((At=_e==null?void 0:_e.source)==null?void 0:At.map);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Option,{label:"Source",content:jsxRuntimeExports.jsx(MapPicker,{value:(Pt=_e==null?void 0:_e.source)==null?void 0:Pt.map,onChange:Gt=>lt(qt=>lodashExports$1.set(qt,"source.map",Gt))})}),((Lt=(Dt=_e==null?void 0:_e.source)==null?void 0:Dt.parsedMap)==null?void 0:Lt.error)&&jsxRuntimeExports.jsx(Type$1,{variant:"body2",color:Gt=>Gt.palette.error.main,sx:{whiteSpace:"pre-line",mb:1,mt:1},children:jsxRuntimeExports.jsx("code",{children:(Nt=(Bt=_e==null?void 0:_e.source)==null?void 0:Bt.parsedMap)==null?void 0:Nt.error})}),!!((jt=_e==null?void 0:_e.source)!=null&&jt.map)&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Heading,{label:"Map Options"}),Rt?jsxRuntimeExports.jsx(Rt,{value:(Ut=_e==null?void 0:_e.source)==null?void 0:Ut.options,onChange:Gt=>lt(qt=>{var Xt;lodashExports$1.set(qt,"source.options",Gt(((Xt=qt.source)==null?void 0:Xt.options)??{}))})}):jsxRuntimeExports.jsx(CircularProgress$1,{sx:{mt:2}})]})]})}),renderer:({layer:_e,index:lt})=>{var Pt;const{nodes:Rt}=((Pt=_e==null?void 0:_e.source)==null?void 0:Pt.parsedMap)??{},At=reactExports.useMemo(()=>[lodashExports$1.map(Rt,Dt=>({...Dt,meta:{...Dt.meta,sourceLayer:_e==null?void 0:_e.key,sourceLayerIndex:lt,sourceLayerAlpha:1-.01*+((_e==null?void 0:_e.transparency)??0),sourceLayerDisplayMode:(_e==null?void 0:_e.displayMode)??"source-over"}}))],[Rt,lt,_e==null?void 0:_e.transparency,_e==null?void 0:_e.displayMode]);return jsxRuntimeExports.jsx(NodeList,{nodes:At})},service:withProduce(({value:_e,produce:lt})=>{var Pt,Dt;const{result:Rt}=useMapContent((Pt=_e==null?void 0:_e.source)==null?void 0:Pt.map),{result:At}=useParsedMap(Rt,(Dt=_e==null?void 0:_e.source)==null?void 0:Dt.options);return useEffectWhen(()=>void lt(Lt=>{lodashExports$1.set(Lt,"source.parsedMap",At),lodashExports$1.set(Lt,"viewKey",nanoid$1())}),[At,lt],[At]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})}),provideSelectionInfo:({children:_e,event:lt,layer:Rt})=>{const{layer:At,setLayer:Pt,layers:Dt}=useLayer(Rt),{parsedMap:Lt}=(At==null?void 0:At.source)??{},{point:Bt,node:Nt}=reactExports.useMemo(()=>{var Ut,Gt,qt,Xt;if(Lt&<){const Kt=(Xt=(qt=getParser((Gt=(Ut=At==null?void 0:At.source)==null?void 0:Ut.map)==null?void 0:Gt.format))==null?void 0:qt.hydrate)==null?void 0:Xt.call(qt,Lt);if(Kt){const Zt=(lt==null?void 0:lt.world)&&Kt.snap(lt.world);if(Zt){const Qt=(lt==null?void 0:lt.world)&&Kt.nodeAt(Zt);return{point:Zt,node:Qt}}}}return{}},[Lt,lt]),jt=reactExports.useMemo(()=>({...At&&Bt&&!lodashExports$1.isUndefined(Nt)&&{[At.key]:{primary:inferLayerName(At),items:{point:{primary:"Point",secondary:`(${lodashExports$1.round(Bt.x,2)}, ${lodashExports$1.round(Bt.y,2)})`}}}}}),[Bt,Nt,At,Dt,Pt]);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:_e==null?void 0:_e(jt)})}};function IconButtonWithTooltip({label:_e,icon:lt,slotProps:Rt,...At}){return jsxRuntimeExports.jsx(Tooltip$1,{title:lodashExports$1.startCase(_e),...Rt==null?void 0:Rt.tooltip,children:jsxRuntimeExports.jsx("span",{children:jsxRuntimeExports.jsx(IconButton$1,{...At,children:lt})})},_e)}const FRAME_TIME_MS=1e3/60;function PlaybackService({children:_e,value:lt}){const{step:Rt,end:At,playing:Pt,pause:Dt,stepWithBreakpointCheck:Lt}=usePlaybackState(lt==null?void 0:lt.key),[{"playback/playbackRate":Bt=1}]=useSettings();return reactExports.useEffect(()=>{if(Pt){let Nt=!1,jt=lodashExports$1.noop,Ut=Date.now();const Gt=()=>{if(!Nt){const qt=Date.now(),Xt=lodashExports$1.ceil(Bt*(qt-Ut)/FRAME_TIME_MS);Rt{jt(),Nt=!0}}},[Lt,Pt,At,Rt,Dt,Bt]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:_e})}function Playback({layer:_e}){const{playing:lt,canPause:Rt,canPlay:At,canStepBackward:Pt,canStepForward:Dt,canStop:Lt,pause:Bt,play:Nt,stepBackward:jt,stepForward:Ut,stop:Gt,stepWithBreakpointCheck:qt,step:Xt,end:Kt}=usePlaybackState(_e==null?void 0:_e.key);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(IconButtonWithTooltip,{label:"step-backward",icon:jsxRuntimeExports.jsx(PreviousIcon,{}),onClick:jt,disabled:!Pt}),jsxRuntimeExports.jsx(IconButtonWithTooltip,{...lt?{label:"pause",icon:jsxRuntimeExports.jsx(PauseIcon,{}),onClick:()=>Bt(),disabled:!Rt}:{label:"play",icon:jsxRuntimeExports.jsx(PlayIcon,{}),onClick:()=>Nt(),disabled:!At,color:"primary"}}),jsxRuntimeExports.jsx(IconButtonWithTooltip,{label:"step-forward",icon:jsxRuntimeExports.jsx(NextIcon,{}),onClick:Ut,disabled:!Dt}),jsxRuntimeExports.jsx(IconButtonWithTooltip,{label:"stop",icon:jsxRuntimeExports.jsx(StopIcon,{}),onClick:Gt,disabled:!Lt}),jsxRuntimeExports.jsx(IconButtonWithTooltip,{label:"step-to-next-breakpoint",icon:jsxRuntimeExports.jsx(SkipIcon,{}),onClick:()=>{qt(Kt-Xt,1)},disabled:!Dt})]})}var ResizeSensor={exports:{}};(function(_e,lt){(function(Rt,At){_e.exports=At()})(typeof window<"u"?window:commonjsGlobal,function(){if(typeof window>"u")return null;var Rt=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")(),At=Rt.requestAnimationFrame||Rt.mozRequestAnimationFrame||Rt.webkitRequestAnimationFrame||function(Ut){return Rt.setTimeout(Ut,20)},Pt=Rt.cancelAnimationFrame||Rt.mozCancelAnimationFrame||Rt.webkitCancelAnimationFrame||function(Ut){Rt.clearTimeout(Ut)};function Dt(Ut,Gt){var qt=Object.prototype.toString.call(Ut),Xt=qt==="[object Array]"||qt==="[object NodeList]"||qt==="[object HTMLCollection]"||qt==="[object Object]"||typeof jQuery<"u"&&Ut instanceof jQuery||typeof Elements<"u"&&Ut instanceof Elements,Kt=0,Zt=Ut.length;if(Xt)for(;Kt=_n&&(Mn+=bn.value),bn.mode==="max"&&xn<=_n&&(Mn+=bn.value),ln[Tn]||(ln[Tn]=""),Mn&&(" "+ln[Tn]+" ").indexOf(" "+Mn+" ")===-1&&(ln[Tn]+=" "+Mn));for(var Cn in An)An.hasOwnProperty(Cn)&&(ln[An[Cn]]?this.element.setAttribute(An[Cn],ln[An[Cn]].substr(1)):this.element.removeAttribute(An[Cn]))}}function qt(rn,sn){rn.elementQueriesSetupInformation||(rn.elementQueriesSetupInformation=new Gt(rn,sn)),rn.elementQueriesSensor||(rn.elementQueriesSensor=new Rt(rn,function(){rn.elementQueriesSetupInformation.call()}))}function Xt(rn,sn,pn,bn){if(typeof Lt[rn]>"u"){Lt[rn]=[];var gn=Bt.length;Dt.innerHTML+=` +`;let Tree$1=class Lu extends React.Component{constructor(){super(...arguments),this.state={dataRef:this.props.data,data:Lu.assignInternalProperties(clone$1(this.props.data)),d3:Lu.calculateD3Geometry(this.props),isTransitioning:!1,isInitialRenderForDataset:!0,dataKey:this.props.dataKey},this.internalState={targetNode:null,isTransitioning:!1},this.svgInstanceRef=`rd3t-svg-${v4()}`,this.gInstanceRef=`rd3t-g-${v4()}`,this.handleNodeToggle=lt=>{const Rt=clone$1(this.state.data),Pt=this.findNodesById(lt,Rt,[])[0];this.props.collapsible&&!this.state.isTransitioning&&(Pt.__rd3t.collapsed?(Lu.expandNode(Pt),this.props.shouldCollapseNeighborNodes&&this.collapseNeighborNodes(Pt,Rt)):Lu.collapseNode(Pt),this.props.enableLegacyTransitions?(this.setState({data:Rt,isTransitioning:!0}),setTimeout(()=>this.setState({isTransitioning:!1}),this.props.transitionDuration+10)):this.setState({data:Rt}),this.internalState.targetNode=Pt)},this.handleAddChildrenToNode=(lt,Rt)=>{const At=clone$1(this.state.data),Pt=this.findNodesById(lt,At,[]);if(Pt.length>0){const Dt=Pt[0],Lt=Dt.__rd3t.depth,Bt=clone$1(Rt).map(Nt=>Lu.assignInternalProperties([Nt],Lt+1));Dt.children.push(...Bt.flat()),this.setState({data:At})}},this.handleOnNodeClickCb=(lt,Rt)=>{const{onNodeClick:At}=this.props;At&&typeof At=="function"&&(Rt.persist(),At(clone$1(lt),Rt))},this.handleOnLinkClickCb=(lt,Rt,At)=>{const{onLinkClick:Pt}=this.props;Pt&&typeof Pt=="function"&&(At.persist(),Pt(clone$1(lt),clone$1(Rt),At))},this.handleOnNodeMouseOverCb=(lt,Rt)=>{const{onNodeMouseOver:At}=this.props;At&&typeof At=="function"&&(Rt.persist(),At(clone$1(lt),Rt))},this.handleOnLinkMouseOverCb=(lt,Rt,At)=>{const{onLinkMouseOver:Pt}=this.props;Pt&&typeof Pt=="function"&&(At.persist(),Pt(clone$1(lt),clone$1(Rt),At))},this.handleOnNodeMouseOutCb=(lt,Rt)=>{const{onNodeMouseOut:At}=this.props;At&&typeof At=="function"&&(Rt.persist(),At(clone$1(lt),Rt))},this.handleOnLinkMouseOutCb=(lt,Rt,At)=>{const{onLinkMouseOut:Pt}=this.props;Pt&&typeof Pt=="function"&&(At.persist(),Pt(clone$1(lt),clone$1(Rt),At))},this.centerNode=lt=>{const{dimensions:Rt,orientation:At,zoom:Pt,centeringTransitionDuration:Dt}=this.props;if(Rt){const Lt=select(`.${this.gInstanceRef}`),Bt=select(`.${this.svgInstanceRef}`),Nt=this.state.d3.scale;let jt,Ut;At==="horizontal"?(Ut=-lt.x*Nt+Rt.height/2,jt=-lt.y*Nt+Rt.width/2):(jt=-lt.x*Nt+Rt.width/2,Ut=-lt.y*Nt+Rt.height/2),Lt.transition().duration(Dt).attr("transform","translate("+jt+","+Ut+")scale("+Nt+")"),Bt.call(d3zoom().transform,identity$2.translate(jt,Ut).scale(Pt))}},this.getNodeClassName=(lt,Rt)=>{const{rootNodeClassName:At,branchNodeClassName:Pt,leafNodeClassName:Dt}=this.props;return lt!=null?Rt.children?Pt:Dt:At}}static getDerivedStateFromProps(lt,Rt){let At=null;const Pt=!lt.dataKey||Rt.dataKey!==lt.dataKey;lt.data!==Rt.dataRef&&Pt&&(At={dataRef:lt.data,data:Lu.assignInternalProperties(clone$1(lt.data)),isInitialRenderForDataset:!0,dataKey:lt.dataKey});const Dt=Lu.calculateD3Geometry(lt);return dequal(Dt,Rt.d3)||(At=At||{},At.d3=Dt),At}componentDidMount(){this.bindZoomListener(this.props),this.setState({isInitialRenderForDataset:!1})}componentDidUpdate(lt){this.props.data!==lt.data&&this.setState({isInitialRenderForDataset:!1}),(!dequal(this.props.translate,lt.translate)||!dequal(this.props.scaleExtent,lt.scaleExtent)||this.props.zoomable!==lt.zoomable||this.props.draggable!==lt.draggable||this.props.zoom!==lt.zoom||this.props.enableLegacyTransitions!==lt.enableLegacyTransitions)&&this.bindZoomListener(this.props),typeof this.props.onUpdate=="function"&&this.props.onUpdate({node:this.internalState.targetNode?clone$1(this.internalState.targetNode):null,zoom:this.state.d3.scale,translate:this.state.d3.translate}),this.internalState.targetNode=null}setInitialTreeDepth(lt,Rt){lt.forEach(At=>{At.data.__rd3t.collapsed=At.depth>=Rt})}bindZoomListener(lt){const{zoomable:Rt,scaleExtent:At,translate:Pt,zoom:Dt,onUpdate:Lt,hasInteractiveNodes:Bt}=lt,Nt=select(`.${this.svgInstanceRef}`),jt=select(`.${this.gInstanceRef}`);Nt.call(d3zoom().transform,identity$2.translate(Pt.x,Pt.y).scale(Dt)),Nt.call(d3zoom().scaleExtent(Rt?[At.min,At.max]:[Dt,Dt]).filter(Ut=>Bt?Ut.target.classList.contains(this.svgInstanceRef)||Ut.target.classList.contains(this.gInstanceRef)||Ut.shiftKey:!0).on("zoom",Ut=>{!this.props.draggable&&["mousemove","touchmove","dblclick"].includes(Ut.sourceEvent.type)||(jt.attr("transform",Ut.transform),typeof Lt=="function"&&(Lt({node:null,zoom:Ut.transform.k,translate:{x:Ut.transform.x,y:Ut.transform.y}}),this.state.d3.scale=Ut.transform.k,this.state.d3.translate={x:Ut.transform.x,y:Ut.transform.y}))}))}static assignInternalProperties(lt,Rt=0){return(Array.isArray(lt)?lt:[lt]).map(Pt=>{const Dt=Pt;return Dt.__rd3t={id:null,depth:null,collapsed:!1},Dt.__rd3t.id=v4(),Dt.__rd3t.depth=Rt,Dt.children&&Dt.children.length>0&&(Dt.children=Lu.assignInternalProperties(Dt.children,Rt+1)),Dt})}findNodesById(lt,Rt,At){return At.length>0||(At=At.concat(Rt.filter(Pt=>Pt.__rd3t.id===lt)),Rt.forEach(Pt=>{Pt.children&&Pt.children.length>0&&(At=this.findNodesById(lt,Pt.children,At))})),At}findNodesAtDepth(lt,Rt,At){return At=At.concat(Rt.filter(Pt=>Pt.__rd3t.depth===lt)),Rt.forEach(Pt=>{Pt.children&&Pt.children.length>0&&(At=this.findNodesAtDepth(lt,Pt.children,At))}),At}static collapseNode(lt){lt.__rd3t.collapsed=!0,lt.children&<.children.length>0&<.children.forEach(Rt=>{Lu.collapseNode(Rt)})}static expandNode(lt){lt.__rd3t.collapsed=!1}collapseNeighborNodes(lt,Rt){this.findNodesAtDepth(lt.__rd3t.depth,Rt,[]).filter(Pt=>Pt.__rd3t.id!==lt.__rd3t.id).forEach(Pt=>Lu.collapseNode(Pt))}generateTree(){const{initialDepth:lt,depthFactor:Rt,separation:At,nodeSize:Pt,orientation:Dt}=this.props,{isInitialRenderForDataset:Lt}=this.state,Nt=d3tree().nodeSize(Dt==="horizontal"?[Pt.y,Pt.x]:[Pt.x,Pt.y]).separation((Gt,qt)=>Gt.parent.data.__rd3t.id===qt.parent.data.__rd3t.id?At.siblings:At.nonSiblings)(hierarchy(this.state.data[0],Gt=>Gt.__rd3t.collapsed?null:Gt.children));let jt=Nt.descendants();const Ut=Nt.links();return lt!==void 0&&Lt&&this.setInitialTreeDepth(jt,lt),Rt&&jt.forEach(Gt=>{Gt.y=Gt.depth*Rt}),{nodes:jt,links:Ut}}static calculateD3Geometry(lt){let Rt;return lt.zoom>lt.scaleExtent.max?Rt=lt.scaleExtent.max:lt.zoomReact.createElement(Link,{key:"link-"+en,orientation:Pt,pathFunc:Dt,pathClassFunc:Xt,linkData:Jt,onClick:this.handleOnLinkClickCb,onMouseOver:this.handleOnLinkMouseOverCb,onMouseOut:this.handleOnLinkMouseOutCb,enableLegacyTransitions:Gt,transitionDuration:Lt})),lt.map((Jt,en)=>{const{data:tn,x:an,y:cn,parent:un}=Jt;return React.createElement(Node$5,{key:"node-"+en,data:tn,position:{x:an,y:cn},hierarchyPointNode:Jt,parent:un,nodeClassName:this.getNodeClassName(un,tn),renderCustomNodeElement:At,nodeSize:Bt,orientation:Pt,enableLegacyTransitions:Gt,transitionDuration:Lt,onNodeToggle:this.handleNodeToggle,onNodeClick:this.handleOnNodeClickCb,onNodeMouseOver:this.handleOnNodeMouseOverCb,onNodeMouseOut:this.handleOnNodeMouseOutCb,handleAddChildrenToNode:this.handleAddChildrenToNode,subscriptions:Qt,centerNode:this.centerNode})}))))}};Tree$1.defaultProps={onNodeClick:void 0,onNodeMouseOver:void 0,onNodeMouseOut:void 0,onLinkClick:void 0,onLinkMouseOver:void 0,onLinkMouseOut:void 0,onUpdate:void 0,orientation:"horizontal",translate:{x:0,y:0},pathFunc:"diagonal",pathClassFunc:void 0,transitionDuration:500,depthFactor:void 0,collapsible:!0,initialDepth:void 0,zoomable:!0,draggable:!0,zoom:1,scaleExtent:{min:.1,max:1},nodeSize:{x:140,y:140},separation:{siblings:1,nonSiblings:2},shouldCollapseNeighborNodes:!1,svgClassName:"",rootNodeClassName:"",branchNodeClassName:"",leafNodeClassName:"",renderCustomNodeElement:void 0,enableLegacyTransitions:!1,hasInteractiveNodes:!1,dimensions:void 0,centeringTransitionDuration:800,dataKey:void 0};const divider$4=jsxRuntimeExports.jsx(Divider$1,{orientation:"vertical",flexItem:!0,sx:{m:1}}),Tree=Tree$1;function useCache(_e,lt=!1){const[Rt,At]=reactExports.useState();return reactExports.useEffect(()=>{lt||_e&&At(_e)},[_e,lt]),Rt}const radius2={small:{value:0,name:"Current",description:"Show the current node and its parents"},medium:{value:4,name:"Nearby",description:"Show nodes with ≤4 degrees of separation"},infinite:{value:void 0,name:"All",description:"Show all nodes, may impact performance"}},orientationOptions={horizontal:{value:"horizontal"},vertical:{value:"vertical"}};function TreePage({template:_e}){var cn,un,rn,sn,pn;const{palette:lt}=useTheme(),{key:Rt,setKey:At,layer:Pt,setLayer:Dt,layers:Lt}=useLayer(),Bt=useThrottle$1(((cn=Pt==null?void 0:Pt.source)==null?void 0:cn.step)??0,600),{controls:Nt,onChange:jt,state:Ut,dragHandle:Gt}=useViewTreeContext(),[qt,Xt]=reactExports.useState("small"),[Kt,Zt]=reactExports.useState("horizontal"),Qt=useCss$1({"&.rd3t-link":{stroke:alpha(lt.text.primary,lt.action.disabledOpacity)}}),{result:Jt,loading:en}=useTreeMemo({trace:(rn=(un=Pt==null?void 0:Pt.source)==null?void 0:un.trace)==null?void 0:rn.content,step:Bt,radius:radius2[qt].value},[Bt,Pt,qt]),tn=useCache(Jt,en),an=reactExports.useCallback(()=>Qt,[Qt]);return jsxRuntimeExports.jsxs(_e,{onChange:jt,stack:Ut,children:[jsxRuntimeExports.jsx(_e.Title,{children:"Tree"}),jsxRuntimeExports.jsx(_e.Handle,{children:Gt}),jsxRuntimeExports.jsx(_e.Content,{children:jsxRuntimeExports.jsx(Flex,{children:(pn=(sn=Pt==null?void 0:Pt.source)==null?void 0:sn.trace)!=null&&pn.content&&(tn!=null&&tn.tree)?jsxRuntimeExports.jsx(AutoSizer,{children:({width:bn,height:gn})=>jsxRuntimeExports.jsx(Box$1,{width:bn,height:gn,children:jsxRuntimeExports.jsx(Tree,{scaleExtent:{max:10,min:.01},orientation:Kt,translate:{x:bn/2,y:bn/2},data:tn.tree,dimensions:{width:bn,height:gn},separation:{siblings:1,nonSiblings:1},pathClassFunc:an,renderCustomNodeElement:({nodeDatum:_n,onNodeClick:xn})=>{var ln;return jsxRuntimeExports.jsx(Node$4,{node:_n,onClick:()=>xn==null?void 0:xn({}),step:(ln=Pt==null?void 0:Pt.source)==null?void 0:ln.step,onStep:Mn=>Dt(produce(Pt,Tn=>{lodashExports$1.set(Tn,"source.step",Mn)}))})}})})}):jsxRuntimeExports.jsx(Placeholder$2,{icon:jsxRuntimeExports.jsx(TreeIcon,{}),label:"Tree",secondary:"When you load a trace that has tree-like data, you'll see it here as a decision tree."})})})," ",jsxRuntimeExports.jsxs(_e.Options,{children:[jsxRuntimeExports.jsx(FeaturePicker,{icon:jsxRuntimeExports.jsx(LayersIcon,{}),label:"Layer",value:Rt,items:lodashExports$1.map(Lt,bn=>({id:bn.key,name:inferLayerName(bn)})),onChange:At,arrow:!0,ellipsis:12}),divider$4,jsxRuntimeExports.jsx(FeaturePicker,{icon:jsxRuntimeExports.jsx(VisibilityOutlined,{}),label:"Radius",value:qt,onChange:bn=>Xt(bn),items:lodashExports$1.map(lodashExports$1.entries(radius2),([bn,gn])=>({id:bn,...gn})),arrow:!0}),divider$4,jsxRuntimeExports.jsx(FeaturePicker,{icon:jsxRuntimeExports.jsx(RotateIcon,{}),label:"Orientation",value:Kt,onChange:bn=>Zt(bn),items:lodashExports$1.entries(orientationOptions).map(([bn,gn])=>({id:bn,name:lodashExports$1.startCase(gn.value)})),arrow:!0})]}),jsxRuntimeExports.jsx(_e.Extras,{children:Nt})]})}const width=16,height=4;function Node$4({onClick:_e,node:lt,step:Rt=0,onStep:At}){var Ut;const{palette:Pt,spacing:Dt,shape:Lt}=useTheme(),Bt=lodashExports$1.findLast(lt==null?void 0:lt.events,Gt=>Gt.step<=Rt),Nt=!!lodashExports$1.find(lt==null?void 0:lt.events,Gt=>Gt.step===Rt),jt=getColorHex((Ut=Bt==null?void 0:Bt.data)==null?void 0:Ut.type);return jsxRuntimeExports.jsx(PopupState,{variant:"popover",children:Gt=>{var qt,Xt;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Tooltip$1,{title:`f: ${((qt=Bt==null?void 0:Bt.data)==null?void 0:qt.f)??"unknown"}, g: ${((Xt=Bt==null?void 0:Bt.data)==null?void 0:Xt.g)??"unknown"}`,children:jsxRuntimeExports.jsxs("g",{onClick:Kt=>{Gt.open(Kt)},children:[jsxRuntimeExports.jsx("clipPath",{id:"clipPath",children:jsxRuntimeExports.jsx("rect",{y:Dt(-height/2),x:Dt(-.25),strokeWidth:0,width:Dt(width),height:Dt(height),rx:Lt.borderRadius})}),jsxRuntimeExports.jsx("rect",{y:Dt(-height/2),x:Dt(-.25),strokeWidth:0,fill:Pt.background.default,width:Dt(width),height:Dt(height),clipPath:"url(#clipPath)"}),Nt&&jsxRuntimeExports.jsx("rect",{y:Dt(-height/2),x:Dt(-.25),strokeWidth:0,fill:alpha(Pt.primary.main,Pt.action.selectedOpacity),width:Dt(width),height:Dt(height),clipPath:"url(#clipPath)"}),jsxRuntimeExports.jsx("rect",{x:Dt(-.25),y:Dt(-height/2),height:Dt(height),width:Dt(.5),fill:jt,strokeWidth:0,clipPath:"url(#clipPath)"}),jsxRuntimeExports.jsx("text",{strokeWidth:0,height:Dt(4),fill:Pt.text.primary,y:0,fontWeight:500,fontSize:"0.875rem",x:Dt(2-.25),alignmentBaseline:"central",children:lt==null?void 0:lt.name}),!!(lt!=null&<.cumulativeChildCount)&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("text",{strokeWidth:0,height:Dt(4),fill:Pt.text.secondary,y:0,x:Dt(width-2.25-1),textAnchor:"end",fontWeight:400,fontSize:"0.875rem",alignmentBaseline:"central",children:lt==null?void 0:lt.cumulativeChildCount}),jsxRuntimeExports.jsx(NextIcon,{width:Dt(2),height:Dt(2),x:Dt(width-2-1),y:Dt(-height/2+1),strokeWidth:0,fill:Pt.text.primary,opacity:Pt.action.disabledOpacity})]})]})}),jsxRuntimeExports.jsx(Menu$1,{anchorOrigin:{horizontal:"center",vertical:"bottom"},transformOrigin:{horizontal:"center",vertical:"top"},...bindMenu(Gt),children:jsxRuntimeExports.jsx(MenuList$1,{dense:!0,sx:{p:0},children:lodashExports$1.map(lt==null?void 0:lt.events,Kt=>jsxRuntimeExports.jsx(MenuItem$1,{selected:Kt.step===Rt,sx:{borderLeft:`4px solid ${getColorHex(Kt.data.type)}`},onClick:()=>{Gt.close(),_e==null||_e(),lodashExports$1.delay(()=>At==null?void 0:At(Kt.step),150)},children:jsxRuntimeExports.jsx(Label$1,{primary:lodashExports$1.startCase(Kt.data.type),secondary:`Step ${Kt.step}`})}))})})]})}})}function SelectionMenu({selection:_e,onClose:lt}){const Rt=useSelectionMenu(),At=useCache(_e),{client:Pt}=_e??{};return jsxRuntimeExports.jsx(Menu$1,{open:!!_e,anchorReference:"anchorPosition",anchorPosition:{top:(Pt==null?void 0:Pt.y)??0,left:(Pt==null?void 0:Pt.x)??0},onClose:lt,keepMounted:!0,children:jsxRuntimeExports.jsx(MenuList$1,{dense:!0,sx:{py:0},children:jsxRuntimeExports.jsx(Rt,{event:At,children:Dt=>{const Lt=lodashExports$1.entries(Dt);return Lt.length?lodashExports$1.chain(Lt).sortBy(([,Bt])=>Bt.index).map(([,{items:Bt,primary:Nt}],jt)=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[!!jt&&jsxRuntimeExports.jsx(Divider$1,{sx:{my:1,mx:2}}),Nt&&jsxRuntimeExports.jsx(ListItem$1,{sx:{py:0},children:jsxRuntimeExports.jsx(Type$1,{color:"text.secondary",variant:"overline",children:Nt})}),lodashExports$1.chain(Bt).entries().sortBy(([,Ut])=>Ut.index).map(([Ut,{action:Gt,icon:qt,primary:Xt,secondary:Kt}])=>Gt?jsxRuntimeExports.jsxs(MenuItem$1,{onClick:()=>{Gt(),lt==null||lt()},children:[qt&&jsxRuntimeExports.jsx(ListItemIcon$1,{children:qt}),jsxRuntimeExports.jsx(ListItemText$1,{primary:Xt,sx:{mr:4}}),jsxRuntimeExports.jsx(Type$1,{variant:"body2",color:"text.secondary",children:Kt})]},Ut):jsxRuntimeExports.jsxs(ListItem$1,{children:[qt&&jsxRuntimeExports.jsx(ListItemIcon$1,{children:qt}),jsxRuntimeExports.jsx(ListItemText$1,{primary:Xt,sx:{mr:4}}),jsxRuntimeExports.jsx(Type$1,{variant:"body2",color:"text.secondary",children:Kt})]},Ut)).value()]})).value():jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(ListItem$1,{children:jsxRuntimeExports.jsx(Type$1,{children:"No info to show."})})})}})})})}const identity$1=({children:_e})=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:_e==null?void 0:_e({})});function useSelectionMenu(){const[{layers:_e}]=useLayers();return reactExports.useMemo(()=>lodashExports$1.chain(_e).reduce((lt,Rt)=>{var Pt;const At=((Pt=getLayerHandler(Rt))==null?void 0:Pt.provideSelectionInfo)??identity$1;return({children:Dt,event:Lt})=>jsxRuntimeExports.jsx(At,{layer:Rt.key,event:Lt,children:Bt=>jsxRuntimeExports.jsx(lt,{event:Lt,children:Nt=>Dt==null?void 0:Dt(lodashExports$1.merge(Bt,Nt))})})},identity$1).value(),[_e])}const TILE_RESOLUTION=128,tileSize=(_e=!1)=>(_e?.75:devicePixelRatio*2)*TILE_RESOLUTION,rendererOptions={tileSubdivision:2,workerCount:lodashExports$1.clamp(navigator.hardwareConcurrency-1,1,12),tileResolution:{width:tileSize(),height:tileSize()}},TraceRendererContext=reactExports.createContext({});function useRendererInstance(){return reactExports.useContext(TraceRendererContext)}function useRenderer(_e,{width:lt,height:Rt}={}){const At=useTheme(),[Pt]=useRenderers(),Dt=reactExports.useRef(null),[Lt,Bt]=reactExports.useState(""),[Nt,jt]=reactExports.useState();return reactExports.useEffect(()=>{if(Bt(""),Dt.current&<&&Rt&&_e){const Ut=lodashExports$1.find(Pt,Gt=>Gt.renderer.meta.id===_e);if(Ut){const Gt=new Ut.renderer.constructor;return Gt.setup({...rendererOptions,screenSize:{width:lt,height:Rt},backgroundColor:At.palette.background.paper,accentColor:At.palette.primary.main}),Dt.current.append(Gt.getView()),jt(Gt),()=>{var qt,Xt;try{(Xt=(qt=Dt.current)==null?void 0:qt.removeChild)==null||Xt.call(qt,Gt.getView()),jt(void 0)}catch(Kt){console.warn(Kt)}finally{Gt.destroy()}}}}},[Dt.current,lodashExports$1.map,_e,Pt,At,Bt,jt]),useDebounce(()=>{Nt&<&&Rt&&Nt.setOptions({screenSize:{width:lt,height:Rt}})},At.transitions.duration.standard,[Nt,lt,Rt]),{instance:Nt,ref:Dt,error:Lt}}function TraceRendererCircularProgress(){const[{map:_e,specimen:lt}]=useLoading();return!!(_e||lt)&&jsxRuntimeExports.jsx(CircularProgress$1,{sx:{position:"absolute",top:Rt=>Rt.spacing(6+2),right:Rt=>Rt.spacing(2)}})}const VIEWPORT_PAGE_DESCRIPTION="When you create a layer, you'll see it visualised here.";function TraceRenderer({width:_e,height:lt,renderer:Rt,rendererRef:At,layers:Pt}){const Dt=reactExports.useMemo(nanoid$1,[]),{instance:Lt,error:Bt,ref:Nt}=useRenderer(Rt,{width:_e,height:lt}),{playing:jt}=usePlaybackState(),[,Ut]=useScreenshots(),[Gt,qt]=reactExports.useState();reactExports.useEffect(()=>{if(Lt){const Kt=(Zt,Qt)=>{const Jt=Zt;qt({client:{x:Jt.clientX,y:Jt.clientY},world:Qt.world,info:{point:Qt.world,components:Qt.components}})};return Lt.on("click",Kt),()=>void Lt.off("click",Kt)}},[Lt]);const Xt=reactExports.useMemo(()=>({renderer:Lt}),[Lt]);return reactExports.useEffect(()=>At==null?void 0:At(Lt),[Lt,At]),reactExports.useEffect(()=>{const Kt=async()=>{var Zt;return await((Zt=Lt==null?void 0:Lt.toDataUrl)==null?void 0:Zt.call(Lt))};return Ut(()=>({[Dt]:Kt})),()=>Ut(()=>({[Dt]:void 0}))},[Dt,Lt]),reactExports.useEffect(()=>{Lt&&Lt.setOptions({tileResolution:{width:tileSize(jt),height:tileSize(jt)}})},[Lt,jt]),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(TraceRendererCircularProgress,{}),jsxRuntimeExports.jsx(TraceRendererContext.Provider,{value:Xt,children:Pt!=null&&Pt.length?Bt?jsxRuntimeExports.jsxs(Box$1,{sx:{display:"flex",flexDirection:"column",width:_e,height:lt,alignItems:"center",justifyContent:"center",color:"text.secondary"},children:[jsxRuntimeExports.jsx(DisabledIcon,{sx:{mb:2},fontSize:"large"}),Bt]}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Box$1,{ref:Nt,children:Pt.map((Kt,Zt)=>jsxRuntimeExports.jsx(RenderLayer,{index:Zt,layer:Kt},Kt.key))})}):jsxRuntimeExports.jsx(Placeholder$2,{icon:jsxRuntimeExports.jsx(ViewportIcon,{}),label:"Viewport",width:_e,height:lt,secondary:VIEWPORT_PAGE_DESCRIPTION})}),jsxRuntimeExports.jsx(SelectionMenu,{selection:Gt,onClose:()=>qt(void 0)})]})}function NodeList({nodes:_e}){const{renderer:lt}=useRendererInstance();return reactExports.useEffect(()=>{if(lt&&(_e!=null&&_e.length))return lt.add(_e.flat())},[lt,_e]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})}function LazyNodeList({nodes:_e,step:lt}){const At=lodashExports$1.floor((lt??0)/200)*200,Pt=reactExports.useMemo(()=>lodashExports$1.slice(_e,0,At),[_e,At]),Dt=reactExports.useMemo(()=>lodashExports$1.slice(_e,At,(lt??0)+1),[_e,At,lt]);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[!!At&&jsxRuntimeExports.jsx(NodeList,{nodes:Pt}),jsxRuntimeExports.jsx(NodeList,{nodes:Dt})]})}function useConnectionResolver(){const[_e]=useConnections();return reactExports.useCallback(lt=>lodashExports$1.find(_e,lt),[_e])}function useConnection(_e){return useConnectionResolver()({url:_e})}function useMapContent(_e){const lt=useSnackbar(),Rt=useLoadingState("map"),At=useConnectionResolver(),Pt=reactExports.useMemo(()=>memo(async({source:Nt,id:jt}={})=>{if(Nt&&jt){const Ut=At({url:Nt});if(Ut){lt("Fetching map...");const Gt=await Ut.transport().call("features/map",{id:jt});return Gt==null?void 0:Gt.content}}},{normalizer:JSON.stringify}),[At,lt]),{content:Dt,source:Lt,id:Bt}=_e??{};return useAsync(()=>Rt(async()=>{if(Bt)return{..._e,content:Dt||await Pt({source:Lt,id:Bt})}}),[Pt,Dt,Lt,Bt])}const noop$4=()=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{});function useMapOptions(_e){const{format:lt}=_e??{};return useAsync(async()=>{var Rt,At;return await((At=(Rt=getParser(lt))==null?void 0:Rt.editor)==null?void 0:At.call(Rt,_e==null?void 0:_e.content))??noop$4},[_e])}function useParsedMap(_e,lt){const Rt=useSnackbar(),At=useTheme(),Pt=useLoadingState("map"),{format:Dt,content:Lt}=_e??{};return useAsync(()=>Pt(async()=>{var Bt,Nt;if(Dt&&Lt){Rt("Processing map...");try{const jt=await((Nt=(Bt=getParser(Dt))==null?void 0:Bt.parse)==null?void 0:Nt.call(Bt,Lt,{color:At.palette.text.primary,background:At.palette.background.paper,...lt}))??{nodes:[]};return Rt("Map loaded",`${jt.nodes.length} elements, ${jt.log.join(", ")}`),jt}catch(jt){return console.error(jt),Rt("Error parsing",lodashExports$1.get(jt,"message")),{error:lodashExports$1.get(jt,"message")}}}}),[Dt,Lt,At,lt])}const controller$2={key:"map",icon:jsxRuntimeExports.jsx(MapTwoTone,{}),inferName:_e=>{var lt;return(lt=_e==null?void 0:_e.source)!=null&<.map?`${_e.source.map.name} (${lodashExports$1.startCase(_e.source.map.format)})`:"Untitled Map"},error:_e=>{var lt,Rt;return(Rt=(lt=_e==null?void 0:_e.source)==null?void 0:lt.parsedMap)==null?void 0:Rt.error},claimImportedFile:async _e=>lodashExports$1.keys(mapParsers).includes(ext(_e.name))?{claimed:!0,layer:async lt=>{lt("Opening map...");try{return{map:{...await readUploadedMap(_e,lodashExports$1.entries(mapParsers).map(([At])=>({id:At}))).read()}}}catch(Rt){return console.error(Rt),lt(`Error opening, ${lodashExports$1.get(Rt,"message")}`),{map:{key:nanoid$1(),id:custom$1().id,error:lodashExports$1.get(Rt,"message"),name:lodashExports$1.startCase(name$2(_e.name))}}}}}:{claimed:!1},editor:withProduce(({value:_e,produce:lt})=>{var At,Pt,Dt,Lt,Bt,Nt,jt,Ut;const{result:Rt}=useMapOptions((At=_e==null?void 0:_e.source)==null?void 0:At.map);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Option,{label:"Source",content:jsxRuntimeExports.jsx(MapPicker,{value:(Pt=_e==null?void 0:_e.source)==null?void 0:Pt.map,onChange:Gt=>lt(qt=>lodashExports$1.set(qt,"source.map",Gt))})}),((Lt=(Dt=_e==null?void 0:_e.source)==null?void 0:Dt.parsedMap)==null?void 0:Lt.error)&&jsxRuntimeExports.jsx(Type$1,{variant:"body2",color:Gt=>Gt.palette.error.main,sx:{whiteSpace:"pre-wrap",mb:1,mt:1},children:jsxRuntimeExports.jsx("code",{children:(Nt=(Bt=_e==null?void 0:_e.source)==null?void 0:Bt.parsedMap)==null?void 0:Nt.error})}),!!((jt=_e==null?void 0:_e.source)!=null&&jt.map)&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Heading,{label:"Map Options"}),Rt?jsxRuntimeExports.jsx(Rt,{value:(Ut=_e==null?void 0:_e.source)==null?void 0:Ut.options,onChange:Gt=>lt(qt=>{var Xt;lodashExports$1.set(qt,"source.options",Gt(((Xt=qt.source)==null?void 0:Xt.options)??{}))})}):jsxRuntimeExports.jsx(CircularProgress$1,{sx:{mt:2}})]})]})}),renderer:({layer:_e,index:lt})=>{var Pt;const{nodes:Rt}=((Pt=_e==null?void 0:_e.source)==null?void 0:Pt.parsedMap)??{},At=reactExports.useMemo(()=>[lodashExports$1.map(Rt,Dt=>({...Dt,meta:{...Dt.meta,sourceLayer:_e==null?void 0:_e.key,sourceLayerIndex:lt,sourceLayerAlpha:1-.01*+((_e==null?void 0:_e.transparency)??0),sourceLayerDisplayMode:(_e==null?void 0:_e.displayMode)??"source-over"}}))],[Rt,lt,_e==null?void 0:_e.transparency,_e==null?void 0:_e.displayMode]);return jsxRuntimeExports.jsx(NodeList,{nodes:At})},service:withProduce(({value:_e,produce:lt})=>{var Pt,Dt;const{result:Rt}=useMapContent((Pt=_e==null?void 0:_e.source)==null?void 0:Pt.map),{result:At}=useParsedMap(Rt,(Dt=_e==null?void 0:_e.source)==null?void 0:Dt.options);return useEffectWhen(()=>void lt(Lt=>{lodashExports$1.set(Lt,"source.parsedMap",At),lodashExports$1.set(Lt,"viewKey",nanoid$1())}),[At,lt],[At]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})}),provideSelectionInfo:({children:_e,event:lt,layer:Rt})=>{const{layer:At,setLayer:Pt,layers:Dt}=useLayer(Rt),{parsedMap:Lt}=(At==null?void 0:At.source)??{},{point:Bt,node:Nt}=reactExports.useMemo(()=>{var Ut,Gt,qt,Xt;if(Lt&<){const Kt=(Xt=(qt=getParser((Gt=(Ut=At==null?void 0:At.source)==null?void 0:Ut.map)==null?void 0:Gt.format))==null?void 0:qt.hydrate)==null?void 0:Xt.call(qt,Lt);if(Kt){const Zt=(lt==null?void 0:lt.world)&&Kt.snap(lt.world);if(Zt){const Qt=(lt==null?void 0:lt.world)&&Kt.nodeAt(Zt);return{point:Zt,node:Qt}}}}return{}},[Lt,lt]),jt=reactExports.useMemo(()=>({...At&&Bt&&!lodashExports$1.isUndefined(Nt)&&{[At.key]:{primary:inferLayerName(At),items:{point:{primary:"Point",secondary:`(${lodashExports$1.round(Bt.x,2)}, ${lodashExports$1.round(Bt.y,2)})`}}}}}),[Bt,Nt,At,Dt,Pt]);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:_e==null?void 0:_e(jt)})}};function IconButtonWithTooltip({label:_e,icon:lt,slotProps:Rt,...At}){return jsxRuntimeExports.jsx(Tooltip$1,{title:lodashExports$1.startCase(_e),...Rt==null?void 0:Rt.tooltip,children:jsxRuntimeExports.jsx("span",{children:jsxRuntimeExports.jsx(IconButton$1,{...At,children:lt})})},_e)}const FRAME_TIME_MS=1e3/60;function PlaybackService({children:_e,value:lt}){const{step:Rt,end:At,playing:Pt,pause:Dt,stepWithBreakpointCheck:Lt}=usePlaybackState(lt==null?void 0:lt.key),[{"playback/playbackRate":Bt=1}]=useSettings();return reactExports.useEffect(()=>{if(Pt){let Nt=!1,jt=lodashExports$1.noop,Ut=Date.now();const Gt=()=>{if(!Nt){const qt=Date.now(),Xt=lodashExports$1.ceil(Bt*(qt-Ut)/FRAME_TIME_MS);Rt{jt(),Nt=!0}}},[Lt,Pt,At,Rt,Dt,Bt]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:_e})}function Playback({layer:_e}){const{playing:lt,canPause:Rt,canPlay:At,canStepBackward:Pt,canStepForward:Dt,canStop:Lt,pause:Bt,play:Nt,stepBackward:jt,stepForward:Ut,stop:Gt,stepWithBreakpointCheck:qt,step:Xt,end:Kt}=usePlaybackState(_e==null?void 0:_e.key);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(IconButtonWithTooltip,{label:"step-backward",icon:jsxRuntimeExports.jsx(PreviousIcon,{}),onClick:jt,disabled:!Pt}),jsxRuntimeExports.jsx(IconButtonWithTooltip,{...lt?{label:"pause",icon:jsxRuntimeExports.jsx(PauseIcon,{}),onClick:()=>Bt(),disabled:!Rt}:{label:"play",icon:jsxRuntimeExports.jsx(PlayIcon,{}),onClick:()=>Nt(),disabled:!At,color:"primary"}}),jsxRuntimeExports.jsx(IconButtonWithTooltip,{label:"step-forward",icon:jsxRuntimeExports.jsx(NextIcon,{}),onClick:Ut,disabled:!Dt}),jsxRuntimeExports.jsx(IconButtonWithTooltip,{label:"stop",icon:jsxRuntimeExports.jsx(StopIcon,{}),onClick:Gt,disabled:!Lt}),jsxRuntimeExports.jsx(IconButtonWithTooltip,{label:"step-to-next-breakpoint",icon:jsxRuntimeExports.jsx(SkipIcon,{}),onClick:()=>{qt(Kt-Xt,1)},disabled:!Dt})]})}var ResizeSensor={exports:{}};(function(_e,lt){(function(Rt,At){_e.exports=At()})(typeof window<"u"?window:commonjsGlobal,function(){if(typeof window>"u")return null;var Rt=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")(),At=Rt.requestAnimationFrame||Rt.mozRequestAnimationFrame||Rt.webkitRequestAnimationFrame||function(Ut){return Rt.setTimeout(Ut,20)},Pt=Rt.cancelAnimationFrame||Rt.mozCancelAnimationFrame||Rt.webkitCancelAnimationFrame||function(Ut){Rt.clearTimeout(Ut)};function Dt(Ut,Gt){var qt=Object.prototype.toString.call(Ut),Xt=qt==="[object Array]"||qt==="[object NodeList]"||qt==="[object HTMLCollection]"||qt==="[object Object]"||typeof jQuery<"u"&&Ut instanceof jQuery||typeof Elements<"u"&&Ut instanceof Elements,Kt=0,Zt=Ut.length;if(Xt)for(;Kt=_n&&(Mn+=bn.value),bn.mode==="max"&&xn<=_n&&(Mn+=bn.value),ln[Tn]||(ln[Tn]=""),Mn&&(" "+ln[Tn]+" ").indexOf(" "+Mn+" ")===-1&&(ln[Tn]+=" "+Mn));for(var Cn in An)An.hasOwnProperty(Cn)&&(ln[An[Cn]]?this.element.setAttribute(An[Cn],ln[An[Cn]].substr(1)):this.element.removeAttribute(An[Cn]))}}function qt(rn,sn){rn.elementQueriesSetupInformation||(rn.elementQueriesSetupInformation=new Gt(rn,sn)),rn.elementQueriesSensor||(rn.elementQueriesSensor=new Rt(rn,function(){rn.elementQueriesSetupInformation.call()}))}function Xt(rn,sn,pn,bn){if(typeof Lt[rn]>"u"){Lt[rn]=[];var gn=Bt.length;Dt.innerHTML+=` `+rn+" {animation: 0.1s element-queries;}",Dt.innerHTML+=` `+rn+" > .resize-sensor {min-width: "+gn+"px;}",Bt.push(rn)}Lt[rn].push({mode:sn,property:pn,value:bn})}function Kt(rn){var sn;if(document.querySelectorAll&&(sn=rn?rn.querySelectorAll.bind(rn):document.querySelectorAll.bind(document)),!sn&&typeof $$<"u"&&(sn=$$),!sn&&typeof jQuery<"u"&&(sn=jQuery),!sn)throw"No document.querySelectorAll, jQuery or Mootools's $$ found.";return sn}function Zt(rn){var sn=Kt(rn);for(var pn in Lt)if(Lt.hasOwnProperty(pn))for(var bn=sn(pn,rn),gn=0,_n=bn.length;gn<_n;gn++)qt(bn[gn],pn)}function Qt(rn){var sn=[],pn=[],bn=[],gn=0,_n=-1,xn=[];for(var ln in rn.children)if(rn.children.hasOwnProperty(ln)&&rn.children[ln].tagName&&rn.children[ln].tagName.toLowerCase()==="img"){sn.push(rn.children[ln]);var Mn=rn.children[ln].getAttribute("min-width")||rn.children[ln].getAttribute("data-min-width"),Tn=rn.children[ln].getAttribute("data-src")||rn.children[ln].getAttribute("url");bn.push(Tn);var An={minWidth:Mn};pn.push(An),Mn?rn.children[ln].style.display="none":(gn=sn.length-1,rn.children[ln].style.display="block")}_n=gn;function Cn(){var wn=!1,Fn;for(Fn in sn)sn.hasOwnProperty(Fn)&&pn[Fn].minWidth&&rn.offsetWidth>pn[Fn].minWidth&&(wn=Fn);if(wn||(wn=gn),_n!==wn)if(xn[wn])sn[_n].style.display="none",sn[wn].style.display="block",_n=wn;else{var $n=new Image;$n.onload=function(){sn[wn].src=bn[wn],sn[_n].style.display="none",sn[wn].style.display="block",xn[wn]=!0,_n=wn},$n.src=bn[wn]}else sn[wn].src=bn[wn]}rn.resizeSensorInstance=new Rt(rn,Cn),Cn()}function Jt(){for(var rn=Kt(),sn=rn("[data-responsive-image],[responsive-image]"),pn=0,bn=sn.length;pn img, [data-responsive-image] {overflow: hidden; padding: 0; } [responsive-image] > img, [data-responsive-image] > img {width: 100%;}",Dt.innerHTML+=` @keyframes element-queries { 0% { visibility: inherit; } }`,document.getElementsByTagName("head")[0].appendChild(Dt),un=!0);for(var sn=0,pn=document.styleSheets.length;sn{if(Bt){const Ut=()=>{{const Gt=Bt.scrollTop<=_e;Gt!==Dt&&Lt(Gt)}{const Gt=Bt.scrollTop<=1;Gt!==At&&Pt(Gt)}jt.current-Bt.scrollTop&&(Math.abs(jt.current-Bt.scrollTop)>2&&jt.current>=0&&Rt(jt.current>Bt.scrollTop),jt.current=Bt.scrollTop)};return Bt.addEventListener("scroll",Ut,{passive:!0}),()=>{Bt.removeEventListener("scroll",Ut)}}},[Bt,Dt,At,jt,_e]),[lt||Dt,Dt,At,Bt,Nt]}const PanelContext=reactExports.createContext(null);function usePanel(){return reactExports.useContext(PanelContext)}/*! @@ -609,7 +609,7 @@ Use Save As... to download, then click back to return to this page.`)&&(location `+Bt+"]":"[ "+Nt.join(", ")+" ]":"["+Nt.join(",")+"]",gap=Bt,Dt}if(rep&&typeof rep=="object")for(Lt=rep.length,At=0;AtRt?`{ `+gap+Nt.join(`, `+gap)+` -`+Bt+"}":"{ "+Nt.join(", ")+" }":"{"+Nt.join(",")+"}",gap=Bt,Dt}}function beautify(_e,lt,Rt,At){var Pt;if(gap="",indent="",At||(At=0),typeof At!="number")throw new Error("beaufifier: limit must be a number");if(typeof Rt=="number")for(Pt=0;Pt+Pt);return Math.abs(At)>4?jsxRuntimeExports.jsxs("span",{children:[Rt,"x10",jsxRuntimeExports.jsx("sup",{style:supProps,children:At})]}):lodashExports$1.round(_e,2)}else return _e;case"string":return lodashExports$1.startCase(`${_e}`);case"undefined":return"null";default:return lt?jsxRuntimeExports.jsx("code",{children:lodashExports$1.isNull(_e)?"null":lodashExports$1.get(_e,"constructor.name")??typeof _e}):jsxRuntimeExports.jsx("code",{style:{whiteSpace:"pre"},children:lodashExports$1.truncate(beautify$1(_e,void 0,2),{length:100})})}}function Property({label:_e,value:lt,type:Rt,simple:At}){return jsxRuntimeExports.jsxs(Flex,{width:"auto",mr:2,mb:.5,alignItems:"baseline",children:[jsxRuntimeExports.jsx(Type$1,{component:"div",variant:"body2",...Rt,sx:{opacity:.54,...Rt==null?void 0:Rt.sx},children:_e}),jsxRuntimeExports.jsx(Space,{}),jsxRuntimeExports.jsx(Type$1,{component:"div",variant:"body2",...Rt,children:renderProperty(lt,At)??"none"})]},`${_e}::${renderProperty(lt)}`)}const OMIT_PROPS=["type","id"],ESSENTIAL_PROPS=["f","g","pId"],ALL_PROPS=[...OMIT_PROPS,...ESSENTIAL_PROPS],sortEventKeys=_e=>lodashExports$1.chain(_e).entries().filter(([,lt])=>!lodashExports$1.isUndefined(lt)).sortBy(([lt])=>lodashExports$1.indexOf(ALL_PROPS,lt)+1||Number.MAX_SAFE_INTEGER).value();function PropertyDialog({event:_e,max:lt=10,simple:Rt,variant:At,...Pt}){const Dt=sortEventKeys(_e);return jsxRuntimeExports.jsx(ManagedModal,{...lodashExports$1.merge({appBar:{children:jsxRuntimeExports.jsx(AppBarTitle,{children:"Event Properties"})},trigger:Lt=>jsxRuntimeExports.jsxs(Button$2,{variant:"text",sx:{mx:-1,minWidth:0,width:"fit-content",color:Bt=>Bt.palette.text.secondary,justifyContent:"left"},onClick:Bt=>{Bt.stopPropagation(),Bt.preventDefault(),Lt(Bt)},children:[Dt.length-lt," more"]})},Pt),children:[{name:"common",props:lodashExports$1.filter(Dt,([Lt])=>OMIT_PROPS.includes(Lt))},{name:"search",props:lodashExports$1.filter(Dt,([Lt])=>ESSENTIAL_PROPS.includes(Lt))},{name:"other",props:lodashExports$1.filter(Dt,([Lt])=>!ALL_PROPS.includes(Lt))}].map(({name:Lt,props:Bt},Nt)=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[!!Nt&&jsxRuntimeExports.jsx(Divider$1,{sx:{mb:1}}),jsxRuntimeExports.jsx(Type$1,{variant:"overline",color:"text.secondary",component:"div",sx:{px:3},children:lodashExports$1.startCase(Lt)}),jsxRuntimeExports.jsx(Box$1,{sx:{p:1,pt:0,display:"grid",gridAutoFlow:"row",gridTemplateColumns:"repeat(2, 1fr)"},children:lodashExports$1.map(Bt,([jt,Ut])=>jsxRuntimeExports.jsx(ListItem$1,{sx:{py:.5},children:jsxRuntimeExports.jsx(ListItemText$1,{secondary:jt,primary:renderProperty(Ut)})},`${jt}::${Ut}`))},Lt)]}))})}function PropertyList(_e){const{event:lt,variant:Rt="body2",max:At=10,simple:Pt,...Dt}=_e,Lt=sortEventKeys(lt);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs(Flex,{...Dt,children:[lodashExports$1.map(lodashExports$1.slice(Lt,0,At),([Bt,Nt],jt)=>jsxRuntimeExports.jsx(Property,{label:Bt,value:Nt,type:{variant:Rt},simple:Pt},jt)),Lt.length>At&&!Pt&&jsxRuntimeExports.jsx(PropertyDialog,{..._e})]})})}function TracePreview({trace:_e,language:lt="json"}){return jsxRuntimeExports.jsx(Box$1,{sx:{width:"100%",height:"100%"},children:jsxRuntimeExports.jsx(ScriptViewer,{options:{readOnly:!0},language:lt,value:_e?beautify$1({..._e,events:lodashExports$1.take(_e.events,10)},null,2,1):"No data"})})}var dist$4={exports:{}};(function(_e,lt){(function(Rt,At){_e.exports=At()})(commonjsGlobal,function(){return function(Rt){function At(Dt){if(Pt[Dt])return Pt[Dt].exports;var Lt=Pt[Dt]={i:Dt,l:!1,exports:{}};return Rt[Dt].call(Lt.exports,Lt,Lt.exports,At),Lt.l=!0,Lt.exports}var Pt={};return At.m=Rt,At.c=Pt,At.d=function(Dt,Lt,Bt){At.o(Dt,Lt)||Object.defineProperty(Dt,Lt,{configurable:!1,enumerable:!0,get:Bt})},At.n=function(Dt){var Lt=Dt&&Dt.__esModule?function(){return Dt.default}:function(){return Dt};return At.d(Lt,"a",Lt),Lt},At.o=function(Dt,Lt){return Object.prototype.hasOwnProperty.call(Dt,Lt)},At.p="",At(At.s=1)}([function(Rt,At,Pt){function Dt(Bt){var Nt=Bt===void 0?{}:Bt,jt=Nt.ESCAPE,Ut=jt===void 0?/^\\/:jt,Gt=Nt.VARIABLE_START,qt=Gt===void 0?/^\${\s*/:Gt,Xt=Nt.VARIABLE_END,Kt=Xt===void 0?/^\s*}/:Xt,Zt=Nt.PIPE_START,Qt=Zt===void 0?/^\s*\|\s*/:Zt,Jt=Nt.PIPE_PARAMETER_START,en=Jt===void 0?/^\s*:\s*/:Jt,tn=Nt.QUOTED_STRING,an=tn===void 0?At.DEFAULT_QUOTED_STRING_REGEX:tn,cn=Nt.QUOTED_STRING_TEST,un=cn===void 0?null:cn,rn=Nt.QUOTED_STRING_GET_AND_ADVANCE,sn=rn===void 0?null:rn,pn=Nt.QUOTED_STRING_IN_PARAMETER_TEST,bn=pn===void 0?null:pn,gn=Nt.QUOTED_STRING_IN_PARAMETER_GET_AND_ADVANCE,_n=gn===void 0?null:gn,xn=un||function(An){return an.test(An)},ln=sn||Lt(an),Mn=bn||function(An){return an.test(An)},Tn=_n||Lt(an);return function(An){function Cn(yr){yr===void 0&&(yr=1),dn=dn.substr(yr)}function wn(yr){yr===void 0&&(yr=/^/),Cn(dn.match(yr)[0].length)}function Fn(){var yr;return wn(Ut),yr=dn.length>0?dn[0]:"",Cn(),yr}function $n(yr){var br=(yr===void 0?{}:yr).isNull,Er=br!==void 0&&br;Gn={name:"",pipes:[]},er=!Er}function Pn(){hn.variables.push(Gn),$n({isNull:!0})}function Vn(yr){var br=(yr===void 0?{}:yr).isNull,Er=br!==void 0&&br;Sn={name:"",parameters:[]},Yn=!Er}function Zn(){Gn.pipes.push(Sn),Vn({isNull:!0})}function tr(yr){var br=(yr===void 0?{}:yr).isNull,Er=br!==void 0&&br;Kn="",dr=!Er}function yn(){Sn.parameters.push(Kn),tr({isNull:!0})}function En(){return!!Kt.test(dn)&&(wn(Kt),vn>=3&&yn(),vn>=2&&Zn(),vn>=1&&Pn(),vn=0,!0)}function kn(){return!!Qt.test(dn)&&(wn(Qt),vn>=3&&yn(),vn>=2&&Zn(),vn>=1&&Vn(),vn=2,!0)}function zn(){return!!en.test(dn)&&(wn(en),vn>=3&&yn(),vn>=2&&tr(),vn=3,!0)}for(var dn=An,hn={literals:[],variables:[]},vn=0,Bn="",Gn={name:"",pipes:[]},Sn={name:"",parameters:[]},Kn="",er=!1,Yn=!1,dr=!1;dn&&dn.length>0;)switch(vn){case 0:if(Ut.test(dn)){Bn+=Fn();continue}if(qt.test(dn)){vn=1,$n(),hn.literals.push(Bn),Bn="",wn(qt);continue}Bn+=dn[0],Cn();break;case 1:if(Ut.test(dn)){Gn.name+=Fn();continue}if(En()||kn())continue;if(xn(dn)){Gn.name+=ln(dn,Cn);continue}Gn.name+=dn[0],Cn();break;case 2:if(Ut.test(dn)){Sn.name+=Fn();continue}if(En()||zn()||kn())continue;if(xn(dn)){Sn.name+=ln(dn,Cn);continue}Sn.name+=dn[0],Cn();break;case 3:if(Ut.test(dn)){Kn+=Fn();continue}if(En()||zn()||kn())continue;if(Mn(dn)){Kn+=Tn(dn,Cn);continue}Kn+=dn[0],Cn()}return dr&&Sn.parameters.push(Kn),Yn&&Gn.pipes.push(Sn),er&&hn.variables.push(Gn),hn.literals.push(Bn),hn}}function Lt(Bt){return function(Nt,jt){var Ut=Nt.match(Bt);return jt(Ut[0].length),Ut.slice(2).join("").replace("\\\\","\\")}}Object.defineProperty(At,"__esModule",{value:!0}),At.DEFAULT_QUOTED_STRING_REGEX=/^('((?:[^'\\]|\\.)*)'|'((?:[^'\\]|\\.)*)$|"((?:[^"\\]|\\.)*)"|"((?:[^"\\]|\\.)*)$)/,At.parseStringTemplateGenerator=Dt,At.parseStringTemplate=Dt(),At.getQuotedStringAndAdvanceForRegex=Lt},function(Rt,At,Pt){Rt.exports=Pt(2)},function(Rt,At,Pt){function Dt(Lt){for(var Bt in Lt)At.hasOwnProperty(Bt)||(At[Bt]=Lt[Bt])}Object.defineProperty(At,"__esModule",{value:!0}),Dt(Pt(0)),Dt(Pt(3))},function(Rt,At,Pt){function Dt(Ut){return function(Gt){return Ut.hasOwnProperty(Gt)?Ut[Gt]:Gt.split(".").reduce(function(qt,Xt){return qt.hasOwnProperty(Xt)?qt[Xt]:""},Ut)}}function Lt(Ut,Gt,qt,Xt){Xt===void 0&&(Xt=Dt(Gt));var Kt=Xt(Ut.name);return Ut.pipes.reduce(function(Zt,Qt){return qt.hasOwnProperty(Qt.name)?qt[Qt.name](Zt,Qt.parameters):Zt},Kt??"")}function Bt(Ut,Gt,qt,Xt){return Xt===void 0&&(Xt=Dt(Gt)),Ut.literals.length===0?"":Ut.literals.slice(1).reduce(function(Kt,Zt,Qt){return""+Kt+Lt(Ut.variables[Qt],Gt,qt,Xt)+Zt},Ut.literals[0])}function Nt(Ut,Gt,qt){return Bt(jt.parseStringTemplate(Ut),Gt,qt)}Object.defineProperty(At,"__esModule",{value:!0});var jt=Pt(0);At.evaluateParsedString=Bt,At.evaluateStringTemplate=Nt}])})})(dist$4);var distExports=dist$4.exports;function mapProperties(_e={},lt){const Rt={};for(const At of Object.keys(_e))Rt[At]=At==="$"?_e[At]:lt(_e[At],At,_e);return Object.setPrototypeOf(Rt,_e)}function parseProperty(_e){switch(_e==null?void 0:_e.constructor){case Array:{const lt=lodashExports$1.map(_e,parseProperty);return Rt=>lodashExports$1.map(lt,At=>At(Rt))}case Object:{const lt=lodashExports$1.mapValues(_e,parseProperty);return Rt=>lodashExports$1.mapValues(lt,At=>At(Rt))}case String:return parseString(_e);default:return()=>_e}}function normalize(_e={}){return mapProperties(_e,lt=>lodashExports$1.isFunction(lt)?lt:parseProperty(lt))}const parseToken=_e=>{const lt=Function("$",`return ${_e};`);return Rt=>lt(new Proxy(normalize(Rt),{get(At,Pt){return typeof(At==null?void 0:At[Pt])=="function"?At[Pt]({}):At==null?void 0:At[Pt]}}))},openBrace=/^\{\{\s*/,closeBrace=/^\s*\}\}/,neverMatch=/\b\B/,parser$1=distExports.parseStringTemplateGenerator({VARIABLE_START:openBrace,VARIABLE_END:closeBrace,PIPE_START:neverMatch,PIPE_PARAMETER_START:neverMatch,QUOTED_STRING:neverMatch}),parseString=memo(_e=>{const lt=parser$1(_e);return lodashExports$1.join(lt.literals,"")?Rt=>distExports.evaluateParsedString(lt,{},{},At=>parseToken(At)(Rt)):parseToken(lt.variables[0].name)},{primitive:!0});function commonjsRequire(_e){throw new Error('Could not dynamically require "'+_e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pluralize$1={exports:{}};(function(_e,lt){(function(Rt,At){typeof commonjsRequire=="function"?_e.exports=At():Rt.pluralize=At()})(commonjsGlobal,function(){var Rt=[],At=[],Pt={},Dt={},Lt={};function Bt(Zt){return typeof Zt=="string"?new RegExp("^"+Zt+"$","i"):Zt}function Nt(Zt,Qt){return Zt===Qt?Qt:Zt===Zt.toLowerCase()?Qt.toLowerCase():Zt===Zt.toUpperCase()?Qt.toUpperCase():Zt[0]===Zt[0].toUpperCase()?Qt.charAt(0).toUpperCase()+Qt.substr(1).toLowerCase():Qt.toLowerCase()}function jt(Zt,Qt){return Zt.replace(/\$(\d{1,2})/g,function(Jt,en){return Qt[en]||""})}function Ut(Zt,Qt){return Zt.replace(Qt[0],function(Jt,en){var tn=jt(Qt[1],arguments);return Nt(Jt===""?Zt[en-1]:Jt,tn)})}function Gt(Zt,Qt,Jt){if(!Zt.length||Pt.hasOwnProperty(Zt))return Qt;for(var en=Jt.length;en--;){var tn=Jt[en];if(tn[0].test(Qt))return Ut(Qt,tn)}return Qt}function qt(Zt,Qt,Jt){return function(en){var tn=en.toLowerCase();return Qt.hasOwnProperty(tn)?Nt(en,tn):Zt.hasOwnProperty(tn)?Nt(en,Zt[tn]):Gt(tn,en,Jt)}}function Xt(Zt,Qt,Jt,en){return function(tn){var an=tn.toLowerCase();return Qt.hasOwnProperty(an)?!0:Zt.hasOwnProperty(an)?!1:Gt(an,an,Jt)===an}}function Kt(Zt,Qt,Jt){var en=Qt===1?Kt.singular(Zt):Kt.plural(Zt);return(Jt?Qt+" ":"")+en}return Kt.plural=qt(Lt,Dt,Rt),Kt.isPlural=Xt(Lt,Dt,Rt),Kt.singular=qt(Dt,Lt,At),Kt.isSingular=Xt(Dt,Lt,At),Kt.addPluralRule=function(Zt,Qt){Rt.push([Bt(Zt),Qt])},Kt.addSingularRule=function(Zt,Qt){At.push([Bt(Zt),Qt])},Kt.addUncountableRule=function(Zt){if(typeof Zt=="string"){Pt[Zt.toLowerCase()]=!0;return}Kt.addPluralRule(Zt,"$0"),Kt.addSingularRule(Zt,"$0")},Kt.addIrregularRule=function(Zt,Qt){Qt=Qt.toLowerCase(),Zt=Zt.toLowerCase(),Lt[Zt]=Qt,Dt[Qt]=Zt},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach(function(Zt){return Kt.addIrregularRule(Zt[0],Zt[1])}),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach(function(Zt){return Kt.addPluralRule(Zt[0],Zt[1])}),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(function(Zt){return Kt.addSingularRule(Zt[0],Zt[1])}),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(Kt.addUncountableRule),Kt})})(pluralize$1);var pluralizeExports=pluralize$1.exports;const pluralize=getDefaultExportFromCjs(pluralizeExports),parseTraceWorkerUrl=""+new URL("parseTrace.worker-413a1f44.js",import.meta.url).href;class ParseTraceWorker extends Worker{constructor(){super(parseTraceWorkerUrl,{type:"module"})}}const parseTraceAsync=usingMemoizedWorkerTask(ParseTraceWorker);function useTraceParser(_e){const lt=useSnackbar(),Rt=useLoadingState("specimen");return reactExports.useCallback(()=>Rt(async()=>{var At;if(_e!=null&&_e.trace){lt("Processing trace...");try{const Pt=await parseTraceAsync(_e);return lt("Trace loaded",pluralize("step",((At=Pt==null?void 0:Pt.stepsPersistent)==null?void 0:At.length)??0,!0)),{components:Pt,content:_e.trace}}catch(Pt){return console.error(Pt),lt("Error parsing",lodashExports$1.get(Pt,"message")),{error:lodashExports$1.get(Pt,"message")}}}}),[_e])}function useTraceContent(_e){const lt=useSnackbar(),Rt=useLoadingState("specimen"),At=useConnectionResolver(),[{traces:Pt}]=useFeatures(),Dt=reactExports.useMemo(()=>memo(async({source:Ut,id:Gt})=>{if(Ut&&Gt){const qt=At({url:Ut});if(qt){lt("Fetching trace...");const Xt=await qt.transport().call("features/trace",{id:Gt});return Xt==null?void 0:Xt.content}}},{normalizer:JSON.stringify}),[At,lt]),{content:Lt,source:Bt,id:Nt}=_e??{},{lastModified:jt}=lodashExports$1.find(Pt,{id:Nt,source:Bt})??{};return useAsync(()=>Rt(async()=>{if(Nt)return{..._e,content:Lt||await Dt({source:Bt,id:Nt,lastModified:jt})}}),[Dt,Lt,Bt,Nt,jt])}const isNullish=_e=>_e==null;function makePathIndex(_e){const lt=[],Rt={},At={},Pt=lodashExports$1.chain(_e==null?void 0:_e.events).map((Bt,Nt)=>({step:Nt,id:Bt.id,pId:Bt.pId})).groupBy("id").value();lodashExports$1.forEach(_e==null?void 0:_e.events,({id:Bt,pId:Nt},jt)=>{!isNullish(Nt)&&Rt[Bt]!==Nt&&(lt.push({id:Bt,pId:Nt,step:jt,prev:lodashExports$1.last(lt)}),Rt[Bt]=Nt),At[jt]=lodashExports$1.last(lt)});const Dt=(Bt,Nt=(jt=>(jt=_e==null?void 0:_e.events)==null?void 0:jt.length)()??0)=>{let Ut=At[Nt];for(;Ut;){if(Ut.id===Bt)return Ut.pId;Ut=Ut.prev}};return{getParent:Dt,getPath:Bt=>{const Nt=[Bt];let jt={...(_e.events??[])[Bt],step:Bt};for(;jt;){const Ut=Dt(jt.id,jt.step);if(Ut){const Gt=lodashExports$1.findLast(Pt[Ut],qt=>qt.step<=jt.step);if(Gt)Nt.push(Gt.step),jt=Gt;else break}else break}return Nt}}}const controller$1={key:"trace",icon:jsxRuntimeExports.jsx(RouteTwoTone,{}),inferName:_e=>{var lt,Rt;return((Rt=(lt=_e.source)==null?void 0:lt.trace)==null?void 0:Rt.name)??"Untitled Trace"},error:_e=>{var lt,Rt,At,Pt;return((Rt=(lt=_e==null?void 0:_e.source)==null?void 0:lt.trace)==null?void 0:Rt.error)||((Pt=(At=_e==null?void 0:_e.source)==null?void 0:At.parsedTrace)==null?void 0:Pt.error)},claimImportedFile:async _e=>isTraceFormat(_e)?{claimed:!0,layer:async lt=>{lt("Opening trace...");try{return{trace:{...await readUploadedTrace(_e).read()}}}catch(Rt){return console.error(Rt),lt(`Error opening, ${lodashExports$1.get(Rt,"message")}`),{trace:{key:nanoid$1(),id:custom$1().id,error:lodashExports$1.get(Rt,"message"),name:lodashExports$1.startCase(name$2(_e.name))}}}}}:{claimed:!1},editor:withProduce(({value:_e,produce:lt})=>{var Rt,At,Pt,Dt,Lt,Bt,Nt,jt,Ut,Gt,qt;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Option,{label:"Trace",content:jsxRuntimeExports.jsx(TracePicker,{onChange:Xt=>lt(Kt=>lodashExports$1.set(Kt,"source.trace",Xt)),value:(Rt=_e==null?void 0:_e.source)==null?void 0:Rt.trace})}),((Pt=(At=_e==null?void 0:_e.source)==null?void 0:At.trace)==null?void 0:Pt.error)&&jsxRuntimeExports.jsx(Type$1,{variant:"body2",color:Xt=>Xt.palette.error.main,sx:{whiteSpace:"pre-line",mb:1,mt:1},children:jsxRuntimeExports.jsx("code",{children:(Lt=(Dt=_e==null?void 0:_e.source)==null?void 0:Dt.trace)==null?void 0:Lt.error})}),((Nt=(Bt=_e==null?void 0:_e.source)==null?void 0:Bt.parsedTrace)==null?void 0:Nt.error)&&jsxRuntimeExports.jsx(Type$1,{variant:"body2",color:Xt=>Xt.palette.error.main,sx:{whiteSpace:"pre-line",mb:1,mt:1},children:jsxRuntimeExports.jsx("code",{children:(Ut=(jt=_e==null?void 0:_e.source)==null?void 0:jt.parsedTrace)==null?void 0:Ut.error})}),jsxRuntimeExports.jsx(Heading,{label:"Preview"}),jsxRuntimeExports.jsx(Box$1,{sx:{height:240,mx:-2},children:jsxRuntimeExports.jsx(TracePreview,{trace:(qt=(Gt=_e==null?void 0:_e.source)==null?void 0:Gt.parsedTrace)==null?void 0:qt.content})})]})}),service:withProduce(({value:_e,produce:lt})=>{var Dt,Lt,Bt;const{palette:Rt}=useTheme(),{result:At}=useTraceContent((Dt=_e==null?void 0:_e.source)==null?void 0:Dt.trace),Pt=useTraceParser({trace:At==null?void 0:At.content,context:{color:colorsHex,themeAccent:Rt.primary.main,themeTextPrimary:Rt.text.primary,themeBackground:Rt.background.paper},view:"main"});return reactExports.useEffect(()=>{lt(Nt=>{var jt,Ut;return lodashExports$1.set(Nt,"source.playbackTo",((Ut=(jt=At==null?void 0:At.content)==null?void 0:jt.events)==null?void 0:Ut.length)??0)})},[(Bt=(Lt=At==null?void 0:At.content)==null?void 0:Lt.events)==null?void 0:Bt.length]),useEffectWhen(async()=>{const Nt=await Pt();lt(jt=>{lodashExports$1.set(jt,"source.parsedTrace",Nt),lodashExports$1.set(jt,"viewKey",nanoid$1())})},[Pt],[At==null?void 0:At.key]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(PlaybackService,{value:_e})})}),renderer:({layer:_e,index:lt})=>{var Nt,jt,Ut;const Rt=(jt=(Nt=_e==null?void 0:_e.source)==null?void 0:Nt.parsedTrace)==null?void 0:jt.components,At=useThrottle$1(((Ut=_e==null?void 0:_e.source)==null?void 0:Ut.step)??0,1e3/60),Pt=use2DPath(_e,lt,At),Dt=reactExports.useMemo(()=>lodashExports$1.map(Rt==null?void 0:Rt.stepsPersistent,Gt=>lodashExports$1.map(Gt,qt=>lodashExports$1.merge(qt,{meta:{sourceLayer:_e==null?void 0:_e.key,sourceLayerIndex:lt,sourceLayerAlpha:1-.01*+((_e==null?void 0:_e.transparency)??0),sourceLayerDisplayMode:(_e==null?void 0:_e.displayMode)??"source-over"}}))),[Rt==null?void 0:Rt.stepsPersistent,_e==null?void 0:_e.key,_e==null?void 0:_e.transparency,_e==null?void 0:_e.displayMode,lt]),Lt=reactExports.useMemo(()=>lodashExports$1.map(Rt==null?void 0:Rt.stepsTransient,Gt=>lodashExports$1.map(Gt,qt=>lodashExports$1.merge(qt,{meta:{sourceLayer:_e==null?void 0:_e.key,sourceLayerIndex:lt,sourceLayerAlpha:1-.01*+((_e==null?void 0:_e.transparency)??0),sourceLayerDisplayMode:(_e==null?void 0:_e.displayMode)??"source-over"}}))),[Rt==null?void 0:Rt.stepsTransient,_e==null?void 0:_e.key,_e==null?void 0:_e.transparency,_e==null?void 0:_e.displayMode,lt]),Bt=reactExports.useMemo(()=>[Lt[At]??[]],[Lt,At]);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(LazyNodeList,{step:At,nodes:Dt}),jsxRuntimeExports.jsx(NodeList,{nodes:Bt}),Pt]})},steps:_e=>{var lt,Rt,At;return((At=(Rt=(lt=_e==null?void 0:_e.source)==null?void 0:lt.parsedTrace)==null?void 0:Rt.content)==null?void 0:At.events)??[]},provideSelectionInfo:({layer:_e,event:lt,children:Rt})=>{const{layer:At,setLayer:Pt}=useLayer(_e),Dt=reactExports.useMemo(()=>{var jt,Ut,Gt,qt,Xt;const Lt=((Gt=(Ut=(jt=At==null?void 0:At.source)==null?void 0:jt.parsedTrace)==null?void 0:Ut.content)==null?void 0:Gt.events)??[],Bt=lodashExports$1.chain((qt=lt==null?void 0:lt.info)==null?void 0:qt.components).filter(Kt=>{var Zt;return((Zt=Kt.meta)==null?void 0:Zt.sourceLayer)===(At==null?void 0:At.key)}).map(Kt=>{var Zt;return(Zt=Kt.meta)==null?void 0:Zt.step}).filter(lodashExports$1.negate(lodashExports$1.isUndefined)).sort((Kt,Zt)=>Kt-Zt).value(),Nt=lodashExports$1.chain((Xt=lt==null?void 0:lt.info)==null?void 0:Xt.components).filter(Kt=>{var Zt;return((Zt=Kt.meta)==null?void 0:Zt.sourceLayer)===(At==null?void 0:At.key)}).filter(Kt=>{var Zt;return(Zt=Kt.meta)==null?void 0:Zt.info}).value();if(Bt.length&&At){const Kt=lodashExports$1.last(Bt),Zt=Lt[Kt];if(Zt)return{...lodashExports$1.keyBy(lodashExports$1.map(Nt,(Qt,Jt)=>({key:`${At.key}.${Jt}`,primary:`Selection in ${inferLayerName(At)}`,items:{info:{index:-1,primary:jsxRuntimeExports.jsx(PropertyList,{event:Qt.meta.info,vertical:!0})}}})),"key"),[At.key]:{primary:inferLayerName(At),items:{properties:{index:-2,primary:jsxRuntimeExports.jsx(PropertyList,{event:Zt,vertical:!0})},[`${Zt}`]:{primary:`Go to Step ${Kt}`,secondary:`${lodashExports$1.startCase(Zt.type)}`,action:()=>Pt(produce(At,Qt=>{lodashExports$1.set(Qt,"source.step",Kt)})),icon:jsxRuntimeExports.jsx(ArrowOutwardRounded,{})}}}}}return{}},[At,lt]);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:Rt==null?void 0:Rt(Dt)})}};function use2DPath(_e,lt=0,Rt=0){var Lt,Bt,Nt;const{palette:At}=useTheme(),{getPath:Pt}=reactExports.useMemo(()=>{var jt,Ut,Gt;return((jt=_e==null?void 0:_e.source)==null?void 0:jt.playback)!=="playing"&&((Gt=(Ut=_e==null?void 0:_e.source)==null?void 0:Ut.parsedTrace)!=null&&Gt.content)?makePathIndex(_e.source.parsedTrace.content):{getParent:lodashExports$1.constant(void 0),getPath:lodashExports$1.constant([])}},[(Bt=(Lt=_e==null?void 0:_e.source)==null?void 0:Lt.parsedTrace)==null?void 0:Bt.content,(Nt=_e==null?void 0:_e.source)==null?void 0:Nt.playback]);return reactExports.useMemo(()=>{var jt,Ut,Gt,qt;if((qt=(Gt=(Ut=(jt=_e==null?void 0:_e.source)==null?void 0:jt.parsedTrace)==null?void 0:Ut.content)==null?void 0:Gt.render)!=null&&qt.path){const{pivot:Xt={},scale:Kt=1}=_e.source.parsedTrace.content.render.path,{x:Zt,y:Qt}=Xt,Jt=Zt?parseString(Zt):an=>an.event.x,en=Qt?parseString(Qt):an=>an.event.y,tn=lodashExports$1.map(Pt(Rt),an=>{var cn,un,rn,sn;return(sn=(rn=(un=(cn=_e==null?void 0:_e.source)==null?void 0:cn.parsedTrace)==null?void 0:un.content)==null?void 0:rn.events)==null?void 0:sn[an]});if(tn.length){const an=[{$:"rect",x:Jt({event:{x:0,y:0,...lodashExports$1.head(tn)}})-2*Kt/2,y:en({event:{x:0,y:0,...lodashExports$1.head(tn)}})-2*Kt/2,fill:getColorHex("destination"),width:2*Kt,height:2*Kt},{$:"rect",x:Jt({event:{x:0,y:0,...lodashExports$1.last(tn)}})-2*Kt/2,y:en({event:{x:0,y:0,...lodashExports$1.last(tn)}})-2*Kt/2,fill:getColorHex("source"),width:2*Kt,height:2*Kt},{$:"path",points:tn.map(cn=>({x:Jt({event:{x:0,y:0,...cn}}),y:en({event:{x:0,y:0,...cn}})})),fill:At.primary.main,alpha:1,lineWidth:1*Kt}];return jsxRuntimeExports.jsx(NodeList,{nodes:[lodashExports$1.map(an,cn=>({component:cn,meta:{source:"path",sourceLayerIndex:-99999+lt}}))]})}}return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})},[_e,lt,Rt,At,Pt])}async function findConnection(_e,lt,Rt){for(const At of _e){const Pt=await At.transport().call("features/algorithms"),Dt=await At.transport().call("features/formats");if(lodashExports$1.find(Pt,{id:lt})&&lodashExports$1.find(Dt,{id:Rt}))return At}}const controller={...lodashExports$1.omit(controller$1,"claimImportedFile"),key:"query",icon:jsxRuntimeExports.jsx(RouteTwoTone,{}),editor:withProduce(({value:_e,produce:lt})=>{var jt,Ut;const{algorithm:Rt}=(_e==null?void 0:_e.source)??{},{layers:At,allLayers:Pt,layer:Dt,key:Lt}=useLayer(void 0,Gt=>{var qt;return((qt=Gt.source)==null?void 0:qt.type)==="map"}),[{algorithms:Bt}]=useFeatures(),[Nt]=useConnections();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Option,{label:"Algorithm",content:jsxRuntimeExports.jsx(FeaturePicker,{arrow:!0,paper:!0,icon:jsxRuntimeExports.jsx(CodeOutlined,{}),label:"Algorithm",value:Rt,items:Bt.map(Gt=>{var qt;return{...Gt,description:(qt=lodashExports$1.find(Nt,{url:Gt.source}))==null?void 0:qt.name}}),onChange:async Gt=>lt(qt=>lodashExports$1.set(qt,"source.algorithm",Gt))})}),!(Bt!=null&&Bt.length)&&jsxRuntimeExports.jsx(Type$1,{variant:"body2",color:"warning.main",sx:{mb:1},children:"No connected solver has declared support for running algorithms"}),jsxRuntimeExports.jsx(Option,{label:"Map",content:jsxRuntimeExports.jsx(FeaturePicker,{arrow:!0,paper:!0,icon:jsxRuntimeExports.jsx(LayersIcon,{}),label:"Layer",value:Lt,items:Pt.map(Gt=>({id:Gt.key,hidden:!lodashExports$1.find(At,qt=>qt.key===Gt.key),name:inferLayerName(Gt)})),onChange:async Gt=>lt(qt=>lodashExports$1.set(qt,"source.mapLayerKey",Gt))})}),Dt&&jsxRuntimeExports.jsxs(Type$1,{variant:"body2",color:"text.secondary",sx:{mb:1,mt:1},children:["Define source and destination nodes by clicking on valid regions on"," ",inferLayerName(Dt)]}),jsxRuntimeExports.jsx(Heading,{label:"Preview"}),jsxRuntimeExports.jsx(Box$1,{sx:{height:240,mx:-2},children:jsxRuntimeExports.jsx(TracePreview,{trace:(Ut=(jt=_e==null?void 0:_e.source)==null?void 0:jt.trace)==null?void 0:Ut.content})})]})}),service:withProduce(({value:_e,produce:lt,onChange:Rt})=>{const At=controller$1.service,Pt=useSnackbar(),{algorithm:Dt,mapLayerKey:Lt,start:Bt,end:Nt}=(_e==null?void 0:_e.source)??{},[{layers:jt}]=useLayers(),[Ut]=useConnections(),[{algorithms:Gt}]=useFeatures(),qt=reactExports.useMemo(()=>{if(Lt&&Dt)return lodashExports$1.find(jt,{key:Lt})},[Lt,Dt,jt]);return useEffectWhenAsync(async Xt=>{var Kt;if(qt&&Dt){const{format:Zt,content:Qt}=((Kt=qt==null?void 0:qt.source)==null?void 0:Kt.map)??{};if(Zt&&Qt){const Jt=await findConnection(Ut,Dt,Zt),en=lodashExports$1.find(Gt,{id:Dt});if(Jt){Pt(`Executing ${inferLayerName(_e)} using ${Jt.name}...`);const tn=await Jt.transport().call("solve/pathfinding",{format:Zt,instances:[{start:Bt??0,end:Nt??0}],mapURI:`map:${encodeURIComponent(Qt)}`,algorithm:Dt});Xt.aborted?Pt("Canceled"):lt(an=>lodashExports$1.set(an,"source.trace",{name:`${en==null?void 0:en.name}`,content:tn,key:nanoid$1(),id:nanoid$1()}))}}}},[qt,Ut,Dt,Bt,Nt,lt,Pt,_e,Gt],[qt,Ut,Dt,Bt,Nt]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(At,{value:_e,onChange:Rt})})}),inferName:_e=>{var lt,Rt;return((Rt=(lt=_e.source)==null?void 0:lt.trace)==null?void 0:Rt.name)??"Untitled Query"},provideSelectionInfo:({children:_e,event:lt,layer:Rt})=>{const At=controller$1.provideSelectionInfo,{layer:Pt,setLayer:Dt,layers:Lt}=useLayer(Rt),Bt=reactExports.useMemo(()=>{const jt=lodashExports$1.filter(Lt,{source:{type:"map"}});return lodashExports$1.filter(lodashExports$1.map(jt,Ut=>{var qt,Xt,Kt,Zt;const{parsedMap:Gt}=(Ut==null?void 0:Ut.source)??{};if(Gt&<){const Qt=(Zt=(Kt=getParser((Xt=(qt=Ut==null?void 0:Ut.source)==null?void 0:qt.map)==null?void 0:Xt.format))==null?void 0:Kt.hydrate)==null?void 0:Zt.call(Kt,Gt);if(Qt){const Jt=(lt==null?void 0:lt.world)&&Qt.snap(lt.world);if(Jt){const en=(lt==null?void 0:lt.world)&&Qt.nodeAt(Jt);return{point:Jt,node:en,key:Ut.key,name:inferLayerName(Ut)}}}}}))},[Lt]),Nt=reactExports.useMemo(()=>!!Pt&&!!Bt.length&&{[Pt.key]:{primary:inferLayerName(Pt),items:{...lodashExports$1.reduce(Bt,(jt,Ut)=>({...jt,[`${Rt}-${Ut==null?void 0:Ut.key}-source`]:{primary:"Set as source",secondary:Ut==null?void 0:Ut.name,action:()=>Dt(produce(Pt,Gt=>{lodashExports$1.set(Gt,"source.start",Ut==null?void 0:Ut.node),lodashExports$1.set(Gt,"source.query",void 0),lodashExports$1.set(Gt,"source.mapLayerKey",Ut==null?void 0:Ut.key),lodashExports$1.set(Gt,"source.trace",void 0)})),icon:jsxRuntimeExports.jsx(StartIcon,{sx:{transform:"scale(0.5)"}})},[`${Rt}-${Ut==null?void 0:Ut.key}-destination`]:{primary:"Set as destination",secondary:Ut==null?void 0:Ut.name,action:()=>Dt(produce(Pt,Gt=>{lodashExports$1.set(Gt,"source.end",Ut==null?void 0:Ut.node),lodashExports$1.set(Gt,"source.query",void 0),lodashExports$1.set(Gt,"source.mapLayerKey",Ut==null?void 0:Ut.key),lodashExports$1.set(Gt,"source.trace",void 0)})),icon:jsxRuntimeExports.jsx(DestinationIcon,{})}}),{})}}},[Bt,Pt,Lt,Dt]);return jsxRuntimeExports.jsx(At,{event:lt,layer:Rt,children:jt=>_e==null?void 0:_e(lodashExports$1.merge(jt,Nt))})}};function getLayerHandler(_e){var lt;return layerHandlers[((lt=_e==null?void 0:_e.source)==null?void 0:lt.type)??""]}const layerHandlers={trace:controller$1,map:controller$2,query:controller};function inferLayerName(_e){var lt,Rt;return _e!=null&&_e.name?_e==null?void 0:_e.name:(lt=_e==null?void 0:_e.source)!=null&<.type?layerHandlers[(Rt=_e.source)==null?void 0:Rt.type].inferName(_e):"Untitled Layer"}function _typeof$1(_e){"@babel/helpers - typeof";return _typeof$1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(lt){return typeof lt}:function(lt){return lt&&typeof Symbol=="function"&<.constructor===Symbol&<!==Symbol.prototype?"symbol":typeof lt},_typeof$1(_e)}function toPrimitive(_e,lt){if(_typeof$1(_e)!="object"||!_e)return _e;var Rt=_e[Symbol.toPrimitive];if(Rt!==void 0){var At=Rt.call(_e,lt||"default");if(_typeof$1(At)!="object")return At;throw new TypeError("@@toPrimitive must return a primitive value.")}return(lt==="string"?String:Number)(_e)}function toPropertyKey(_e){var lt=toPrimitive(_e,"string");return _typeof$1(lt)=="symbol"?lt:String(lt)}function _defineProperty$1(_e,lt,Rt){return lt=toPropertyKey(lt),lt in _e?Object.defineProperty(_e,lt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):_e[lt]=Rt,_e}function ownKeys(_e,lt){var Rt=Object.keys(_e);if(Object.getOwnPropertySymbols){var At=Object.getOwnPropertySymbols(_e);lt&&(At=At.filter(function(Pt){return Object.getOwnPropertyDescriptor(_e,Pt).enumerable})),Rt.push.apply(Rt,At)}return Rt}function _objectSpread2(_e){for(var lt=1;lt"u"&&(Rt=lt,lt=void 0),typeof Rt<"u"){if(typeof Rt!="function")throw new Error(formatProdErrorMessage(1));return Rt(createStore$1)(_e,lt)}if(typeof _e!="function")throw new Error(formatProdErrorMessage(2));var Pt=_e,Dt=lt,Lt=[],Bt=Lt,Nt=!1;function jt(){Bt===Lt&&(Bt=Lt.slice())}function Ut(){if(Nt)throw new Error(formatProdErrorMessage(3));return Dt}function Gt(Zt){if(typeof Zt!="function")throw new Error(formatProdErrorMessage(4));if(Nt)throw new Error(formatProdErrorMessage(5));var Qt=!0;return jt(),Bt.push(Zt),function(){if(Qt){if(Nt)throw new Error(formatProdErrorMessage(6));Qt=!1,jt();var en=Bt.indexOf(Zt);Bt.splice(en,1),Lt=null}}}function qt(Zt){if(!isPlainObject(Zt))throw new Error(formatProdErrorMessage(7));if(typeof Zt.type>"u")throw new Error(formatProdErrorMessage(8));if(Nt)throw new Error(formatProdErrorMessage(9));try{Nt=!0,Dt=Pt(Dt,Zt)}finally{Nt=!1}for(var Qt=Lt=Bt,Jt=0;Jt=0;At--){var Pt=lt[At](_e);if(Pt)return Pt}return function(Dt,Lt){throw new Error("Invalid value of type "+typeof _e+" for "+Rt+" argument when connecting component "+Lt.wrappedComponentName+".")}}function strictEqual(_e,lt){return _e===lt}function createConnect(_e){var lt=_e===void 0?{}:_e,Rt=lt.connectHOC,At=Rt===void 0?connectAdvanced:Rt,Pt=lt.mapStateToPropsFactories,Dt=Pt===void 0?defaultMapStateToPropsFactories:Pt,Lt=lt.mapDispatchToPropsFactories,Bt=Lt===void 0?defaultMapDispatchToPropsFactories:Lt,Nt=lt.mergePropsFactories,jt=Nt===void 0?defaultMergePropsFactories:Nt,Ut=lt.selectorFactory,Gt=Ut===void 0?finalPropsSelectorFactory:Ut;return function(Xt,Kt,Zt,Qt){Qt===void 0&&(Qt={});var Jt=Qt,en=Jt.pure,tn=en===void 0?!0:en,an=Jt.areStatesEqual,cn=an===void 0?strictEqual:an,un=Jt.areOwnPropsEqual,rn=un===void 0?shallowEqual:un,sn=Jt.areStatePropsEqual,pn=sn===void 0?shallowEqual:sn,bn=Jt.areMergedPropsEqual,gn=bn===void 0?shallowEqual:bn,_n=_objectWithoutPropertiesLoose$3(Jt,_excluded),xn=match(Xt,Dt,"mapStateToProps"),ln=match(Kt,Bt,"mapDispatchToProps"),Mn=match(Zt,jt,"mergeProps");return At(Gt,_extends$2({methodName:"connect",getDisplayName:function(An){return"Connect("+An+")"},shouldHandleStateChanges:!!Xt,initMapStateToProps:xn,initMapDispatchToProps:ln,initMergeProps:Mn,pure:tn,areStatesEqual:cn,areOwnPropsEqual:rn,areStatePropsEqual:pn,areMergedPropsEqual:gn},_n))}}const connect$1=createConnect();setBatch(reactDomExports.unstable_batchedUpdates);function areInputsEqual$1(_e,lt){if(_e.length!==lt.length)return!1;for(var Rt=0;Rt<_e.length;Rt++)if(_e[Rt]!==lt[Rt])return!1;return!0}function useMemoOne(_e,lt){var Rt=reactExports.useState(function(){return{inputs:lt,result:_e()}})[0],At=reactExports.useRef(!0),Pt=reactExports.useRef(Rt),Dt=At.current||!!(lt&&Pt.current.inputs&&areInputsEqual$1(lt,Pt.current.inputs)),Lt=Dt?Pt.current:{inputs:lt,result:_e()};return reactExports.useEffect(function(){At.current=!1,Pt.current=Lt},[Lt]),Lt.result}function useCallbackOne(_e,lt){return useMemoOne(function(){return _e},lt)}var useMemo=useMemoOne,useCallback=useCallbackOne,isProduction=!0,prefix$2="Invariant failed";function invariant$1(_e,lt){if(!_e){if(isProduction)throw new Error(prefix$2);var Rt=typeof lt=="function"?lt():lt,At=Rt?"".concat(prefix$2,": ").concat(Rt):prefix$2;throw new Error(At)}}var getRect=function _e(lt){var Rt=lt.top,At=lt.right,Pt=lt.bottom,Dt=lt.left,Lt=At-Dt,Bt=Pt-Rt,Nt={top:Rt,right:At,bottom:Pt,left:Dt,width:Lt,height:Bt,x:Dt,y:Rt,center:{x:(At+Dt)/2,y:(Pt+Rt)/2}};return Nt},expand=function _e(lt,Rt){return{top:lt.top-Rt.top,left:lt.left-Rt.left,bottom:lt.bottom+Rt.bottom,right:lt.right+Rt.right}},shrink=function _e(lt,Rt){return{top:lt.top+Rt.top,left:lt.left+Rt.left,bottom:lt.bottom-Rt.bottom,right:lt.right-Rt.right}},shift=function _e(lt,Rt){return{top:lt.top+Rt.y,left:lt.left+Rt.x,bottom:lt.bottom+Rt.y,right:lt.right+Rt.x}},noSpacing$1={top:0,right:0,bottom:0,left:0},createBox=function _e(lt){var Rt=lt.borderBox,At=lt.margin,Pt=At===void 0?noSpacing$1:At,Dt=lt.border,Lt=Dt===void 0?noSpacing$1:Dt,Bt=lt.padding,Nt=Bt===void 0?noSpacing$1:Bt,jt=getRect(expand(Rt,Pt)),Ut=getRect(shrink(Rt,Lt)),Gt=getRect(shrink(Ut,Nt));return{marginBox:jt,borderBox:getRect(Rt),paddingBox:Ut,contentBox:Gt,margin:Pt,border:Lt,padding:Nt}},parse$6=function _e(lt){var Rt=lt.slice(0,-2),At=lt.slice(-2);if(At!=="px")return 0;var Pt=Number(Rt);return isNaN(Pt)&&invariant$1(!1),Pt},getWindowScroll$1=function _e(){return{x:window.pageXOffset,y:window.pageYOffset}},offset=function _e(lt,Rt){var At=lt.borderBox,Pt=lt.border,Dt=lt.margin,Lt=lt.padding,Bt=shift(At,Rt);return createBox({borderBox:Bt,border:Pt,margin:Dt,padding:Lt})},withScroll=function _e(lt,Rt){return Rt===void 0&&(Rt=getWindowScroll$1()),offset(lt,Rt)},calculateBox=function _e(lt,Rt){var At={top:parse$6(Rt.marginTop),right:parse$6(Rt.marginRight),bottom:parse$6(Rt.marginBottom),left:parse$6(Rt.marginLeft)},Pt={top:parse$6(Rt.paddingTop),right:parse$6(Rt.paddingRight),bottom:parse$6(Rt.paddingBottom),left:parse$6(Rt.paddingLeft)},Dt={top:parse$6(Rt.borderTopWidth),right:parse$6(Rt.borderRightWidth),bottom:parse$6(Rt.borderBottomWidth),left:parse$6(Rt.borderLeftWidth)};return createBox({borderBox:lt,margin:At,padding:Pt,border:Dt})},getBox=function _e(lt){var Rt=lt.getBoundingClientRect(),At=window.getComputedStyle(lt);return calculateBox(Rt,At)},safeIsNaN=Number.isNaN||function _e(lt){return typeof lt=="number"&<!==lt};function isEqual$2(_e,lt){return!!(_e===lt||safeIsNaN(_e)&&safeIsNaN(lt))}function areInputsEqual(_e,lt){if(_e.length!==lt.length)return!1;for(var Rt=0;Rt<_e.length;Rt++)if(!isEqual$2(_e[Rt],lt[Rt]))return!1;return!0}function memoizeOne(_e,lt){lt===void 0&&(lt=areInputsEqual);var Rt,At=[],Pt,Dt=!1;function Lt(){for(var Bt=[],Nt=0;Nt");return At.callbacks},At.setCallbacks=function(Bt){At.callbacks=Bt},At}var Rt=lt.prototype;return Rt.componentDidMount=function(){this.unbind=bindEvents(window,[{eventName:"error",fn:this.onWindowError}])},Rt.componentDidCatch=function(Pt){if(Pt instanceof RbdInvariant){this.setState({});return}throw Pt},Rt.componentWillUnmount=function(){this.unbind()},Rt.render=function(){return this.props.children(this.setCallbacks)},lt}(React.Component),dragHandleUsageInstructions=` +`+Bt+"}":"{ "+Nt.join(", ")+" }":"{"+Nt.join(",")+"}",gap=Bt,Dt}}function beautify(_e,lt,Rt,At){var Pt;if(gap="",indent="",At||(At=0),typeof At!="number")throw new Error("beaufifier: limit must be a number");if(typeof Rt=="number")for(Pt=0;Pt+Pt);return Math.abs(At)>4?jsxRuntimeExports.jsxs("span",{children:[Rt,"x10",jsxRuntimeExports.jsx("sup",{style:supProps,children:At})]}):lodashExports$1.round(_e,2)}else return _e;case"string":return lodashExports$1.startCase(`${_e}`);case"undefined":return"null";default:return lt?jsxRuntimeExports.jsx("code",{children:lodashExports$1.isNull(_e)?"null":lodashExports$1.get(_e,"constructor.name")??typeof _e}):jsxRuntimeExports.jsx("code",{style:{whiteSpace:"pre"},children:lodashExports$1.truncate(beautify$1(_e,void 0,2),{length:100})})}}function Property({label:_e,value:lt,type:Rt,simple:At}){return jsxRuntimeExports.jsxs(Flex,{width:"auto",mr:2,mb:.5,alignItems:"baseline",children:[jsxRuntimeExports.jsx(Type$1,{component:"div",variant:"body2",...Rt,sx:{opacity:.54,...Rt==null?void 0:Rt.sx},children:_e}),jsxRuntimeExports.jsx(Space,{}),jsxRuntimeExports.jsx(Type$1,{component:"div",variant:"body2",...Rt,children:renderProperty(lt,At)??"none"})]},`${_e}::${renderProperty(lt)}`)}const OMIT_PROPS=["type","id"],ESSENTIAL_PROPS=["f","g","pId"],ALL_PROPS=[...OMIT_PROPS,...ESSENTIAL_PROPS],sortEventKeys=_e=>lodashExports$1.chain(_e).entries().filter(([,lt])=>!lodashExports$1.isUndefined(lt)).sortBy(([lt])=>lodashExports$1.indexOf(ALL_PROPS,lt)+1||Number.MAX_SAFE_INTEGER).value();function PropertyDialog({event:_e,max:lt=10,simple:Rt,variant:At,...Pt}){const Dt=sortEventKeys(_e);return jsxRuntimeExports.jsx(ManagedModal,{...lodashExports$1.merge({appBar:{children:jsxRuntimeExports.jsx(AppBarTitle,{children:"Event Properties"})},trigger:Lt=>jsxRuntimeExports.jsxs(Button$2,{variant:"text",sx:{mx:-1,minWidth:0,width:"fit-content",color:Bt=>Bt.palette.text.secondary,justifyContent:"left"},onClick:Bt=>{Bt.stopPropagation(),Bt.preventDefault(),Lt(Bt)},children:[Dt.length-lt," more"]})},Pt),children:[{name:"common",props:lodashExports$1.filter(Dt,([Lt])=>OMIT_PROPS.includes(Lt))},{name:"search",props:lodashExports$1.filter(Dt,([Lt])=>ESSENTIAL_PROPS.includes(Lt))},{name:"other",props:lodashExports$1.filter(Dt,([Lt])=>!ALL_PROPS.includes(Lt))}].map(({name:Lt,props:Bt},Nt)=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[!!Nt&&jsxRuntimeExports.jsx(Divider$1,{sx:{mb:1}}),jsxRuntimeExports.jsx(Type$1,{variant:"overline",color:"text.secondary",component:"div",sx:{px:3},children:lodashExports$1.startCase(Lt)}),jsxRuntimeExports.jsx(Box$1,{sx:{p:1,pt:0,display:"grid",gridAutoFlow:"row",gridTemplateColumns:"repeat(2, 1fr)"},children:lodashExports$1.map(Bt,([jt,Ut])=>jsxRuntimeExports.jsx(ListItem$1,{sx:{py:.5},children:jsxRuntimeExports.jsx(ListItemText$1,{secondary:jt,primary:renderProperty(Ut)})},`${jt}::${Ut}`))},Lt)]}))})}function PropertyList(_e){const{event:lt,variant:Rt="body2",max:At=10,simple:Pt,...Dt}=_e,Lt=sortEventKeys(lt);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs(Flex,{...Dt,children:[lodashExports$1.map(lodashExports$1.slice(Lt,0,At),([Bt,Nt],jt)=>jsxRuntimeExports.jsx(Property,{label:Bt,value:Nt,type:{variant:Rt},simple:Pt},jt)),Lt.length>At&&!Pt&&jsxRuntimeExports.jsx(PropertyDialog,{..._e})]})})}function TracePreview({trace:_e,language:lt="json"}){return jsxRuntimeExports.jsx(Box$1,{sx:{width:"100%",height:"100%"},children:jsxRuntimeExports.jsx(ScriptViewer,{options:{readOnly:!0},language:lt,value:_e?beautify$1({..._e,events:lodashExports$1.take(_e.events,10)},null,2,1):"No data"})})}var dist$4={exports:{}};(function(_e,lt){(function(Rt,At){_e.exports=At()})(commonjsGlobal,function(){return function(Rt){function At(Dt){if(Pt[Dt])return Pt[Dt].exports;var Lt=Pt[Dt]={i:Dt,l:!1,exports:{}};return Rt[Dt].call(Lt.exports,Lt,Lt.exports,At),Lt.l=!0,Lt.exports}var Pt={};return At.m=Rt,At.c=Pt,At.d=function(Dt,Lt,Bt){At.o(Dt,Lt)||Object.defineProperty(Dt,Lt,{configurable:!1,enumerable:!0,get:Bt})},At.n=function(Dt){var Lt=Dt&&Dt.__esModule?function(){return Dt.default}:function(){return Dt};return At.d(Lt,"a",Lt),Lt},At.o=function(Dt,Lt){return Object.prototype.hasOwnProperty.call(Dt,Lt)},At.p="",At(At.s=1)}([function(Rt,At,Pt){function Dt(Bt){var Nt=Bt===void 0?{}:Bt,jt=Nt.ESCAPE,Ut=jt===void 0?/^\\/:jt,Gt=Nt.VARIABLE_START,qt=Gt===void 0?/^\${\s*/:Gt,Xt=Nt.VARIABLE_END,Kt=Xt===void 0?/^\s*}/:Xt,Zt=Nt.PIPE_START,Qt=Zt===void 0?/^\s*\|\s*/:Zt,Jt=Nt.PIPE_PARAMETER_START,en=Jt===void 0?/^\s*:\s*/:Jt,tn=Nt.QUOTED_STRING,an=tn===void 0?At.DEFAULT_QUOTED_STRING_REGEX:tn,cn=Nt.QUOTED_STRING_TEST,un=cn===void 0?null:cn,rn=Nt.QUOTED_STRING_GET_AND_ADVANCE,sn=rn===void 0?null:rn,pn=Nt.QUOTED_STRING_IN_PARAMETER_TEST,bn=pn===void 0?null:pn,gn=Nt.QUOTED_STRING_IN_PARAMETER_GET_AND_ADVANCE,_n=gn===void 0?null:gn,xn=un||function(An){return an.test(An)},ln=sn||Lt(an),Mn=bn||function(An){return an.test(An)},Tn=_n||Lt(an);return function(An){function Cn(yr){yr===void 0&&(yr=1),dn=dn.substr(yr)}function wn(yr){yr===void 0&&(yr=/^/),Cn(dn.match(yr)[0].length)}function Fn(){var yr;return wn(Ut),yr=dn.length>0?dn[0]:"",Cn(),yr}function $n(yr){var br=(yr===void 0?{}:yr).isNull,Er=br!==void 0&&br;Gn={name:"",pipes:[]},er=!Er}function Pn(){hn.variables.push(Gn),$n({isNull:!0})}function Vn(yr){var br=(yr===void 0?{}:yr).isNull,Er=br!==void 0&&br;Sn={name:"",parameters:[]},Yn=!Er}function Zn(){Gn.pipes.push(Sn),Vn({isNull:!0})}function tr(yr){var br=(yr===void 0?{}:yr).isNull,Er=br!==void 0&&br;Kn="",dr=!Er}function yn(){Sn.parameters.push(Kn),tr({isNull:!0})}function En(){return!!Kt.test(dn)&&(wn(Kt),vn>=3&&yn(),vn>=2&&Zn(),vn>=1&&Pn(),vn=0,!0)}function kn(){return!!Qt.test(dn)&&(wn(Qt),vn>=3&&yn(),vn>=2&&Zn(),vn>=1&&Vn(),vn=2,!0)}function zn(){return!!en.test(dn)&&(wn(en),vn>=3&&yn(),vn>=2&&tr(),vn=3,!0)}for(var dn=An,hn={literals:[],variables:[]},vn=0,Bn="",Gn={name:"",pipes:[]},Sn={name:"",parameters:[]},Kn="",er=!1,Yn=!1,dr=!1;dn&&dn.length>0;)switch(vn){case 0:if(Ut.test(dn)){Bn+=Fn();continue}if(qt.test(dn)){vn=1,$n(),hn.literals.push(Bn),Bn="",wn(qt);continue}Bn+=dn[0],Cn();break;case 1:if(Ut.test(dn)){Gn.name+=Fn();continue}if(En()||kn())continue;if(xn(dn)){Gn.name+=ln(dn,Cn);continue}Gn.name+=dn[0],Cn();break;case 2:if(Ut.test(dn)){Sn.name+=Fn();continue}if(En()||zn()||kn())continue;if(xn(dn)){Sn.name+=ln(dn,Cn);continue}Sn.name+=dn[0],Cn();break;case 3:if(Ut.test(dn)){Kn+=Fn();continue}if(En()||zn()||kn())continue;if(Mn(dn)){Kn+=Tn(dn,Cn);continue}Kn+=dn[0],Cn()}return dr&&Sn.parameters.push(Kn),Yn&&Gn.pipes.push(Sn),er&&hn.variables.push(Gn),hn.literals.push(Bn),hn}}function Lt(Bt){return function(Nt,jt){var Ut=Nt.match(Bt);return jt(Ut[0].length),Ut.slice(2).join("").replace("\\\\","\\")}}Object.defineProperty(At,"__esModule",{value:!0}),At.DEFAULT_QUOTED_STRING_REGEX=/^('((?:[^'\\]|\\.)*)'|'((?:[^'\\]|\\.)*)$|"((?:[^"\\]|\\.)*)"|"((?:[^"\\]|\\.)*)$)/,At.parseStringTemplateGenerator=Dt,At.parseStringTemplate=Dt(),At.getQuotedStringAndAdvanceForRegex=Lt},function(Rt,At,Pt){Rt.exports=Pt(2)},function(Rt,At,Pt){function Dt(Lt){for(var Bt in Lt)At.hasOwnProperty(Bt)||(At[Bt]=Lt[Bt])}Object.defineProperty(At,"__esModule",{value:!0}),Dt(Pt(0)),Dt(Pt(3))},function(Rt,At,Pt){function Dt(Ut){return function(Gt){return Ut.hasOwnProperty(Gt)?Ut[Gt]:Gt.split(".").reduce(function(qt,Xt){return qt.hasOwnProperty(Xt)?qt[Xt]:""},Ut)}}function Lt(Ut,Gt,qt,Xt){Xt===void 0&&(Xt=Dt(Gt));var Kt=Xt(Ut.name);return Ut.pipes.reduce(function(Zt,Qt){return qt.hasOwnProperty(Qt.name)?qt[Qt.name](Zt,Qt.parameters):Zt},Kt??"")}function Bt(Ut,Gt,qt,Xt){return Xt===void 0&&(Xt=Dt(Gt)),Ut.literals.length===0?"":Ut.literals.slice(1).reduce(function(Kt,Zt,Qt){return""+Kt+Lt(Ut.variables[Qt],Gt,qt,Xt)+Zt},Ut.literals[0])}function Nt(Ut,Gt,qt){return Bt(jt.parseStringTemplate(Ut),Gt,qt)}Object.defineProperty(At,"__esModule",{value:!0});var jt=Pt(0);At.evaluateParsedString=Bt,At.evaluateStringTemplate=Nt}])})})(dist$4);var distExports=dist$4.exports;function mapProperties(_e={},lt){const Rt={};for(const At of Object.keys(_e))Rt[At]=At==="$"?_e[At]:lt(_e[At],At,_e);return Object.setPrototypeOf(Rt,_e)}function parseProperty(_e){switch(_e==null?void 0:_e.constructor){case Array:{const lt=lodashExports$1.map(_e,parseProperty);return Rt=>lodashExports$1.map(lt,At=>At(Rt))}case Object:{const lt=lodashExports$1.mapValues(_e,parseProperty);return Rt=>lodashExports$1.mapValues(lt,At=>At(Rt))}case String:return parseString(_e);default:return()=>_e}}function normalize(_e={}){return mapProperties(_e,lt=>lodashExports$1.isFunction(lt)?lt:parseProperty(lt))}const parseToken=_e=>{const lt=Function("$",`return ${_e};`);return Rt=>lt(new Proxy(normalize(Rt),{get(At,Pt){return typeof(At==null?void 0:At[Pt])=="function"?At[Pt]({}):At==null?void 0:At[Pt]}}))},openBrace=/^\{\{\s*/,closeBrace=/^\s*\}\}/,neverMatch=/\b\B/,parser$1=distExports.parseStringTemplateGenerator({VARIABLE_START:openBrace,VARIABLE_END:closeBrace,PIPE_START:neverMatch,PIPE_PARAMETER_START:neverMatch,QUOTED_STRING:neverMatch}),parseString=memo(_e=>{const lt=parser$1(_e);return lodashExports$1.join(lt.literals,"")?Rt=>distExports.evaluateParsedString(lt,{},{},At=>parseToken(At)(Rt)):parseToken(lt.variables[0].name)},{primitive:!0});function commonjsRequire(_e){throw new Error('Could not dynamically require "'+_e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pluralize$1={exports:{}};(function(_e,lt){(function(Rt,At){typeof commonjsRequire=="function"?_e.exports=At():Rt.pluralize=At()})(commonjsGlobal,function(){var Rt=[],At=[],Pt={},Dt={},Lt={};function Bt(Zt){return typeof Zt=="string"?new RegExp("^"+Zt+"$","i"):Zt}function Nt(Zt,Qt){return Zt===Qt?Qt:Zt===Zt.toLowerCase()?Qt.toLowerCase():Zt===Zt.toUpperCase()?Qt.toUpperCase():Zt[0]===Zt[0].toUpperCase()?Qt.charAt(0).toUpperCase()+Qt.substr(1).toLowerCase():Qt.toLowerCase()}function jt(Zt,Qt){return Zt.replace(/\$(\d{1,2})/g,function(Jt,en){return Qt[en]||""})}function Ut(Zt,Qt){return Zt.replace(Qt[0],function(Jt,en){var tn=jt(Qt[1],arguments);return Nt(Jt===""?Zt[en-1]:Jt,tn)})}function Gt(Zt,Qt,Jt){if(!Zt.length||Pt.hasOwnProperty(Zt))return Qt;for(var en=Jt.length;en--;){var tn=Jt[en];if(tn[0].test(Qt))return Ut(Qt,tn)}return Qt}function qt(Zt,Qt,Jt){return function(en){var tn=en.toLowerCase();return Qt.hasOwnProperty(tn)?Nt(en,tn):Zt.hasOwnProperty(tn)?Nt(en,Zt[tn]):Gt(tn,en,Jt)}}function Xt(Zt,Qt,Jt,en){return function(tn){var an=tn.toLowerCase();return Qt.hasOwnProperty(an)?!0:Zt.hasOwnProperty(an)?!1:Gt(an,an,Jt)===an}}function Kt(Zt,Qt,Jt){var en=Qt===1?Kt.singular(Zt):Kt.plural(Zt);return(Jt?Qt+" ":"")+en}return Kt.plural=qt(Lt,Dt,Rt),Kt.isPlural=Xt(Lt,Dt,Rt),Kt.singular=qt(Dt,Lt,At),Kt.isSingular=Xt(Dt,Lt,At),Kt.addPluralRule=function(Zt,Qt){Rt.push([Bt(Zt),Qt])},Kt.addSingularRule=function(Zt,Qt){At.push([Bt(Zt),Qt])},Kt.addUncountableRule=function(Zt){if(typeof Zt=="string"){Pt[Zt.toLowerCase()]=!0;return}Kt.addPluralRule(Zt,"$0"),Kt.addSingularRule(Zt,"$0")},Kt.addIrregularRule=function(Zt,Qt){Qt=Qt.toLowerCase(),Zt=Zt.toLowerCase(),Lt[Zt]=Qt,Dt[Qt]=Zt},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach(function(Zt){return Kt.addIrregularRule(Zt[0],Zt[1])}),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach(function(Zt){return Kt.addPluralRule(Zt[0],Zt[1])}),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(function(Zt){return Kt.addSingularRule(Zt[0],Zt[1])}),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(Kt.addUncountableRule),Kt})})(pluralize$1);var pluralizeExports=pluralize$1.exports;const pluralize=getDefaultExportFromCjs(pluralizeExports),parseTraceWorkerUrl=""+new URL("parseTrace.worker-413a1f44.js",import.meta.url).href;class ParseTraceWorker extends Worker{constructor(){super(parseTraceWorkerUrl,{type:"module"})}}const parseTraceAsync=usingMemoizedWorkerTask(ParseTraceWorker);function useTraceParser(_e){const lt=useSnackbar(),Rt=useLoadingState("specimen");return reactExports.useCallback(()=>Rt(async()=>{var At;if(_e!=null&&_e.trace){lt("Processing trace...");try{const Pt=await parseTraceAsync(_e);return lt("Trace loaded",pluralize("step",((At=Pt==null?void 0:Pt.stepsPersistent)==null?void 0:At.length)??0,!0)),{components:Pt,content:_e.trace}}catch(Pt){return console.error(Pt),lt("Error parsing",lodashExports$1.get(Pt,"message")),{error:lodashExports$1.get(Pt,"message")}}}}),[_e])}function useTraceContent(_e){const lt=useSnackbar(),Rt=useLoadingState("specimen"),At=useConnectionResolver(),[{traces:Pt}]=useFeatures(),Dt=reactExports.useMemo(()=>memo(async({source:Ut,id:Gt})=>{if(Ut&&Gt){const qt=At({url:Ut});if(qt){lt("Fetching trace...");const Xt=await qt.transport().call("features/trace",{id:Gt});return Xt==null?void 0:Xt.content}}},{normalizer:JSON.stringify}),[At,lt]),{content:Lt,source:Bt,id:Nt}=_e??{},{lastModified:jt}=lodashExports$1.find(Pt,{id:Nt,source:Bt})??{};return useAsync(()=>Rt(async()=>{if(Nt)return{..._e,content:Lt||await Dt({source:Bt,id:Nt,lastModified:jt})}}),[Dt,Lt,Bt,Nt,jt])}const isNullish=_e=>_e==null;function makePathIndex(_e){const lt=[],Rt={},At={},Pt=lodashExports$1.chain(_e==null?void 0:_e.events).map((Bt,Nt)=>({step:Nt,id:Bt.id,pId:Bt.pId})).groupBy("id").value();lodashExports$1.forEach(_e==null?void 0:_e.events,({id:Bt,pId:Nt},jt)=>{!isNullish(Nt)&&Rt[Bt]!==Nt&&(lt.push({id:Bt,pId:Nt,step:jt,prev:lodashExports$1.last(lt)}),Rt[Bt]=Nt),At[jt]=lodashExports$1.last(lt)});const Dt=(Bt,Nt=(jt=>(jt=_e==null?void 0:_e.events)==null?void 0:jt.length)()??0)=>{let Ut=At[Nt];for(;Ut;){if(Ut.id===Bt)return Ut.pId;Ut=Ut.prev}};return{getParent:Dt,getPath:Bt=>{const Nt=[Bt];let jt={...(_e.events??[])[Bt],step:Bt};for(;jt;){const Ut=Dt(jt.id,jt.step);if(Ut){const Gt=lodashExports$1.findLast(Pt[Ut],qt=>qt.step<=jt.step);if(Gt)Nt.push(Gt.step),jt=Gt;else break}else break}return Nt}}}const controller$1={key:"trace",icon:jsxRuntimeExports.jsx(RouteTwoTone,{}),inferName:_e=>{var lt,Rt;return((Rt=(lt=_e.source)==null?void 0:lt.trace)==null?void 0:Rt.name)??"Untitled Trace"},error:_e=>{var lt,Rt,At,Pt;return((Rt=(lt=_e==null?void 0:_e.source)==null?void 0:lt.trace)==null?void 0:Rt.error)||((Pt=(At=_e==null?void 0:_e.source)==null?void 0:At.parsedTrace)==null?void 0:Pt.error)},claimImportedFile:async _e=>isTraceFormat(_e)?{claimed:!0,layer:async lt=>{lt("Opening trace...");try{return{trace:{...await readUploadedTrace(_e).read()}}}catch(Rt){return console.error(Rt),lt(`Error opening, ${lodashExports$1.get(Rt,"message")}`),{trace:{key:nanoid$1(),id:custom$1().id,error:lodashExports$1.get(Rt,"message"),name:lodashExports$1.startCase(name$2(_e.name))}}}}}:{claimed:!1},editor:withProduce(({value:_e,produce:lt})=>{var Rt,At,Pt,Dt,Lt,Bt,Nt,jt,Ut,Gt,qt;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Option,{label:"Trace",content:jsxRuntimeExports.jsx(TracePicker,{onChange:Xt=>lt(Kt=>lodashExports$1.set(Kt,"source.trace",Xt)),value:(Rt=_e==null?void 0:_e.source)==null?void 0:Rt.trace})}),((Pt=(At=_e==null?void 0:_e.source)==null?void 0:At.trace)==null?void 0:Pt.error)&&jsxRuntimeExports.jsx(Type$1,{variant:"body2",color:Xt=>Xt.palette.error.main,sx:{whiteSpace:"pre-wrap",mb:1,mt:1},children:jsxRuntimeExports.jsx("code",{children:(Lt=(Dt=_e==null?void 0:_e.source)==null?void 0:Dt.trace)==null?void 0:Lt.error})}),((Nt=(Bt=_e==null?void 0:_e.source)==null?void 0:Bt.parsedTrace)==null?void 0:Nt.error)&&jsxRuntimeExports.jsx(Type$1,{variant:"body2",color:Xt=>Xt.palette.error.main,sx:{whiteSpace:"pre-wrap",mb:1,mt:1},children:jsxRuntimeExports.jsx("code",{children:(Ut=(jt=_e==null?void 0:_e.source)==null?void 0:jt.parsedTrace)==null?void 0:Ut.error})}),jsxRuntimeExports.jsx(Heading,{label:"Preview"}),jsxRuntimeExports.jsx(Box$1,{sx:{height:240,mx:-2},children:jsxRuntimeExports.jsx(TracePreview,{trace:(qt=(Gt=_e==null?void 0:_e.source)==null?void 0:Gt.parsedTrace)==null?void 0:qt.content})})]})}),service:withProduce(({value:_e,produce:lt})=>{var Dt,Lt,Bt;const{palette:Rt}=useTheme(),{result:At}=useTraceContent((Dt=_e==null?void 0:_e.source)==null?void 0:Dt.trace),Pt=useTraceParser({trace:At==null?void 0:At.content,context:{color:colorsHex,themeAccent:Rt.primary.main,themeTextPrimary:Rt.text.primary,themeBackground:Rt.background.paper},view:"main"});return reactExports.useEffect(()=>{lt(Nt=>{var jt,Ut;return lodashExports$1.set(Nt,"source.playbackTo",((Ut=(jt=At==null?void 0:At.content)==null?void 0:jt.events)==null?void 0:Ut.length)??0)})},[(Bt=(Lt=At==null?void 0:At.content)==null?void 0:Lt.events)==null?void 0:Bt.length]),useEffectWhen(async()=>{const Nt=await Pt();lt(jt=>{lodashExports$1.set(jt,"source.parsedTrace",Nt),lodashExports$1.set(jt,"viewKey",nanoid$1())})},[Pt],[At==null?void 0:At.key]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(PlaybackService,{value:_e})})}),renderer:({layer:_e,index:lt})=>{var Nt,jt,Ut;const Rt=(jt=(Nt=_e==null?void 0:_e.source)==null?void 0:Nt.parsedTrace)==null?void 0:jt.components,At=useThrottle$1(((Ut=_e==null?void 0:_e.source)==null?void 0:Ut.step)??0,1e3/60),Pt=use2DPath(_e,lt,At),Dt=reactExports.useMemo(()=>lodashExports$1.map(Rt==null?void 0:Rt.stepsPersistent,Gt=>lodashExports$1.map(Gt,qt=>lodashExports$1.merge(qt,{meta:{sourceLayer:_e==null?void 0:_e.key,sourceLayerIndex:lt,sourceLayerAlpha:1-.01*+((_e==null?void 0:_e.transparency)??0),sourceLayerDisplayMode:(_e==null?void 0:_e.displayMode)??"source-over"}}))),[Rt==null?void 0:Rt.stepsPersistent,_e==null?void 0:_e.key,_e==null?void 0:_e.transparency,_e==null?void 0:_e.displayMode,lt]),Lt=reactExports.useMemo(()=>lodashExports$1.map(Rt==null?void 0:Rt.stepsTransient,Gt=>lodashExports$1.map(Gt,qt=>lodashExports$1.merge(qt,{meta:{sourceLayer:_e==null?void 0:_e.key,sourceLayerIndex:lt,sourceLayerAlpha:1-.01*+((_e==null?void 0:_e.transparency)??0),sourceLayerDisplayMode:(_e==null?void 0:_e.displayMode)??"source-over"}}))),[Rt==null?void 0:Rt.stepsTransient,_e==null?void 0:_e.key,_e==null?void 0:_e.transparency,_e==null?void 0:_e.displayMode,lt]),Bt=reactExports.useMemo(()=>[Lt[At]??[]],[Lt,At]);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(LazyNodeList,{step:At,nodes:Dt}),jsxRuntimeExports.jsx(NodeList,{nodes:Bt}),Pt]})},steps:_e=>{var lt,Rt,At;return((At=(Rt=(lt=_e==null?void 0:_e.source)==null?void 0:lt.parsedTrace)==null?void 0:Rt.content)==null?void 0:At.events)??[]},provideSelectionInfo:({layer:_e,event:lt,children:Rt})=>{const{layer:At,setLayer:Pt}=useLayer(_e),Dt=reactExports.useMemo(()=>{var jt,Ut,Gt,qt,Xt;const Lt=((Gt=(Ut=(jt=At==null?void 0:At.source)==null?void 0:jt.parsedTrace)==null?void 0:Ut.content)==null?void 0:Gt.events)??[],Bt=lodashExports$1.chain((qt=lt==null?void 0:lt.info)==null?void 0:qt.components).filter(Kt=>{var Zt;return((Zt=Kt.meta)==null?void 0:Zt.sourceLayer)===(At==null?void 0:At.key)}).map(Kt=>{var Zt;return(Zt=Kt.meta)==null?void 0:Zt.step}).filter(lodashExports$1.negate(lodashExports$1.isUndefined)).sort((Kt,Zt)=>Kt-Zt).value(),Nt=lodashExports$1.chain((Xt=lt==null?void 0:lt.info)==null?void 0:Xt.components).filter(Kt=>{var Zt;return((Zt=Kt.meta)==null?void 0:Zt.sourceLayer)===(At==null?void 0:At.key)}).filter(Kt=>{var Zt;return(Zt=Kt.meta)==null?void 0:Zt.info}).value();if(Bt.length&&At){const Kt=lodashExports$1.last(Bt),Zt=Lt[Kt];if(Zt)return{...lodashExports$1.keyBy(lodashExports$1.map(Nt,(Qt,Jt)=>({key:`${At.key}.${Jt}`,primary:`Selection in ${inferLayerName(At)}`,items:{info:{index:-1,primary:jsxRuntimeExports.jsx(PropertyList,{event:Qt.meta.info,vertical:!0})}}})),"key"),[At.key]:{primary:inferLayerName(At),items:{properties:{index:-2,primary:jsxRuntimeExports.jsx(PropertyList,{event:Zt,vertical:!0})},[`${Zt}`]:{primary:`Go to Step ${Kt}`,secondary:`${lodashExports$1.startCase(Zt.type)}`,action:()=>Pt(produce(At,Qt=>{lodashExports$1.set(Qt,"source.step",Kt)})),icon:jsxRuntimeExports.jsx(ArrowOutwardRounded,{})}}}}}return{}},[At,lt]);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:Rt==null?void 0:Rt(Dt)})}};function use2DPath(_e,lt=0,Rt=0){var Lt,Bt,Nt;const{palette:At}=useTheme(),{getPath:Pt}=reactExports.useMemo(()=>{var jt,Ut,Gt;return((jt=_e==null?void 0:_e.source)==null?void 0:jt.playback)!=="playing"&&((Gt=(Ut=_e==null?void 0:_e.source)==null?void 0:Ut.parsedTrace)!=null&&Gt.content)?makePathIndex(_e.source.parsedTrace.content):{getParent:lodashExports$1.constant(void 0),getPath:lodashExports$1.constant([])}},[(Bt=(Lt=_e==null?void 0:_e.source)==null?void 0:Lt.parsedTrace)==null?void 0:Bt.content,(Nt=_e==null?void 0:_e.source)==null?void 0:Nt.playback]);return reactExports.useMemo(()=>{var jt,Ut,Gt,qt;if((qt=(Gt=(Ut=(jt=_e==null?void 0:_e.source)==null?void 0:jt.parsedTrace)==null?void 0:Ut.content)==null?void 0:Gt.render)!=null&&qt.path){const{pivot:Xt={},scale:Kt=1}=_e.source.parsedTrace.content.render.path,{x:Zt,y:Qt}=Xt,Jt=Zt?parseString(Zt):an=>an.event.x,en=Qt?parseString(Qt):an=>an.event.y,tn=lodashExports$1.map(Pt(Rt),an=>{var cn,un,rn,sn;return(sn=(rn=(un=(cn=_e==null?void 0:_e.source)==null?void 0:cn.parsedTrace)==null?void 0:un.content)==null?void 0:rn.events)==null?void 0:sn[an]});if(tn.length){const an=[{$:"rect",x:Jt({event:{x:0,y:0,...lodashExports$1.head(tn)}})-2*Kt/2,y:en({event:{x:0,y:0,...lodashExports$1.head(tn)}})-2*Kt/2,fill:getColorHex("destination"),width:2*Kt,height:2*Kt},{$:"rect",x:Jt({event:{x:0,y:0,...lodashExports$1.last(tn)}})-2*Kt/2,y:en({event:{x:0,y:0,...lodashExports$1.last(tn)}})-2*Kt/2,fill:getColorHex("source"),width:2*Kt,height:2*Kt},{$:"path",points:tn.map(cn=>({x:Jt({event:{x:0,y:0,...cn}}),y:en({event:{x:0,y:0,...cn}})})),fill:At.primary.main,alpha:1,lineWidth:1*Kt}];return jsxRuntimeExports.jsx(NodeList,{nodes:[lodashExports$1.map(an,cn=>({component:cn,meta:{source:"path",sourceLayerIndex:-99999+lt}}))]})}}return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})},[_e,lt,Rt,At,Pt])}async function findConnection(_e,lt,Rt){for(const At of _e){const Pt=await At.transport().call("features/algorithms"),Dt=await At.transport().call("features/formats");if(lodashExports$1.find(Pt,{id:lt})&&lodashExports$1.find(Dt,{id:Rt}))return At}}const controller={...lodashExports$1.omit(controller$1,"claimImportedFile"),key:"query",icon:jsxRuntimeExports.jsx(RouteTwoTone,{}),editor:withProduce(({value:_e,produce:lt})=>{var jt,Ut;const{algorithm:Rt}=(_e==null?void 0:_e.source)??{},{layers:At,allLayers:Pt,layer:Dt,key:Lt}=useLayer(void 0,Gt=>{var qt;return((qt=Gt.source)==null?void 0:qt.type)==="map"}),[{algorithms:Bt}]=useFeatures(),[Nt]=useConnections();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Option,{label:"Algorithm",content:jsxRuntimeExports.jsx(FeaturePicker,{arrow:!0,paper:!0,icon:jsxRuntimeExports.jsx(CodeOutlined,{}),label:"Algorithm",value:Rt,items:Bt.map(Gt=>{var qt;return{...Gt,description:(qt=lodashExports$1.find(Nt,{url:Gt.source}))==null?void 0:qt.name}}),onChange:async Gt=>lt(qt=>lodashExports$1.set(qt,"source.algorithm",Gt))})}),!(Bt!=null&&Bt.length)&&jsxRuntimeExports.jsx(Type$1,{variant:"body2",color:"warning.main",sx:{mb:1},children:"No connected solver has declared support for running algorithms"}),jsxRuntimeExports.jsx(Option,{label:"Map",content:jsxRuntimeExports.jsx(FeaturePicker,{arrow:!0,paper:!0,icon:jsxRuntimeExports.jsx(LayersIcon,{}),label:"Layer",value:Lt,items:Pt.map(Gt=>({id:Gt.key,hidden:!lodashExports$1.find(At,qt=>qt.key===Gt.key),name:inferLayerName(Gt)})),onChange:async Gt=>lt(qt=>lodashExports$1.set(qt,"source.mapLayerKey",Gt))})}),Dt&&jsxRuntimeExports.jsxs(Type$1,{variant:"body2",color:"text.secondary",sx:{mb:1,mt:1},children:["Define source and destination nodes by clicking on valid regions on"," ",inferLayerName(Dt)]}),jsxRuntimeExports.jsx(Heading,{label:"Preview"}),jsxRuntimeExports.jsx(Box$1,{sx:{height:240,mx:-2},children:jsxRuntimeExports.jsx(TracePreview,{trace:(Ut=(jt=_e==null?void 0:_e.source)==null?void 0:jt.trace)==null?void 0:Ut.content})})]})}),service:withProduce(({value:_e,produce:lt,onChange:Rt})=>{const At=controller$1.service,Pt=useSnackbar(),{algorithm:Dt,mapLayerKey:Lt,start:Bt,end:Nt}=(_e==null?void 0:_e.source)??{},[{layers:jt}]=useLayers(),[Ut]=useConnections(),[{algorithms:Gt}]=useFeatures(),qt=reactExports.useMemo(()=>{if(Lt&&Dt)return lodashExports$1.find(jt,{key:Lt})},[Lt,Dt,jt]);return useEffectWhenAsync(async Xt=>{var Kt;if(qt&&Dt){const{format:Zt,content:Qt}=((Kt=qt==null?void 0:qt.source)==null?void 0:Kt.map)??{};if(Zt&&Qt){const Jt=await findConnection(Ut,Dt,Zt),en=lodashExports$1.find(Gt,{id:Dt});if(Jt){Pt(`Executing ${inferLayerName(_e)} using ${Jt.name}...`);const tn=await Jt.transport().call("solve/pathfinding",{format:Zt,instances:[{start:Bt??0,end:Nt??0}],mapURI:`map:${encodeURIComponent(Qt)}`,algorithm:Dt});Xt.aborted?Pt("Canceled"):lt(an=>lodashExports$1.set(an,"source.trace",{name:`${en==null?void 0:en.name}`,content:tn,key:nanoid$1(),id:nanoid$1()}))}}}},[qt,Ut,Dt,Bt,Nt,lt,Pt,_e,Gt],[qt,Ut,Dt,Bt,Nt]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(At,{value:_e,onChange:Rt})})}),inferName:_e=>{var lt,Rt;return((Rt=(lt=_e.source)==null?void 0:lt.trace)==null?void 0:Rt.name)??"Untitled Query"},provideSelectionInfo:({children:_e,event:lt,layer:Rt})=>{const At=controller$1.provideSelectionInfo,{layer:Pt,setLayer:Dt,layers:Lt}=useLayer(Rt),Bt=reactExports.useMemo(()=>{const jt=lodashExports$1.filter(Lt,{source:{type:"map"}});return lodashExports$1.filter(lodashExports$1.map(jt,Ut=>{var qt,Xt,Kt,Zt;const{parsedMap:Gt}=(Ut==null?void 0:Ut.source)??{};if(Gt&<){const Qt=(Zt=(Kt=getParser((Xt=(qt=Ut==null?void 0:Ut.source)==null?void 0:qt.map)==null?void 0:Xt.format))==null?void 0:Kt.hydrate)==null?void 0:Zt.call(Kt,Gt);if(Qt){const Jt=(lt==null?void 0:lt.world)&&Qt.snap(lt.world);if(Jt){const en=(lt==null?void 0:lt.world)&&Qt.nodeAt(Jt);return{point:Jt,node:en,key:Ut.key,name:inferLayerName(Ut)}}}}}))},[Lt]),Nt=reactExports.useMemo(()=>!!Pt&&!!Bt.length&&{[Pt.key]:{primary:inferLayerName(Pt),items:{...lodashExports$1.reduce(Bt,(jt,Ut)=>({...jt,[`${Rt}-${Ut==null?void 0:Ut.key}-source`]:{primary:"Set as source",secondary:Ut==null?void 0:Ut.name,action:()=>Dt(produce(Pt,Gt=>{lodashExports$1.set(Gt,"source.start",Ut==null?void 0:Ut.node),lodashExports$1.set(Gt,"source.query",void 0),lodashExports$1.set(Gt,"source.mapLayerKey",Ut==null?void 0:Ut.key),lodashExports$1.set(Gt,"source.trace",void 0)})),icon:jsxRuntimeExports.jsx(StartIcon,{sx:{transform:"scale(0.5)"}})},[`${Rt}-${Ut==null?void 0:Ut.key}-destination`]:{primary:"Set as destination",secondary:Ut==null?void 0:Ut.name,action:()=>Dt(produce(Pt,Gt=>{lodashExports$1.set(Gt,"source.end",Ut==null?void 0:Ut.node),lodashExports$1.set(Gt,"source.query",void 0),lodashExports$1.set(Gt,"source.mapLayerKey",Ut==null?void 0:Ut.key),lodashExports$1.set(Gt,"source.trace",void 0)})),icon:jsxRuntimeExports.jsx(DestinationIcon,{})}}),{})}}},[Bt,Pt,Lt,Dt]);return jsxRuntimeExports.jsx(At,{event:lt,layer:Rt,children:jt=>_e==null?void 0:_e(lodashExports$1.merge(jt,Nt))})}};function getLayerHandler(_e){var lt;return layerHandlers[((lt=_e==null?void 0:_e.source)==null?void 0:lt.type)??""]}const layerHandlers={trace:controller$1,map:controller$2,query:controller};function inferLayerName(_e){var lt,Rt;return _e!=null&&_e.name?_e==null?void 0:_e.name:(lt=_e==null?void 0:_e.source)!=null&<.type?layerHandlers[(Rt=_e.source)==null?void 0:Rt.type].inferName(_e):"Untitled Layer"}function _typeof$1(_e){"@babel/helpers - typeof";return _typeof$1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(lt){return typeof lt}:function(lt){return lt&&typeof Symbol=="function"&<.constructor===Symbol&<!==Symbol.prototype?"symbol":typeof lt},_typeof$1(_e)}function toPrimitive(_e,lt){if(_typeof$1(_e)!="object"||!_e)return _e;var Rt=_e[Symbol.toPrimitive];if(Rt!==void 0){var At=Rt.call(_e,lt||"default");if(_typeof$1(At)!="object")return At;throw new TypeError("@@toPrimitive must return a primitive value.")}return(lt==="string"?String:Number)(_e)}function toPropertyKey(_e){var lt=toPrimitive(_e,"string");return _typeof$1(lt)=="symbol"?lt:String(lt)}function _defineProperty$1(_e,lt,Rt){return lt=toPropertyKey(lt),lt in _e?Object.defineProperty(_e,lt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):_e[lt]=Rt,_e}function ownKeys(_e,lt){var Rt=Object.keys(_e);if(Object.getOwnPropertySymbols){var At=Object.getOwnPropertySymbols(_e);lt&&(At=At.filter(function(Pt){return Object.getOwnPropertyDescriptor(_e,Pt).enumerable})),Rt.push.apply(Rt,At)}return Rt}function _objectSpread2(_e){for(var lt=1;lt"u"&&(Rt=lt,lt=void 0),typeof Rt<"u"){if(typeof Rt!="function")throw new Error(formatProdErrorMessage(1));return Rt(createStore$1)(_e,lt)}if(typeof _e!="function")throw new Error(formatProdErrorMessage(2));var Pt=_e,Dt=lt,Lt=[],Bt=Lt,Nt=!1;function jt(){Bt===Lt&&(Bt=Lt.slice())}function Ut(){if(Nt)throw new Error(formatProdErrorMessage(3));return Dt}function Gt(Zt){if(typeof Zt!="function")throw new Error(formatProdErrorMessage(4));if(Nt)throw new Error(formatProdErrorMessage(5));var Qt=!0;return jt(),Bt.push(Zt),function(){if(Qt){if(Nt)throw new Error(formatProdErrorMessage(6));Qt=!1,jt();var en=Bt.indexOf(Zt);Bt.splice(en,1),Lt=null}}}function qt(Zt){if(!isPlainObject(Zt))throw new Error(formatProdErrorMessage(7));if(typeof Zt.type>"u")throw new Error(formatProdErrorMessage(8));if(Nt)throw new Error(formatProdErrorMessage(9));try{Nt=!0,Dt=Pt(Dt,Zt)}finally{Nt=!1}for(var Qt=Lt=Bt,Jt=0;Jt=0;At--){var Pt=lt[At](_e);if(Pt)return Pt}return function(Dt,Lt){throw new Error("Invalid value of type "+typeof _e+" for "+Rt+" argument when connecting component "+Lt.wrappedComponentName+".")}}function strictEqual(_e,lt){return _e===lt}function createConnect(_e){var lt=_e===void 0?{}:_e,Rt=lt.connectHOC,At=Rt===void 0?connectAdvanced:Rt,Pt=lt.mapStateToPropsFactories,Dt=Pt===void 0?defaultMapStateToPropsFactories:Pt,Lt=lt.mapDispatchToPropsFactories,Bt=Lt===void 0?defaultMapDispatchToPropsFactories:Lt,Nt=lt.mergePropsFactories,jt=Nt===void 0?defaultMergePropsFactories:Nt,Ut=lt.selectorFactory,Gt=Ut===void 0?finalPropsSelectorFactory:Ut;return function(Xt,Kt,Zt,Qt){Qt===void 0&&(Qt={});var Jt=Qt,en=Jt.pure,tn=en===void 0?!0:en,an=Jt.areStatesEqual,cn=an===void 0?strictEqual:an,un=Jt.areOwnPropsEqual,rn=un===void 0?shallowEqual:un,sn=Jt.areStatePropsEqual,pn=sn===void 0?shallowEqual:sn,bn=Jt.areMergedPropsEqual,gn=bn===void 0?shallowEqual:bn,_n=_objectWithoutPropertiesLoose$3(Jt,_excluded),xn=match(Xt,Dt,"mapStateToProps"),ln=match(Kt,Bt,"mapDispatchToProps"),Mn=match(Zt,jt,"mergeProps");return At(Gt,_extends$2({methodName:"connect",getDisplayName:function(An){return"Connect("+An+")"},shouldHandleStateChanges:!!Xt,initMapStateToProps:xn,initMapDispatchToProps:ln,initMergeProps:Mn,pure:tn,areStatesEqual:cn,areOwnPropsEqual:rn,areStatePropsEqual:pn,areMergedPropsEqual:gn},_n))}}const connect$1=createConnect();setBatch(reactDomExports.unstable_batchedUpdates);function areInputsEqual$1(_e,lt){if(_e.length!==lt.length)return!1;for(var Rt=0;Rt<_e.length;Rt++)if(_e[Rt]!==lt[Rt])return!1;return!0}function useMemoOne(_e,lt){var Rt=reactExports.useState(function(){return{inputs:lt,result:_e()}})[0],At=reactExports.useRef(!0),Pt=reactExports.useRef(Rt),Dt=At.current||!!(lt&&Pt.current.inputs&&areInputsEqual$1(lt,Pt.current.inputs)),Lt=Dt?Pt.current:{inputs:lt,result:_e()};return reactExports.useEffect(function(){At.current=!1,Pt.current=Lt},[Lt]),Lt.result}function useCallbackOne(_e,lt){return useMemoOne(function(){return _e},lt)}var useMemo=useMemoOne,useCallback=useCallbackOne,isProduction=!0,prefix$2="Invariant failed";function invariant$1(_e,lt){if(!_e){if(isProduction)throw new Error(prefix$2);var Rt=typeof lt=="function"?lt():lt,At=Rt?"".concat(prefix$2,": ").concat(Rt):prefix$2;throw new Error(At)}}var getRect=function _e(lt){var Rt=lt.top,At=lt.right,Pt=lt.bottom,Dt=lt.left,Lt=At-Dt,Bt=Pt-Rt,Nt={top:Rt,right:At,bottom:Pt,left:Dt,width:Lt,height:Bt,x:Dt,y:Rt,center:{x:(At+Dt)/2,y:(Pt+Rt)/2}};return Nt},expand=function _e(lt,Rt){return{top:lt.top-Rt.top,left:lt.left-Rt.left,bottom:lt.bottom+Rt.bottom,right:lt.right+Rt.right}},shrink=function _e(lt,Rt){return{top:lt.top+Rt.top,left:lt.left+Rt.left,bottom:lt.bottom-Rt.bottom,right:lt.right-Rt.right}},shift=function _e(lt,Rt){return{top:lt.top+Rt.y,left:lt.left+Rt.x,bottom:lt.bottom+Rt.y,right:lt.right+Rt.x}},noSpacing$1={top:0,right:0,bottom:0,left:0},createBox=function _e(lt){var Rt=lt.borderBox,At=lt.margin,Pt=At===void 0?noSpacing$1:At,Dt=lt.border,Lt=Dt===void 0?noSpacing$1:Dt,Bt=lt.padding,Nt=Bt===void 0?noSpacing$1:Bt,jt=getRect(expand(Rt,Pt)),Ut=getRect(shrink(Rt,Lt)),Gt=getRect(shrink(Ut,Nt));return{marginBox:jt,borderBox:getRect(Rt),paddingBox:Ut,contentBox:Gt,margin:Pt,border:Lt,padding:Nt}},parse$6=function _e(lt){var Rt=lt.slice(0,-2),At=lt.slice(-2);if(At!=="px")return 0;var Pt=Number(Rt);return isNaN(Pt)&&invariant$1(!1),Pt},getWindowScroll$1=function _e(){return{x:window.pageXOffset,y:window.pageYOffset}},offset=function _e(lt,Rt){var At=lt.borderBox,Pt=lt.border,Dt=lt.margin,Lt=lt.padding,Bt=shift(At,Rt);return createBox({borderBox:Bt,border:Pt,margin:Dt,padding:Lt})},withScroll=function _e(lt,Rt){return Rt===void 0&&(Rt=getWindowScroll$1()),offset(lt,Rt)},calculateBox=function _e(lt,Rt){var At={top:parse$6(Rt.marginTop),right:parse$6(Rt.marginRight),bottom:parse$6(Rt.marginBottom),left:parse$6(Rt.marginLeft)},Pt={top:parse$6(Rt.paddingTop),right:parse$6(Rt.paddingRight),bottom:parse$6(Rt.paddingBottom),left:parse$6(Rt.paddingLeft)},Dt={top:parse$6(Rt.borderTopWidth),right:parse$6(Rt.borderRightWidth),bottom:parse$6(Rt.borderBottomWidth),left:parse$6(Rt.borderLeftWidth)};return createBox({borderBox:lt,margin:At,padding:Pt,border:Dt})},getBox=function _e(lt){var Rt=lt.getBoundingClientRect(),At=window.getComputedStyle(lt);return calculateBox(Rt,At)},safeIsNaN=Number.isNaN||function _e(lt){return typeof lt=="number"&<!==lt};function isEqual$2(_e,lt){return!!(_e===lt||safeIsNaN(_e)&&safeIsNaN(lt))}function areInputsEqual(_e,lt){if(_e.length!==lt.length)return!1;for(var Rt=0;Rt<_e.length;Rt++)if(!isEqual$2(_e[Rt],lt[Rt]))return!1;return!0}function memoizeOne(_e,lt){lt===void 0&&(lt=areInputsEqual);var Rt,At=[],Pt,Dt=!1;function Lt(){for(var Bt=[],Nt=0;Nt");return At.callbacks},At.setCallbacks=function(Bt){At.callbacks=Bt},At}var Rt=lt.prototype;return Rt.componentDidMount=function(){this.unbind=bindEvents(window,[{eventName:"error",fn:this.onWindowError}])},Rt.componentDidCatch=function(Pt){if(Pt instanceof RbdInvariant){this.setState({});return}throw Pt},Rt.componentWillUnmount=function(){this.unbind()},Rt.render=function(){return this.props.children(this.setCallbacks)},lt}(React.Component),dragHandleUsageInstructions=` Press space bar to start a drag. When dragging you can use the arrow keys to move the item around and escape to cancel. Some screen readers may require you to be in focus mode or to use your pass through key diff --git a/index.html b/index.html index 7c7c5a0c..f8ece3b4 100644 --- a/index.html +++ b/index.html @@ -10,7 +10,7 @@ - +