diff --git a/assets/index-7559b58e.js b/assets/index-9449debc.js similarity index 99% rename from assets/index-7559b58e.js rename to assets/index-9449debc.js index dd8c3184..b3b7064d 100644 --- a/assets/index-7559b58e.js +++ b/assets/index-9449debc.js @@ -406,12 +406,12 @@ PERFORMANCE OF THIS SOFTWARE. background: #434252; } /* ====== */`);const u$3=React.forwardRef(({className:_e,theme:lt,draggerClassName:Rt,direction:At=z$3.Vertical,onDragging:Pt},Lt)=>{const Dt=`__dbk__gutter ${At} ${_e||lt}`,Bt=`__dbk__dragger ${At} ${Rt||lt}`;return jsxRuntimeExports.jsx("div",Object.assign({className:Dt,ref:Lt,dir:At,onMouseDown:Pt,onTouchStart:C$3?Pt:void 0},{children:jsxRuntimeExports.jsx("div",{className:Bt},void 0)}),void 0)});var h$4;function p$4(_e,lt,Rt){let At,Pt;return lt?(At=_e/2,Pt=_e):Rt?(At=_e,Pt=_e/2):(At=_e,Pt=_e),{aGutterSize:At,bGutterSize:Pt}}function f$4(_e,lt){switch(lt.type){case h$4.SetIsReadyToCompute:return Object.assign(Object.assign({},_e),{isReady:lt.payload.isReady});case h$4.CreatePairs:{const{direction:Rt,children:At,gutters:Pt}=lt.payload,Lt=At[0].parentNode;if(!Lt)throw new Error("Cannot create pairs - parent is undefined.");const Dt=c$4(Rt,Lt);if(Dt===void 0)throw new Error(`Cannot create pairs - parent has undefined or zero size: ${Dt}.`);const Bt=[];return At.forEach((Nt,jt)=>{if(jt>0){const Ut=At[jt-1],Gt=At[jt],qt=Pt[jt-1],Xt=Rt===z$3.Horizontal?Ut.getBoundingClientRect().left:Ut.getBoundingClientRect().top,Kt=Rt===z$3.Horizontal?Gt.getBoundingClientRect().right:Gt.getBoundingClientRect().bottom,Zt=Rt===z$3.Horizontal?Ut.getBoundingClientRect().width+qt.getBoundingClientRect().width+Gt.getBoundingClientRect().width:Ut.getBoundingClientRect().height+qt.getBoundingClientRect().height+Gt.getBoundingClientRect().height,Qt=Rt===z$3.Horizontal?qt.getBoundingClientRect().width:qt.getBoundingClientRect().height,Jt={idx:jt-1,a:Ut,b:Gt,gutter:qt,parent:Lt,start:Xt,end:Kt,size:Zt,gutterSize:Qt,aSizePct:100/At.length,bSizePct:100/At.length};Bt.push(Jt)}}),Object.assign(Object.assign({},_e),{pairs:Bt})}case h$4.StartDragging:{const{gutterIdx:Rt}=lt.payload;return Object.assign(Object.assign({},_e),{isDragging:!0,draggingIdx:Rt})}case h$4.StopDragging:return Object.assign(Object.assign({},_e),{isDragging:!1});case h$4.CalculateSizes:{const{direction:Rt,gutterIdx:At}=lt.payload,Pt=_e.pairs[At],Lt=c$4(Rt,Pt.parent);if(!Lt)throw new Error("Cannot calculate sizes - 'pair.parent' has undefined or zero size.");const Dt=Pt.gutter[Rt===z$3.Horizontal?"clientWidth":"clientHeight"],Bt=At===0,Nt=At===_e.pairs.length-1,{aGutterSize:jt,bGutterSize:Ut}=p$4(Dt,Bt,Nt);let Gt,qt,Xt,Kt,Zt;return Rt===z$3.Horizontal?(Gt=Pt.a.getBoundingClientRect().left,qt=Pt.b.getBoundingClientRect().right,Kt=(Pt.a.getBoundingClientRect().width+jt)/Lt*100,Zt=(Pt.b.getBoundingClientRect().width+Ut)/Lt*100,Xt=Pt.a.getBoundingClientRect().width+jt+Ut+Pt.b.getBoundingClientRect().width):(Gt=Pt.a.getBoundingClientRect().top,qt=Pt.b.getBoundingClientRect().bottom,Kt=(Pt.a.getBoundingClientRect().height+jt)/Lt*100,Zt=(Pt.b.getBoundingClientRect().height+Ut)/Lt*100,Xt=Pt.a.getBoundingClientRect().height+jt+Ut+Pt.b.getBoundingClientRect().height),_e.pairs[At]=Object.assign(Object.assign({},Pt),{start:Gt,end:qt,size:Xt,aSizePct:Kt,bSizePct:Zt,gutterSize:Dt}),Object.assign({},_e)}default:return _e}}function _$3(_e,lt=0,Rt=[]){return reactExports.Children.toArray(_e).reduce((At,Pt,Lt)=>(reactIsExports.isFragment(Pt)?At.push.apply(At,_$3(Pt.props.children,lt+1,Rt.concat(Pt.key||Lt))):reactExports.isValidElement(Pt)?At.push(reactExports.cloneElement(Pt,{key:Rt.concat(String(Pt.key)).join(".")})):typeof Pt!="string"&&typeof Pt!="number"||At.push(Pt),At),[])}(function(_e){_e[_e.SetIsReadyToCompute=0]="SetIsReadyToCompute",_e[_e.CreatePairs=1]="CreatePairs",_e[_e.CalculateSizes=2]="CalculateSizes",_e[_e.StartDragging=3]="StartDragging",_e[_e.StopDragging=4]="StopDragging"})(h$4||(h$4={}));const b$4=_e=>"changedTouches"in _e;var z$3,w$4;(function(_e){_e.Horizontal="Horizontal",_e.Vertical="Vertical"})(z$3||(z$3={})),function(_e){_e.Light="Light",_e.Dark="Dark"}(w$4||(w$4={}));const C$3=typeof window<"u"&&"ontouchstart"in window;function y$4(_e){return _e===z$3.Horizontal?"col-resize":"row-resize"}const S$4={isReady:!1,isDragging:!1,pairs:[]};function m$4({direction:_e=z$3.Horizontal,minWidths:lt=[],minHeights:Rt=[],initialSizes:At,gutterTheme:Pt=w$4.Dark,gutterClassName:Lt,draggerClassName:Dt,children:Bt,onResizeStarted:Nt,onResizeFinished:jt,classes:Ut=[]}){const Gt=_$3(Bt),[qt,Xt]=reactExports.useReducer(f$4,S$4),Kt=reactExports.useRef(null),Zt=reactExports.useRef([]),Qt=reactExports.useRef([]);Zt.current=[],Qt.current=[];const Jt=React.useCallback(_n=>{Xt({type:h$4.SetIsReadyToCompute,payload:{isReady:_n}})},[]),en=React.useCallback((_n,xn)=>{Xt({type:h$4.StartDragging,payload:{gutterIdx:xn}});const ln=qt.pairs[xn];Nt==null||Nt(ln.idx),ln.a.style.userSelect="none",ln.b.style.userSelect="none",ln.gutter.style.cursor=y$4(_n),ln.parent.style.cursor=y$4(_n),document.body.style.cursor=y$4(_n)},[qt.pairs]),tn=React.useCallback(()=>{Xt({type:h$4.StopDragging});const _n=[];for(let ln=0;ln{Xt({type:h$4.CalculateSizes,payload:{direction:_n,gutterIdx:xn}})},[]),un=React.useCallback((_n,xn,ln)=>{Xt({type:h$4.CreatePairs,payload:{direction:_n,children:xn,gutters:ln}})},[]),cn=React.useCallback((_n,xn,ln,On)=>{const Cn=xn[0].parentNode;if(!Cn)throw new Error("Cannot set initial sizes - parent is undefined");if(c$4(_n,Cn)===void 0)throw new Error("Cannot set initial sizes - parent has undefined size");xn.forEach((Pn,Tn)=>{const Sn=Tn===0,Fn=Tn===xn.length-1;let $n,An=0;xn.length>1&&(An=ln[Fn?Tn-1:Tn].getBoundingClientRect()[_n===z$3.Horizontal?"width":"height"],An=Sn||Fn?An/2:An),$n=On&&Tn{if(qt.draggingIdx===void 0)throw new Error("Cannot adjust size - 'draggingIdx' is undefined");const ln=qt.pairs[qt.draggingIdx];if(ln.size===void 0)throw new Error("Cannot adjust size - 'pair.size' is undefined");if(ln.gutterSize===void 0)throw new Error("Cannot adjust size - 'pair.gutterSize' is undefined");const On=ln.aSizePct+ln.bSizePct,Cn=xn/ln.size*On,Pn=On-xn/ln.size*On,Tn=qt.draggingIdx===0,Sn=qt.draggingIdx===qt.pairs.length-1,{aGutterSize:Fn,bGutterSize:$n}=p$4(ln.gutterSize,Tn,Sn),An=`calc(${Cn}% - ${Fn}px)`,Vn=`calc(${Pn}% - ${$n}px)`;_n===z$3.Horizontal?(ln.a.style.width=An,ln.b.style.width=Vn):(ln.a.style.height=An,ln.b.style.height=Vn)},[qt.draggingIdx,qt.pairs,_e]),sn=React.useCallback((_n,xn,ln)=>{if(!qt.isDragging)return;if(qt.draggingIdx===void 0)throw new Error("Cannot drag - 'draggingIdx' is undefined");const On=qt.pairs[qt.draggingIdx];if(On.start===void 0)throw new Error("Cannot drag - 'pair.start' is undefined");if(On.size===void 0)throw new Error("Cannot drag - 'pair.size' is undefined");if(On.gutterSize===void 0)throw new Error("Cannot drag - 'pair.gutterSize' is undefined");let Cn=function(Sn,Fn){const $n=b$4(Fn)?Fn.changedTouches[0]:Fn;return Sn===z$3.Horizontal?$n.clientX:$n.clientY}(xn,_n)-On.start,Pn=16,Tn=16;ln.length>qt.draggingIdx&&(Pn=ln[qt.draggingIdx]),ln.length>=qt.draggingIdx+1&&(Tn=ln[qt.draggingIdx+1]),Cn=On.size-(On.gutterSize+Tn)&&(Cn=On.size-(On.gutterSize+Tn)),rn(xn,Cn)},[qt.isDragging,qt.draggingIdx,qt.pairs,rn]),pn=()=>{if(qt.isDragging){if(qt.draggingIdx===void 0)throw new Error("Cannot calculate sizes after dragging = 'state.draggingIdx' is undefined");an(_e,qt.draggingIdx),tn()}},bn=_n=>{qt.isDragging&&(b$4(_n)&&_n.preventDefault(),sn(_n,_e,_e===z$3.Horizontal?lt:Rt))};function vn(_n,xn){if(!_n.current)throw new Error("Can't add element to ref object - ref isn't initialized");xn&&!_n.current.includes(xn)&&_n.current.push(xn)}return l$4("mouseup",pn,[qt.isDragging,tn]),l$4("mousemove",bn,[_e,qt.isDragging,sn,lt,Rt]),l$4("touchend",pn,[qt.isDragging,tn],{condition:C$3}),l$4("touchmove",bn,[_e,qt.isDragging,sn,lt,Rt],{condition:C$3,passive:!C$3}),reactExports.useEffect(function(){if(!Kt.current)return;const _n=Kt.current.parentElement;if(!_n)return;const xn=new ResizeObserver(()=>{const ln=getComputedStyle(_n),On=_e===z$3.Horizontal?_n.clientWidth:_n.clientHeight;Jt(!!ln&&!!On)});return xn.observe(_n),()=>{xn.disconnect()}},[Kt.current,_e]),reactExports.useEffect(function(){if(qt.isReady&&(!Zt.current||Zt.current[0].offsetParent)){if(!Zt.current||!Qt.current)throw new Error("Cannot create pairs - either variable 'childRefs' or 'gutterRefs' is undefined");Gt.length<=1?cn(_e,Zt.current,Qt.current,At):(cn(_e,Zt.current,Qt.current,At),un(_e,Zt.current,Qt.current))}},[Bt,qt.isReady,_e,cn,un,At]),jsxRuntimeExports.jsx("div",Object.assign({className:`__dbk__container ${_e}`,ref:Kt},{children:qt.isReady&&Gt.map((_n,xn)=>jsxRuntimeExports.jsxs(React.Fragment,{children:[jsxRuntimeExports.jsx("div",Object.assign({ref:ln=>vn(Zt,ln),className:"__dbk__child-wrapper "+(xnvn(Qt,ln),className:Lt,theme:Pt,draggerClassName:Dt,direction:_e,onDragging:()=>{return an(_e,ln=xn),void en(_e,ln);var ln}},void 0)]},xn))}),void 0)}const urlAlphabet="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let nanoid$1=(_e=21)=>{let lt="",Rt=crypto.getRandomValues(new Uint8Array(_e));for(;_e--;)lt+=urlAlphabet[Rt[_e]&63];return lt};function produce(_e,lt){const Rt=lodashExports$1.clone(_e);return lt(Rt),Rt}function produce2(_e,lt){return lt(lodashExports$1.clone(_e))}function withProduce(_e){return lt=>reactExports.createElement(_e,{...lt,produce:Rt=>{var At;return(At=lt==null?void 0:lt.onChange)==null?void 0:At.call(lt,Pt=>produce(Pt,Rt))}})}const DndContext=reactExports.createContext({dragDropManager:void 0});function formatProdErrorMessage$1(_e){return"Minified Redux error #"+_e+"; visit https://redux.js.org/Errors?code="+_e+" for the full message or use the non-minified dev environment for full errors. "}var $$observable$1=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),randomString$1=function(){return Math.random().toString(36).substring(7).split("").join(".")},ActionTypes$1={INIT:"@@redux/INIT"+randomString$1(),REPLACE:"@@redux/REPLACE"+randomString$1(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+randomString$1()}};function isPlainObject$1(_e){if(typeof _e!="object"||_e===null)return!1;for(var lt=_e;Object.getPrototypeOf(lt)!==null;)lt=Object.getPrototypeOf(lt);return Object.getPrototypeOf(_e)===lt}function createStore$2(_e,lt,Rt){var At;if(typeof lt=="function"&&typeof Rt=="function"||typeof Rt=="function"&&typeof arguments[3]=="function")throw new Error(formatProdErrorMessage$1(0));if(typeof lt=="function"&&typeof Rt>"u"&&(Rt=lt,lt=void 0),typeof Rt<"u"){if(typeof Rt!="function")throw new Error(formatProdErrorMessage$1(1));return Rt(createStore$2)(_e,lt)}if(typeof _e!="function")throw new Error(formatProdErrorMessage$1(2));var Pt=_e,Lt=lt,Dt=[],Bt=Dt,Nt=!1;function jt(){Bt===Dt&&(Bt=Dt.slice())}function Ut(){if(Nt)throw new Error(formatProdErrorMessage$1(3));return Lt}function Gt(Zt){if(typeof Zt!="function")throw new Error(formatProdErrorMessage$1(4));if(Nt)throw new Error(formatProdErrorMessage$1(5));var Qt=!0;return jt(),Bt.push(Zt),function(){if(Qt){if(Nt)throw new Error(formatProdErrorMessage$1(6));Qt=!1,jt();var en=Bt.indexOf(Zt);Bt.splice(en,1),Dt=null}}}function qt(Zt){if(!isPlainObject$1(Zt))throw new Error(formatProdErrorMessage$1(7));if(typeof Zt.type>"u")throw new Error(formatProdErrorMessage$1(8));if(Nt)throw new Error(formatProdErrorMessage$1(9));try{Nt=!0,Lt=Pt(Lt,Zt)}finally{Nt=!1}for(var Qt=Dt=Bt,Jt=0;JtAt&&At[Pt]?At[Pt]:Rt||null,_e)}function without$1(_e,lt){return _e.filter(Rt=>Rt!==lt)}function isObject$8(_e){return typeof _e=="object"}function xor(_e,lt){const Rt=new Map,At=Lt=>{Rt.set(Lt,Rt.has(Lt)?Rt.get(Lt)+1:1)};_e.forEach(At),lt.forEach(At);const Pt=[];return Rt.forEach((Lt,Dt)=>{Lt===1&&Pt.push(Dt)}),Pt}function intersection(_e,lt){return _e.filter(Rt=>lt.indexOf(Rt)>-1)}const INIT_COORDS="dnd-core/INIT_COORDS",BEGIN_DRAG="dnd-core/BEGIN_DRAG",PUBLISH_DRAG_SOURCE="dnd-core/PUBLISH_DRAG_SOURCE",HOVER="dnd-core/HOVER",DROP="dnd-core/DROP",END_DRAG="dnd-core/END_DRAG";function setClientOffset(_e,lt){return{type:INIT_COORDS,payload:{sourceClientOffset:lt||null,clientOffset:_e||null}}}const ResetCoordinatesAction={type:INIT_COORDS,payload:{clientOffset:null,sourceClientOffset:null}};function createBeginDrag(_e){return function(Rt=[],At={publishSource:!0}){const{publishSource:Pt=!0,clientOffset:Lt,getSourceClientOffset:Dt}=At,Bt=_e.getMonitor(),Nt=_e.getRegistry();_e.dispatch(setClientOffset(Lt)),verifyInvariants$1(Rt,Bt,Nt);const jt=getDraggableSource(Rt,Bt);if(jt==null){_e.dispatch(ResetCoordinatesAction);return}let Ut=null;if(Lt){if(!Dt)throw new Error("getSourceClientOffset must be defined");verifyGetSourceClientOffsetIsFunction(Dt),Ut=Dt(jt)}_e.dispatch(setClientOffset(Lt,Ut));const qt=Nt.getSource(jt).beginDrag(Bt,jt);if(qt==null)return;verifyItemIsObject(qt),Nt.pinSource(jt);const Xt=Nt.getSourceType(jt);return{type:BEGIN_DRAG,payload:{itemType:Xt,item:qt,sourceId:jt,clientOffset:Lt||null,sourceClientOffset:Ut||null,isSourcePublic:!!Pt}}}}function verifyInvariants$1(_e,lt,Rt){invariant$2(!lt.isDragging(),"Cannot call beginDrag while dragging."),_e.forEach(function(At){invariant$2(Rt.getSource(At),"Expected sourceIds to be registered.")})}function verifyGetSourceClientOffsetIsFunction(_e){invariant$2(typeof _e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function verifyItemIsObject(_e){invariant$2(isObject$8(_e),"Item must be an object.")}function getDraggableSource(_e,lt){let Rt=null;for(let At=_e.length-1;At>=0;At--)if(lt.canDragSource(_e[At])){Rt=_e[At];break}return Rt}function _defineProperty$8(_e,lt,Rt){return lt in _e?Object.defineProperty(_e,lt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):_e[lt]=Rt,_e}function _objectSpread$4(_e){for(var lt=1;lt{const Nt=determineDropResult(Dt,Bt,Pt,At),jt={type:DROP,payload:{dropResult:_objectSpread$4({},Rt,Nt)}};_e.dispatch(jt)})}}function verifyInvariants(_e){invariant$2(_e.isDragging(),"Cannot call drop while not dragging."),invariant$2(!_e.didDrop(),"Cannot call drop twice during one drag operation.")}function determineDropResult(_e,lt,Rt,At){const Pt=Rt.getTarget(_e);let Lt=Pt?Pt.drop(At,_e):void 0;return verifyDropResultType(Lt),typeof Lt>"u"&&(Lt=lt===0?{}:At.getDropResult()),Lt}function verifyDropResultType(_e){invariant$2(typeof _e>"u"||isObject$8(_e),"Drop result must either be an object or undefined.")}function getDroppableTargets(_e){const lt=_e.getTargetIds().filter(_e.canDropOnTarget,_e);return lt.reverse(),lt}function createEndDrag(_e){return function(){const Rt=_e.getMonitor(),At=_e.getRegistry();verifyIsDragging(Rt);const Pt=Rt.getSourceId();return Pt!=null&&(At.getSource(Pt,!0).endDrag(Rt,Pt),At.unpinSource()),{type:END_DRAG}}}function verifyIsDragging(_e){invariant$2(_e.isDragging(),"Cannot call endDrag while not dragging.")}function matchesType(_e,lt){return lt===null?_e===null:Array.isArray(_e)?_e.some(Rt=>Rt===lt):_e===lt}function createHover(_e){return function(Rt,{clientOffset:At}={}){verifyTargetIdsIsArray(Rt);const Pt=Rt.slice(0),Lt=_e.getMonitor(),Dt=_e.getRegistry(),Bt=Lt.getItemType();return removeNonMatchingTargetIds(Pt,Dt,Bt),checkInvariants(Pt,Lt,Dt),hoverAllTargets(Pt,Lt,Dt),{type:HOVER,payload:{targetIds:Pt,clientOffset:At||null}}}}function verifyTargetIdsIsArray(_e){invariant$2(Array.isArray(_e),"Expected targetIds to be an array.")}function checkInvariants(_e,lt,Rt){invariant$2(lt.isDragging(),"Cannot call hover while not dragging."),invariant$2(!lt.didDrop(),"Cannot call hover after drop.");for(let At=0;At<_e.length;At++){const Pt=_e[At];invariant$2(_e.lastIndexOf(Pt)===At,"Expected targetIds to be unique in the passed array.");const Lt=Rt.getTarget(Pt);invariant$2(Lt,"Expected targetIds to be registered.")}}function removeNonMatchingTargetIds(_e,lt,Rt){for(let At=_e.length-1;At>=0;At--){const Pt=_e[At],Lt=lt.getTargetType(Pt);matchesType(Lt,Rt)||_e.splice(At,1)}}function hoverAllTargets(_e,lt,Rt){_e.forEach(function(At){Rt.getTarget(At).hover(lt,At)})}function createPublishDragSource(_e){return function(){if(_e.getMonitor().isDragging())return{type:PUBLISH_DRAG_SOURCE}}}function createDragDropActions(_e){return{beginDrag:createBeginDrag(_e),publishDragSource:createPublishDragSource(_e),hover:createHover(_e),drop:createDrop(_e),endDrag:createEndDrag(_e)}}class DragDropManagerImpl{receiveBackend(lt){this.backend=lt}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const lt=this,{dispatch:Rt}=this.store;function At(Lt){return(...Dt)=>{const Bt=Lt.apply(lt,Dt);typeof Bt<"u"&&Rt(Bt)}}const Pt=createDragDropActions(this);return Object.keys(Pt).reduce((Lt,Dt)=>{const Bt=Pt[Dt];return Lt[Dt]=At(Bt),Lt},{})}dispatch(lt){this.store.dispatch(lt)}constructor(lt,Rt){this.isSetUp=!1,this.handleRefCountChange=()=>{const At=this.store.getState().refCount>0;this.backend&&(At&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!At&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=lt,this.monitor=Rt,lt.subscribe(this.handleRefCountChange)}}function add$1(_e,lt){return{x:_e.x+lt.x,y:_e.y+lt.y}}function subtract$1(_e,lt){return{x:_e.x-lt.x,y:_e.y-lt.y}}function getSourceClientOffset(_e){const{clientOffset:lt,initialClientOffset:Rt,initialSourceClientOffset:At}=_e;return!lt||!Rt||!At?null:subtract$1(add$1(lt,At),Rt)}function getDifferenceFromInitialOffset(_e){const{clientOffset:lt,initialClientOffset:Rt}=_e;return!lt||!Rt?null:subtract$1(lt,Rt)}const NONE$2=[],ALL=[];NONE$2.__IS_NONE__=!0;ALL.__IS_ALL__=!0;function areDirty(_e,lt){return _e===NONE$2?!1:_e===ALL||typeof lt>"u"?!0:intersection(lt,_e).length>0}class DragDropMonitorImpl{subscribeToStateChange(lt,Rt={}){const{handlerIds:At}=Rt;invariant$2(typeof lt=="function","listener must be a function."),invariant$2(typeof At>"u"||Array.isArray(At),"handlerIds, when specified, must be an array of strings.");let Pt=this.store.getState().stateId;const Lt=()=>{const Dt=this.store.getState(),Bt=Dt.stateId;try{Bt===Pt||Bt===Pt+1&&!areDirty(Dt.dirtyHandlerIds,At)||lt()}finally{Pt=Bt}};return this.store.subscribe(Lt)}subscribeToOffsetChange(lt){invariant$2(typeof lt=="function","listener must be a function.");let Rt=this.store.getState().dragOffset;const At=()=>{const Pt=this.store.getState().dragOffset;Pt!==Rt&&(Rt=Pt,lt())};return this.store.subscribe(At)}canDragSource(lt){if(!lt)return!1;const Rt=this.registry.getSource(lt);return invariant$2(Rt,`Expected to find a valid source. sourceId=${lt}`),this.isDragging()?!1:Rt.canDrag(this,lt)}canDropOnTarget(lt){if(!lt)return!1;const Rt=this.registry.getTarget(lt);if(invariant$2(Rt,`Expected to find a valid target. targetId=${lt}`),!this.isDragging()||this.didDrop())return!1;const At=this.registry.getTargetType(lt),Pt=this.getItemType();return matchesType(At,Pt)&&Rt.canDrop(this,lt)}isDragging(){return!!this.getItemType()}isDraggingSource(lt){if(!lt)return!1;const Rt=this.registry.getSource(lt,!0);if(invariant$2(Rt,`Expected to find a valid source. sourceId=${lt}`),!this.isDragging()||!this.isSourcePublic())return!1;const At=this.registry.getSourceType(lt),Pt=this.getItemType();return At!==Pt?!1:Rt.isDragging(this,lt)}isOverTarget(lt,Rt={shallow:!1}){if(!lt)return!1;const{shallow:At}=Rt;if(!this.isDragging())return!1;const Pt=this.registry.getTargetType(lt),Lt=this.getItemType();if(Lt&&!matchesType(Pt,Lt))return!1;const Dt=this.getTargetIds();if(!Dt.length)return!1;const Bt=Dt.indexOf(lt);return At?Bt===Dt.length-1:Bt>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return getSourceClientOffset(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return getDifferenceFromInitialOffset(this.store.getState().dragOffset)}constructor(lt,Rt){this.store=lt,this.registry=Rt}}const scope=typeof global<"u"?global:self,BrowserMutationObserver=scope.MutationObserver||scope.WebKitMutationObserver;function makeRequestCallFromTimer(_e){return function(){const Rt=setTimeout(Pt,0),At=setInterval(Pt,50);function Pt(){clearTimeout(Rt),clearInterval(At),_e()}}}function makeRequestCallFromMutationObserver(_e){let lt=1;const Rt=new BrowserMutationObserver(_e),At=document.createTextNode("");return Rt.observe(At,{characterData:!0}),function(){lt=-lt,At.data=lt}}const makeRequestCall=typeof BrowserMutationObserver=="function"?makeRequestCallFromMutationObserver:makeRequestCallFromTimer;class AsapQueue{enqueueTask(lt){const{queue:Rt,requestFlush:At}=this;Rt.length||(At(),this.flushing=!0),Rt[Rt.length]=lt}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:lt}=this;for(;this.indexthis.capacity){for(let At=0,Pt=lt.length-this.index;At{this.pendingErrors.push(lt),this.requestErrorThrow()},this.requestFlush=makeRequestCall(this.flush),this.requestErrorThrow=makeRequestCallFromTimer(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class RawTask{call(){try{this.task&&this.task()}catch(lt){this.onError(lt)}finally{this.task=null,this.release(this)}}constructor(lt,Rt){this.onError=lt,this.release=Rt,this.task=null}}class TaskFactory{create(lt){const Rt=this.freeTasks,At=Rt.length?Rt.pop():new RawTask(this.onError,Pt=>Rt[Rt.length]=Pt);return At.task=lt,At}constructor(lt){this.onError=lt,this.freeTasks=[]}}const asapQueue=new AsapQueue,taskFactory=new TaskFactory(asapQueue.registerPendingError);function asap(_e){asapQueue.enqueueTask(taskFactory.create(_e))}const ADD_SOURCE="dnd-core/ADD_SOURCE",ADD_TARGET="dnd-core/ADD_TARGET",REMOVE_SOURCE="dnd-core/REMOVE_SOURCE",REMOVE_TARGET="dnd-core/REMOVE_TARGET";function addSource(_e){return{type:ADD_SOURCE,payload:{sourceId:_e}}}function addTarget(_e){return{type:ADD_TARGET,payload:{targetId:_e}}}function removeSource(_e){return{type:REMOVE_SOURCE,payload:{sourceId:_e}}}function removeTarget(_e){return{type:REMOVE_TARGET,payload:{targetId:_e}}}function validateSourceContract(_e){invariant$2(typeof _e.canDrag=="function","Expected canDrag to be a function."),invariant$2(typeof _e.beginDrag=="function","Expected beginDrag to be a function."),invariant$2(typeof _e.endDrag=="function","Expected endDrag to be a function.")}function validateTargetContract(_e){invariant$2(typeof _e.canDrop=="function","Expected canDrop to be a function."),invariant$2(typeof _e.hover=="function","Expected hover to be a function."),invariant$2(typeof _e.drop=="function","Expected beginDrag to be a function.")}function validateType(_e,lt){if(lt&&Array.isArray(_e)){_e.forEach(Rt=>validateType(Rt,!1));return}invariant$2(typeof _e=="string"||typeof _e=="symbol",lt?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var HandlerRole;(function(_e){_e.SOURCE="SOURCE",_e.TARGET="TARGET"})(HandlerRole||(HandlerRole={}));let nextUniqueId=0;function getNextUniqueId(){return nextUniqueId++}function getNextHandlerId(_e){const lt=getNextUniqueId().toString();switch(_e){case HandlerRole.SOURCE:return`S${lt}`;case HandlerRole.TARGET:return`T${lt}`;default:throw new Error(`Unknown Handler Role: ${_e}`)}}function parseRoleFromHandlerId(_e){switch(_e[0]){case"S":return HandlerRole.SOURCE;case"T":return HandlerRole.TARGET;default:throw new Error(`Cannot parse handler ID: ${_e}`)}}function mapContainsValue(_e,lt){const Rt=_e.entries();let At=!1;do{const{done:Pt,value:[,Lt]}=Rt.next();if(Lt===lt)return!0;At=!!Pt}while(!At);return!1}class HandlerRegistryImpl{addSource(lt,Rt){validateType(lt),validateSourceContract(Rt);const At=this.addHandler(HandlerRole.SOURCE,lt,Rt);return this.store.dispatch(addSource(At)),At}addTarget(lt,Rt){validateType(lt,!0),validateTargetContract(Rt);const At=this.addHandler(HandlerRole.TARGET,lt,Rt);return this.store.dispatch(addTarget(At)),At}containsHandler(lt){return mapContainsValue(this.dragSources,lt)||mapContainsValue(this.dropTargets,lt)}getSource(lt,Rt=!1){return invariant$2(this.isSourceId(lt),"Expected a valid source ID."),Rt&<===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(lt)}getTarget(lt){return invariant$2(this.isTargetId(lt),"Expected a valid target ID."),this.dropTargets.get(lt)}getSourceType(lt){return invariant$2(this.isSourceId(lt),"Expected a valid source ID."),this.types.get(lt)}getTargetType(lt){return invariant$2(this.isTargetId(lt),"Expected a valid target ID."),this.types.get(lt)}isSourceId(lt){return parseRoleFromHandlerId(lt)===HandlerRole.SOURCE}isTargetId(lt){return parseRoleFromHandlerId(lt)===HandlerRole.TARGET}removeSource(lt){invariant$2(this.getSource(lt),"Expected an existing source."),this.store.dispatch(removeSource(lt)),asap(()=>{this.dragSources.delete(lt),this.types.delete(lt)})}removeTarget(lt){invariant$2(this.getTarget(lt),"Expected an existing target."),this.store.dispatch(removeTarget(lt)),this.dropTargets.delete(lt),this.types.delete(lt)}pinSource(lt){const Rt=this.getSource(lt);invariant$2(Rt,"Expected an existing source."),this.pinnedSourceId=lt,this.pinnedSource=Rt}unpinSource(){invariant$2(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(lt,Rt,At){const Pt=getNextHandlerId(lt);return this.types.set(Pt,Rt),lt===HandlerRole.SOURCE?this.dragSources.set(Pt,At):lt===HandlerRole.TARGET&&this.dropTargets.set(Pt,At),Pt}constructor(lt){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=lt}}const strictEquality=(_e,lt)=>_e===lt;function areCoordsEqual(_e,lt){return!_e&&!lt?!0:!_e||!lt?!1:_e.x===lt.x&&_e.y===lt.y}function areArraysEqual$1(_e,lt,Rt=strictEquality){if(_e.length!==lt.length)return!1;for(let At=0;At<_e.length;++At)if(!Rt(_e[At],lt[At]))return!1;return!0}function reduce$5(_e=NONE$2,lt){switch(lt.type){case HOVER:break;case ADD_SOURCE:case ADD_TARGET:case REMOVE_TARGET:case REMOVE_SOURCE:return NONE$2;case BEGIN_DRAG:case PUBLISH_DRAG_SOURCE:case END_DRAG:case DROP:default:return ALL}const{targetIds:Rt=[],prevTargetIds:At=[]}=lt.payload,Pt=xor(Rt,At);if(!(Pt.length>0||!areArraysEqual$1(Rt,At)))return NONE$2;const Dt=At[At.length-1],Bt=Rt[Rt.length-1];return Dt!==Bt&&(Dt&&Pt.push(Dt),Bt&&Pt.push(Bt)),Pt}function _defineProperty$7(_e,lt,Rt){return lt in _e?Object.defineProperty(_e,lt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):_e[lt]=Rt,_e}function _objectSpread$3(_e){for(var lt=1;lt=0)&&Object.prototype.propertyIsEnumerable.call(_e,At)&&(Rt[At]=_e[At])}return Rt}function _objectWithoutPropertiesLoose$2(_e,lt){if(_e==null)return{};var Rt={},At=Object.keys(_e),Pt,Lt;for(Lt=0;Lt=0)&&(Rt[Pt]=_e[Pt]);return Rt}let refCount=0;const INSTANCE_SYM=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var DndProvider=reactExports.memo(function(lt){var{children:Rt}=lt,At=_objectWithoutProperties$1(lt,["children"]);const[Pt,Lt]=getDndContextValue(At);return reactExports.useEffect(()=>{if(Lt){const Dt=getGlobalContext();return++refCount,()=>{--refCount===0&&(Dt[INSTANCE_SYM]=null)}}},[]),jsxRuntimeExports.jsx(DndContext.Provider,{value:Pt,children:Rt})});function getDndContextValue(_e){if("manager"in _e)return[{dragDropManager:_e.manager},!1];const lt=createSingletonDndContext(_e.backend,_e.context,_e.options,_e.debugMode),Rt=!_e.context;return[lt,Rt]}function createSingletonDndContext(_e,lt=getGlobalContext(),Rt,At){const Pt=lt;return Pt[INSTANCE_SYM]||(Pt[INSTANCE_SYM]={dragDropManager:createDragDropManager(_e,lt,Rt,At)}),Pt[INSTANCE_SYM]}function getGlobalContext(){return typeof global<"u"?global:window}var fastDeepEqual=function _e(lt,Rt){if(lt===Rt)return!0;if(lt&&Rt&&typeof lt=="object"&&typeof Rt=="object"){if(lt.constructor!==Rt.constructor)return!1;var At,Pt,Lt;if(Array.isArray(lt)){if(At=lt.length,At!=Rt.length)return!1;for(Pt=At;Pt--!==0;)if(!_e(lt[Pt],Rt[Pt]))return!1;return!0}if(lt.constructor===RegExp)return lt.source===Rt.source&<.flags===Rt.flags;if(lt.valueOf!==Object.prototype.valueOf)return lt.valueOf()===Rt.valueOf();if(lt.toString!==Object.prototype.toString)return lt.toString()===Rt.toString();if(Lt=Object.keys(lt),At=Lt.length,At!==Object.keys(Rt).length)return!1;for(Pt=At;Pt--!==0;)if(!Object.prototype.hasOwnProperty.call(Rt,Lt[Pt]))return!1;for(Pt=At;Pt--!==0;){var Dt=Lt[Pt];if(!_e(lt[Dt],Rt[Dt]))return!1}return!0}return lt!==lt&&Rt!==Rt};const equal=getDefaultExportFromCjs(fastDeepEqual),useIsomorphicLayoutEffect$6=typeof window<"u"?reactExports.useLayoutEffect:reactExports.useEffect;function useCollector(_e,lt,Rt){const[At,Pt]=reactExports.useState(()=>lt(_e)),Lt=reactExports.useCallback(()=>{const Dt=lt(_e);equal(At,Dt)||(Pt(Dt),Rt&&Rt())},[At,_e,Rt]);return useIsomorphicLayoutEffect$6(Lt),[At,Lt]}function useMonitorOutput(_e,lt,Rt){const[At,Pt]=useCollector(_e,lt,Rt);return useIsomorphicLayoutEffect$6(function(){const Dt=_e.getHandlerId();if(Dt!=null)return _e.subscribeToStateChange(Pt,{handlerIds:[Dt]})},[_e,Pt]),At}function useCollectedProps(_e,lt,Rt){return useMonitorOutput(lt,_e||(()=>({})),()=>Rt.reconnect())}function useOptionalFactory(_e,lt){const Rt=[...lt||[]];return lt==null&&typeof _e!="function"&&Rt.push(_e),reactExports.useMemo(()=>typeof _e=="function"?_e():_e,Rt)}function useConnectDragSource(_e){return reactExports.useMemo(()=>_e.hooks.dragSource(),[_e])}function useConnectDragPreview(_e){return reactExports.useMemo(()=>_e.hooks.dragPreview(),[_e])}let isCallingCanDrag=!1,isCallingIsDragging=!1;class DragSourceMonitorImpl{receiveHandlerId(lt){this.sourceId=lt}getHandlerId(){return this.sourceId}canDrag(){invariant$2(!isCallingCanDrag,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return isCallingCanDrag=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{isCallingCanDrag=!1}}isDragging(){if(!this.sourceId)return!1;invariant$2(!isCallingIsDragging,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return isCallingIsDragging=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{isCallingIsDragging=!1}}subscribeToStateChange(lt,Rt){return this.internalMonitor.subscribeToStateChange(lt,Rt)}isDraggingSource(lt){return this.internalMonitor.isDraggingSource(lt)}isOverTarget(lt,Rt){return this.internalMonitor.isOverTarget(lt,Rt)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(lt){return this.internalMonitor.subscribeToOffsetChange(lt)}canDragSource(lt){return this.internalMonitor.canDragSource(lt)}canDropOnTarget(lt){return this.internalMonitor.canDropOnTarget(lt)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(lt){this.sourceId=null,this.internalMonitor=lt.getMonitor()}}let isCallingCanDrop=!1;class DropTargetMonitorImpl{receiveHandlerId(lt){this.targetId=lt}getHandlerId(){return this.targetId}subscribeToStateChange(lt,Rt){return this.internalMonitor.subscribeToStateChange(lt,Rt)}canDrop(){if(!this.targetId)return!1;invariant$2(!isCallingCanDrop,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return isCallingCanDrop=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{isCallingCanDrop=!1}}isOver(lt){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,lt):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(lt){this.targetId=null,this.internalMonitor=lt.getMonitor()}}function registerTarget(_e,lt,Rt){const At=Rt.getRegistry(),Pt=At.addTarget(_e,lt);return[Pt,()=>At.removeTarget(Pt)]}function registerSource(_e,lt,Rt){const At=Rt.getRegistry(),Pt=At.addSource(_e,lt);return[Pt,()=>At.removeSource(Pt)]}function shallowEqual$1(_e,lt,Rt,At){let Pt=Rt?Rt.call(At,_e,lt):void 0;if(Pt!==void 0)return!!Pt;if(_e===lt)return!0;if(typeof _e!="object"||!_e||typeof lt!="object"||!lt)return!1;const Lt=Object.keys(_e),Dt=Object.keys(lt);if(Lt.length!==Dt.length)return!1;const Bt=Object.prototype.hasOwnProperty.bind(lt);for(let Nt=0;Nt, or turn it into a drag source or a drop target itself.`)}function wrapHookToRecognizeElement(_e){return(lt=null,Rt=null)=>{if(!reactExports.isValidElement(lt)){const Lt=lt;return _e(Lt,Rt),Lt}const At=lt;return throwIfCompositeComponentElement(At),cloneWithRef(At,Rt?Lt=>_e(Lt,Rt):_e)}}function wrapConnectorHooks(_e){const lt={};return Object.keys(_e).forEach(Rt=>{const At=_e[Rt];if(Rt.endsWith("Ref"))lt[Rt]=_e[Rt];else{const Pt=wrapHookToRecognizeElement(At);lt[Rt]=()=>Pt}}),lt}function setRef(_e,lt){typeof _e=="function"?_e(lt):_e.current=lt}function cloneWithRef(_e,lt){const Rt=_e.ref;return invariant$2(typeof Rt!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a or
. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),Rt?reactExports.cloneElement(_e,{ref:At=>{setRef(Rt,At),setRef(lt,At)}}):reactExports.cloneElement(_e,{ref:lt})}class SourceConnector{receiveHandlerId(lt){this.handlerId!==lt&&(this.handlerId=lt,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(lt){this.dragSourceOptionsInternal=lt}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(lt){this.dragPreviewOptionsInternal=lt}reconnect(){const lt=this.reconnectDragSource();this.reconnectDragPreview(lt)}reconnectDragSource(){const lt=this.dragSource,Rt=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return Rt&&this.disconnectDragSource(),this.handlerId?lt?(Rt&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=lt,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,lt,this.dragSourceOptions)),Rt):(this.lastConnectedDragSource=lt,Rt):Rt}reconnectDragPreview(lt=!1){const Rt=this.dragPreview,At=lt||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(At&&this.disconnectDragPreview(),!!this.handlerId){if(!Rt){this.lastConnectedDragPreview=Rt;return}At&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=Rt,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,Rt,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!shallowEqual$1(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!shallowEqual$1(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(lt){this.hooks=wrapConnectorHooks({dragSource:(Rt,At)=>{this.clearDragSource(),this.dragSourceOptions=At||null,isRef(Rt)?this.dragSourceRef=Rt:this.dragSourceNode=Rt,this.reconnectDragSource()},dragPreview:(Rt,At)=>{this.clearDragPreview(),this.dragPreviewOptions=At||null,isRef(Rt)?this.dragPreviewRef=Rt:this.dragPreviewNode=Rt,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=lt}}class TargetConnector{get connectTarget(){return this.dropTarget}reconnect(){const lt=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();lt&&this.disconnectDropTarget();const Rt=this.dropTarget;if(this.handlerId){if(!Rt){this.lastConnectedDropTarget=Rt;return}lt&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=Rt,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,Rt,this.dropTargetOptions))}}receiveHandlerId(lt){lt!==this.handlerId&&(this.handlerId=lt,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(lt){this.dropTargetOptionsInternal=lt}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!shallowEqual$1(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(lt){this.hooks=wrapConnectorHooks({dropTarget:(Rt,At)=>{this.clearDropTarget(),this.dropTargetOptions=At,isRef(Rt)?this.dropTargetRef=Rt:this.dropTargetNode=Rt,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=lt}}function useDragDropManager(){const{dragDropManager:_e}=reactExports.useContext(DndContext);return invariant$2(_e!=null,"Expected drag drop context"),_e}function useDragSourceConnector(_e,lt){const Rt=useDragDropManager(),At=reactExports.useMemo(()=>new SourceConnector(Rt.getBackend()),[Rt]);return useIsomorphicLayoutEffect$6(()=>(At.dragSourceOptions=_e||null,At.reconnect(),()=>At.disconnectDragSource()),[At,_e]),useIsomorphicLayoutEffect$6(()=>(At.dragPreviewOptions=lt||null,At.reconnect(),()=>At.disconnectDragPreview()),[At,lt]),At}function useDragSourceMonitor(){const _e=useDragDropManager();return reactExports.useMemo(()=>new DragSourceMonitorImpl(_e),[_e])}class DragSourceImpl{beginDrag(){const lt=this.spec,Rt=this.monitor;let At=null;return typeof lt.item=="object"?At=lt.item:typeof lt.item=="function"?At=lt.item(Rt):At={},At??null}canDrag(){const lt=this.spec,Rt=this.monitor;return typeof lt.canDrag=="boolean"?lt.canDrag:typeof lt.canDrag=="function"?lt.canDrag(Rt):!0}isDragging(lt,Rt){const At=this.spec,Pt=this.monitor,{isDragging:Lt}=At;return Lt?Lt(Pt):Rt===lt.getSourceId()}endDrag(){const lt=this.spec,Rt=this.monitor,At=this.connector,{end:Pt}=lt;Pt&&Pt(Rt.getItem(),Rt),At.reconnect()}constructor(lt,Rt,At){this.spec=lt,this.monitor=Rt,this.connector=At}}function useDragSource(_e,lt,Rt){const At=reactExports.useMemo(()=>new DragSourceImpl(_e,lt,Rt),[lt,Rt]);return reactExports.useEffect(()=>{At.spec=_e},[_e]),At}function useDragType(_e){return reactExports.useMemo(()=>{const lt=_e.type;return invariant$2(lt!=null,"spec.type must be defined"),lt},[_e])}function useRegisteredDragSource(_e,lt,Rt){const At=useDragDropManager(),Pt=useDragSource(_e,lt,Rt),Lt=useDragType(_e);useIsomorphicLayoutEffect$6(function(){if(Lt!=null){const[Bt,Nt]=registerSource(Lt,Pt,At);return lt.receiveHandlerId(Bt),Rt.receiveHandlerId(Bt),Nt}},[At,lt,Rt,Pt,Lt])}function useDrag(_e,lt){const Rt=useOptionalFactory(_e,lt);invariant$2(!Rt.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const At=useDragSourceMonitor(),Pt=useDragSourceConnector(Rt.options,Rt.previewOptions);return useRegisteredDragSource(Rt,At,Pt),[useCollectedProps(Rt.collect,At,Pt),useConnectDragSource(Pt),useConnectDragPreview(Pt)]}function useConnectDropTarget(_e){return reactExports.useMemo(()=>_e.hooks.dropTarget(),[_e])}function useDropTargetConnector(_e){const lt=useDragDropManager(),Rt=reactExports.useMemo(()=>new TargetConnector(lt.getBackend()),[lt]);return useIsomorphicLayoutEffect$6(()=>(Rt.dropTargetOptions=_e||null,Rt.reconnect(),()=>Rt.disconnectDropTarget()),[_e]),Rt}function useDropTargetMonitor(){const _e=useDragDropManager();return reactExports.useMemo(()=>new DropTargetMonitorImpl(_e),[_e])}function useAccept(_e){const{accept:lt}=_e;return reactExports.useMemo(()=>(invariant$2(_e.accept!=null,"accept must be defined"),Array.isArray(lt)?lt:[lt]),[lt])}class DropTargetImpl{canDrop(){const lt=this.spec,Rt=this.monitor;return lt.canDrop?lt.canDrop(Rt.getItem(),Rt):!0}hover(){const lt=this.spec,Rt=this.monitor;lt.hover&<.hover(Rt.getItem(),Rt)}drop(){const lt=this.spec,Rt=this.monitor;if(lt.drop)return lt.drop(Rt.getItem(),Rt)}constructor(lt,Rt){this.spec=lt,this.monitor=Rt}}function useDropTarget(_e,lt){const Rt=reactExports.useMemo(()=>new DropTargetImpl(_e,lt),[lt]);return reactExports.useEffect(()=>{Rt.spec=_e},[_e]),Rt}function useRegisteredDropTarget(_e,lt,Rt){const At=useDragDropManager(),Pt=useDropTarget(_e,lt),Lt=useAccept(_e);useIsomorphicLayoutEffect$6(function(){const[Bt,Nt]=registerTarget(Lt,Pt,At);return lt.receiveHandlerId(Bt),Rt.receiveHandlerId(Bt),Nt},[At,lt,Pt,Rt,Lt.map(Dt=>Dt.toString()).join("|")])}function useDrop(_e,lt){const Rt=useOptionalFactory(_e,lt),At=useDropTargetMonitor(),Pt=useDropTargetConnector(Rt.options);return useRegisteredDropTarget(Rt,At,Pt),[useCollectedProps(Rt.collect,At,Pt),useConnectDropTarget(Pt)]}function memoize(_e){let lt=null;return()=>(lt==null&&(lt=_e()),lt)}function without(_e,lt){return _e.filter(Rt=>Rt!==lt)}function union(_e,lt){const Rt=new Set,At=Lt=>Rt.add(Lt);_e.forEach(At),lt.forEach(At);const Pt=[];return Rt.forEach(Lt=>Pt.push(Lt)),Pt}class EnterLeaveCounter{enter(lt){const Rt=this.entered.length,At=Pt=>this.isNodeInDocument(Pt)&&(!Pt.contains||Pt.contains(lt));return this.entered=union(this.entered.filter(At),[lt]),Rt===0&&this.entered.length>0}leave(lt){const Rt=this.entered.length;return this.entered=without(this.entered.filter(this.isNodeInDocument),lt),Rt>0&&this.entered.length===0}reset(){this.entered=[]}constructor(lt){this.entered=[],this.isNodeInDocument=lt}}class NativeDragSource{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(lt=>{Object.defineProperty(this.item,lt,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${lt}" until the drop event.`),null}})})}loadDataTransfer(lt){if(lt){const Rt={};Object.keys(this.config.exposeProperties).forEach(At=>{const Pt=this.config.exposeProperties[At];Pt!=null&&(Rt[At]={value:Pt(lt,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,Rt)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(lt,Rt){return Rt===lt.getSourceId()}endDrag(){}constructor(lt){this.config=lt,this.item={},this.initializeExposedProperties()}}const FILE="__NATIVE_FILE__",URL$1="__NATIVE_URL__",TEXT="__NATIVE_TEXT__",HTML="__NATIVE_HTML__",NativeTypes=Object.freeze(Object.defineProperty({__proto__:null,FILE,HTML,TEXT,URL:URL$1},Symbol.toStringTag,{value:"Module"}));function getDataFromDataTransfer(_e,lt,Rt){const At=lt.reduce((Pt,Lt)=>Pt||_e.getData(Lt),"");return At??Rt}const nativeTypesConfig={[FILE]:{exposeProperties:{files:_e=>Array.prototype.slice.call(_e.files),items:_e=>_e.items,dataTransfer:_e=>_e},matchesTypes:["Files"]},[HTML]:{exposeProperties:{html:(_e,lt)=>getDataFromDataTransfer(_e,lt,""),dataTransfer:_e=>_e},matchesTypes:["Html","text/html"]},[URL$1]:{exposeProperties:{urls:(_e,lt)=>getDataFromDataTransfer(_e,lt,"").split(` -`),dataTransfer:_e=>_e},matchesTypes:["Url","text/uri-list"]},[TEXT]:{exposeProperties:{text:(_e,lt)=>getDataFromDataTransfer(_e,lt,""),dataTransfer:_e=>_e},matchesTypes:["Text","text/plain"]}};function createNativeDragSource(_e,lt){const Rt=nativeTypesConfig[_e];if(!Rt)throw new Error(`native type ${_e} has no configuration`);const At=new NativeDragSource(Rt);return At.loadDataTransfer(lt),At}function matchNativeItemType(_e){if(!_e)return null;const lt=Array.prototype.slice.call(_e.types||[]);return Object.keys(nativeTypesConfig).filter(Rt=>{const At=nativeTypesConfig[Rt];return At!=null&&At.matchesTypes?At.matchesTypes.some(Pt=>lt.indexOf(Pt)>-1):!1})[0]||null}const isFirefox=memoize(()=>/firefox/i.test(navigator.userAgent)),isSafari=memoize(()=>!!window.safari);class MonotonicInterpolant{interpolate(lt){const{xs:Rt,ys:At,c1s:Pt,c2s:Lt,c3s:Dt}=this;let Bt=Rt.length-1;if(lt===Rt[Bt])return At[Bt];let Nt=0,jt=Dt.length-1,Ut;for(;Nt<=jt;){Ut=Math.floor(.5*(Nt+jt));const Xt=Rt[Ut];if(Xtlt)jt=Ut-1;else return At[Ut]}Bt=Math.max(0,jt);const Gt=lt-Rt[Bt],qt=Gt*Gt;return At[Bt]+Pt[Bt]*Gt+Lt[Bt]*qt+Dt[Bt]*Gt*qt}constructor(lt,Rt){const{length:At}=lt,Pt=[];for(let Xt=0;Xtlt[Xt]{let cn=new MonotonicInterpolant([0,.5,1],[Nt.y,Nt.y/Ut*Kt,Nt.y+Kt-Ut]).interpolate(qt);return isSafari()&&Lt&&(cn+=(window.devicePixelRatio-1)*Kt),cn},Qt=()=>new MonotonicInterpolant([0,.5,1],[Nt.x,Nt.x/jt*Xt,Nt.x+Xt-jt]).interpolate(Gt),{offsetX:Jt,offsetY:en}=Pt,tn=Jt===0||Jt,an=en===0||en;return{x:tn?Jt:Qt(),y:an?en:Zt()}}class OptionsReader{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var lt;return!((lt=this.globalContext)===null||lt===void 0)&<.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var lt;return((lt=this.optionsArgs)===null||lt===void 0?void 0:lt.rootElement)||this.window}constructor(lt,Rt){this.ownerDocument=null,this.globalContext=lt,this.optionsArgs=Rt}}function _defineProperty$4(_e,lt,Rt){return lt in _e?Object.defineProperty(_e,lt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):_e[lt]=Rt,_e}function _objectSpread(_e){for(var lt=1;lt{this.sourcePreviewNodes.delete(lt),this.sourcePreviewNodeOptions.delete(lt)}}connectDragSource(lt,Rt,At){this.sourceNodes.set(lt,Rt),this.sourceNodeOptions.set(lt,At);const Pt=Dt=>this.handleDragStart(Dt,lt),Lt=Dt=>this.handleSelectStart(Dt);return Rt.setAttribute("draggable","true"),Rt.addEventListener("dragstart",Pt),Rt.addEventListener("selectstart",Lt),()=>{this.sourceNodes.delete(lt),this.sourceNodeOptions.delete(lt),Rt.removeEventListener("dragstart",Pt),Rt.removeEventListener("selectstart",Lt),Rt.setAttribute("draggable","false")}}connectDropTarget(lt,Rt){const At=Dt=>this.handleDragEnter(Dt,lt),Pt=Dt=>this.handleDragOver(Dt,lt),Lt=Dt=>this.handleDrop(Dt,lt);return Rt.addEventListener("dragenter",At),Rt.addEventListener("dragover",Pt),Rt.addEventListener("drop",Lt),()=>{Rt.removeEventListener("dragenter",At),Rt.removeEventListener("dragover",Pt),Rt.removeEventListener("drop",Lt)}}addEventListeners(lt){lt.addEventListener&&(lt.addEventListener("dragstart",this.handleTopDragStart),lt.addEventListener("dragstart",this.handleTopDragStartCapture,!0),lt.addEventListener("dragend",this.handleTopDragEndCapture,!0),lt.addEventListener("dragenter",this.handleTopDragEnter),lt.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),lt.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),lt.addEventListener("dragover",this.handleTopDragOver),lt.addEventListener("dragover",this.handleTopDragOverCapture,!0),lt.addEventListener("drop",this.handleTopDrop),lt.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(lt){lt.removeEventListener&&(lt.removeEventListener("dragstart",this.handleTopDragStart),lt.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),lt.removeEventListener("dragend",this.handleTopDragEndCapture,!0),lt.removeEventListener("dragenter",this.handleTopDragEnter),lt.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),lt.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),lt.removeEventListener("dragover",this.handleTopDragOver),lt.removeEventListener("dragover",this.handleTopDragOverCapture,!0),lt.removeEventListener("drop",this.handleTopDrop),lt.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const lt=this.monitor.getSourceId(),Rt=this.sourceNodeOptions.get(lt);return _objectSpread({dropEffect:this.altKeyPressed?"copy":"move"},Rt||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const lt=this.monitor.getSourceId(),Rt=this.sourcePreviewNodeOptions.get(lt);return _objectSpread({anchorX:.5,anchorY:.5,captureDraggingState:!1},Rt||{})}isDraggingNativeItem(){const lt=this.monitor.getItemType();return Object.keys(NativeTypes).some(Rt=>NativeTypes[Rt]===lt)}beginDragNativeItem(lt,Rt){this.clearCurrentDragSourceNode(),this.currentNativeSource=createNativeDragSource(lt,Rt),this.currentNativeHandle=this.registry.addSource(lt,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(lt){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=lt;const Rt=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var At;return(At=this.rootElement)===null||At===void 0?void 0:At.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},Rt)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var lt;(lt=this.window)===null||lt===void 0||lt.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(lt,Rt){lt.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(Rt))}handleDragEnter(lt,Rt){this.dragEnterTargetIds.unshift(Rt)}handleDragOver(lt,Rt){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(Rt)}handleDrop(lt,Rt){this.dropTargetIds.unshift(Rt)}constructor(lt,Rt,At){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=Pt=>{const Lt=this.sourceNodes.get(Pt);return Lt&&getNodeClientOffset(Lt)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=Pt=>!!(Pt&&this.document&&this.document.body&&this.document.body.contains(Pt)),this.endDragIfSourceWasRemovedFromDOM=()=>{const Pt=this.currentDragSourceNode;Pt==null||this.isNodeInDocument(Pt)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=Pt=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(Pt||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=Pt=>{if(Pt.defaultPrevented)return;const{dragStartSourceIds:Lt}=this;this.dragStartSourceIds=null;const Dt=getEventClientOffset(Pt);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(Lt||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:Dt});const{dataTransfer:Bt}=Pt,Nt=matchNativeItemType(Bt);if(this.monitor.isDragging()){if(Bt&&typeof Bt.setDragImage=="function"){const Ut=this.monitor.getSourceId(),Gt=this.sourceNodes.get(Ut),qt=this.sourcePreviewNodes.get(Ut)||Gt;if(qt){const{anchorX:Xt,anchorY:Kt,offsetX:Zt,offsetY:Qt}=this.getCurrentSourcePreviewNodeOptions(),tn=getDragPreviewOffset(Gt,qt,Dt,{anchorX:Xt,anchorY:Kt},{offsetX:Zt,offsetY:Qt});Bt.setDragImage(qt,tn.x,tn.y)}}try{Bt==null||Bt.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(Pt.target);const{captureDraggingState:jt}=this.getCurrentSourcePreviewNodeOptions();jt?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(Nt)this.beginDragNativeItem(Nt);else{if(Bt&&!Bt.types&&(Pt.target&&!Pt.target.hasAttribute||!Pt.target.hasAttribute("draggable")))return;Pt.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=Pt=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var Lt;(Lt=this.currentNativeSource)===null||Lt===void 0||Lt.loadDataTransfer(Pt.dataTransfer)}if(!this.enterLeaveCounter.enter(Pt.target)||this.monitor.isDragging())return;const{dataTransfer:Bt}=Pt,Nt=matchNativeItemType(Bt);Nt&&this.beginDragNativeItem(Nt,Bt)},this.handleTopDragEnter=Pt=>{const{dragEnterTargetIds:Lt}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=Pt.altKey,Lt.length>0&&this.actions.hover(Lt,{clientOffset:getEventClientOffset(Pt)}),Lt.some(Bt=>this.monitor.canDropOnTarget(Bt))&&(Pt.preventDefault(),Pt.dataTransfer&&(Pt.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=Pt=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var Lt;(Lt=this.currentNativeSource)===null||Lt===void 0||Lt.loadDataTransfer(Pt.dataTransfer)}},this.handleTopDragOver=Pt=>{const{dragOverTargetIds:Lt}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){Pt.preventDefault(),Pt.dataTransfer&&(Pt.dataTransfer.dropEffect="none");return}this.altKeyPressed=Pt.altKey,this.lastClientOffset=getEventClientOffset(Pt),this.scheduleHover(Lt),(Lt||[]).some(Bt=>this.monitor.canDropOnTarget(Bt))?(Pt.preventDefault(),Pt.dataTransfer&&(Pt.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?Pt.preventDefault():(Pt.preventDefault(),Pt.dataTransfer&&(Pt.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=Pt=>{this.isDraggingNativeItem()&&Pt.preventDefault(),this.enterLeaveCounter.leave(Pt.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=Pt=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var Lt;Pt.preventDefault(),(Lt=this.currentNativeSource)===null||Lt===void 0||Lt.loadDataTransfer(Pt.dataTransfer)}else matchNativeItemType(Pt.dataTransfer)&&Pt.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=Pt=>{const{dropTargetIds:Lt}=this;this.dropTargetIds=[],this.actions.hover(Lt,{clientOffset:getEventClientOffset(Pt)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=Pt=>{const Lt=Pt.target;typeof Lt.dragDrop=="function"&&(Lt.tagName==="INPUT"||Lt.tagName==="SELECT"||Lt.tagName==="TEXTAREA"||Lt.isContentEditable||(Pt.preventDefault(),Lt.dragDrop()))},this.options=new OptionsReader(Rt,At),this.actions=lt.getActions(),this.monitor=lt.getMonitor(),this.registry=lt.getRegistry(),this.enterLeaveCounter=new EnterLeaveCounter(this.isNodeInDocument)}}const HTML5Backend=function(lt,Rt,At){return new HTML5BackendImpl(lt,Rt,At)};function useEvent(_e){if(typeof window>"u")return _e;const lt=reactExports.useRef(null);return reactExports.useLayoutEffect(()=>{lt.current=_e}),reactExports.useCallback((...Rt)=>{var At;(At=lt.current)===null||At===void 0||At.call(lt,...Rt)},[])}const printedWarnings={};function warn$1(_e,lt){printedWarnings[_e]||(printedWarnings[_e]=!0,console.error("[material-ui-popup-state] WARNING",lt))}const initCoreState={isOpen:!1,setAnchorElUsed:!1,anchorEl:void 0,anchorPosition:void 0,hovered:!1,focused:!1,_openEventType:null,_childPopupState:null,_deferNextOpen:!1,_deferNextClose:!1};function usePopupState({parentPopupState:_e,popupId:lt,variant:Rt,disableAutoFocus:At}){const Pt=reactExports.useRef(!0);reactExports.useEffect(()=>(Pt.current=!0,()=>{Pt.current=!1}),[]);const[Lt,Dt]=reactExports.useState(initCoreState),Bt=reactExports.useCallback(en=>{Pt.current&&Dt(en)},[]),Nt=reactExports.useCallback(en=>Bt(tn=>({...tn,setAnchorElUsed:!0,anchorEl:en??void 0})),[]),jt=useEvent(en=>(Lt.isOpen?qt(en):Ut(en),Lt)),Ut=useEvent(en=>{const tn=en instanceof Element?void 0:en,an=en instanceof Element?en:(en==null?void 0:en.currentTarget)instanceof Element?en.currentTarget:void 0;if((tn==null?void 0:tn.type)==="touchstart"){Bt(pn=>({...pn,_deferNextOpen:!0}));return}const un=tn==null?void 0:tn.clientX,cn=tn==null?void 0:tn.clientY,rn=typeof un=="number"&&typeof cn=="number"?{left:un,top:cn}:void 0,sn=pn=>{if(!en&&!pn.setAnchorElUsed&&Rt!=="dialog"&&warn$1("missingEventOrAnchorEl","eventOrAnchorEl should be defined if setAnchorEl is not used"),_e){if(!_e.isOpen)return pn;setTimeout(()=>_e._setChildPopupState(Jt))}const bn={...pn,isOpen:!0,anchorPosition:rn,hovered:(tn==null?void 0:tn.type)==="mouseover"||pn.hovered,focused:(tn==null?void 0:tn.type)==="focus"||pn.focused,_openEventType:tn==null?void 0:tn.type};return tn!=null&&tn.currentTarget?pn.setAnchorElUsed||(bn.anchorEl=tn==null?void 0:tn.currentTarget):an&&(bn.anchorEl=an),bn};Bt(pn=>pn._deferNextOpen?(setTimeout(()=>Bt(sn),0),{...pn,_deferNextOpen:!1}):sn(pn))}),Gt=en=>{const{_childPopupState:tn}=en;return setTimeout(()=>{tn==null||tn.close(),_e==null||_e._setChildPopupState(null)}),{...en,isOpen:!1,hovered:!1,focused:!1}},qt=useEvent(en=>{const tn=en instanceof Element?void 0:en;if((tn==null?void 0:tn.type)==="touchstart"){Bt(an=>({...an,_deferNextClose:!0}));return}Bt(an=>an._deferNextClose?(setTimeout(()=>Bt(Gt),0),{...an,_deferNextClose:!1}):Gt(an))}),Xt=reactExports.useCallback((en,tn)=>{en?Ut(tn):qt(tn)},[]),Kt=useEvent(en=>{const{relatedTarget:tn}=en;Bt(an=>an.hovered&&!(tn instanceof Element&&isElementInPopup(tn,Jt))?an.focused?{...an,hovered:!1}:Gt(an):an)}),Zt=useEvent(en=>{if(!en)return;const{relatedTarget:tn}=en;Bt(an=>an.focused&&!(tn instanceof Element&&isElementInPopup(tn,Jt))?an.hovered?{...an,focused:!1}:Gt(an):an)}),Qt=reactExports.useCallback(en=>Bt(tn=>({...tn,_childPopupState:en})),[]),Jt={...Lt,setAnchorEl:Nt,popupId:lt,variant:Rt,open:Ut,close:qt,toggle:jt,setOpen:Xt,onBlur:Zt,onMouseLeave:Kt,disableAutoFocus:At??!!(Lt.hovered||Lt.focused),_setChildPopupState:Qt};return Jt}function controlAriaProps({isOpen:_e,popupId:lt,variant:Rt}){return{...Rt==="popover"?{"aria-haspopup":!0,"aria-controls":_e&<!=null?lt:void 0}:Rt==="popper"?{"aria-describedby":_e&<!=null?lt:void 0}:void 0}}function bindTrigger(_e){return{...controlAriaProps(_e),onClick:_e.open,onTouchStart:_e.open}}function bindPopover({isOpen:_e,anchorEl:lt,anchorPosition:Rt,close:At,popupId:Pt,onMouseLeave:Lt,disableAutoFocus:Dt,_openEventType:Bt}){return{id:Pt,anchorEl:lt,anchorPosition:Rt,anchorReference:Bt==="contextmenu"?"anchorPosition":"anchorEl",open:_e,onClose:At,onMouseLeave:Lt,...Dt&&{disableAutoFocus:!0,disableEnforceFocus:!0,disableRestoreFocus:!0}}}function bindMenu({isOpen:_e,anchorEl:lt,anchorPosition:Rt,close:At,popupId:Pt,onMouseLeave:Lt,disableAutoFocus:Dt,_openEventType:Bt}){return{id:Pt,anchorEl:lt,anchorPosition:Rt,anchorReference:Bt==="contextmenu"?"anchorPosition":"anchorEl",open:_e,onClose:At,onMouseLeave:Lt,...Dt&&{autoFocus:!1,disableAutoFocusItem:!0,disableAutoFocus:!0,disableEnforceFocus:!0,disableRestoreFocus:!0}}}function getPopup(_e,{popupId:lt}){if(!lt)return null;const Rt=typeof _e.getRootNode=="function"?_e.getRootNode():document;return typeof Rt.getElementById=="function"?Rt.getElementById(lt):null}function isElementInPopup(_e,lt){const{anchorEl:Rt,_childPopupState:At}=lt;return isAncestor(Rt,_e)||isAncestor(getPopup(_e,lt),_e)||At!=null&&isElementInPopup(_e,At)}function isAncestor(_e,lt){if(!_e)return!1;for(;lt;){if(lt===_e)return!0;lt=lt.parentElement}return!1}function PopupState({children:_e,popupId:lt,variant:Rt,parentPopupState:At,disableAutoFocus:Pt}){const Lt=usePopupState({popupId:lt,variant:Rt,parentPopupState:At,disableAutoFocus:Pt}),Dt=_e(Lt);return Dt??null}PopupState.propTypes={children:PropTypes$1.func.isRequired,popupId:PropTypes$1.string,variant:PropTypes$1.oneOf(["popover","popper"]).isRequired,parentPopupState:PropTypes$1.object,disableAutoFocus:PropTypes$1.bool};function ViewControls({onSplitHorizontal:_e,onClose:lt,onSplitVertical:Rt,closeDisabled:At,splitHorizontalDisabled:Pt,splitVerticalDisabled:Lt,onPopOut:Dt,popOutDisabled:Bt}){return jsxRuntimeExports.jsx(PopupState,{variant:"popover",children:Nt=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Stack$1,{sx:{m:1},children:jsxRuntimeExports.jsx(Tooltip$1,{title:"Panel Options",children:jsxRuntimeExports.jsx(IconButton$1,{size:"small",...bindTrigger(Nt),children:jsxRuntimeExports.jsx(MoreVertOutlined,{fontSize:"small"})})})}),jsxRuntimeExports.jsxs(Menu$1,{...bindMenu(Nt),transformOrigin:{horizontal:"right",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"top"},children:[jsxRuntimeExports.jsxs(MenuItem$1,{onClick:()=>{Rt==null||Rt(),Nt.close()},disabled:Lt,children:[jsxRuntimeExports.jsx(ListItemIcon$1,{children:jsxRuntimeExports.jsx(SplitIcon,{fontSize:"small"})}),jsxRuntimeExports.jsx(ListItemText$1,{children:"Split Vertical"})]}),jsxRuntimeExports.jsxs(MenuItem$1,{onClick:()=>{_e==null||_e(),Nt.close()},disabled:Pt,children:[jsxRuntimeExports.jsx(ListItemIcon$1,{children:jsxRuntimeExports.jsx(SplitIcon,{fontSize:"small",sx:{transform:"rotate(90deg)"}})}),jsxRuntimeExports.jsx(ListItemText$1,{children:"Split Horizontal"})]}),jsxRuntimeExports.jsx(Divider$1,{}),!(Bt||At)&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(MenuItem$1,{onClick:()=>{Dt==null||Dt(),lt==null||lt(),Nt.close()},children:[jsxRuntimeExports.jsx(ListItemIcon$1,{children:jsxRuntimeExports.jsx(OpenInNewOutlined,{fontSize:"small"})}),jsxRuntimeExports.jsx(ListItemText$1,{children:"Pop Out"})]}),jsxRuntimeExports.jsx(Divider$1,{})]}),jsxRuntimeExports.jsxs(MenuItem$1,{onClick:()=>{lt==null||lt(),Nt.close()},disabled:At,children:[jsxRuntimeExports.jsx(ListItemIcon$1,{children:jsxRuntimeExports.jsx(CloseOutlined,{fontSize:"small"})}),jsxRuntimeExports.jsx(ListItemText$1,{children:"Close Panel"})]})]})]})})}function findInTree(_e,lt){const Rt=At=>{var Pt;return"children"in At&&((Pt=At.children)!=null&&Pt.length)?lodashExports$1.flatMap(At.children,Rt):[At]};return lodashExports$1.find(Rt(_e),lt)}const ViewTreeContext=reactExports.createContext({});function useViewTreeContext(){return reactExports.useContext(ViewTreeContext)}function handleSwap(_e,lt,Rt){const At=findInTree(_e,Lt=>Lt.key===lt),Pt=findInTree(_e,Lt=>Lt.key===Rt);if((At==null?void 0:At.type)==="leaf"&&(Pt==null?void 0:Pt.type)==="leaf"){const Lt=At.content,Dt=Pt.content;At.content=Dt,Pt.content=Lt}return _e}function ViewTree(_e){const{onChange:lt,root:Rt}=_e;return jsxRuntimeExports.jsx(DndProvider,{backend:HTML5Backend,children:jsxRuntimeExports.jsx(ViewBranch,{..._e,onSwap:(At,Pt)=>{Rt&&(lt==null||lt(produce(Rt,Lt=>handleSwap(Lt,At,Pt))))}})})}function ViewLeaf({root:_e={type:"leaf",key:""},renderLeaf:lt,onChange:Rt,onClose:At,onPopOut:Pt,canPopOut:Lt,depth:Dt=0,onSwap:Bt}){const[{isOver:Nt},jt]=useDrop(()=>({accept:["panel"],collect:Xt=>({isOver:Xt.isOver()&&Xt.getItem().key!==_e.key}),drop:Xt=>Bt==null?void 0:Bt(Xt.key,_e.key)})),[{isDragging:Ut},Gt]=useDrag(()=>({type:"panel",item:{key:_e.key},collect:Xt=>({isDragging:Xt.isDragging()})})),qt=reactExports.useMemo(()=>{const Xt=Kt=>Rt==null?void 0:Rt(produce2(_e,Zt=>({key:nanoid$1(),type:"branch",orientation:Kt,children:[{...structuredClone(Zt),size:50,key:nanoid$1()},{...structuredClone(Zt),size:50,key:nanoid$1()}]})));return _e.type==="leaf"?{state:_e.content,controls:jsxRuntimeExports.jsx(ViewControls,{onClose:At,closeDisabled:!Dt,onSplitHorizontal:()=>Xt("horizontal"),onSplitVertical:()=>Xt("vertical"),onPopOut:()=>Pt==null?void 0:Pt(_e),popOutDisabled:!(Lt!=null&&Lt(_e))}),dragHandle:jsxRuntimeExports.jsx(Box$1,{ref:Gt,sx:{display:"flex",alignItems:"center"},children:jsxRuntimeExports.jsx(DragIndicatorOutlined,{fontSize:"small",color:"disabled",sx:{mr:.5,cursor:"grab"}})}),onChange:Kt=>Rt==null?void 0:Rt(produce(_e,Zt=>{Zt.content={...Zt.content,...Kt}}))}:{}},[Rt,At,Dt,_e,Gt]);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Flex,{ref:jt,sx:{overflow:"hidden","::before":{pointerEvents:"none",content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:1,boxShadow:Xt=>Nt?`inset 0 0 0 2px ${Xt.palette.primary.main}`:"none",transition:Xt=>Xt.transitions.create("box-shadow")},transition:Xt=>Xt.transitions.create("opacity"),opacity:Xt=>Ut?Xt.palette.action.disabledOpacity:1},children:jsxRuntimeExports.jsx(ViewTreeContext.Provider,{value:qt,children:lt==null?void 0:lt(_e)})})})}function ViewBranch(_e){const{root:lt={type:"leaf",key:""},onChange:Rt,depth:At=0}=_e,{palette:Pt,spacing:Lt,transitions:Dt}=useTheme(),Bt=useCss$1({"div&":{background:Pt.text.secondary,opacity:0,transition:Dt.create("opacity"),"&.Horizontal":{width:"3px"},"&.Vertical":{height:"3px"}}}),Nt=useCss$1({"div&":{background:Pt.mode==="dark"?Pt.background.default:Pt.divider,boxShadow:`inset 0 0 0 1px ${Pt.background.paper}`,[`&:hover .${Bt}`]:{opacity:1},"&.Horizontal":{padding:0,width:"3px"},"&.Vertical":{padding:0}}}),jt=Gt=>Number(Lt(Gt).slice(0,-2));function Ut(Gt){const qt=100-lodashExports$1.sumBy(Gt,"size"),Xt=lodashExports$1.filter(Gt,Kt=>!Kt.size).length;return Xt?qt/Xt:0}return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:lt.type==="leaf"?jsxRuntimeExports.jsx(ViewLeaf,{..._e}):jsxRuntimeExports.jsx(m$4,{gutterClassName:Nt,draggerClassName:Bt,onResizeFinished:(Gt,qt)=>Rt==null?void 0:Rt(produce(lt,Xt=>{lodashExports$1.forEach(qt,(Kt,Zt)=>{Xt.children[Zt].size=Kt})})),minHeights:lodashExports$1.map(lt.children,()=>jt(6)-8),minWidths:lodashExports$1.map(lt.children,()=>jt(32)),initialSizes:lodashExports$1.map(lt.children,(Gt,qt,Xt)=>Gt.size??Ut(Xt)),direction:{vertical:z$3.Vertical,horizontal:z$3.Horizontal}[lt.orientation],children:lodashExports$1.map(lt.children,(Gt,qt)=>reactExports.createElement(ViewBranch,{..._e,key:Gt.key,depth:At+1,root:Gt,onChange:Xt=>Rt==null?void 0:Rt(produce(lt,Kt=>Kt.children[qt]=Xt)),onClose:()=>Rt==null?void 0:Rt(produce2(lt,Xt=>(Xt.children.splice(qt,1),Xt.children.length===1?Xt.children[0].type==="leaf"?{type:"leaf",key:nanoid$1(),content:Xt.children[0].content}:Xt.children[0]:(lodashExports$1.forEach(Xt.children,(Kt,Zt,Qt)=>Kt.size=100/Qt.length),Xt))))}))})})}const logo=""+new URL("logo512-23eace97.png",import.meta.url).href,name$1="Visualiser",version="1.1.7",version_name="1.1.7; mid February 2024",repository="https://github.com/path-visualiser/app",docs="https://github.com/path-visualiser/app/blob/master/docs",homepage="https://path-visualiser.github.io/",contacts=[{name:"Dr Daniel Harabor",email:"daniel.harabor@monash.edu"},{name:"Dr Michael Wybrow",email:"michael.wybrow@monash.edu"},{name:"Karan Batta",email:"krnbatta@gmail.com"},{name:"Jay Wingate",email:"jaypeterwingate@gmail.com"},{name:"Kevin Zheng",email:"kzhe0012@student.monash.edu"},{name:"Leo Whitehead",email:"leo@whiteheadsoftware.dev"},{name:"Can Wang",email:"camwang@outlook.com"},{name:"Rory Tobin-Underwood",email:"rorytu@gmail.com"}];function AboutPage({template:_e}){const{controls:lt,onChange:Rt,state:At,dragHandle:Pt}=useViewTreeContext();function Lt(Dt,Bt){return jsxRuntimeExports.jsxs(Box$1,{sx:{pt:2},children:[jsxRuntimeExports.jsx(Type$2,{variant:"overline",color:"text.secondary",children:Dt}),jsxRuntimeExports.jsx(Type$2,{variant:"body2",children:Bt})]})}return jsxRuntimeExports.jsxs(_e,{onChange:Rt,stack:At,children:[jsxRuntimeExports.jsx(_e.Handle,{children:Pt}),jsxRuntimeExports.jsx(_e.Content,{children:jsxRuntimeExports.jsxs(Flex,{children:[" ",jsxRuntimeExports.jsx(Scroll,{y:!0,children:jsxRuntimeExports.jsxs(Box$1,{sx:{p:2},children:[jsxRuntimeExports.jsx(Box$1,{sx:{pt:6,pb:2},children:jsxRuntimeExports.jsx("img",{src:logo,height:"64"})}),jsxRuntimeExports.jsx(Type$2,{variant:"h6",children:name$1}),Lt("Build Info",jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:version_name})),Lt("About this App",jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[name$1," is a visualising debugging tool for pathfinding search. It can be used to visualise progression of search and debug pathfinding algorithms. It can handle range of different types of algorithms (demos are provided in the home page). This tool is highly customizable and provide flexibility to visualise any algorithm trace that you can augment using our docs."]})),Lt("Team",jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:["Our team is made up of present/past Monash students and Professors Dr Daniel Harabor:",jsxRuntimeExports.jsx(List$2,{sx:{mx:-2},children:contacts.map(({name:Dt,email:Bt},Nt)=>jsxRuntimeExports.jsxs(ListItemButton$1,{href:`mailto:${Bt}`,children:[jsxRuntimeExports.jsx(ListItemAvatar$1,{children:jsxRuntimeExports.jsx(Avatar$1,{children:lodashExports$1.head(Dt)})}),jsxRuntimeExports.jsx(ListItemText$1,{primary:Dt,secondary:Bt})]},Nt))})]})),Lt("Resources",jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(List$2,{sx:{mx:-2},children:jsxRuntimeExports.jsxs(ListItemButton$1,{target:"_blank",href:"https://github.com/path-visualiser",children:[jsxRuntimeExports.jsx(ListItemIcon$1,{children:jsxRuntimeExports.jsx(GitHub,{})}),jsxRuntimeExports.jsx(ListItemText$1,{primary:"Repository",secondary:"https://github.com/path-visualiser"})]})})}))]})})]})}),jsxRuntimeExports.jsx(_e.Extras,{children:lt})]})}const Context=reactExports.createContext(null);function useUniquePrefix(){const[_e,lt]=reactExports.useState(null);return reactExports.useEffect(()=>{lt(`mui-p-${Math.round(Math.random()*1e5)}`)},[]),_e}function TabContext(_e){const{children:lt,value:Rt}=_e,At=useUniquePrefix(),Pt=reactExports.useMemo(()=>({idPrefix:At,value:Rt}),[At,Rt]);return jsxRuntimeExports.jsx(Context.Provider,{value:Pt,children:lt})}function useTabContext(){return reactExports.useContext(Context)}function getPanelId(_e,lt){const{idPrefix:Rt}=_e;return Rt===null?null:`${_e.idPrefix}-P-${lt}`}function getTabId(_e,lt){const{idPrefix:Rt}=_e;return Rt===null?null:`${_e.idPrefix}-T-${lt}`}const _excluded$4=["children"],TabList=reactExports.forwardRef(function(lt,Rt){const{children:At}=lt,Pt=_objectWithoutPropertiesLoose$3(lt,_excluded$4),Lt=useTabContext();if(Lt===null)throw new TypeError("No TabContext provided");const Dt=reactExports.Children.map(At,Bt=>reactExports.isValidElement(Bt)?reactExports.cloneElement(Bt,{"aria-controls":getPanelId(Lt,Bt.props.value),id:getTabId(Lt,Bt.props.value)}):null);return jsxRuntimeExports.jsx(Tabs$1,_extends$2({},Pt,{ref:Rt,value:Lt.value,children:Dt}))}),TabList$1=TabList;function getTabPanelUtilityClass(_e){return generateUtilityClass$1("MuiTabPanel",_e)}generateUtilityClasses$1("MuiTabPanel",["root"]);const _excluded$3=["children","className","value"],useUtilityClasses=_e=>{const{classes:lt}=_e;return composeClasses({root:["root"]},getTabPanelUtilityClass,lt)},TabPanelRoot=styled$1("div",{name:"MuiTabPanel",slot:"Root",overridesResolver:(_e,lt)=>lt.root})(({theme:_e})=>({padding:_e.spacing(3)})),TabPanel=reactExports.forwardRef(function(lt,Rt){const At=useThemeProps({props:lt,name:"MuiTabPanel"}),{children:Pt,className:Lt,value:Dt}=At,Bt=_objectWithoutPropertiesLoose$3(At,_excluded$3),Nt=_extends$2({},At),jt=useUtilityClasses(Nt),Ut=useTabContext();if(Ut===null)throw new TypeError("No TabContext provided");const Gt=getPanelId(Ut,Dt),qt=getTabId(Ut,Dt);return jsxRuntimeExports.jsx(TabPanelRoot,_extends$2({"aria-labelledby":qt,className:clsx(jt.root,Lt),hidden:Dt!==Ut.value,id:Gt,ref:Rt,role:"tabpanel",ownerState:Nt},Bt,{children:Dt===Ut.value&&Pt}))}),TabPanel$1=TabPanel;function useSmallDisplay(){const _e=useTheme();return useMediaQuery(_e.breakpoints.down("sm"))}const itemHeight$1=_e=>_e?48:36,padding$1=8;function Select({trigger:_e,items:lt,value:Rt,onChange:At,showTooltip:Pt,placeholder:Lt="Select Option"}){const Dt=useSmallDisplay(),Bt=lodashExports$1.max([lodashExports$1.findIndex(lt,{value:Rt}),0])??0;return jsxRuntimeExports.jsx(PopupState,{variant:"popover",children:Nt=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Tooltip$1,{title:Lt,children:jsxRuntimeExports.jsx("span",{children:_e==null?void 0:_e(bindTrigger(Nt))})}),jsxRuntimeExports.jsx(Menu$1,{...bindMenu(Nt),anchorOrigin:{horizontal:"center",vertical:-itemHeight$1(Dt)*Bt-padding$1},transformOrigin:{vertical:"top",horizontal:"center"},children:lodashExports$1.map(lt,({value:jt,label:Ut,disabled:Gt,icon:qt})=>jsxRuntimeExports.jsx(Tooltip$1,{title:Pt&&jt,placement:"right",children:jsxRuntimeExports.jsxs(MenuItem$1,{disabled:Gt,value:jt,selected:jt===Rt,onClick:()=>{Nt.close(),At==null||At(jt)},children:[qt&&jsxRuntimeExports.jsx(ListItemIcon$1,{sx:{transform:"scale(0.8)"},children:qt}),Ut]},jt)},jt))})]})})}function SelectField(_e){const{placeholder:lt,value:Rt,items:At=[],onChange:Pt}=_e;return jsxRuntimeExports.jsx(TextField$1,{sx:{minWidth:120},select:!0,label:lt,defaultValue:Rt,variant:"filled",..._e,onChange:Lt=>Pt==null?void 0:Pt(Lt.target.value),children:lodashExports$1.map(At,Lt=>jsxRuntimeExports.jsx(MenuItem$1,{value:Lt.value,children:Lt.label},Lt.value))})}const defaultRemotes=[{url:"https://cdn.jsdelivr.net/gh/path-visualiser/app@adapter-warthog-wasm-dist/warthog-wasm.mjs",transport:"ipc",key:"default-ipc"}],defaultRenderers=[{url:"internal://d2-renderer/",key:"d2-renderer",transport:"native"}],defaultPlaybackRate=1,defaults$3={renderer:defaultRenderers,remote:defaultRemotes,"playback/playbackRate":defaultPlaybackRate,"appearance/theme":"dark","appearance/acrylic":!0,"appearance/accentColor":"blue","behaviour/showOnStart":"explore"},[useSettings,SettingsProvider]=createSlice({},withLocalStorage("settings",defaults$3)),{common:common$1,...accentColors}=colors,shadow=` +`),dataTransfer:_e=>_e},matchesTypes:["Url","text/uri-list"]},[TEXT]:{exposeProperties:{text:(_e,lt)=>getDataFromDataTransfer(_e,lt,""),dataTransfer:_e=>_e},matchesTypes:["Text","text/plain"]}};function createNativeDragSource(_e,lt){const Rt=nativeTypesConfig[_e];if(!Rt)throw new Error(`native type ${_e} has no configuration`);const At=new NativeDragSource(Rt);return At.loadDataTransfer(lt),At}function matchNativeItemType(_e){if(!_e)return null;const lt=Array.prototype.slice.call(_e.types||[]);return Object.keys(nativeTypesConfig).filter(Rt=>{const At=nativeTypesConfig[Rt];return At!=null&&At.matchesTypes?At.matchesTypes.some(Pt=>lt.indexOf(Pt)>-1):!1})[0]||null}const isFirefox=memoize(()=>/firefox/i.test(navigator.userAgent)),isSafari=memoize(()=>!!window.safari);class MonotonicInterpolant{interpolate(lt){const{xs:Rt,ys:At,c1s:Pt,c2s:Lt,c3s:Dt}=this;let Bt=Rt.length-1;if(lt===Rt[Bt])return At[Bt];let Nt=0,jt=Dt.length-1,Ut;for(;Nt<=jt;){Ut=Math.floor(.5*(Nt+jt));const Xt=Rt[Ut];if(Xtlt)jt=Ut-1;else return At[Ut]}Bt=Math.max(0,jt);const Gt=lt-Rt[Bt],qt=Gt*Gt;return At[Bt]+Pt[Bt]*Gt+Lt[Bt]*qt+Dt[Bt]*Gt*qt}constructor(lt,Rt){const{length:At}=lt,Pt=[];for(let Xt=0;Xtlt[Xt]{let cn=new MonotonicInterpolant([0,.5,1],[Nt.y,Nt.y/Ut*Kt,Nt.y+Kt-Ut]).interpolate(qt);return isSafari()&&Lt&&(cn+=(window.devicePixelRatio-1)*Kt),cn},Qt=()=>new MonotonicInterpolant([0,.5,1],[Nt.x,Nt.x/jt*Xt,Nt.x+Xt-jt]).interpolate(Gt),{offsetX:Jt,offsetY:en}=Pt,tn=Jt===0||Jt,an=en===0||en;return{x:tn?Jt:Qt(),y:an?en:Zt()}}class OptionsReader{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var lt;return!((lt=this.globalContext)===null||lt===void 0)&<.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var lt;return((lt=this.optionsArgs)===null||lt===void 0?void 0:lt.rootElement)||this.window}constructor(lt,Rt){this.ownerDocument=null,this.globalContext=lt,this.optionsArgs=Rt}}function _defineProperty$4(_e,lt,Rt){return lt in _e?Object.defineProperty(_e,lt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):_e[lt]=Rt,_e}function _objectSpread(_e){for(var lt=1;lt{this.sourcePreviewNodes.delete(lt),this.sourcePreviewNodeOptions.delete(lt)}}connectDragSource(lt,Rt,At){this.sourceNodes.set(lt,Rt),this.sourceNodeOptions.set(lt,At);const Pt=Dt=>this.handleDragStart(Dt,lt),Lt=Dt=>this.handleSelectStart(Dt);return Rt.setAttribute("draggable","true"),Rt.addEventListener("dragstart",Pt),Rt.addEventListener("selectstart",Lt),()=>{this.sourceNodes.delete(lt),this.sourceNodeOptions.delete(lt),Rt.removeEventListener("dragstart",Pt),Rt.removeEventListener("selectstart",Lt),Rt.setAttribute("draggable","false")}}connectDropTarget(lt,Rt){const At=Dt=>this.handleDragEnter(Dt,lt),Pt=Dt=>this.handleDragOver(Dt,lt),Lt=Dt=>this.handleDrop(Dt,lt);return Rt.addEventListener("dragenter",At),Rt.addEventListener("dragover",Pt),Rt.addEventListener("drop",Lt),()=>{Rt.removeEventListener("dragenter",At),Rt.removeEventListener("dragover",Pt),Rt.removeEventListener("drop",Lt)}}addEventListeners(lt){lt.addEventListener&&(lt.addEventListener("dragstart",this.handleTopDragStart),lt.addEventListener("dragstart",this.handleTopDragStartCapture,!0),lt.addEventListener("dragend",this.handleTopDragEndCapture,!0),lt.addEventListener("dragenter",this.handleTopDragEnter),lt.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),lt.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),lt.addEventListener("dragover",this.handleTopDragOver),lt.addEventListener("dragover",this.handleTopDragOverCapture,!0),lt.addEventListener("drop",this.handleTopDrop),lt.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(lt){lt.removeEventListener&&(lt.removeEventListener("dragstart",this.handleTopDragStart),lt.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),lt.removeEventListener("dragend",this.handleTopDragEndCapture,!0),lt.removeEventListener("dragenter",this.handleTopDragEnter),lt.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),lt.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),lt.removeEventListener("dragover",this.handleTopDragOver),lt.removeEventListener("dragover",this.handleTopDragOverCapture,!0),lt.removeEventListener("drop",this.handleTopDrop),lt.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const lt=this.monitor.getSourceId(),Rt=this.sourceNodeOptions.get(lt);return _objectSpread({dropEffect:this.altKeyPressed?"copy":"move"},Rt||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const lt=this.monitor.getSourceId(),Rt=this.sourcePreviewNodeOptions.get(lt);return _objectSpread({anchorX:.5,anchorY:.5,captureDraggingState:!1},Rt||{})}isDraggingNativeItem(){const lt=this.monitor.getItemType();return Object.keys(NativeTypes).some(Rt=>NativeTypes[Rt]===lt)}beginDragNativeItem(lt,Rt){this.clearCurrentDragSourceNode(),this.currentNativeSource=createNativeDragSource(lt,Rt),this.currentNativeHandle=this.registry.addSource(lt,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(lt){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=lt;const Rt=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var At;return(At=this.rootElement)===null||At===void 0?void 0:At.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},Rt)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var lt;(lt=this.window)===null||lt===void 0||lt.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(lt,Rt){lt.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(Rt))}handleDragEnter(lt,Rt){this.dragEnterTargetIds.unshift(Rt)}handleDragOver(lt,Rt){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(Rt)}handleDrop(lt,Rt){this.dropTargetIds.unshift(Rt)}constructor(lt,Rt,At){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=Pt=>{const Lt=this.sourceNodes.get(Pt);return Lt&&getNodeClientOffset(Lt)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=Pt=>!!(Pt&&this.document&&this.document.body&&this.document.body.contains(Pt)),this.endDragIfSourceWasRemovedFromDOM=()=>{const Pt=this.currentDragSourceNode;Pt==null||this.isNodeInDocument(Pt)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=Pt=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(Pt||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=Pt=>{if(Pt.defaultPrevented)return;const{dragStartSourceIds:Lt}=this;this.dragStartSourceIds=null;const Dt=getEventClientOffset(Pt);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(Lt||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:Dt});const{dataTransfer:Bt}=Pt,Nt=matchNativeItemType(Bt);if(this.monitor.isDragging()){if(Bt&&typeof Bt.setDragImage=="function"){const Ut=this.monitor.getSourceId(),Gt=this.sourceNodes.get(Ut),qt=this.sourcePreviewNodes.get(Ut)||Gt;if(qt){const{anchorX:Xt,anchorY:Kt,offsetX:Zt,offsetY:Qt}=this.getCurrentSourcePreviewNodeOptions(),tn=getDragPreviewOffset(Gt,qt,Dt,{anchorX:Xt,anchorY:Kt},{offsetX:Zt,offsetY:Qt});Bt.setDragImage(qt,tn.x,tn.y)}}try{Bt==null||Bt.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(Pt.target);const{captureDraggingState:jt}=this.getCurrentSourcePreviewNodeOptions();jt?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(Nt)this.beginDragNativeItem(Nt);else{if(Bt&&!Bt.types&&(Pt.target&&!Pt.target.hasAttribute||!Pt.target.hasAttribute("draggable")))return;Pt.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=Pt=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var Lt;(Lt=this.currentNativeSource)===null||Lt===void 0||Lt.loadDataTransfer(Pt.dataTransfer)}if(!this.enterLeaveCounter.enter(Pt.target)||this.monitor.isDragging())return;const{dataTransfer:Bt}=Pt,Nt=matchNativeItemType(Bt);Nt&&this.beginDragNativeItem(Nt,Bt)},this.handleTopDragEnter=Pt=>{const{dragEnterTargetIds:Lt}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=Pt.altKey,Lt.length>0&&this.actions.hover(Lt,{clientOffset:getEventClientOffset(Pt)}),Lt.some(Bt=>this.monitor.canDropOnTarget(Bt))&&(Pt.preventDefault(),Pt.dataTransfer&&(Pt.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=Pt=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var Lt;(Lt=this.currentNativeSource)===null||Lt===void 0||Lt.loadDataTransfer(Pt.dataTransfer)}},this.handleTopDragOver=Pt=>{const{dragOverTargetIds:Lt}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){Pt.preventDefault(),Pt.dataTransfer&&(Pt.dataTransfer.dropEffect="none");return}this.altKeyPressed=Pt.altKey,this.lastClientOffset=getEventClientOffset(Pt),this.scheduleHover(Lt),(Lt||[]).some(Bt=>this.monitor.canDropOnTarget(Bt))?(Pt.preventDefault(),Pt.dataTransfer&&(Pt.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?Pt.preventDefault():(Pt.preventDefault(),Pt.dataTransfer&&(Pt.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=Pt=>{this.isDraggingNativeItem()&&Pt.preventDefault(),this.enterLeaveCounter.leave(Pt.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=Pt=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var Lt;Pt.preventDefault(),(Lt=this.currentNativeSource)===null||Lt===void 0||Lt.loadDataTransfer(Pt.dataTransfer)}else matchNativeItemType(Pt.dataTransfer)&&Pt.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=Pt=>{const{dropTargetIds:Lt}=this;this.dropTargetIds=[],this.actions.hover(Lt,{clientOffset:getEventClientOffset(Pt)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=Pt=>{const Lt=Pt.target;typeof Lt.dragDrop=="function"&&(Lt.tagName==="INPUT"||Lt.tagName==="SELECT"||Lt.tagName==="TEXTAREA"||Lt.isContentEditable||(Pt.preventDefault(),Lt.dragDrop()))},this.options=new OptionsReader(Rt,At),this.actions=lt.getActions(),this.monitor=lt.getMonitor(),this.registry=lt.getRegistry(),this.enterLeaveCounter=new EnterLeaveCounter(this.isNodeInDocument)}}const HTML5Backend=function(lt,Rt,At){return new HTML5BackendImpl(lt,Rt,At)};function useEvent(_e){if(typeof window>"u")return _e;const lt=reactExports.useRef(null);return reactExports.useLayoutEffect(()=>{lt.current=_e}),reactExports.useCallback((...Rt)=>{var At;(At=lt.current)===null||At===void 0||At.call(lt,...Rt)},[])}const printedWarnings={};function warn$1(_e,lt){printedWarnings[_e]||(printedWarnings[_e]=!0,console.error("[material-ui-popup-state] WARNING",lt))}const initCoreState={isOpen:!1,setAnchorElUsed:!1,anchorEl:void 0,anchorPosition:void 0,hovered:!1,focused:!1,_openEventType:null,_childPopupState:null,_deferNextOpen:!1,_deferNextClose:!1};function usePopupState({parentPopupState:_e,popupId:lt,variant:Rt,disableAutoFocus:At}){const Pt=reactExports.useRef(!0);reactExports.useEffect(()=>(Pt.current=!0,()=>{Pt.current=!1}),[]);const[Lt,Dt]=reactExports.useState(initCoreState),Bt=reactExports.useCallback(en=>{Pt.current&&Dt(en)},[]),Nt=reactExports.useCallback(en=>Bt(tn=>({...tn,setAnchorElUsed:!0,anchorEl:en??void 0})),[]),jt=useEvent(en=>(Lt.isOpen?qt(en):Ut(en),Lt)),Ut=useEvent(en=>{const tn=en instanceof Element?void 0:en,an=en instanceof Element?en:(en==null?void 0:en.currentTarget)instanceof Element?en.currentTarget:void 0;if((tn==null?void 0:tn.type)==="touchstart"){Bt(pn=>({...pn,_deferNextOpen:!0}));return}const un=tn==null?void 0:tn.clientX,cn=tn==null?void 0:tn.clientY,rn=typeof un=="number"&&typeof cn=="number"?{left:un,top:cn}:void 0,sn=pn=>{if(!en&&!pn.setAnchorElUsed&&Rt!=="dialog"&&warn$1("missingEventOrAnchorEl","eventOrAnchorEl should be defined if setAnchorEl is not used"),_e){if(!_e.isOpen)return pn;setTimeout(()=>_e._setChildPopupState(Jt))}const bn={...pn,isOpen:!0,anchorPosition:rn,hovered:(tn==null?void 0:tn.type)==="mouseover"||pn.hovered,focused:(tn==null?void 0:tn.type)==="focus"||pn.focused,_openEventType:tn==null?void 0:tn.type};return tn!=null&&tn.currentTarget?pn.setAnchorElUsed||(bn.anchorEl=tn==null?void 0:tn.currentTarget):an&&(bn.anchorEl=an),bn};Bt(pn=>pn._deferNextOpen?(setTimeout(()=>Bt(sn),0),{...pn,_deferNextOpen:!1}):sn(pn))}),Gt=en=>{const{_childPopupState:tn}=en;return setTimeout(()=>{tn==null||tn.close(),_e==null||_e._setChildPopupState(null)}),{...en,isOpen:!1,hovered:!1,focused:!1}},qt=useEvent(en=>{const tn=en instanceof Element?void 0:en;if((tn==null?void 0:tn.type)==="touchstart"){Bt(an=>({...an,_deferNextClose:!0}));return}Bt(an=>an._deferNextClose?(setTimeout(()=>Bt(Gt),0),{...an,_deferNextClose:!1}):Gt(an))}),Xt=reactExports.useCallback((en,tn)=>{en?Ut(tn):qt(tn)},[]),Kt=useEvent(en=>{const{relatedTarget:tn}=en;Bt(an=>an.hovered&&!(tn instanceof Element&&isElementInPopup(tn,Jt))?an.focused?{...an,hovered:!1}:Gt(an):an)}),Zt=useEvent(en=>{if(!en)return;const{relatedTarget:tn}=en;Bt(an=>an.focused&&!(tn instanceof Element&&isElementInPopup(tn,Jt))?an.hovered?{...an,focused:!1}:Gt(an):an)}),Qt=reactExports.useCallback(en=>Bt(tn=>({...tn,_childPopupState:en})),[]),Jt={...Lt,setAnchorEl:Nt,popupId:lt,variant:Rt,open:Ut,close:qt,toggle:jt,setOpen:Xt,onBlur:Zt,onMouseLeave:Kt,disableAutoFocus:At??!!(Lt.hovered||Lt.focused),_setChildPopupState:Qt};return Jt}function controlAriaProps({isOpen:_e,popupId:lt,variant:Rt}){return{...Rt==="popover"?{"aria-haspopup":!0,"aria-controls":_e&<!=null?lt:void 0}:Rt==="popper"?{"aria-describedby":_e&<!=null?lt:void 0}:void 0}}function bindTrigger(_e){return{...controlAriaProps(_e),onClick:_e.open,onTouchStart:_e.open}}function bindPopover({isOpen:_e,anchorEl:lt,anchorPosition:Rt,close:At,popupId:Pt,onMouseLeave:Lt,disableAutoFocus:Dt,_openEventType:Bt}){return{id:Pt,anchorEl:lt,anchorPosition:Rt,anchorReference:Bt==="contextmenu"?"anchorPosition":"anchorEl",open:_e,onClose:At,onMouseLeave:Lt,...Dt&&{disableAutoFocus:!0,disableEnforceFocus:!0,disableRestoreFocus:!0}}}function bindMenu({isOpen:_e,anchorEl:lt,anchorPosition:Rt,close:At,popupId:Pt,onMouseLeave:Lt,disableAutoFocus:Dt,_openEventType:Bt}){return{id:Pt,anchorEl:lt,anchorPosition:Rt,anchorReference:Bt==="contextmenu"?"anchorPosition":"anchorEl",open:_e,onClose:At,onMouseLeave:Lt,...Dt&&{autoFocus:!1,disableAutoFocusItem:!0,disableAutoFocus:!0,disableEnforceFocus:!0,disableRestoreFocus:!0}}}function getPopup(_e,{popupId:lt}){if(!lt)return null;const Rt=typeof _e.getRootNode=="function"?_e.getRootNode():document;return typeof Rt.getElementById=="function"?Rt.getElementById(lt):null}function isElementInPopup(_e,lt){const{anchorEl:Rt,_childPopupState:At}=lt;return isAncestor(Rt,_e)||isAncestor(getPopup(_e,lt),_e)||At!=null&&isElementInPopup(_e,At)}function isAncestor(_e,lt){if(!_e)return!1;for(;lt;){if(lt===_e)return!0;lt=lt.parentElement}return!1}function PopupState({children:_e,popupId:lt,variant:Rt,parentPopupState:At,disableAutoFocus:Pt}){const Lt=usePopupState({popupId:lt,variant:Rt,parentPopupState:At,disableAutoFocus:Pt}),Dt=_e(Lt);return Dt??null}PopupState.propTypes={children:PropTypes$1.func.isRequired,popupId:PropTypes$1.string,variant:PropTypes$1.oneOf(["popover","popper"]).isRequired,parentPopupState:PropTypes$1.object,disableAutoFocus:PropTypes$1.bool};function ViewControls({onSplitHorizontal:_e,onClose:lt,onSplitVertical:Rt,closeDisabled:At,splitHorizontalDisabled:Pt,splitVerticalDisabled:Lt,onPopOut:Dt,popOutDisabled:Bt}){return jsxRuntimeExports.jsx(PopupState,{variant:"popover",children:Nt=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Stack$1,{sx:{m:1},children:jsxRuntimeExports.jsx(Tooltip$1,{title:"Panel Options",children:jsxRuntimeExports.jsx(IconButton$1,{size:"small",...bindTrigger(Nt),children:jsxRuntimeExports.jsx(MoreVertOutlined,{fontSize:"small"})})})}),jsxRuntimeExports.jsxs(Menu$1,{...bindMenu(Nt),transformOrigin:{horizontal:"right",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"top"},children:[jsxRuntimeExports.jsxs(MenuItem$1,{onClick:()=>{Rt==null||Rt(),Nt.close()},disabled:Lt,children:[jsxRuntimeExports.jsx(ListItemIcon$1,{children:jsxRuntimeExports.jsx(SplitIcon,{fontSize:"small"})}),jsxRuntimeExports.jsx(ListItemText$1,{children:"Split Vertical"})]}),jsxRuntimeExports.jsxs(MenuItem$1,{onClick:()=>{_e==null||_e(),Nt.close()},disabled:Pt,children:[jsxRuntimeExports.jsx(ListItemIcon$1,{children:jsxRuntimeExports.jsx(SplitIcon,{fontSize:"small",sx:{transform:"rotate(90deg)"}})}),jsxRuntimeExports.jsx(ListItemText$1,{children:"Split Horizontal"})]}),jsxRuntimeExports.jsx(Divider$1,{}),!(Bt||At)&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(MenuItem$1,{onClick:()=>{Dt==null||Dt(),lt==null||lt(),Nt.close()},children:[jsxRuntimeExports.jsx(ListItemIcon$1,{children:jsxRuntimeExports.jsx(OpenInNewOutlined,{fontSize:"small"})}),jsxRuntimeExports.jsx(ListItemText$1,{children:"Pop Out"})]}),jsxRuntimeExports.jsx(Divider$1,{})]}),jsxRuntimeExports.jsxs(MenuItem$1,{onClick:()=>{lt==null||lt(),Nt.close()},disabled:At,children:[jsxRuntimeExports.jsx(ListItemIcon$1,{children:jsxRuntimeExports.jsx(CloseOutlined,{fontSize:"small"})}),jsxRuntimeExports.jsx(ListItemText$1,{children:"Close Panel"})]})]})]})})}function findInTree(_e,lt){const Rt=At=>{var Pt;return"children"in At&&((Pt=At.children)!=null&&Pt.length)?lodashExports$1.flatMap(At.children,Rt):[At]};return lodashExports$1.find(Rt(_e),lt)}const ViewTreeContext=reactExports.createContext({});function useViewTreeContext(){return reactExports.useContext(ViewTreeContext)}function handleSwap(_e,lt,Rt){const At=findInTree(_e,Lt=>Lt.key===lt),Pt=findInTree(_e,Lt=>Lt.key===Rt);if((At==null?void 0:At.type)==="leaf"&&(Pt==null?void 0:Pt.type)==="leaf"){const Lt=At.content,Dt=Pt.content;At.content=Dt,Pt.content=Lt}return _e}function ViewTree(_e){const{onChange:lt,root:Rt}=_e;return jsxRuntimeExports.jsx(DndProvider,{backend:HTML5Backend,children:jsxRuntimeExports.jsx(ViewBranch,{..._e,onSwap:(At,Pt)=>{Rt&&(lt==null||lt(produce(Rt,Lt=>handleSwap(Lt,At,Pt))))}})})}function ViewLeaf({root:_e={type:"leaf",key:""},renderLeaf:lt,onChange:Rt,onClose:At,onPopOut:Pt,canPopOut:Lt,depth:Dt=0,onSwap:Bt}){const[{isOver:Nt},jt]=useDrop(()=>({accept:["panel"],collect:Xt=>({isOver:Xt.isOver()&&Xt.getItem().key!==_e.key}),drop:Xt=>Bt==null?void 0:Bt(Xt.key,_e.key)})),[{isDragging:Ut},Gt]=useDrag(()=>({type:"panel",item:{key:_e.key},collect:Xt=>({isDragging:Xt.isDragging()})})),qt=reactExports.useMemo(()=>{const Xt=Kt=>Rt==null?void 0:Rt(produce2(_e,Zt=>({key:nanoid$1(),type:"branch",orientation:Kt,children:[{...structuredClone(Zt),size:50,key:nanoid$1()},{...structuredClone(Zt),size:50,key:nanoid$1()}]})));return _e.type==="leaf"?{isViewTree:!0,state:_e.content,controls:jsxRuntimeExports.jsx(ViewControls,{onClose:At,closeDisabled:!Dt,onSplitHorizontal:()=>Xt("horizontal"),onSplitVertical:()=>Xt("vertical"),onPopOut:()=>Pt==null?void 0:Pt(_e),popOutDisabled:!(Lt!=null&&Lt(_e))}),dragHandle:jsxRuntimeExports.jsx(Box$1,{ref:Gt,sx:{display:"flex",alignItems:"center"},children:jsxRuntimeExports.jsx(DragIndicatorOutlined,{fontSize:"small",color:"disabled",sx:{mr:.5,cursor:"grab"}})}),onChange:Kt=>Rt==null?void 0:Rt(produce(_e,Zt=>{Zt.content={...Zt.content,...Kt}}))}:{}},[Rt,At,Dt,_e,Gt]);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Flex,{ref:jt,sx:{overflow:"hidden","::before":{pointerEvents:"none",content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:1,boxShadow:Xt=>Nt?`inset 0 0 0 2px ${Xt.palette.primary.main}`:"none",transition:Xt=>Xt.transitions.create("box-shadow")},transition:Xt=>Xt.transitions.create("opacity"),opacity:Xt=>Ut?Xt.palette.action.disabledOpacity:1},children:jsxRuntimeExports.jsx(ViewTreeContext.Provider,{value:qt,children:lt==null?void 0:lt(_e)})})})}function ViewBranch(_e){const{root:lt={type:"leaf",key:""},onChange:Rt,depth:At=0}=_e,{palette:Pt,spacing:Lt,transitions:Dt}=useTheme(),Bt=useCss$1({"div&":{background:Pt.text.secondary,opacity:0,transition:Dt.create("opacity"),"&.Horizontal":{width:"3px"},"&.Vertical":{height:"3px"}}}),Nt=useCss$1({"div&":{background:Pt.mode==="dark"?Pt.background.default:Pt.divider,boxShadow:`inset 0 0 0 1px ${Pt.background.paper}`,[`&:hover .${Bt}`]:{opacity:1},"&.Horizontal":{padding:0,width:"3px"},"&.Vertical":{padding:0}}}),jt=Gt=>Number(Lt(Gt).slice(0,-2));function Ut(Gt){const qt=100-lodashExports$1.sumBy(Gt,"size"),Xt=lodashExports$1.filter(Gt,Kt=>!Kt.size).length;return Xt?qt/Xt:0}return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:lt.type==="leaf"?jsxRuntimeExports.jsx(ViewLeaf,{..._e}):jsxRuntimeExports.jsx(m$4,{gutterClassName:Nt,draggerClassName:Bt,onResizeFinished:(Gt,qt)=>Rt==null?void 0:Rt(produce(lt,Xt=>{lodashExports$1.forEach(qt,(Kt,Zt)=>{Xt.children[Zt].size=Kt})})),minHeights:lodashExports$1.map(lt.children,()=>jt(6)-8),minWidths:lodashExports$1.map(lt.children,()=>jt(32)),initialSizes:lodashExports$1.map(lt.children,(Gt,qt,Xt)=>Gt.size??Ut(Xt)),direction:{vertical:z$3.Vertical,horizontal:z$3.Horizontal}[lt.orientation],children:lodashExports$1.map(lt.children,(Gt,qt)=>reactExports.createElement(ViewBranch,{..._e,key:Gt.key,depth:At+1,root:Gt,onChange:Xt=>Rt==null?void 0:Rt(produce(lt,Kt=>Kt.children[qt]=Xt)),onClose:()=>Rt==null?void 0:Rt(produce2(lt,Xt=>(Xt.children.splice(qt,1),Xt.children.length===1?Xt.children[0].type==="leaf"?{type:"leaf",key:nanoid$1(),content:Xt.children[0].content}:Xt.children[0]:(lodashExports$1.forEach(Xt.children,(Kt,Zt,Qt)=>Kt.size=100/Qt.length),Xt))))}))})})}const logo=""+new URL("logo512-23eace97.png",import.meta.url).href,name$1="Visualiser",version="1.1.7",version_name="1.1.7; mid February 2024",repository="https://github.com/path-visualiser/app",docs="https://github.com/path-visualiser/app/blob/master/docs",homepage="https://path-visualiser.github.io/",contacts=[{name:"Dr Daniel Harabor",email:"daniel.harabor@monash.edu"},{name:"Dr Michael Wybrow",email:"michael.wybrow@monash.edu"},{name:"Karan Batta",email:"krnbatta@gmail.com"},{name:"Jay Wingate",email:"jaypeterwingate@gmail.com"},{name:"Kevin Zheng",email:"kzhe0012@student.monash.edu"},{name:"Leo Whitehead",email:"leo@whiteheadsoftware.dev"},{name:"Can Wang",email:"camwang@outlook.com"},{name:"Rory Tobin-Underwood",email:"rorytu@gmail.com"}];function AboutPage({template:_e}){const{controls:lt,onChange:Rt,state:At,dragHandle:Pt}=useViewTreeContext();function Lt(Dt,Bt){return jsxRuntimeExports.jsxs(Box$1,{sx:{pt:2},children:[jsxRuntimeExports.jsx(Type$2,{variant:"overline",color:"text.secondary",children:Dt}),jsxRuntimeExports.jsx(Type$2,{variant:"body2",children:Bt})]})}return jsxRuntimeExports.jsxs(_e,{onChange:Rt,stack:At,children:[jsxRuntimeExports.jsx(_e.Handle,{children:Pt}),jsxRuntimeExports.jsx(_e.Content,{children:jsxRuntimeExports.jsxs(Flex,{children:[" ",jsxRuntimeExports.jsx(Scroll,{y:!0,children:jsxRuntimeExports.jsxs(Box$1,{sx:{p:2},children:[jsxRuntimeExports.jsx(Box$1,{sx:{pt:6,pb:2},children:jsxRuntimeExports.jsx("img",{src:logo,height:"64"})}),jsxRuntimeExports.jsx(Type$2,{variant:"h6",children:name$1}),Lt("Build Info",jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:version_name})),Lt("About this App",jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[name$1," is a visualising debugging tool for pathfinding search. It can be used to visualise progression of search and debug pathfinding algorithms. It can handle range of different types of algorithms (demos are provided in the home page). This tool is highly customizable and provide flexibility to visualise any algorithm trace that you can augment using our docs."]})),Lt("Team",jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:["Our team is made up of present/past Monash students and Professors Dr Daniel Harabor:",jsxRuntimeExports.jsx(List$2,{sx:{mx:-2},children:contacts.map(({name:Dt,email:Bt},Nt)=>jsxRuntimeExports.jsxs(ListItemButton$1,{href:`mailto:${Bt}`,children:[jsxRuntimeExports.jsx(ListItemAvatar$1,{children:jsxRuntimeExports.jsx(Avatar$1,{children:lodashExports$1.head(Dt)})}),jsxRuntimeExports.jsx(ListItemText$1,{primary:Dt,secondary:Bt})]},Nt))})]})),Lt("Resources",jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(List$2,{sx:{mx:-2},children:jsxRuntimeExports.jsxs(ListItemButton$1,{target:"_blank",href:"https://github.com/path-visualiser",children:[jsxRuntimeExports.jsx(ListItemIcon$1,{children:jsxRuntimeExports.jsx(GitHub,{})}),jsxRuntimeExports.jsx(ListItemText$1,{primary:"Repository",secondary:"https://github.com/path-visualiser"})]})})}))]})})]})}),jsxRuntimeExports.jsx(_e.Extras,{children:lt})]})}const Context=reactExports.createContext(null);function useUniquePrefix(){const[_e,lt]=reactExports.useState(null);return reactExports.useEffect(()=>{lt(`mui-p-${Math.round(Math.random()*1e5)}`)},[]),_e}function TabContext(_e){const{children:lt,value:Rt}=_e,At=useUniquePrefix(),Pt=reactExports.useMemo(()=>({idPrefix:At,value:Rt}),[At,Rt]);return jsxRuntimeExports.jsx(Context.Provider,{value:Pt,children:lt})}function useTabContext(){return reactExports.useContext(Context)}function getPanelId(_e,lt){const{idPrefix:Rt}=_e;return Rt===null?null:`${_e.idPrefix}-P-${lt}`}function getTabId(_e,lt){const{idPrefix:Rt}=_e;return Rt===null?null:`${_e.idPrefix}-T-${lt}`}const _excluded$4=["children"],TabList=reactExports.forwardRef(function(lt,Rt){const{children:At}=lt,Pt=_objectWithoutPropertiesLoose$3(lt,_excluded$4),Lt=useTabContext();if(Lt===null)throw new TypeError("No TabContext provided");const Dt=reactExports.Children.map(At,Bt=>reactExports.isValidElement(Bt)?reactExports.cloneElement(Bt,{"aria-controls":getPanelId(Lt,Bt.props.value),id:getTabId(Lt,Bt.props.value)}):null);return jsxRuntimeExports.jsx(Tabs$1,_extends$2({},Pt,{ref:Rt,value:Lt.value,children:Dt}))}),TabList$1=TabList;function getTabPanelUtilityClass(_e){return generateUtilityClass$1("MuiTabPanel",_e)}generateUtilityClasses$1("MuiTabPanel",["root"]);const _excluded$3=["children","className","value"],useUtilityClasses=_e=>{const{classes:lt}=_e;return composeClasses({root:["root"]},getTabPanelUtilityClass,lt)},TabPanelRoot=styled$1("div",{name:"MuiTabPanel",slot:"Root",overridesResolver:(_e,lt)=>lt.root})(({theme:_e})=>({padding:_e.spacing(3)})),TabPanel=reactExports.forwardRef(function(lt,Rt){const At=useThemeProps({props:lt,name:"MuiTabPanel"}),{children:Pt,className:Lt,value:Dt}=At,Bt=_objectWithoutPropertiesLoose$3(At,_excluded$3),Nt=_extends$2({},At),jt=useUtilityClasses(Nt),Ut=useTabContext();if(Ut===null)throw new TypeError("No TabContext provided");const Gt=getPanelId(Ut,Dt),qt=getTabId(Ut,Dt);return jsxRuntimeExports.jsx(TabPanelRoot,_extends$2({"aria-labelledby":qt,className:clsx(jt.root,Lt),hidden:Dt!==Ut.value,id:Gt,ref:Rt,role:"tabpanel",ownerState:Nt},Bt,{children:Dt===Ut.value&&Pt}))}),TabPanel$1=TabPanel;function useSmallDisplay(){const _e=useTheme();return useMediaQuery(_e.breakpoints.down("sm"))}const itemHeight$1=_e=>_e?48:36,padding$1=8;function Select({trigger:_e,items:lt,value:Rt,onChange:At,showTooltip:Pt,placeholder:Lt="Select Option"}){const Dt=useSmallDisplay(),Bt=lodashExports$1.max([lodashExports$1.findIndex(lt,{value:Rt}),0])??0;return jsxRuntimeExports.jsx(PopupState,{variant:"popover",children:Nt=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Tooltip$1,{title:Lt,children:jsxRuntimeExports.jsx("span",{children:_e==null?void 0:_e(bindTrigger(Nt))})}),jsxRuntimeExports.jsx(Menu$1,{...bindMenu(Nt),anchorOrigin:{horizontal:"center",vertical:-itemHeight$1(Dt)*Bt-padding$1},transformOrigin:{vertical:"top",horizontal:"center"},children:lodashExports$1.map(lt,({value:jt,label:Ut,disabled:Gt,icon:qt})=>jsxRuntimeExports.jsx(Tooltip$1,{title:Pt&&jt,placement:"right",children:jsxRuntimeExports.jsxs(MenuItem$1,{disabled:Gt,value:jt,selected:jt===Rt,onClick:()=>{Nt.close(),At==null||At(jt)},children:[qt&&jsxRuntimeExports.jsx(ListItemIcon$1,{sx:{transform:"scale(0.8)"},children:qt}),Ut]},jt)},jt))})]})})}function SelectField(_e){const{placeholder:lt,value:Rt,items:At=[],onChange:Pt}=_e;return jsxRuntimeExports.jsx(TextField$1,{sx:{minWidth:120},select:!0,label:lt,defaultValue:Rt,variant:"filled",..._e,onChange:Lt=>Pt==null?void 0:Pt(Lt.target.value),children:lodashExports$1.map(At,Lt=>jsxRuntimeExports.jsx(MenuItem$1,{value:Lt.value,children:Lt.label},Lt.value))})}const defaultRemotes=[{url:"https://cdn.jsdelivr.net/gh/path-visualiser/app@adapter-warthog-wasm-dist/warthog-wasm.mjs",transport:"ipc",key:"default-ipc"}],defaultRenderers=[{url:"internal://d2-renderer/",key:"d2-renderer",transport:"native"}],defaultPlaybackRate=1,defaults$3={renderer:defaultRenderers,remote:defaultRemotes,"playback/playbackRate":defaultPlaybackRate,"appearance/theme":"dark","appearance/acrylic":!0,"appearance/accentColor":"blue","behaviour/showOnStart":"explore"},[useSettings,SettingsProvider]=createSlice({},withLocalStorage("settings",defaults$3)),{common:common$1,...accentColors}=colors,shadow=` 0px 4px 9px -1px rgb(0 0 0 / 4%), 0px 5px 24px 0px rgb(0 0 0 / 4%), 0px 10px 48px 0px rgb(0 0 0 / 4%) `,getShade=(_e="blue",lt="light",Rt)=>colors[_e][Rt??(lt==="dark"?"A100":"A700")],fontFamily=`"Inter", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", - "Droid Sans", "Helvetica Neue", "Arial", sans-serif`,makeTheme=(_e,lt)=>createTheme({palette:{primary:{main:getShade(lt,_e)},mode:_e,background:_e==="dark"?{default:"#0a0c10",paper:"#111317"}:{default:"#f6f8fa",paper:"#ffffff"}},typography:{allVariants:{fontFamily},button:{textTransform:"none",fontWeight:400,letterSpacing:0,backgroundColor:"background.paper"},subtitle2:{marginTop:6,fontWeight:400}},components:{MuiPopover:{styleOverrides:{paper:{backgroundImage:"linear-gradient(rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.06))"}}},MuiTooltip:{styleOverrides:{tooltip:{backgroundImage:"linear-gradient(#1c2128, #1c2128)",fontFamily}}},MuiTypography:{styleOverrides:{body1:{fontWeight:400,fontSize:"0.875rem"},overline:{fontWeight:400,textTransform:"none",letterSpacing:0,fontSize:"0.875rem"},h6:{fontWeight:500,letterSpacing:-.4}}}},shadows:["",...lodashExports$1.times(24,lodashExports$1.constant(shadow))]});function useAcrylic(){const[{"appearance/acrylic":_e}]=useSettings();return _e?{backdropFilter:"blur(10px)",background:({palette:lt})=>alpha(lt.background.paper,.75)}:{backdropFilter:"blur(0px)",background:({palette:lt})=>lt.background.paper}}function usePaper(){return(_e=1)=>({boxShadow:({shadows:lt,palette:Rt})=>Rt.mode==="dark"?lt[1]:lt[Math.max(_e-1,0)],backgroundColor:({palette:lt})=>lt.mode==="dark"?alpha(lt.action.disabledBackground,_e*.02):lt.background.paper,border:({palette:lt})=>lt.mode==="dark"?`1px solid ${alpha(lt.text.primary,_e*.08)}`:`1px solid ${alpha(lt.text.primary,_e*.16)}`})}const textFieldProps={variant:"filled"};function FeaturePickerButton({children:_e,icon:lt,showArrow:Rt,...At}){return jsxRuntimeExports.jsx(MuiButton,{...At,sx:{minWidth:0,...At.sx},startIcon:lt,endIcon:Rt&&jsxRuntimeExports.jsx(KeyboardArrowDownOutlined,{sx:{ml:-.5,color:"text.primary",opacity:Pt=>At.disabled?Pt.palette.action.disabledOpacity:1}}),children:jsxRuntimeExports.jsx(Box$1,{sx:{color:"text.primary",opacity:Pt=>At.disabled?Pt.palette.action.disabledOpacity:1},children:_e})})}function FeaturePicker({label:_e,value:lt,onChange:Rt,items:At,icon:Pt,showArrow:Lt,disabled:Dt,ButtonProps:Bt,showTooltip:Nt,itemOrientation:jt="horizontal"}){const{palette:Ut}=useTheme(),Gt=(Xt,Kt)=>Xt&&reactExports.cloneElement(Xt,{sx:{color:Kt?getShade(Kt,Ut.mode):"primary.main"}}),qt=lodashExports$1.find(At,{id:lt});return jsxRuntimeExports.jsx(Select,{showTooltip:Nt,placeholder:lodashExports$1.startCase(_e),trigger:Xt=>jsxRuntimeExports.jsx(FeaturePickerButton,{...Xt,...Bt,disabled:!(At!=null&&At.length)||Dt,icon:qt!=null&&qt.icon?Gt(qt.icon,qt.color):Pt,showArrow:Lt,children:(qt==null?void 0:qt.name)??_e}),items:lodashExports$1.map(At,({id:Xt,name:Kt,description:Zt,hidden:Qt,icon:Jt,color:en})=>({value:Xt,label:jsxRuntimeExports.jsxs(Flex,{vertical:jt==="vertical",children:[jsxRuntimeExports.jsxs(Type$2,{children:[Kt,jsxRuntimeExports.jsx(Space,{})]}),jsxRuntimeExports.jsx(Type$2,{variant:"body2",color:"text.secondary",children:Zt})]}),icon:Gt(Jt,en),disabled:Qt})),value:qt==null?void 0:qt.id,onChange:Rt})}function _defineProperty$3(_e,lt,Rt){return lt in _e?Object.defineProperty(_e,lt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):_e[lt]=Rt,_e}function ownKeys$2(_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$2(_e){for(var lt=1;lt=0)&&(Rt[Pt]=_e[Pt]);return Rt}function _objectWithoutProperties(_e,lt){if(_e==null)return{};var Rt=_objectWithoutPropertiesLoose$1(_e,lt),At,Pt;if(Object.getOwnPropertySymbols){var Lt=Object.getOwnPropertySymbols(_e);for(Pt=0;Pt=0)&&Object.prototype.propertyIsEnumerable.call(_e,At)&&(Rt[At]=_e[At])}return Rt}function _slicedToArray$1(_e,lt){return _arrayWithHoles$1(_e)||_iterableToArrayLimit$1(_e,lt)||_unsupportedIterableToArray$1(_e,lt)||_nonIterableRest$1()}function _arrayWithHoles$1(_e){if(Array.isArray(_e))return _e}function _iterableToArrayLimit$1(_e,lt){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(_e)))){var Rt=[],At=!0,Pt=!1,Lt=void 0;try{for(var Dt=_e[Symbol.iterator](),Bt;!(At=(Bt=Dt.next()).done)&&(Rt.push(Bt.value),!(lt&&Rt.length===lt));At=!0);}catch(Nt){Pt=!0,Lt=Nt}finally{try{!At&&Dt.return!=null&&Dt.return()}finally{if(Pt)throw Lt}}return Rt}}function _unsupportedIterableToArray$1(_e,lt){if(_e){if(typeof _e=="string")return _arrayLikeToArray$1(_e,lt);var Rt=Object.prototype.toString.call(_e).slice(8,-1);if(Rt==="Object"&&_e.constructor&&(Rt=_e.constructor.name),Rt==="Map"||Rt==="Set")return Array.from(_e);if(Rt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Rt))return _arrayLikeToArray$1(_e,lt)}}function _arrayLikeToArray$1(_e,lt){(lt==null||lt>_e.length)&&(lt=_e.length);for(var Rt=0,At=new Array(lt);RtcreateTheme({palette:{primary:{main:getShade(lt,_e)},mode:_e,background:_e==="dark"?{default:"#0a0c10",paper:"#111317"}:{default:"#f6f8fa",paper:"#ffffff"}},typography:{allVariants:{fontFamily},button:{textTransform:"none",fontWeight:400,letterSpacing:0,backgroundColor:"background.paper"},subtitle2:{marginTop:6,fontWeight:400}},components:{MuiPopover:{styleOverrides:{paper:{backgroundImage:"linear-gradient(rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.06))"}}},MuiTooltip:{styleOverrides:{tooltip:{backgroundImage:"linear-gradient(#1c2128, #1c2128)",fontFamily}}},MuiTypography:{styleOverrides:{body1:{fontWeight:400,fontSize:"0.875rem"},overline:{fontWeight:400,textTransform:"none",letterSpacing:0,fontSize:"0.875rem"},h4:{marginBottom:12},h6:{fontWeight:500,letterSpacing:-.4}}}},shadows:["",...lodashExports$1.times(24,lodashExports$1.constant(shadow))]});function useAcrylic(){const[{"appearance/acrylic":_e}]=useSettings();return _e?{backdropFilter:"blur(10px)",background:({palette:lt})=>alpha(lt.background.paper,.75)}:{backdropFilter:"blur(0px)",background:({palette:lt})=>lt.background.paper}}function usePaper(){return(_e=1)=>({boxShadow:({shadows:lt,palette:Rt})=>Rt.mode==="dark"?lt[1]:lt[Math.max(_e-1,0)],backgroundColor:({palette:lt})=>lt.mode==="dark"?alpha(lt.action.disabledBackground,_e*.02):lt.background.paper,border:({palette:lt})=>lt.mode==="dark"?`1px solid ${alpha(lt.text.primary,_e*.08)}`:`1px solid ${alpha(lt.text.primary,_e*.16)}`})}const textFieldProps={variant:"filled"};function FeaturePickerButton({children:_e,icon:lt,showArrow:Rt,...At}){return jsxRuntimeExports.jsx(MuiButton,{...At,sx:{minWidth:0,...At.sx},startIcon:lt,endIcon:Rt&&jsxRuntimeExports.jsx(KeyboardArrowDownOutlined,{sx:{ml:-.5,color:"text.primary",opacity:Pt=>At.disabled?Pt.palette.action.disabledOpacity:1}}),children:jsxRuntimeExports.jsx(Box$1,{sx:{color:"text.primary",opacity:Pt=>At.disabled?Pt.palette.action.disabledOpacity:1},children:_e})})}function FeaturePicker({label:_e,value:lt,onChange:Rt,items:At,icon:Pt,showArrow:Lt,disabled:Dt,ButtonProps:Bt,showTooltip:Nt,itemOrientation:jt="horizontal"}){const{palette:Ut}=useTheme(),Gt=(Xt,Kt)=>Xt&&reactExports.cloneElement(Xt,{sx:{color:Kt?getShade(Kt,Ut.mode):"primary.main"}}),qt=lodashExports$1.find(At,{id:lt});return jsxRuntimeExports.jsx(Select,{showTooltip:Nt,placeholder:lodashExports$1.startCase(_e),trigger:Xt=>jsxRuntimeExports.jsx(FeaturePickerButton,{...Xt,...Bt,disabled:!(At!=null&&At.length)||Dt,icon:qt!=null&&qt.icon?Gt(qt.icon,qt.color):Pt,showArrow:Lt,children:(qt==null?void 0:qt.name)??_e}),items:lodashExports$1.map(At,({id:Xt,name:Kt,description:Zt,hidden:Qt,icon:Jt,color:en})=>({value:Xt,label:jsxRuntimeExports.jsxs(Flex,{vertical:jt==="vertical",children:[jsxRuntimeExports.jsxs(Type$2,{children:[Kt,jsxRuntimeExports.jsx(Space,{})]}),jsxRuntimeExports.jsx(Type$2,{variant:"body2",color:"text.secondary",children:Zt})]}),icon:Gt(Jt,en),disabled:Qt})),value:qt==null?void 0:qt.id,onChange:Rt})}function _defineProperty$3(_e,lt,Rt){return lt in _e?Object.defineProperty(_e,lt,{value:Rt,enumerable:!0,configurable:!0,writable:!0}):_e[lt]=Rt,_e}function ownKeys$2(_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$2(_e){for(var lt=1;lt=0)&&(Rt[Pt]=_e[Pt]);return Rt}function _objectWithoutProperties(_e,lt){if(_e==null)return{};var Rt=_objectWithoutPropertiesLoose$1(_e,lt),At,Pt;if(Object.getOwnPropertySymbols){var Lt=Object.getOwnPropertySymbols(_e);for(Pt=0;Pt=0)&&Object.prototype.propertyIsEnumerable.call(_e,At)&&(Rt[At]=_e[At])}return Rt}function _slicedToArray$1(_e,lt){return _arrayWithHoles$1(_e)||_iterableToArrayLimit$1(_e,lt)||_unsupportedIterableToArray$1(_e,lt)||_nonIterableRest$1()}function _arrayWithHoles$1(_e){if(Array.isArray(_e))return _e}function _iterableToArrayLimit$1(_e,lt){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(_e)))){var Rt=[],At=!0,Pt=!1,Lt=void 0;try{for(var Dt=_e[Symbol.iterator](),Bt;!(At=(Bt=Dt.next()).done)&&(Rt.push(Bt.value),!(lt&&Rt.length===lt));At=!0);}catch(Nt){Pt=!0,Lt=Nt}finally{try{!At&&Dt.return!=null&&Dt.return()}finally{if(Pt)throw Lt}}return Rt}}function _unsupportedIterableToArray$1(_e,lt){if(_e){if(typeof _e=="string")return _arrayLikeToArray$1(_e,lt);var Rt=Object.prototype.toString.call(_e).slice(8,-1);if(Rt==="Object"&&_e.constructor&&(Rt=_e.constructor.name),Rt==="Map"||Rt==="Set")return Array.from(_e);if(Rt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Rt))return _arrayLikeToArray$1(_e,lt)}}function _arrayLikeToArray$1(_e,lt){(lt==null||lt>_e.length)&&(lt=_e.length);for(var Rt=0,At=new Array(lt);Rt=_e.length?_e.apply(this,Pt):function(){for(var Dt=arguments.length,Bt=new Array(Dt),Nt=0;Nt1&&arguments[1]!==void 0?arguments[1]:{};validators$1.initial(_e),validators$1.handler(lt);var Rt={current:_e},At=curry$1(didStateUpdate)(Rt,lt),Pt=curry$1(updateState)(Rt),Lt=curry$1(validators$1.changes)(_e),Dt=curry$1(extractChanges)(Rt);function Bt(){var jt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(Ut){return Ut};return validators$1.selector(jt),jt(Rt.current)}function Nt(jt){compose$3(At,Pt,Lt,Dt)(jt)}return[Bt,Nt]}function extractChanges(_e,lt){return isFunction$4(lt)?lt(_e.current):lt}function updateState(_e,lt){return _e.current=_objectSpread2$1(_objectSpread2$1({},_e.current),lt),lt}function didStateUpdate(_e,lt,Rt){return isFunction$4(lt)?lt(_e.current):Object.keys(Rt).forEach(function(At){var Pt;return(Pt=lt[At])===null||Pt===void 0?void 0:Pt.call(lt,_e.current[At])}),Rt}var index$1={create:create$5},config$2={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}};function curry(_e){return function lt(){for(var Rt=this,At=arguments.length,Pt=new Array(At),Lt=0;Lt=_e.length?_e.apply(this,Pt):function(){for(var Dt=arguments.length,Bt=new Array(Dt),Nt=0;Nt0&&(Ut.anchors=new Map(Gt.map(function(en){return[Pt.anchors.map[en],{alias:[],aliasCount:0,count:1}]})));var qt=toJSON(this.contents,Rt,Ut);if(typeof At=="function"&&Ut.anchors){var Xt=_createForOfIteratorHelper(Ut.anchors.values()),Kt;try{for(Xt.s();!(Kt=Xt.n()).done;){var Zt=Kt.value,Qt=Zt.count,Jt=Zt.res;At(Jt,Qt)}}catch(en){Xt.e(en)}finally{Xt.f()}}return qt}},{key:"toString",value:function(){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");var Rt=this.options.indent;if(!Number.isInteger(Rt)||Rt<=0){var At=JSON.stringify(Rt);throw new Error('"indent" option must be a positive integer, not '.concat(At))}this.setSchema();var Pt=[],Lt=!1;if(this.version){var Dt="%YAML 1.2";this.schema.name==="yaml-1.1"&&(this.version==="1.0"?Dt="%YAML:1.0":this.version==="1.1"&&(Dt="%YAML 1.1")),Pt.push(Dt),Lt=!0}var Bt=this.listNonDefaultTags();this.tagPrefixes.forEach(function(Xt){var Kt=Xt.handle,Zt=Xt.prefix;Bt.some(function(Qt){return Qt.indexOf(Zt)===0})&&(Pt.push("%TAG ".concat(Kt," ").concat(Zt)),Lt=!0)}),(Lt||this.directivesEndMarker)&&Pt.push("---"),this.commentBefore&&((Lt||!this.directivesEndMarker)&&Pt.unshift(""),Pt.unshift(this.commentBefore.replace(/^/gm,"#")));var Nt={anchors:Object.create(null),doc:this,indent:"",indentStep:" ".repeat(Rt),stringify:stringify$1$1},jt=!1,Ut=null;if(this.contents){this.contents instanceof Node$2&&(this.contents.spaceBefore&&(Lt||this.directivesEndMarker)&&Pt.push(""),this.contents.commentBefore&&Pt.push(this.contents.commentBefore.replace(/^/gm,"#")),Nt.forceBlockIndent=!!this.comment,Ut=this.contents.comment);var Gt=Ut?null:function(){return jt=!0},qt=stringify$1$1(this.contents,Nt,function(){return Ut=null},Gt);Pt.push(addComment(qt,"",Ut))}else this.contents!==void 0&&Pt.push(stringify$1$1(this.contents,Nt));return this.comment&&((!jt||Ut)&&Pt[Pt.length-1]!==""&&Pt.push(""),Pt.push(this.comment.replace(/^/gm,"#"))),Pt.join(` `)+` -`}}]),_e}();_defineProperty(Document$1,"defaults",documentOptions);function createNode$1(_e){var lt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,Rt=arguments.length>2?arguments[2]:void 0;Rt===void 0&&typeof lt=="string"&&(Rt=lt,lt=!0);var At=Object.assign({},Document$1.defaults[defaultOptions.version],defaultOptions),Pt=new Schema(At);return Pt.createNode(_e,lt,Rt)}var Document=function(_e){_inherits(Rt,_e);var lt=_createSuper(Rt);function Rt(At){return _classCallCheck(this,Rt),lt.call(this,Object.assign({},defaultOptions,At))}return Rt}(Document$1);function parseAllDocuments(_e,lt){var Rt=[],At,Pt=_createForOfIteratorHelper(parse$5(_e)),Lt;try{for(Pt.s();!(Lt=Pt.n()).done;){var Dt=Lt.value,Bt=new Document(lt);Bt.parse(Dt,At),Rt.push(Bt),At=Bt}}catch(Nt){Pt.e(Nt)}finally{Pt.f()}return Rt}function parseDocument(_e,lt){var Rt=parse$5(_e),At=new Document(lt).parse(Rt[0]);if(Rt.length>1){var Pt="Source contains multiple documents; please use YAML.parseAllDocuments()";At.errors.unshift(new YAMLSemanticError(Rt[1],Pt))}return At}function parse$4(_e,lt){var Rt=parseDocument(_e,lt);if(Rt.warnings.forEach(function(At){return warn(At)}),Rt.errors.length>0)throw Rt.errors[0];return Rt.toJSON()}function stringify$2(_e,lt){var Rt=new Document(lt);return Rt.contents=_e,String(Rt)}var YAML={createNode:createNode$1,defaultOptions,Document,parse:parse$4,parseAllDocuments,parseCST:parse$5,parseDocument,scalarOptions,stringify:stringify$2};const dist$3=Object.freeze(Object.defineProperty({__proto__:null,YAML},Symbol.toStringTag,{value:"Module"})),require$$0=getAugmentedNamespace(dist$3);var browser=require$$0.YAML;function Button({children:_e,sx:lt,...Rt}){return jsxRuntimeExports.jsx(MuiButton,{disableElevation:!0,variant:"outlined",color:"primary",...Rt,sx:{borderColor:At=>alpha(At.palette.text.primary,At.palette.action.activatedOpacity),...lt},children:jsxRuntimeExports.jsx(Box$1,{sx:{color:"text.primary"},children:_e})})}const paths=Object.assign({"/public/recipes/9-tiles.workspace":()=>__vitePreload(()=>import("./9-tiles-1f224294.js"),[],import.meta.url).then(_e=>_e.default),"/public/recipes/a-star-grid-search.workspace":()=>__vitePreload(()=>import("./a-star-grid-search-ffae5751.js"),[],import.meta.url).then(_e=>_e.default),"/public/recipes/dynamic-star-craft.workspace":()=>__vitePreload(()=>import("./dynamic-star-craft-6a733d35.js"),[],import.meta.url).then(_e=>_e.default),"/public/recipes/rayscan.workspace":()=>__vitePreload(()=>import("./rayscan-202b7804.js"),[],import.meta.url).then(_e=>_e.default),"/public/recipes/weighted-a-star.workspace":()=>__vitePreload(()=>import("./weighted-a-star-756c8812.js"),[],import.meta.url).then(_e=>_e.default)}),metaPaths=Object.assign({"/public/recipes/9-tiles.workspace.meta":()=>__vitePreload(()=>import("./9-tiles.workspace-621e8328.js"),[],import.meta.url).then(_e=>_e.default),"/public/recipes/a-star-grid-search.workspace.meta":()=>__vitePreload(()=>import("./a-star-grid-search.workspace-8079d31e.js"),[],import.meta.url).then(_e=>_e.default),"/public/recipes/dynamic-star-craft.workspace.meta":()=>__vitePreload(()=>import("./dynamic-star-craft.workspace-5fa26288.js"),[],import.meta.url).then(_e=>_e.default),"/public/recipes/rayscan.workspace.meta":()=>__vitePreload(()=>import("./rayscan.workspace-b6c007ed.js"),[],import.meta.url).then(_e=>_e.default),"/public/recipes/weighted-a-star.workspace.meta":()=>__vitePreload(()=>import("./weighted-a-star.workspace-13502ed5.js"),[],import.meta.url).then(_e=>_e.default)});function stripExtension(_e){return _e.split(".")[0]}function basename(_e){return _e.split("/").pop()}async function getMeta(_e){const lt=metaPaths[_e.replace(/workspace$/,"workspace.meta")],Rt=await(lt==null?void 0:lt());if(Rt){const At=await fetch(Rt);return browser.parse(await At.text())}}async function getFileInfo(_e,lt){return{name:lodashExports$1.chain(_e).thru(basename).thru(stripExtension).startCase().value(),path:await lt(),...await getMeta(_e)}}const makeAvatar=_e=>lt=>jsxRuntimeExports.jsx(Avatar$1,{sx:lt,children:_e});function getAuthor(_e){if(_e){try{const{protocol:lt,pathname:Rt}=new URL(_e);switch(lt){case"github:":return{name:Rt,avatar:At=>jsxRuntimeExports.jsx("a",{href:`https://github.com/${Rt}`,target:"_blank",rel:"noreferrer",children:jsxRuntimeExports.jsx(Avatar$1,{sx:At,src:`https://github.com/${Rt}.png`})})};default:break}}catch{}return{name:_e,avatar:makeAvatar(_e[0])}}return{name:"No author",avatar:makeAvatar()}}const ellipsisProps={textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"};function FeatureCard({name:_e,description:lt,image:Rt,author:At,size:Pt,onOpenClick:Lt,...Dt}){const[{"appearance/acrylic":Bt}]=useSettings(),Nt=usePaper(),{name:jt,avatar:Ut}=reactExports.useMemo(()=>getAuthor(At),[At]);return jsxRuntimeExports.jsxs(Card$1,{variant:"outlined",sx:{...Nt(1),position:"relative",height:"100%"},...Dt,children:[Bt&&jsxRuntimeExports.jsx(Box$1,{sx:{zIndex:-1,filter:"blur(64px)",opacity:.15,position:"absolute",width:"100%",height:"100%",backgroundImage:`url("${Rt}")`,backgroundSize:"200%",backgroundPosition:"bottom right"}}),jsxRuntimeExports.jsx(CardHeader$1,{sx:{alignItems:"flex-start","> .MuiCardHeader-content":{overflow:"hidden"}},avatar:jsxRuntimeExports.jsx(Box$1,{sx:{...Nt(1),border:"none",borderRadius:1,width:64,height:64,overflow:"hidden"},children:jsxRuntimeExports.jsx(Box$1,{sx:{width:64,height:64,backgroundImage:`url("${Rt}")`,backgroundSize:"cover",backgroundPosition:"center"}})}),titleTypographyProps:ellipsisProps,title:_e||"Untitled",subheaderTypographyProps:ellipsisProps,subheader:jsxRuntimeExports.jsxs(Stack$1,{gap:2,sx:{pt:1,alignItems:"flex-start"},children:[jsxRuntimeExports.jsx(Box$1,{sx:{...ellipsisProps,maxWidth:"100%",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:3,whiteSpace:"break-spaces",height:60},children:lt||"No description"}),jsxRuntimeExports.jsxs(Stack$1,{direction:"row",alignItems:"center",gap:1,children:[Ut==null?void 0:Ut({width:18,height:18,fontSize:"0.8rem"}),jsxRuntimeExports.jsx(Type$2,{variant:"caption",children:jt})]}),jsxRuntimeExports.jsx(Button,{onClick:Lt,startIcon:jsxRuntimeExports.jsx(WorkspacesOutlined,{}),sx:Nt(2),children:jsxRuntimeExports.jsxs(Stack$1,{direction:"row",gap:1,children:[jsxRuntimeExports.jsx(Type$2,{children:"Open"}),!!Pt&&jsxRuntimeExports.jsxs(Type$2,{color:"text.secondary",children:[lodashExports$1.round(Pt/1024/1024,2)," MB"]})]})})]})})]})}function ExplorePage({template:_e}){const lt=useSnackbar(),{controls:Rt,onChange:At,state:Pt,dragHandle:Lt}=useViewTreeContext(),[Dt,Bt]=reactExports.useState(""),[Nt,jt]=reactExports.useState("explore"),{load:Ut}=useWorkspace(),Gt=useLoadingState(),{result:qt,loading:Xt}=useAsync(async()=>await map$6(lodashExports$1.entries(paths),Qt=>getFileInfo(...Qt)),[]),Kt=Qt=>Gt(async()=>{try{lt(`Loading ${basename(Qt)}...`);const Jt=await fetch(Qt);Jt.ok||lt(`Couldn't load ${basename(Qt)}`,"Network error",{error:!0});const en=await Jt.blob(),tn=new File([en],basename(Qt),{type:en.type});Ut(tn)}catch(Jt){lt(`Couldn't load ${basename(Qt)}`,`${Jt}`,{error:!0})}}),Zt=reactExports.useMemo(()=>lodashExports$1.filter(qt,Qt=>lodashExports$1.upperCase(browser.stringify(Qt)).includes(lodashExports$1.upperCase(Dt))),[Dt,qt]);return jsxRuntimeExports.jsx(TabContext,{value:Nt,children:jsxRuntimeExports.jsxs(_e,{onChange:At,stack:Pt,children:[jsxRuntimeExports.jsx(_e.Handle,{children:Lt}),jsxRuntimeExports.jsx(_e.Options,{children:jsxRuntimeExports.jsxs(TabList$1,{onChange:(Qt,Jt)=>jt(Jt),children:[jsxRuntimeExports.jsx(Tab$1,{label:"Examples",value:"explore"}),jsxRuntimeExports.jsx(Tab$1,{label:"Guides",value:"guides"})]})}),jsxRuntimeExports.jsx(_e.Content,{children:jsxRuntimeExports.jsx(Flex,{vertical:!0,children:jsxRuntimeExports.jsx(Scroll,{y:!0,children:jsxRuntimeExports.jsxs(Box$1,{pt:6,children:[jsxRuntimeExports.jsxs(TabPanel$1,{value:"explore",sx:{p:0},children:[jsxRuntimeExports.jsxs(Box$1,{p:2,children:[jsxRuntimeExports.jsx(Type$2,{variant:"h6",children:"Examples"}),jsxRuntimeExports.jsx(Type$2,{variant:"subtitle2",color:"text.secondary",children:"Browse a library of included and community-made examples"})]}),jsxRuntimeExports.jsx(Box$1,{px:2,py:1,children:jsxRuntimeExports.jsx(TextField$1,{...textFieldProps,size:"small",hiddenLabel:!0,fullWidth:!0,sx:{maxWidth:480},InputProps:{startAdornment:jsxRuntimeExports.jsx(InputAdornment$1,{position:"start",children:jsxRuntimeExports.jsx(SearchOutlined,{})})},onChange:Qt=>Bt(Qt.target.value),placeholder:"Search examples"})}),Xt?jsxRuntimeExports.jsx(Box$1,{sx:{p:2},children:jsxRuntimeExports.jsx(CircularProgress$1,{})}):jsxRuntimeExports.jsx(Box$1,{sx:{p:1,display:"grid",gridAutoFlow:"row",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 320px), 1fr))"},children:Zt.length?lodashExports$1.map(Zt,({name:Qt,path:Jt,description:en,screenshots:tn,author:an,size:un},cn)=>jsxRuntimeExports.jsx(Box$1,{sx:{p:1},children:jsxRuntimeExports.jsx(FeatureCard,{name:Qt,description:en??"No description",image:lodashExports$1.first(tn),author:an,onOpenClick:()=>Kt(Jt),size:un})},cn)):jsxRuntimeExports.jsx(Type$2,{color:"text.secondary",sx:{p:1},children:"No results match your search."})})]}),jsxRuntimeExports.jsxs(TabPanel$1,{value:"guides",sx:{p:0},children:[jsxRuntimeExports.jsxs(Box$1,{p:2,children:[jsxRuntimeExports.jsx(Type$2,{variant:"h6",children:"Guides"}),jsxRuntimeExports.jsx(Type$2,{variant:"subtitle2",color:"text.secondary",children:`Learn how to use ${name$1} and explore ${name$1} features`})]}),jsxRuntimeExports.jsxs(Stack$1,{sx:{p:2},gap:2,children:[jsxRuntimeExports.jsx(Type$2,{children:"We're still working on this feature. Check out our documentation instead."}),jsxRuntimeExports.jsx(Button,{onClick:()=>window.open(homepage,"_blank"),startIcon:jsxRuntimeExports.jsx(LaunchOutlined,{}),children:"Open Documentation"})]})]})]})})})}),jsxRuntimeExports.jsx(_e.Extras,{children:Rt})]})})}function InfoPage({template:_e}){const{controls:lt,onChange:Rt,state:At,dragHandle:Pt}=useViewTreeContext(),[Lt]=useLog();return jsxRuntimeExports.jsxs(_e,{onChange:Rt,stack:At,children:[jsxRuntimeExports.jsx(_e.Handle,{children:Pt}),jsxRuntimeExports.jsx(_e.Content,{children:jsxRuntimeExports.jsx(Flex,{vertical:!0,children:Lt.length?jsxRuntimeExports.jsx(Scroll,{y:!0,children:jsxRuntimeExports.jsx(List$2,{sx:{pt:6},children:lodashExports$1.map(Lt,(Dt,Bt)=>jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx(ListItem$1,{children:jsxRuntimeExports.jsx(ListItemText$1,{primary:Dt.content,secondary:Dt.timestamp})}),jsxRuntimeExports.jsx(Divider$1,{})]},Bt))})}):jsxRuntimeExports.jsx(Placeholder$2,{pt:6,label:"Logs",icon:jsxRuntimeExports.jsx(LogsIcon,{})})})}),jsxRuntimeExports.jsx(_e.Extras,{children:lt})]})}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 Lt(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&&(On+=bn.value),bn.mode==="max"&&xn<=_n&&(On+=bn.value),ln[Cn]||(ln[Cn]=""),On&&(" "+ln[Cn]+" ").indexOf(" "+On+" ")===-1&&(ln[Cn]+=" "+On));for(var Tn in Pn)Pn.hasOwnProperty(Tn)&&(ln[Pn[Tn]]?this.element.setAttribute(Pn[Tn],ln[Pn[Tn]].substr(1)):this.element.removeAttribute(Pn[Tn]))}}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 Dt[rn]>"u"){Dt[rn]=[];var vn=Bt.length;Lt.innerHTML+=` +`}}]),_e}();_defineProperty(Document$1,"defaults",documentOptions);function createNode$1(_e){var lt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,Rt=arguments.length>2?arguments[2]:void 0;Rt===void 0&&typeof lt=="string"&&(Rt=lt,lt=!0);var At=Object.assign({},Document$1.defaults[defaultOptions.version],defaultOptions),Pt=new Schema(At);return Pt.createNode(_e,lt,Rt)}var Document=function(_e){_inherits(Rt,_e);var lt=_createSuper(Rt);function Rt(At){return _classCallCheck(this,Rt),lt.call(this,Object.assign({},defaultOptions,At))}return Rt}(Document$1);function parseAllDocuments(_e,lt){var Rt=[],At,Pt=_createForOfIteratorHelper(parse$5(_e)),Lt;try{for(Pt.s();!(Lt=Pt.n()).done;){var Dt=Lt.value,Bt=new Document(lt);Bt.parse(Dt,At),Rt.push(Bt),At=Bt}}catch(Nt){Pt.e(Nt)}finally{Pt.f()}return Rt}function parseDocument(_e,lt){var Rt=parse$5(_e),At=new Document(lt).parse(Rt[0]);if(Rt.length>1){var Pt="Source contains multiple documents; please use YAML.parseAllDocuments()";At.errors.unshift(new YAMLSemanticError(Rt[1],Pt))}return At}function parse$4(_e,lt){var Rt=parseDocument(_e,lt);if(Rt.warnings.forEach(function(At){return warn(At)}),Rt.errors.length>0)throw Rt.errors[0];return Rt.toJSON()}function stringify$2(_e,lt){var Rt=new Document(lt);return Rt.contents=_e,String(Rt)}var YAML={createNode:createNode$1,defaultOptions,Document,parse:parse$4,parseAllDocuments,parseCST:parse$5,parseDocument,scalarOptions,stringify:stringify$2};const dist$3=Object.freeze(Object.defineProperty({__proto__:null,YAML},Symbol.toStringTag,{value:"Module"})),require$$0=getAugmentedNamespace(dist$3);var browser=require$$0.YAML;function Button({children:_e,sx:lt,...Rt}){return jsxRuntimeExports.jsx(MuiButton,{disableElevation:!0,variant:"outlined",color:"primary",...Rt,sx:{borderColor:At=>alpha(At.palette.text.primary,At.palette.action.activatedOpacity),...lt},children:jsxRuntimeExports.jsx(Box$1,{sx:{color:"text.primary"},children:_e})})}const paths=Object.assign({"/public/recipes/9-tiles.workspace":()=>__vitePreload(()=>import("./9-tiles-1f224294.js"),[],import.meta.url).then(_e=>_e.default),"/public/recipes/a-star-grid-search.workspace":()=>__vitePreload(()=>import("./a-star-grid-search-ffae5751.js"),[],import.meta.url).then(_e=>_e.default),"/public/recipes/dynamic-star-craft.workspace":()=>__vitePreload(()=>import("./dynamic-star-craft-6a733d35.js"),[],import.meta.url).then(_e=>_e.default),"/public/recipes/rayscan.workspace":()=>__vitePreload(()=>import("./rayscan-202b7804.js"),[],import.meta.url).then(_e=>_e.default),"/public/recipes/weighted-a-star.workspace":()=>__vitePreload(()=>import("./weighted-a-star-756c8812.js"),[],import.meta.url).then(_e=>_e.default)}),metaPaths=Object.assign({"/public/recipes/9-tiles.workspace.meta":()=>__vitePreload(()=>import("./9-tiles.workspace-621e8328.js"),[],import.meta.url).then(_e=>_e.default),"/public/recipes/a-star-grid-search.workspace.meta":()=>__vitePreload(()=>import("./a-star-grid-search.workspace-8079d31e.js"),[],import.meta.url).then(_e=>_e.default),"/public/recipes/dynamic-star-craft.workspace.meta":()=>__vitePreload(()=>import("./dynamic-star-craft.workspace-5fa26288.js"),[],import.meta.url).then(_e=>_e.default),"/public/recipes/rayscan.workspace.meta":()=>__vitePreload(()=>import("./rayscan.workspace-b6c007ed.js"),[],import.meta.url).then(_e=>_e.default),"/public/recipes/weighted-a-star.workspace.meta":()=>__vitePreload(()=>import("./weighted-a-star.workspace-13502ed5.js"),[],import.meta.url).then(_e=>_e.default)});function stripExtension(_e){return _e.split(".")[0]}function basename(_e){return _e.split("/").pop()}async function getMeta(_e){const lt=metaPaths[_e.replace(/workspace$/,"workspace.meta")],Rt=await(lt==null?void 0:lt());if(Rt){const At=await fetch(Rt);return browser.parse(await At.text())}}async function getFileInfo(_e,lt){return{name:lodashExports$1.chain(_e).thru(basename).thru(stripExtension).startCase().value(),path:await lt(),...await getMeta(_e)}}const makeAvatar=_e=>lt=>jsxRuntimeExports.jsx(Avatar$1,{sx:lt,children:_e});function getAuthor(_e){if(_e){try{const{protocol:lt,pathname:Rt}=new URL(_e);switch(lt){case"github:":return{name:Rt,avatar:At=>jsxRuntimeExports.jsx("a",{href:`https://github.com/${Rt}`,target:"_blank",rel:"noreferrer",children:jsxRuntimeExports.jsx(Avatar$1,{sx:At,src:`https://github.com/${Rt}.png`})})};default:break}}catch{}return{name:_e,avatar:makeAvatar(_e[0])}}return{name:"No author",avatar:makeAvatar()}}const ellipsisProps={textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"};function FeatureCard({name:_e,description:lt,image:Rt,author:At,size:Pt,onOpenClick:Lt,...Dt}){const[{"appearance/acrylic":Bt}]=useSettings(),Nt=usePaper(),{name:jt,avatar:Ut}=reactExports.useMemo(()=>getAuthor(At),[At]);return jsxRuntimeExports.jsxs(Card$1,{variant:"outlined",sx:{...Nt(1),position:"relative",height:"100%"},...Dt,children:[Bt&&jsxRuntimeExports.jsx(Box$1,{sx:{zIndex:-1,filter:"blur(64px)",opacity:.15,position:"absolute",width:"100%",height:"100%",backgroundImage:`url("${Rt}")`,backgroundSize:"200%",backgroundPosition:"bottom right"}}),jsxRuntimeExports.jsx(CardHeader$1,{sx:{alignItems:"flex-start","> .MuiCardHeader-content":{overflow:"hidden"}},avatar:jsxRuntimeExports.jsx(Box$1,{sx:{...Nt(1),border:"none",borderRadius:1,width:64,height:64,overflow:"hidden"},children:jsxRuntimeExports.jsx(Box$1,{sx:{width:64,height:64,backgroundImage:`url("${Rt}")`,backgroundSize:"cover",backgroundPosition:"center"}})}),titleTypeProps:ellipsisProps,title:_e||"Untitled",subheaderTypeProps:ellipsisProps,subheader:jsxRuntimeExports.jsxs(Stack$1,{gap:2,sx:{pt:1,alignItems:"flex-start"},children:[jsxRuntimeExports.jsx(Box$1,{sx:{...ellipsisProps,maxWidth:"100%",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:3,whiteSpace:"break-spaces",height:60},children:lt||"No description"}),jsxRuntimeExports.jsxs(Stack$1,{direction:"row",alignItems:"center",gap:1,children:[Ut==null?void 0:Ut({width:18,height:18,fontSize:"0.8rem"}),jsxRuntimeExports.jsx(Type$2,{variant:"caption",children:jt})]}),jsxRuntimeExports.jsx(Button,{onClick:Lt,startIcon:jsxRuntimeExports.jsx(WorkspacesOutlined,{}),sx:Nt(2),children:jsxRuntimeExports.jsxs(Stack$1,{direction:"row",gap:1,children:[jsxRuntimeExports.jsx(Type$2,{children:"Open"}),!!Pt&&jsxRuntimeExports.jsxs(Type$2,{color:"text.secondary",children:[lodashExports$1.round(Pt/1024/1024,2)," MB"]})]})})]})})]})}const CONTENT_WIDTH=940;function ExplorePage({template:_e}){const lt=useSnackbar(),{controls:Rt,onChange:At,state:Pt,dragHandle:Lt,isViewTree:Dt}=useViewTreeContext(),Bt=useSmallDisplay()||Dt,[Nt,jt]=reactExports.useState(""),[Ut,Gt]=reactExports.useState("explore"),{load:qt}=useWorkspace(),Xt=useLoadingState(),{result:Kt,loading:Zt}=useAsync(async()=>await map$6(lodashExports$1.entries(paths),en=>getFileInfo(...en)),[]),Qt=en=>Xt(async()=>{try{lt(`Loading ${basename(en)}...`);const tn=await fetch(en);tn.ok||lt(`Couldn't load ${basename(en)}`,"Network error",{error:!0});const an=await tn.blob(),un=new File([an],basename(en),{type:an.type});qt(un)}catch(tn){lt(`Couldn't load ${basename(en)}`,`${tn}`,{error:!0})}}),Jt=reactExports.useMemo(()=>lodashExports$1.filter(Kt,en=>lodashExports$1.upperCase(browser.stringify(en)).includes(lodashExports$1.upperCase(Nt))),[Nt,Kt]);return jsxRuntimeExports.jsx(TabContext,{value:Ut,children:jsxRuntimeExports.jsxs(_e,{onChange:At,stack:Pt,children:[jsxRuntimeExports.jsx(_e.Handle,{children:Lt}),jsxRuntimeExports.jsx(_e.Options,{children:jsxRuntimeExports.jsxs(TabList$1,{onChange:(en,tn)=>Gt(tn),children:[jsxRuntimeExports.jsx(Tab$1,{label:"Examples",value:"explore"}),jsxRuntimeExports.jsx(Tab$1,{label:"Guides",value:"guides"})]})}),jsxRuntimeExports.jsx(_e.Content,{children:jsxRuntimeExports.jsx(Flex,{vertical:!0,children:jsxRuntimeExports.jsx(Scroll,{y:!0,children:jsxRuntimeExports.jsx(Box$1,{sx:Bt?void 0:{p:4,maxWidth:CONTENT_WIDTH,mx:"auto"},children:jsxRuntimeExports.jsxs(Box$1,{pt:6,children:[jsxRuntimeExports.jsxs(TabPanel$1,{value:"explore",sx:{p:0},children:[jsxRuntimeExports.jsxs(Box$1,{p:2,children:[jsxRuntimeExports.jsx(Type$2,{variant:Bt?"h6":"h4",children:"Examples"}),jsxRuntimeExports.jsx(Type$2,{variant:"subtitle2",color:"text.secondary",children:"Browse a library of included and community-made examples"})]}),jsxRuntimeExports.jsx(Box$1,{px:2,py:1,children:jsxRuntimeExports.jsx(TextField$1,{...textFieldProps,size:"small",hiddenLabel:!0,fullWidth:!0,sx:{maxWidth:480},InputProps:{startAdornment:jsxRuntimeExports.jsx(InputAdornment$1,{position:"start",children:jsxRuntimeExports.jsx(SearchOutlined,{})})},onChange:en=>jt(en.target.value),placeholder:"Search examples"})}),Zt?jsxRuntimeExports.jsx(Box$1,{sx:{p:2},children:jsxRuntimeExports.jsx(CircularProgress$1,{})}):jsxRuntimeExports.jsx(Box$1,{sx:{p:1,display:"grid",gridAutoFlow:"row",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 320px), 1fr))"},children:Jt.length?lodashExports$1.map(Jt,({name:en,path:tn,description:an,screenshots:un,author:cn,size:rn},sn)=>jsxRuntimeExports.jsx(Box$1,{sx:{p:1},children:jsxRuntimeExports.jsx(FeatureCard,{name:en,description:an??"No description",image:lodashExports$1.first(un),author:cn,onOpenClick:()=>Qt(tn),size:rn})},sn)):jsxRuntimeExports.jsx(Type$2,{color:"text.secondary",sx:{p:1},children:"No results match your search."})})]}),jsxRuntimeExports.jsxs(TabPanel$1,{value:"guides",sx:{p:0},children:[jsxRuntimeExports.jsxs(Box$1,{p:2,children:[jsxRuntimeExports.jsx(Type$2,{variant:Bt?"h6":"h4",children:"Guides"}),jsxRuntimeExports.jsx(Type$2,{variant:"subtitle2",color:"text.secondary",children:`Learn how to use ${name$1} and explore ${name$1} features`})]}),jsxRuntimeExports.jsxs(Stack$1,{sx:{p:2},gap:2,children:[jsxRuntimeExports.jsx(Type$2,{children:"We're still working on this feature. Check out our documentation instead."}),jsxRuntimeExports.jsx(Button,{onClick:()=>window.open(homepage,"_blank"),startIcon:jsxRuntimeExports.jsx(LaunchOutlined,{}),children:"Open Documentation"})]})]})]})})})})}),jsxRuntimeExports.jsx(_e.Extras,{children:Rt})]})})}function InfoPage({template:_e}){const{controls:lt,onChange:Rt,state:At,dragHandle:Pt}=useViewTreeContext(),[Lt]=useLog();return jsxRuntimeExports.jsxs(_e,{onChange:Rt,stack:At,children:[jsxRuntimeExports.jsx(_e.Handle,{children:Pt}),jsxRuntimeExports.jsx(_e.Content,{children:jsxRuntimeExports.jsx(Flex,{vertical:!0,children:Lt.length?jsxRuntimeExports.jsx(Scroll,{y:!0,children:jsxRuntimeExports.jsx(List$2,{sx:{pt:6},children:lodashExports$1.map(Lt,(Dt,Bt)=>jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx(ListItem$1,{children:jsxRuntimeExports.jsx(ListItemText$1,{primary:Dt.content,secondary:Dt.timestamp})}),jsxRuntimeExports.jsx(Divider$1,{})]},Bt))})}):jsxRuntimeExports.jsx(Placeholder$2,{pt:6,label:"Logs",icon:jsxRuntimeExports.jsx(LogsIcon,{})})})}),jsxRuntimeExports.jsx(_e.Extras,{children:lt})]})}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 Lt(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&&(On+=bn.value),bn.mode==="max"&&xn<=_n&&(On+=bn.value),ln[Cn]||(ln[Cn]=""),On&&(" "+ln[Cn]+" ").indexOf(" "+On+" ")===-1&&(ln[Cn]+=" "+On));for(var Tn in Pn)Pn.hasOwnProperty(Tn)&&(ln[Pn[Tn]]?this.element.setAttribute(Pn[Tn],ln[Pn[Tn]].substr(1)):this.element.removeAttribute(Pn[Tn]))}}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 Dt[rn]>"u"){Dt[rn]=[];var vn=Bt.length;Lt.innerHTML+=` `+rn+" {animation: 0.1s element-queries;}",Lt.innerHTML+=` `+rn+" > .resize-sensor {min-width: "+vn+"px;}",Bt.push(rn)}Dt[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 Dt)if(Dt.hasOwnProperty(pn))for(var bn=sn(pn,rn),vn=0,_n=bn.length;vn<_n;vn++)qt(bn[vn],pn)}function Qt(rn){var sn=[],pn=[],bn=[],vn=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 On=rn.children[ln].getAttribute("min-width")||rn.children[ln].getAttribute("data-min-width"),Cn=rn.children[ln].getAttribute("data-src")||rn.children[ln].getAttribute("url");bn.push(Cn);var Pn={minWidth:On};pn.push(Pn),On?rn.children[ln].style.display="none":(vn=sn.length-1,rn.children[ln].style.display="block")}_n=vn;function Tn(){var Sn=!1,Fn;for(Fn in sn)sn.hasOwnProperty(Fn)&&pn[Fn].minWidth&&rn.offsetWidth>pn[Fn].minWidth&&(Sn=Fn);if(Sn||(Sn=vn),_n!==Sn)if(xn[Sn])sn[_n].style.display="none",sn[Sn].style.display="block",_n=Sn;else{var $n=new Image;$n.onload=function(){sn[Sn].src=bn[Sn],sn[_n].style.display="none",sn[Sn].style.display="block",xn[Sn]=!0,_n=Sn},$n.src=bn[Sn]}else sn[Sn].src=bn[Sn]}rn.resizeSensorInstance=new Rt(rn,Tn),Tn()}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%;}",Lt.innerHTML+=` @keyframes element-queries { 0% { visibility: inherit; } }`,document.getElementsByTagName("head")[0].appendChild(Lt),cn=!0);for(var sn=0,pn=document.styleSheets.length;sn{if(At&<)return At.addEventListener("scroll",lt,{passive:!0}),()=>At.removeEventListener("scroll",lt)},[At,lt]),jsxRuntimeExports.jsx("div",{...Rt,style:{height:"100%",width:"100%",overflow:"hidden scroll",...Rt.style},ref:Lt=>{Pt(Lt),_e==null||_e(Lt)},children:jsxRuntimeExports.jsx(PanelContext.Provider,{value:At,children:jsxRuntimeExports.jsx("div",{style:{width:"100%"},children:Rt.children})})})}const PanelContext=reactExports.createContext(null);function usePanel(){return reactExports.useContext(PanelContext)}function useScrollState(_e=128){const[lt,Rt]=reactExports.useState(!0),[At,Pt]=reactExports.useState(!0),[Lt,Dt]=reactExports.useState(!0),[Bt,Nt]=reactExports.useState(null),jt=reactExports.useRef(0);return reactExports.useEffect(()=>{if(Bt){const Ut=()=>{{const Gt=Bt.scrollTop<=_e;Gt!==Lt&&Dt(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,Lt,At,jt,_e]),[lt||Lt,Lt,At,Bt,Nt]}function AppBarTitle({children:_e}){return jsxRuntimeExports.jsx(Type$2,{variant:"h6",children:_e})}function ModalAppBar({onClose:_e=()=>{},style:lt,elevatedStyle:Rt,children:At,transitionProperties:Pt=["box-shadow","background","border-bottom"],elevatedChildren:Lt,simple:Dt,position:Bt="sticky"}){const Nt=usePanel(),jt=useTheme(),[,,Ut,,Gt]=useScrollState();reactExports.useEffect(()=>{Gt(Nt)},[Nt,Gt]);const qt=Ut?{background:jt.palette.background.paper,...!Dt&&{boxShadow:jt.shadows[0]},...lt}:{background:jt.palette.background.paper,...!Dt&&{boxShadow:jt.shadows[4]},...Rt};return jsxRuntimeExports.jsx(AppBar$1,{elevation:0,position:Bt,style:{color:jt.palette.text.primary,transition:jt.transitions.create(Pt),...qt},children:jsxRuntimeExports.jsxs(Toolbar$1,{children:[jsxRuntimeExports.jsx(IconButton$1,{style:{marginRight:jt.spacing(1)},"aria-label":"open drawer",edge:"start",onClick:()=>_e(),children:jsxRuntimeExports.jsx(ArrowBack,{})}),At&&jsxRuntimeExports.jsx("div",{style:{gridColumn:1,gridRow:1,flex:1,overflow:"auto"},children:jsxRuntimeExports.jsx(Fade$1,{in:!!(!Lt||Ut),mountOnEnter:!0,unmountOnExit:!0,children:jsxRuntimeExports.jsx(Box$1,{style:{width:"100%"},children:At})})}),Lt&&jsxRuntimeExports.jsx("div",{style:{gridColumn:1,gridRow:1,flex:1,overflow:"auto"},children:jsxRuntimeExports.jsx(Fade$1,{in:!!(Lt&&!Ut),mountOnEnter:!0,unmountOnExit:!0,children:jsxRuntimeExports.jsx(Box$1,{style:{width:"100%"},children:Lt})})})]})})}function Modal({children:_e,actions:lt,width:Rt=480,height:At,onTarget:Pt,variant:Lt="default",scrollable:Dt=!0,...Bt}){var un;const[Nt,jt]=reactExports.useState(void 0);reactExports.useEffect(()=>{_e&&jt(_e)},[_e]);const Ut=useTheme(),Gt=useSmallDisplay(),[qt,Xt]=reactExports.useState(null),[Kt,Zt]=reactExports.useState(null),[Qt,Jt]=reactExports.useState(!1),[en,tn]=reactExports.useState(0);reactExports.useEffect(()=>{if(qt&&Kt&&!Gt&&!At){const cn=()=>{const sn=window.innerHeight-64{window.removeEventListener("resize",cn),rn.detach()}}},[qt,Kt,Gt,At]);const an=Lt==="submodal"&≫return jsxRuntimeExports.jsxs(Dialog$1,{fullScreen:Gt,...Bt,style:{...an&&{paddingTop:Ut.spacing(8)},...Bt.style},PaperProps:{ref:cn=>Xt(cn),style:{...an&&{borderRadius:`${Ut.shape.borderRadius}px ${Ut.shape.borderRadius}px 0 0`},background:Gt?Ut.palette.background.default:Ut.palette.background.paper,overflow:"hidden",height:At&&!Gt?At:Qt||Gt?"100%":en||"fit-content",position:"relative",maxWidth:"none",...Gt&&{paddingTop:36},...(un=Bt.PaperProps)==null?void 0:un.style},...Bt.PaperProps},children:[jsxRuntimeExports.jsx(ScrollPanel,{style:{height:"100%",width:Gt?void 0:Rt,maxWidth:"100%",overflow:Dt?void 0:"hidden"},onTarget:Pt,children:jsxRuntimeExports.jsx("div",{ref:cn=>Zt(cn),style:{width:"100%",height:"100%"},children:Nt})}),lt]})}function ManagedModal({options:_e,appBar:lt,trigger:Rt=()=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{}),children:At}){return jsxRuntimeExports.jsx(PopupState,{variant:"popover",children:({open:Pt,close:Lt,isOpen:Dt})=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[reactExports.cloneElement(Rt(Pt)),jsxRuntimeExports.jsxs(Modal,{open:Dt,onClose:Lt,..._e,children:[jsxRuntimeExports.jsx(ModalAppBar,{onClose:Lt,...lt}),At??(_e==null?void 0:_e.children)]})]})})}const compositeOperations=["color","color-burn","color-dodge","copy","darken","destination-atop","destination-in","destination-out","destination-over","difference","exclusion","hard-light","hue","lighten","lighter","luminosity","multiply","overlay","saturation","screen","soft-light","source-atop","source-in","source-out","source-over","xor"];function useDraft(_e,lt,Rt=600){const[At,Pt]=reactExports.useState(_e);reactExports.useEffect(()=>void Pt(_e),[Pt,_e]);const Lt=reactExports.useMemo(()=>lodashExports$1.debounce(Dt=>lt==null?void 0:lt(Dt),Rt),[lt,Rt]);return[At,Dt=>{Pt(Dt),Lt(Dt)}]}function Component({value:_e,onValueChange:lt},Rt){var Ut,Gt,qt;const[At,Pt]=useDraft(_e,lt),Lt=Xt=>jsxRuntimeExports.jsx(Type$2,{variant:"overline",color:"text.secondary",sx:{pt:1},component:"p",children:Xt}),Dt=Xt=>jsxRuntimeExports.jsx(Type$2,{variant:"body1",children:Xt}),Bt=(Xt,Kt)=>jsxRuntimeExports.jsxs(Flex,{alignItems:"center",children:[Dt(Xt),jsxRuntimeExports.jsx(Space,{flex:1}),Kt]}),Nt=Xt=>Xt.map(Kt=>({id:Kt,name:lodashExports$1.startCase(Kt)})),jt=At.name||inferLayerName(_e);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs(Stack$1,{alignItems:"center",direction:"row",gap:2,children:[jsxRuntimeExports.jsxs(Box$1,{py:1,ml:-1,children:[jsxRuntimeExports.jsx(Type$2,{children:jt}),jsxRuntimeExports.jsx(Type$2,{variant:"body2",color:"text.secondary",children:lodashExports$1.startCase((Ut=At.source)==null?void 0:Ut.type)})]}),jsxRuntimeExports.jsx(Space,{flex:1}),jsxRuntimeExports.jsx(Stack$1,{alignItems:"center",direction:"row",children:jsxRuntimeExports.jsx(ManagedModal,{appBar:{children:jsxRuntimeExports.jsx(AppBarTitle,{children:"Edit Layer"})},trigger:Xt=>jsxRuntimeExports.jsx(IconButton$1,{size:"small",onClick:Xt,children:jsxRuntimeExports.jsx(EditIcon,{})}),children:jsxRuntimeExports.jsxs(Box$1,{p:2,children:[jsxRuntimeExports.jsx(Box$1,{pb:2,children:jsxRuntimeExports.jsx(TextField$1,{fullWidth:!0,variant:"filled",label:"Layer Name",defaultValue:At.name??"",onChange:Xt=>Pt==null?void 0:Pt(produce(At,Kt=>lodashExports$1.set(Kt,"name",Xt.target.value)))})}),Lt("Layer Options"),Bt("Transparency",jsxRuntimeExports.jsx(FeaturePicker,{label:"Transparency",items:["0","25","50","75"].map(Xt=>({id:Xt,name:`${Xt}%`})),value:At.transparency??"0",showArrow:!0,onChange:Xt=>Pt==null?void 0:Pt(produce(At,Kt=>lodashExports$1.set(Kt,"transparency",Xt)))})),Bt("Display Mode",jsxRuntimeExports.jsx(FeaturePicker,{label:"Display Mode",value:At.displayMode??"source-over",items:Nt(compositeOperations),showArrow:!0,onChange:Xt=>Pt==null?void 0:Pt(produce(At,Kt=>lodashExports$1.set(Kt,"displayMode",Xt)))})),Lt("Source Options"),Bt("Type",jsxRuntimeExports.jsx(FeaturePicker,{label:"Type",value:(Gt=At.source)==null?void 0:Gt.type,items:lodashExports$1.keys(layerHandlers).map(Xt=>({id:Xt,name:lodashExports$1.startCase(Xt)})),onChange:Xt=>Pt==null?void 0:Pt(produce(At,Kt=>{lodashExports$1.set(Kt,"source",{type:Xt})})),showArrow:!0})),((qt=At.source)==null?void 0:qt.type)&&reactExports.createElement(layerHandlers[At.source.type].editor,{onChange:Xt=>Pt(Xt(At)),value:At})]})})})]})})}const LayerEditor=reactExports.forwardRef(Component);function LayerListEditor(){const[{layers:_e=[]},lt]=useLayers();return jsxRuntimeExports.jsx(Box$1,{sx:{overflow:"auto hidden",width:"100%"},children:jsxRuntimeExports.jsx(Box$1,{sx:{mb:2},children:jsxRuntimeExports.jsx(ListEditor,{sortable:!0,icon:null,value:_e,deletable:!0,orderable:!0,extras:Rt=>jsxRuntimeExports.jsx(PopupState,{variant:"popover",children:At=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Menu$1,{...bindMenu(At),children:jsxRuntimeExports.jsx(MenuList$1,{dense:!0,sx:{p:0},children:[{name:"Fit Layer",key:"fit-layer",action:()=>lt(({layers:Pt})=>({layers:lodashExports$1.map(Pt,Lt=>({...Lt,viewKey:Lt.key===(Rt==null?void 0:Rt.key)?nanoid$1():void 0}))}))}].map(({name:Pt,key:Lt,action:Dt})=>jsxRuntimeExports.jsx(MenuItem$1,{onClick:()=>{Dt==null||Dt(),At.close()},children:Pt},Lt))})}),jsxRuntimeExports.jsx(IconButton$1,{...bindTrigger(At),children:jsxRuntimeExports.jsx(MoreVertOutlined,{})})]})}),editor:Rt=>jsxRuntimeExports.jsx(LayerEditor,{value:Rt}),create:()=>({source:{type:"trace",trace:{}}}),onChange:Rt=>lt(()=>({layers:Rt})),addItemLabel:"Layer",placeholder:jsxRuntimeExports.jsx(Box$1,{pt:2,children:"Click the button below to add a layer."})})})})}function LayersPage({template:_e}){const{controls:lt,onChange:Rt,state:At,dragHandle:Pt}=useViewTreeContext();return jsxRuntimeExports.jsxs(_e,{onChange:Rt,stack:At,children:[jsxRuntimeExports.jsx(_e.Handle,{children:Pt}),jsxRuntimeExports.jsx(_e.Content,{children:jsxRuntimeExports.jsx(Box$1,{p:2,pr:1,pt:6,children:jsxRuntimeExports.jsx(LayerListEditor,{})})}),jsxRuntimeExports.jsx(_e.Extras,{children:lt})]})}function OverlineDot(_e){return jsxRuntimeExports.jsx(FiberManualRecord,{..._e,sx:{fontSize:12,transform:"translateY(1.75px) translateX(-2px)",..._e.sx}})}function Overline({children:_e}){return jsxRuntimeExports.jsx(Type$2,{variant:"overline",sx:{my:-.75,display:"block"},children:_e})}var lodash={exports:{}};/** diff --git a/index.html b/index.html index ed9f544e..9c31df3c 100644 --- a/index.html +++ b/index.html @@ -10,7 +10,7 @@ - +