From e2aa4f500bc3a4626e15a8e07be9e1b76d240126 Mon Sep 17 00:00:00 2001 From: Sadanand Pai Date: Fri, 5 Apr 2024 16:51:13 +0000 Subject: [PATCH] build files - github action --- docs/assets/{index-D2NvW99C.js => index-CV5pcjUy.js} | 2 +- docs/assets/{index-CdCdsSVj.css => index-DI2khIP7.css} | 2 +- docs/index.html | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) rename docs/assets/{index-D2NvW99C.js => index-CV5pcjUy.js} (96%) rename docs/assets/{index-CdCdsSVj.css => index-DI2khIP7.css} (95%) diff --git a/docs/assets/index-D2NvW99C.js b/docs/assets/index-CV5pcjUy.js similarity index 96% rename from docs/assets/index-D2NvW99C.js rename to docs/assets/index-CV5pcjUy.js index 2e811a9..7512404 100644 --- a/docs/assets/index-D2NvW99C.js +++ b/docs/assets/index-CV5pcjUy.js @@ -232,7 +232,7 @@ dompurify/dist/purify.es.mjs: `},{id:4,heading:"Greedy Best-First Search",content:` Greedy best-first search is an informed search algorithm that finds a path between cells in a grid but does not gaurantee the shortest path. It prioritizes cells based solely on the estimated cost to reach the goal from the current cell. - `}],dO="_infoButton_1nrkm_1",pO="_dialog_1nrkm_18",hO="_closeButton_1nrkm_38",mO="_body_1nrkm_51",gO="_contentHeading_1nrkm_57",yO="_content_1nrkm_57",vO="_contentPara_1nrkm_70",no={infoButton:dO,dialog:pO,closeButton:hO,body:mO,contentHeading:gO,content:yO,contentPara:vO},g1=({content:e})=>{const t=_.useRef(null),n=()=>{var o;(o=t.current)==null||o.showModal()},r=()=>{var o;(o=t.current)==null||o.close()};return x.jsxs(x.Fragment,{children:[x.jsx("button",{onClick:n,className:no.infoButton,children:x.jsx(F_,{size:20})}),cr.createPortal(x.jsxs("dialog",{ref:t,className:no.dialog,children:[x.jsx("button",{onClick:r,className:no.closeButton,children:x.jsx(H_,{})}),x.jsx("div",{className:no.body,children:e.map(o=>x.jsxs("div",{className:no.content,children:[x.jsx("h1",{className:no.contentHeading,children:o.heading}),x.jsx("p",{className:no.contentPara,children:o.content})]},o.id))})]}),document.getElementById("modal"))]})};function wO(e,t){return async function(n,r){const o=r().pathFinder;n(wo(0)),n(Zl(Fe.Generating));function i(s){t&&n(gc({grid:s,clone:!0}))}function a(){return r().pathFinder.status===Fe.Generating}async function l(s,u,c=A.clear){if(!a())throw new Error("Maze generation cancelled");Array.isArray(u)||(u=[u]),u.forEach(f=>{s[f.row][f.col]=c}),t&&(n(Fg({cells:u,cellType:c})),await Eo(t))}try{const s=await e({rows:o.rows,cols:o.cols,entry:o.entry,exit:o.exit,updateGrid:i,updateCells:l});n(gc({grid:s})),n(Zl(Fe.Ready))}catch{}}}const SO="_controller_1m4sf_1",xO="_operation_1m4sf_9",EO="_execution_1m4sf_13",bO="_mazeSelector_1m4sf_17",_O="_pathFinder_1m4sf_18",kO="_speed_1m4sf_26",CO="_play_1m4sf_27",TO="_pathInfo_1m4sf_30",PO="_highlight_1m4sf_34",Gt={controller:SO,operation:xO,execution:EO,mazeSelector:bO,pathFinder:_O,speed:kO,play:CO,pathInfo:TO,highlight:PO};function OO({defaultSpeed:e}){const t=Nt(),[n,r]=_.useState(""),[o,i]=_.useState(Jl.get(e)),a=Pe(d=>d.pathFinder.status),l=n?ic.get(n):null,s=a===Fe.Generating||a===Fe.Searching;function u(d=l){d&&t(wO(d.fn,o))}function c(d){const h=d.target.value;h&&(r(h),u(ic.get(h)))}function f(){t($g()),t(wo(0)),t(ui(0))}return x.jsxs("div",{className:Gt.operation+" select-maze",children:[x.jsx(g1,{content:cO}),x.jsxs("select",{name:"maze",id:"maze",value:n,onChange:c,className:Gt.mazeSelector,disabled:s,children:[x.jsx("option",{value:"",disabled:!0,children:"Select a Maze"}),[...ic.entries()].map(([d,{name:h}])=>x.jsx("option",{value:d,children:h},d))]}),x.jsx("select",{className:Gt.speed,name:"maze-speed",id:"maze-speed",value:o,onChange:d=>i(Number(d.target.value)),disabled:s,children:[...Jl.entries()].map(([d,h])=>x.jsx("option",{value:h,children:d},d))}),x.jsx("button",{className:Gt.play,"data-testid":"generate-maze",onClick:()=>u(),"data-tooltip":"Play",disabled:s||!n,children:x.jsx(g0,{size:20})}),x.jsx("button",{"data-testid":"reset",onClick:f,"data-tooltip":"Reset",children:x.jsx(W_,{size:20})})]})}function RO(e){for(var t=[],n=1;n{let i=0;function a(){return o().pathFinder.status===Fe.Searching}async function l(u,c=A.path){if(!a())throw new Error("Path search cancelled");e[u.row][u.col]=c,i+=1,n&&(r(ui(i)),r(va({...u,cellType:c})),await Eo(n))}const s=o().pathFinder;if(t){Ts.success("Path found!!! 😃");const u=await DO({parents:t,entry:s.entry,exit:s.exit,updateCell:l});r(ui(u+1))}else Ts.error("No path found 😔")}}function FO(e,t){return async(n,r)=>{let o=0;function i(){return r().pathFinder.status===Fe.Searching}async function a(c,f,d=A.clear){if(!i())throw new Error("Path search cancelled");Array.isArray(f)||(f=[f]),f.forEach(h=>{c[h.row][h.col]=d}),o+=f.length,t&&(n(wo(o)),n(Fg({cells:f,cellType:d})),await Eo(t))}const l=r().pathFinder,{grid:s,parents:u}=await e({grid:l.grid,entry:l.entry,exit:l.exit,updateCells:a});return n(wo(o)),{grid:s,parents:u}}}function $O({defaultSpeed:e}){const t=Nt(),[n,r]=_.useState(""),[o,i]=_.useState(Jl.get(e)),a=Pe(y=>y.pathFinder.entry),l=Pe(y=>y.pathFinder.exit),s=Pe(y=>y.pathFinder.status),u=n?oc.get(n):null,c=s===Fe.Generating||s===Fe.Searching;async function f(y,S){if(s===Fe.Complete&&t(Mp()),!!y)try{t(wo(0)),t(ui(0)),t(Zl(Fe.Searching));const{grid:g,parents:p}=await t(FO(y.fn,S));await t(zO(g,p,S)),t(gc({grid:g,clone:!1})),t(Zl(Fe.Complete))}catch{}}async function d(y=u){await f(y,o)}async function h(y){const S=y.target.value;r(S),await f(oc.get(S),o)}function m(){t(Mp()),t(wo(0)),t(ui(0))}return y1(async()=>{s===Fe.Complete&&await f(u,0)},333,[a,l]),x.jsxs("div",{className:Gt.execution+" execution",children:[x.jsx(g1,{content:fO}),x.jsxs("select",{className:Gt.pathFinder,name:"path-finder",id:"path-finder",value:n,onChange:h,disabled:c,children:[x.jsx("option",{value:"",disabled:!0,children:"Select a Path finder"}),[...oc.entries()].map(([y,{name:S}])=>x.jsx("option",{value:y,children:S},y))]}),x.jsx("select",{className:`${Gt.speed}`,name:"path-finder-speed",id:"path-finder-speed",value:o,onChange:y=>i(Number(y.target.value)),disabled:c,children:[...Jl.entries()].map(([y,S])=>x.jsx("option",{value:S,children:y},y))}),x.jsx("button",{className:`${Gt.play}`,"data-testid":"player",disabled:c||!n,"data-tooltip":"Play",onClick:()=>d(),children:x.jsx(g0,{size:20})}),x.jsx("button",{"data-testid":"clear",onClick:m,disabled:s===Fe.Generating,"data-tooltip":"clear",children:x.jsx(U_,{size:20})})]})}function UO(){const[e,t]=_.useState(0),[n,r]=_.useState(!1),o=_.useRef(null);function i(){r(!0),o.current=setInterval(()=>{t(s=>s+1)},100)}function a(){r(!1),o.current&&clearInterval(o.current)}function l(){o.current&&clearInterval(o.current),t(0),r(!1)}return{time:e,isRunning:n,startTimer:i,stopTimer:a,resetTimer:l}}function BO(){const e=Nt(),t=Pe(u=>u.pathFinder.status),n=Pe(u=>u.pathFinder.visitedCellCount),r=Pe(u=>u.pathFinder.pathLength),{time:o,isRunning:i,startTimer:a,stopTimer:l,resetTimer:s}=UO();return _.useEffect(()=>{t===Fe.Searching&&!i&&(s(),a()),Fe.Complete===t&&l(),[Fe.Ready,Fe.Generating].includes(t)&&(s(),e(wo(0)),e(ui(0)))},[t,a,l,i,s,e]),x.jsxs("div",{className:Gt.pathInfo+" path-info",children:[x.jsxs("p",{children:["Visits:"," ",x.jsx("span",{className:Gt.highlight,"data-testid":"visits",children:n})]}),x.jsxs("p",{children:["Path:"," ",x.jsx("span",{className:Gt.highlight,"data-testid":"path",children:r})]}),x.jsxs("p",{children:["Time:"," ",x.jsx("span",{className:Gt.highlight,"data-testid":"time",children:o})]})]})}function WO(){const e=Nt(),t=Pe(a=>a.pathFinder.rows),n=Pe(a=>a.pathFinder.cols),{width:r,height:o}=AO(),i=r<768?Np.mobile:Np.desktop;return y1(()=>{const a=Dg();a.maxRows===t&&a.maxCols===n||(e(xS({rows:a.maxRows,cols:a.maxCols})),e($g()))},333,[r,o]),x.jsxs("section",{className:Gt.controller,children:[x.jsx(OO,{defaultSpeed:i}),x.jsx(BO,{}),x.jsx($O,{defaultSpeed:i})]})}const HO="_grid_58jdc_1",VO="_type0_58jdc_6",GO="_type1_58jdc_9",KO="_type2_58jdc_13",YO="_type3_58jdc_17",qO="_wallAnimation_58jdc_1",QO="_type4_58jdc_22",XO="_visitedAnimation_58jdc_1",JO="_type5_58jdc_27",ng={grid:HO,type0:VO,type1:GO,type2:KO,type3:YO,wallAnimation:qO,type4:QO,visitedAnimation:XO,type5:JO};function rg(){return"ontouchstart"in window||navigator.maxTouchPoints>0}function v1(e){if(!e)return{isValidCell:!1};if(e.tagName!=="BUTTON")return{isValidCell:!1};const t=Number(e.dataset.row??-1),n=Number(e.dataset.col??-1),r=Number(e.dataset.cellType??-1);return t===-1||n===-1||r===-1?{isValidCell:!1}:{isValidCell:!0,selectedCell:{row:t,col:n,cellType:r}}}function ZO({isMobile:e,ref:t}){const n=Nt(),r=_.useRef(null),o=_.useCallback(i=>{const{isValidCell:a,selectedCell:l}=v1(i.target);if(a){if(r.current){[A.entry,A.exit,A.wall].includes(l.cellType)||n(va({...l,cellType:r.current.cellType})),r.current=null;return}if([A.entry,A.exit].includes(l.cellType)){r.current=l;return}n(va({row:l.row,col:l.col,cellType:l.cellType===A.wall?A.clear:A.wall}))}},[n]);_.useEffect(()=>{if(!e)return;const i=t.current;if(i)return i.addEventListener("click",o),()=>{i.removeEventListener("mousedown",o)}},[e,o,t])}function eR({isMobile:e,ref:t}){const[n,r]=_.useState(null),o=_.useRef(!1),i=s=>{s.target&&(o.current=!0,r(s.target))},a=s=>{o.current&&r(s.target)},l=()=>{o.current=!1,r(null)};return _.useEffect(()=>{if(e)return;const s=t.current;if(s)return s.addEventListener("mousedown",i),s.addEventListener("mousemove",a),s.addEventListener("mouseup",l),s.addEventListener("mouseleave",l),()=>{s.removeEventListener("mousedown",i),s.removeEventListener("mouseleave",a),s.removeEventListener("mouseup",l),s.removeEventListener("mouseleave",l)}},[e,t]),{element:n,isMouseDown:o.current}}function tR({isMobile:e,ref:t}){const n=Nt(),{element:r,isMouseDown:o}=eR({isMobile:e,ref:t}),{isValidCell:i,selectedCell:a}=v1(r),l=_.useRef(null),s=_.useRef(null);_.useEffect(()=>{o||(l.current=null,s.current=null)},[o]),_.useEffect(()=>{var c,f;if(!i)return;if(l.current){[A.entry,A.exit,A.wall].includes(a.cellType)||n(va({...a,cellType:l.current.cellType}));return}if([A.entry,A.exit].includes(a.cellType)){l.current=a;return}((c=s.current)==null?void 0:c.row)===a.row&&((f=s.current)==null?void 0:f.col)===a.col||(n(va({row:a.row,col:a.col,cellType:a.cellType===A.wall?A.clear:A.wall})),s.current=a)},[i,a,n])}function nR(){const e=Pe(o=>o.pathFinder.grid),t=Pe(o=>o.pathFinder.status),n=_.useRef(null);tR({isMobile:rg(),ref:n}),ZO({isMobile:rg(),ref:n});const r={gridTemplateRows:`repeat(${e.length}, ${so}px)`,gridTemplateColumns:`repeat(${e[0].length}, ${so}px)`};return x.jsx("div",{className:ng.grid,style:r,ref:n,children:e.map((o,i)=>o.map((a,l)=>x.jsx("button",{"data-row":i,"data-col":l,"data-cell-type":a,className:ng["type"+a],disabled:t===Fe.Searching||t===Fe.Generating},`${i}-${l}`)))})}function rR(){return x.jsxs(x.Fragment,{children:[x.jsx(Zd,{top:10,right:20}),x.jsx(y2,{title:"Path Finder"}),x.jsx(WO,{}),x.jsx("main",{className:"text-center",children:x.jsx(nR,{})})]})}function oR(){return x.jsxs(x.Fragment,{children:[x.jsx(ep,{richColors:!0,duration:3e3,position:"top-center"}),x.jsx(rR,{})]})}const iR=[{path:"/path-finder/",element:x.jsx(oR,{})}];function aR(e){return e=e.replace(/\s/g,""),e=e.replace(/\d{4}/g,""),e=e.replace(/\s\s/g," "),e=e.replace(/\s,/g,","),e=e.replace(/,,/g,","),e=e.replace(/[^0-9,\s]/g,""),e.split(",").join(", ").trim()}function lR(e){return e.split(",").filter(t=>t!=="").map(t=>+t)}function og(e=0,t=999){return Math.floor(Math.random()*(t-e))+e}const sR=e=>{const t=e.length;for(let n=0;nn-r);case"descending":return[...t].sort((n,r)=>r-n);case"random":return sR([...t])}return t}const uR="_controllerWrapper_18ff3_1",cR="_controller_18ff3_1",fR="_numbers_18ff3_9",dR="_generator_18ff3_15",pR="_rndmBtn_18ff3_20",hR="_select_18ff3_28",mR="_arrayInput_18ff3_37",gR="_controls_18ff3_51",yR="_checkboxWrapper_18ff3_63",vR="_listItem_18ff3_70",wR="_checkbox_18ff3_63",SR="_switchContainer_18ff3_87",fn={controllerWrapper:uR,controller:cR,numbers:fR,generator:dR,rndmBtn:pR,select:hR,arrayInput:mR,controls:gR,checkboxWrapper:yR,listItem:vR,checkbox:wR,switchContainer:SR},xR=["random","ascending","descending"];function ER({setInput:e}){const t=Nt(),n=Pe(l=>l.sortViz.array),[r,o]=_.useState("random"),i=()=>{let l=Array.from(new Array(og(jp.min,jp.max)),()=>og());r!=="random"&&(l=ig(r,l)),e(l.join(", ")),t(xc(l))},a=l=>{const s=l.target.value;o(s);const u=ig(s,n);e(u.join(", ")),t(xc(u))};return x.jsxs("div",{className:fn.generator,children:[x.jsx("button",{className:fn.rndmBtn,onClick:i,children:"Generate"}),x.jsx("select",{className:fn.select,onChange:a,value:r,name:"sequence-type",children:xR.map(l=>x.jsx("option",{value:l,children:l},l))})]})}function bR(){const e=Nt(),t=Pe(i=>i.sortViz.array),[n,r]=_.useState(t.join(", "));_.useEffect(()=>{e(ci(!1)),e(Bs())},[t,e]);const o=i=>{const a=aR(i.target.value);r(a);const l=lR(a);e(xc(l))};return x.jsxs("div",{className:fn.numbers,children:[x.jsx(ER,{setInput:r}),x.jsx("input",{id:"user-input",className:fn.arrayInput,type:"text",placeholder:"Numbers to sort (comma separate - max 3 digits)",value:n,onChange:o})]})}const _R="/algo-visualizers/icons/pause.svg",kR="/algo-visualizers/icons/play.svg",CR="/algo-visualizers/icons/reset.svg";function TR(){const e=Nt(),t=Pe(i=>i.sortViz.array),n=Pe(i=>i.sortViz.speed),r=Pe(i=>i.sortViz.isPlaying),o=Pe(i=>i.sortViz.reset);return _.useEffect(()=>{r&&e(WS())},[e,r]),_.useEffect(()=>{e(ci(!1))},[e,o]),_.useEffect(()=>{e(Dp(n))},[e,n]),x.jsxs("div",{className:fn.controls,children:[x.jsx("button",{"data-testid":"player",onClick:()=>e(ci(!r)),disabled:t.length===0||r===null,"data-tooltip":r?"Pause":"Play",children:x.jsx("img",{src:r?_R:kR,alt:r?"Pause":"Play",height:24,width:24})}),x.jsx("button",{onClick:()=>e(Bs()),disabled:t.length===0,"data-tooltip":"Reset",children:x.jsx("img",{src:CR,height:24,width:24})}),x.jsx("input",{id:"speed","data-tooltip":"Animation speed",type:"range",min:1,max:20,value:n,step:1,onChange:i=>e(Dp(i.target.valueAsNumber))})]})}function Mf(){return Mf=Object.assign?Object.assign.bind():function(e){for(var t=1;t=s)&&this.A(n),this.W&&this.setState({N:!1,j:!1}),this.l=Date.now()},t.prototype.p=function(n){n.preventDefault(),typeof n.button=="number"&&n.button!==0||(this.I(n.clientX),window.addEventListener("mousemove",this.v),window.addEventListener("mouseup",this.g))},t.prototype.v=function(n){n.preventDefault(),this.L(n.clientX)},t.prototype.g=function(n){this.U(n),window.removeEventListener("mousemove",this.v),window.removeEventListener("mouseup",this.g)},t.prototype.k=function(n){this.X=null,this.I(n.touches[0].clientX)},t.prototype.m=function(n){this.L(n.touches[0].clientX)},t.prototype.M=function(n){n.preventDefault(),this.U(n)},t.prototype.$=function(n){Date.now()-this.l>50&&(this.A(n),Date.now()-this.u>50&&this.W&&this.setState({j:!1}))},t.prototype.C=function(){this.u=Date.now()},t.prototype.D=function(){this.setState({j:!0})},t.prototype.O=function(){this.setState({j:!1})},t.prototype.S=function(n){this.H=n},t.prototype.T=function(n){n.preventDefault(),this.H.focus(),this.A(n),this.W&&this.setState({j:!1})},t.prototype.A=function(n){var r=this.props;(0,r.onChange)(!r.checked,n,r.id)},t.prototype.render=function(){var n=this.props,r=n.checked,o=n.disabled,i=n.className,a=n.offColor,l=n.onColor,s=n.offHandleColor,u=n.onHandleColor,c=n.checkedIcon,f=n.uncheckedIcon,d=n.checkedHandleIcon,h=n.uncheckedHandleIcon,m=n.boxShadow,y=n.activeBoxShadow,S=n.height,g=n.width,p=n.borderRadius,v=function(Ce,qe){var me={};for(var L in Ce)Object.prototype.hasOwnProperty.call(Ce,L)&&qe.indexOf(L)===-1&&(me[L]=Ce[L]);return me}(n,["checked","disabled","className","offColor","onColor","offHandleColor","onHandleColor","checkedIcon","uncheckedIcon","checkedHandleIcon","uncheckedHandleIcon","boxShadow","activeBoxShadow","height","width","borderRadius","handleDiameter"]),b=this.state,C=b.h,w=b.N,P=b.j,M={position:"relative",display:"inline-block",textAlign:"left",opacity:o?.5:1,direction:"ltr",borderRadius:S/2,WebkitTransition:"opacity 0.25s",MozTransition:"opacity 0.25s",transition:"opacity 0.25s",touchAction:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},I={height:S,width:g,margin:Math.max(0,(this.t-S)/2),position:"relative",background:lg(C,this.i,this.o,a,l),borderRadius:typeof p=="number"?p:S/2,cursor:o?"default":"pointer",WebkitTransition:w?null:"background 0.25s",MozTransition:w?null:"background 0.25s",transition:w?null:"background 0.25s"},$={height:S,width:Math.min(1.5*S,g-(this.t+S)/2+1),position:"relative",opacity:(C-this.o)/(this.i-this.o),pointerEvents:"none",WebkitTransition:w?null:"opacity 0.25s",MozTransition:w?null:"opacity 0.25s",transition:w?null:"opacity 0.25s"},X={height:S,width:Math.min(1.5*S,g-(this.t+S)/2+1),position:"absolute",opacity:1-(C-this.o)/(this.i-this.o),right:0,top:0,pointerEvents:"none",WebkitTransition:w?null:"opacity 0.25s",MozTransition:w?null:"opacity 0.25s",transition:w?null:"opacity 0.25s"},xe={height:this.t,width:this.t,background:lg(C,this.i,this.o,s,u),display:"inline-block",cursor:o?"default":"pointer",borderRadius:typeof p=="number"?p-1:"50%",position:"absolute",transform:"translateX("+C+"px)",top:Math.max(0,(S-this.t)/2),outline:0,boxShadow:P?y:m,border:0,WebkitTransition:w?null:"background-color 0.25s, transform 0.25s, box-shadow 0.15s",MozTransition:w?null:"background-color 0.25s, transform 0.25s, box-shadow 0.15s",transition:w?null:"background-color 0.25s, transform 0.25s, box-shadow 0.15s"},ye={height:this.t,width:this.t,opacity:Math.max(2*(1-(C-this.o)/(this.i-this.o)-.5),0),position:"absolute",left:0,top:0,pointerEvents:"none",WebkitTransition:w?null:"opacity 0.25s",MozTransition:w?null:"opacity 0.25s",transition:w?null:"opacity 0.25s"},le={height:this.t,width:this.t,opacity:Math.max(2*((C-this.o)/(this.i-this.o)-.5),0),position:"absolute",left:0,top:0,pointerEvents:"none",WebkitTransition:w?null:"opacity 0.25s",MozTransition:w?null:"opacity 0.25s",transition:w?null:"opacity 0.25s"};return O.createElement("div",{className:i,style:M},O.createElement("div",{className:"react-switch-bg",style:I,onClick:o?null:this.T,onMouseDown:function(Ce){return Ce.preventDefault()}},c&&O.createElement("div",{style:$},c),f&&O.createElement("div",{style:X},f)),O.createElement("div",{className:"react-switch-handle",style:xe,onClick:function(Ce){return Ce.preventDefault()},onMouseDown:o?null:this.p,onTouchStart:o?null:this.k,onTouchMove:o?null:this.m,onTouchEnd:o?null:this.M,onTouchCancel:o?null:this.O},h&&O.createElement("div",{style:ye},h),d&&O.createElement("div",{style:le},d)),O.createElement("input",Mf({},{type:"checkbox",role:"switch","aria-checked":r,checked:r,disabled:o,style:{border:0,clip:"rect(0 0 0 0)",height:1,margin:-1,overflow:"hidden",padding:0,position:"absolute",width:1}},v,{ref:this.S,onFocus:this.D,onBlur:this.O,onKeyUp:this.C,onChange:this.$})))},t}(_.Component);w1.defaultProps={disabled:!1,offColor:"#888",onColor:"#080",offHandleColor:"#fff",onHandleColor:"#fff",uncheckedIcon:PR,checkedIcon:OR,boxShadow:null,activeBoxShadow:"0 0 2px 3px #3bf",height:28,width:56};function RR(){const e=Nt(),t=Pe(n=>n.sortViz.visualizerType);return x.jsxs("div",{className:fn.switchContainer,children:[x.jsx("span",{children:"Cell"}),x.jsx(w1,{id:"visualizerType",onChange:()=>e(US()),checked:t==="bar",checkedIcon:!1,uncheckedIcon:!1,height:20,width:40,offColor:"#2b4bfe",onColor:"#2b4bfe"}),x.jsx("span",{children:"Bar"})]})}function NR(){const{algoName:e}=Qd(),t=Nt();return _.useEffect(()=>{t(ci(!1)),t(Bs())},[e,t]),x.jsxs("section",{className:fn.controllerWrapper,children:[x.jsxs("div",{className:fn.controller,"data-testid":"controller",children:[x.jsx(bR,{}),x.jsx(TR,{})]}),x.jsx(RR,{})]})}const MR="_navbar_8y9jz_1",IR="_active_8y9jz_40",LR="_hamButton_8y9jz_62",lc={navbar:MR,active:IR,hamButton:LR},jR="/algo-visualizers/icons/ham.svg";function AR({title:e,menuItems:t}){const[n,r]=_.useState(!1);return x.jsxs("nav",{className:lc.navbar,children:[x.jsx(Xd,{title:e}),x.jsxs(x.Fragment,{children:[x.jsx("button",{onClick:()=>r(!n),className:lc.hamButton,children:x.jsx("img",{src:jR,alt:"hamburger"})}),x.jsx("ul",{"data-toggle":n,children:t.map(o=>x.jsx("li",{children:x.jsx(h0,{to:`/sorting-visualizer/${o}`,className:({isActive:i})=>i?lc.active:"",onClick:()=>r(!1),children:o})},o))})]})]})}const DR="_main_1hg6y_1",zR="_allAlgos_1hg6y_6",S1={main:DR,allAlgos:zR};function Is({children:e}){return x.jsxs("div",{children:[x.jsx(Zd,{bottom:10,right:20}),x.jsx(AR,{title:"Sorting Visualizer",menuItems:Wg}),x.jsx(NR,{}),x.jsx("main",{className:S1.main,children:e})]})}const FR="_container_wgxfy_1",$R="_warning_wgxfy_20",x1={container:FR,warning:$R};function E1(){return x.jsx("p",{className:x1.warning,children:"Please enter a valid list of numbers to play with the visualization"})}function UR({algoName:e,isCompleted:t}){const n=Pe(o=>o.sortViz.time),r=_.useRef(0);return _.useEffect(()=>{t&&(r.current=n)},[t]),x.jsxs("header",{children:[x.jsxs("h2",{children:[e," Sort"]}),x.jsxs("span",{children:["Time: ",x.jsx("strong",{children:r.current||n})]})]})}const BR="_arrayContainer_116to_1",WR="_values_116to_6",HR="_pivot_116to_19",VR="_sort_116to_22",GR="_highlight_116to_25",KR="_indices_116to_28",Pl={arrayContainer:BR,values:WR,pivot:HR,sort:VR,highlight:GR,indices:KR};function YR({array:e,sorts:t,highlights:n,pivot:r}){const o=_.useMemo(()=>Math.max(...e),[e]);function i(a){let l="";return r===a&&(l="pivot"),t.includes(a)&&(l="sort"),n.includes(a)&&(l="highlight"),l}return x.jsxs("div",{className:Pl.arrayContainer,children:[x.jsx("ul",{className:Pl.values,"data-testid":"bar-values",children:e.map((a,l)=>x.jsx("li",{className:Pl[i(l)],style:{height:`${a/o*100}%`}},l))}),x.jsx("ul",{className:Pl.indices,children:e.map((a,l)=>x.jsx("li",{children:l},l))})]})}const qR="_arrayContainer_9tgyc_1",QR="_values_9tgyc_6",XR="_cell_9tgyc_10",JR="_pivot_9tgyc_24",ZR="_sort_9tgyc_27",eN="_highlight_9tgyc_30",tN="_indices_9tgyc_33",ma={arrayContainer:qR,values:QR,cell:XR,pivot:JR,sort:ZR,highlight:eN,indices:tN};function cp({order:e,animation:t,value:n,isSorted:r=!1,isHighlighted:o=!1,isPivot:i=!1}){let a="";return i&&(a="pivot"),r&&(a="sort"),o&&(a="highlight"),x.jsx("li",{className:`${ma.cell} ${ma[a]}`,style:{animation:t,order:e},children:n})}const Fo=document.querySelector('[data-id="animation-element"]');function b1(e){var n;const t=(n=Fo==null?void 0:Fo.sheet)==null?void 0:n.insertRule(e);setTimeout(()=>{var r;t&&((r=Fo==null?void 0:Fo.sheet)==null||r.deleteRule(t))},xo)}function _1(e,t=1e3){const n=`anime-${Math.random().toString(36).substring(2,9)}`,r=`${t}ms linear forwards ${n}`,o=Mr.size+Mr.margin,i=`@keyframes ${n} { + `}],dO="_infoButton_1nrkm_1",pO="_dialog_1nrkm_18",hO="_closeButton_1nrkm_38",mO="_body_1nrkm_51",gO="_contentHeading_1nrkm_57",yO="_content_1nrkm_57",vO="_contentPara_1nrkm_70",no={infoButton:dO,dialog:pO,closeButton:hO,body:mO,contentHeading:gO,content:yO,contentPara:vO},g1=({content:e})=>{const t=_.useRef(null),n=()=>{var o;(o=t.current)==null||o.showModal()},r=()=>{var o;(o=t.current)==null||o.close()};return x.jsxs(x.Fragment,{children:[x.jsx("button",{onClick:n,className:no.infoButton,children:x.jsx(F_,{size:20})}),cr.createPortal(x.jsxs("dialog",{ref:t,className:no.dialog,children:[x.jsx("button",{onClick:r,className:no.closeButton,children:x.jsx(H_,{})}),x.jsx("div",{className:no.body,children:e.map(o=>x.jsxs("div",{className:no.content,children:[x.jsx("h1",{className:no.contentHeading,children:o.heading}),x.jsx("p",{className:no.contentPara,children:o.content})]},o.id))})]}),document.getElementById("modal"))]})};function wO(e,t){return async function(n,r){const o=r().pathFinder;n(wo(0)),n(Zl(Fe.Generating));function i(s){t&&n(gc({grid:s,clone:!0}))}function a(){return r().pathFinder.status===Fe.Generating}async function l(s,u,c=A.clear){if(!a())throw new Error("Maze generation cancelled");Array.isArray(u)||(u=[u]),u.forEach(f=>{s[f.row][f.col]=c}),t&&(n(Fg({cells:u,cellType:c})),await Eo(t))}try{const s=await e({rows:o.rows,cols:o.cols,entry:o.entry,exit:o.exit,updateGrid:i,updateCells:l});n(gc({grid:s})),n(Zl(Fe.Ready))}catch{}}}const SO="_controller_1ap2y_1",xO="_operation_1ap2y_9",EO="_execution_1ap2y_13",bO="_mazeSelector_1ap2y_17",_O="_pathFinder_1ap2y_18",kO="_speed_1ap2y_26",CO="_play_1ap2y_27",TO="_pathInfo_1ap2y_30",PO="_highlight_1ap2y_34",Gt={controller:SO,operation:xO,execution:EO,mazeSelector:bO,pathFinder:_O,speed:kO,play:CO,pathInfo:TO,highlight:PO};function OO({defaultSpeed:e}){const t=Nt(),[n,r]=_.useState(""),[o,i]=_.useState(Jl.get(e)),a=Pe(d=>d.pathFinder.status),l=n?ic.get(n):null,s=a===Fe.Generating||a===Fe.Searching;function u(d=l){d&&t(wO(d.fn,o))}function c(d){const h=d.target.value;h&&(r(h),u(ic.get(h)))}function f(){t($g()),t(wo(0)),t(ui(0))}return x.jsxs("div",{className:Gt.operation+" select-maze",children:[x.jsx(g1,{content:cO}),x.jsxs("select",{name:"maze",id:"maze",value:n,onChange:c,className:Gt.mazeSelector,disabled:s,children:[x.jsx("option",{value:"",disabled:!0,children:"Select a Maze"}),[...ic.entries()].map(([d,{name:h}])=>x.jsx("option",{value:d,children:h},d))]}),x.jsx("select",{className:Gt.speed,name:"maze-speed",id:"maze-speed",value:o,onChange:d=>i(Number(d.target.value)),disabled:s,children:[...Jl.entries()].map(([d,h])=>x.jsx("option",{value:h,children:d},d))}),x.jsx("button",{className:Gt.play,"data-testid":"generate-maze",onClick:()=>u(),"data-tooltip":"Play",disabled:s||!n,children:x.jsx(g0,{size:20})}),x.jsx("button",{"data-testid":"reset",onClick:f,"data-tooltip":"Reset",children:x.jsx(W_,{size:20})})]})}function RO(e){for(var t=[],n=1;n{let i=0;function a(){return o().pathFinder.status===Fe.Searching}async function l(u,c=A.path){if(!a())throw new Error("Path search cancelled");e[u.row][u.col]=c,i+=1,n&&(r(ui(i)),r(va({...u,cellType:c})),await Eo(n))}const s=o().pathFinder;if(t){Ts.success("Path found!!! 😃");const u=await DO({parents:t,entry:s.entry,exit:s.exit,updateCell:l});r(ui(u+1))}else Ts.error("No path found 😔")}}function FO(e,t){return async(n,r)=>{let o=0;function i(){return r().pathFinder.status===Fe.Searching}async function a(c,f,d=A.clear){if(!i())throw new Error("Path search cancelled");Array.isArray(f)||(f=[f]),f.forEach(h=>{c[h.row][h.col]=d}),o+=f.length,t&&(n(wo(o)),n(Fg({cells:f,cellType:d})),await Eo(t))}const l=r().pathFinder,{grid:s,parents:u}=await e({grid:l.grid,entry:l.entry,exit:l.exit,updateCells:a});return n(wo(o)),{grid:s,parents:u}}}function $O({defaultSpeed:e}){const t=Nt(),[n,r]=_.useState(""),[o,i]=_.useState(Jl.get(e)),a=Pe(y=>y.pathFinder.entry),l=Pe(y=>y.pathFinder.exit),s=Pe(y=>y.pathFinder.status),u=n?oc.get(n):null,c=s===Fe.Generating||s===Fe.Searching;async function f(y,S){if(s===Fe.Complete&&t(Mp()),!!y)try{t(wo(0)),t(ui(0)),t(Zl(Fe.Searching));const{grid:g,parents:p}=await t(FO(y.fn,S));await t(zO(g,p,S)),t(gc({grid:g,clone:!1})),t(Zl(Fe.Complete))}catch{}}async function d(y=u){await f(y,o)}async function h(y){const S=y.target.value;r(S),await f(oc.get(S),o)}function m(){t(Mp()),t(wo(0)),t(ui(0))}return y1(async()=>{s===Fe.Complete&&await f(u,0)},333,[a,l]),x.jsxs("div",{className:Gt.execution+" execution",children:[x.jsx(g1,{content:fO}),x.jsxs("select",{className:Gt.pathFinder,name:"path-finder",id:"path-finder",value:n,onChange:h,disabled:c,children:[x.jsx("option",{value:"",disabled:!0,children:"Select a Path finder"}),[...oc.entries()].map(([y,{name:S}])=>x.jsx("option",{value:y,children:S},y))]}),x.jsx("select",{className:`${Gt.speed}`,name:"path-finder-speed",id:"path-finder-speed",value:o,onChange:y=>i(Number(y.target.value)),disabled:c,children:[...Jl.entries()].map(([y,S])=>x.jsx("option",{value:S,children:y},y))}),x.jsx("button",{className:`${Gt.play}`,"data-testid":"player",disabled:c||!n,"data-tooltip":"Play",onClick:()=>d(),children:x.jsx(g0,{size:20})}),x.jsx("button",{"data-testid":"clear",onClick:m,disabled:s===Fe.Generating,"data-tooltip":"clear",children:x.jsx(U_,{size:20})})]})}function UO(){const[e,t]=_.useState(0),[n,r]=_.useState(!1),o=_.useRef(null);function i(){r(!0),o.current=setInterval(()=>{t(s=>s+1)},100)}function a(){r(!1),o.current&&clearInterval(o.current)}function l(){o.current&&clearInterval(o.current),t(0),r(!1)}return{time:e,isRunning:n,startTimer:i,stopTimer:a,resetTimer:l}}function BO(){const e=Nt(),t=Pe(u=>u.pathFinder.status),n=Pe(u=>u.pathFinder.visitedCellCount),r=Pe(u=>u.pathFinder.pathLength),{time:o,isRunning:i,startTimer:a,stopTimer:l,resetTimer:s}=UO();return _.useEffect(()=>{t===Fe.Searching&&!i&&(s(),a()),Fe.Complete===t&&l(),[Fe.Ready,Fe.Generating].includes(t)&&(s(),e(wo(0)),e(ui(0)))},[t,a,l,i,s,e]),x.jsxs("div",{className:Gt.pathInfo+" path-info",children:[x.jsxs("p",{children:["Visits:"," ",x.jsx("span",{className:Gt.highlight,"data-testid":"visits",children:n})]}),x.jsxs("p",{children:["Path:"," ",x.jsx("span",{className:Gt.highlight,"data-testid":"path",children:r})]}),x.jsxs("p",{children:["Time:"," ",x.jsx("span",{className:Gt.highlight,"data-testid":"time",children:o})]})]})}function WO(){const e=Nt(),t=Pe(a=>a.pathFinder.rows),n=Pe(a=>a.pathFinder.cols),{width:r,height:o}=AO(),i=r<768?Np.mobile:Np.desktop;return y1(()=>{const a=Dg();a.maxRows===t&&a.maxCols===n||(e(xS({rows:a.maxRows,cols:a.maxCols})),e($g()))},333,[r,o]),x.jsxs("section",{className:Gt.controller,children:[x.jsx(OO,{defaultSpeed:i}),x.jsx(BO,{}),x.jsx($O,{defaultSpeed:i})]})}const HO="_grid_58jdc_1",VO="_type0_58jdc_6",GO="_type1_58jdc_9",KO="_type2_58jdc_13",YO="_type3_58jdc_17",qO="_wallAnimation_58jdc_1",QO="_type4_58jdc_22",XO="_visitedAnimation_58jdc_1",JO="_type5_58jdc_27",ng={grid:HO,type0:VO,type1:GO,type2:KO,type3:YO,wallAnimation:qO,type4:QO,visitedAnimation:XO,type5:JO};function rg(){return"ontouchstart"in window||navigator.maxTouchPoints>0}function v1(e){if(!e)return{isValidCell:!1};if(e.tagName!=="BUTTON")return{isValidCell:!1};const t=Number(e.dataset.row??-1),n=Number(e.dataset.col??-1),r=Number(e.dataset.cellType??-1);return t===-1||n===-1||r===-1?{isValidCell:!1}:{isValidCell:!0,selectedCell:{row:t,col:n,cellType:r}}}function ZO({isMobile:e,ref:t}){const n=Nt(),r=_.useRef(null),o=_.useCallback(i=>{const{isValidCell:a,selectedCell:l}=v1(i.target);if(a){if(r.current){[A.entry,A.exit,A.wall].includes(l.cellType)||n(va({...l,cellType:r.current.cellType})),r.current=null;return}if([A.entry,A.exit].includes(l.cellType)){r.current=l;return}n(va({row:l.row,col:l.col,cellType:l.cellType===A.wall?A.clear:A.wall}))}},[n]);_.useEffect(()=>{if(!e)return;const i=t.current;if(i)return i.addEventListener("click",o),()=>{i.removeEventListener("mousedown",o)}},[e,o,t])}function eR({isMobile:e,ref:t}){const[n,r]=_.useState(null),o=_.useRef(!1),i=s=>{s.target&&(o.current=!0,r(s.target))},a=s=>{o.current&&r(s.target)},l=()=>{o.current=!1,r(null)};return _.useEffect(()=>{if(e)return;const s=t.current;if(s)return s.addEventListener("mousedown",i),s.addEventListener("mousemove",a),s.addEventListener("mouseup",l),s.addEventListener("mouseleave",l),()=>{s.removeEventListener("mousedown",i),s.removeEventListener("mouseleave",a),s.removeEventListener("mouseup",l),s.removeEventListener("mouseleave",l)}},[e,t]),{element:n,isMouseDown:o.current}}function tR({isMobile:e,ref:t}){const n=Nt(),{element:r,isMouseDown:o}=eR({isMobile:e,ref:t}),{isValidCell:i,selectedCell:a}=v1(r),l=_.useRef(null),s=_.useRef(null);_.useEffect(()=>{o||(l.current=null,s.current=null)},[o]),_.useEffect(()=>{var c,f;if(!i)return;if(l.current){[A.entry,A.exit,A.wall].includes(a.cellType)||n(va({...a,cellType:l.current.cellType}));return}if([A.entry,A.exit].includes(a.cellType)){l.current=a;return}((c=s.current)==null?void 0:c.row)===a.row&&((f=s.current)==null?void 0:f.col)===a.col||(n(va({row:a.row,col:a.col,cellType:a.cellType===A.wall?A.clear:A.wall})),s.current=a)},[i,a,n])}function nR(){const e=Pe(o=>o.pathFinder.grid),t=Pe(o=>o.pathFinder.status),n=_.useRef(null);tR({isMobile:rg(),ref:n}),ZO({isMobile:rg(),ref:n});const r={gridTemplateRows:`repeat(${e.length}, ${so}px)`,gridTemplateColumns:`repeat(${e[0].length}, ${so}px)`};return x.jsx("div",{className:ng.grid,style:r,id:"grid",ref:n,children:e.map((o,i)=>o.map((a,l)=>x.jsx("button",{"data-row":i,"data-col":l,"data-cell-type":a,className:ng["type"+a],disabled:t===Fe.Searching||t===Fe.Generating},`${i}-${l}`)))})}function rR(){return x.jsxs(x.Fragment,{children:[x.jsx(Zd,{top:10,right:20}),x.jsx(y2,{title:"Path Finder"}),x.jsx(WO,{}),x.jsx("main",{className:"text-center",children:x.jsx(nR,{})})]})}function oR(){return x.jsxs(x.Fragment,{children:[x.jsx(ep,{richColors:!0,duration:3e3,position:"top-center"}),x.jsx(rR,{})]})}const iR=[{path:"/path-finder/",element:x.jsx(oR,{})}];function aR(e){return e=e.replace(/\s/g,""),e=e.replace(/\d{4}/g,""),e=e.replace(/\s\s/g," "),e=e.replace(/\s,/g,","),e=e.replace(/,,/g,","),e=e.replace(/[^0-9,\s]/g,""),e.split(",").join(", ").trim()}function lR(e){return e.split(",").filter(t=>t!=="").map(t=>+t)}function og(e=0,t=999){return Math.floor(Math.random()*(t-e))+e}const sR=e=>{const t=e.length;for(let n=0;nn-r);case"descending":return[...t].sort((n,r)=>r-n);case"random":return sR([...t])}return t}const uR="_controllerWrapper_18ff3_1",cR="_controller_18ff3_1",fR="_numbers_18ff3_9",dR="_generator_18ff3_15",pR="_rndmBtn_18ff3_20",hR="_select_18ff3_28",mR="_arrayInput_18ff3_37",gR="_controls_18ff3_51",yR="_checkboxWrapper_18ff3_63",vR="_listItem_18ff3_70",wR="_checkbox_18ff3_63",SR="_switchContainer_18ff3_87",fn={controllerWrapper:uR,controller:cR,numbers:fR,generator:dR,rndmBtn:pR,select:hR,arrayInput:mR,controls:gR,checkboxWrapper:yR,listItem:vR,checkbox:wR,switchContainer:SR},xR=["random","ascending","descending"];function ER({setInput:e}){const t=Nt(),n=Pe(l=>l.sortViz.array),[r,o]=_.useState("random"),i=()=>{let l=Array.from(new Array(og(jp.min,jp.max)),()=>og());r!=="random"&&(l=ig(r,l)),e(l.join(", ")),t(xc(l))},a=l=>{const s=l.target.value;o(s);const u=ig(s,n);e(u.join(", ")),t(xc(u))};return x.jsxs("div",{className:fn.generator,children:[x.jsx("button",{className:fn.rndmBtn,onClick:i,children:"Generate"}),x.jsx("select",{className:fn.select,onChange:a,value:r,name:"sequence-type",children:xR.map(l=>x.jsx("option",{value:l,children:l},l))})]})}function bR(){const e=Nt(),t=Pe(i=>i.sortViz.array),[n,r]=_.useState(t.join(", "));_.useEffect(()=>{e(ci(!1)),e(Bs())},[t,e]);const o=i=>{const a=aR(i.target.value);r(a);const l=lR(a);e(xc(l))};return x.jsxs("div",{className:fn.numbers,children:[x.jsx(ER,{setInput:r}),x.jsx("input",{id:"user-input",className:fn.arrayInput,type:"text",placeholder:"Numbers to sort (comma separate - max 3 digits)",value:n,onChange:o})]})}const _R="/algo-visualizers/icons/pause.svg",kR="/algo-visualizers/icons/play.svg",CR="/algo-visualizers/icons/reset.svg";function TR(){const e=Nt(),t=Pe(i=>i.sortViz.array),n=Pe(i=>i.sortViz.speed),r=Pe(i=>i.sortViz.isPlaying),o=Pe(i=>i.sortViz.reset);return _.useEffect(()=>{r&&e(WS())},[e,r]),_.useEffect(()=>{e(ci(!1))},[e,o]),_.useEffect(()=>{e(Dp(n))},[e,n]),x.jsxs("div",{className:fn.controls,children:[x.jsx("button",{"data-testid":"player",onClick:()=>e(ci(!r)),disabled:t.length===0||r===null,"data-tooltip":r?"Pause":"Play",children:x.jsx("img",{src:r?_R:kR,alt:r?"Pause":"Play",height:24,width:24})}),x.jsx("button",{onClick:()=>e(Bs()),disabled:t.length===0,"data-tooltip":"Reset",children:x.jsx("img",{src:CR,height:24,width:24})}),x.jsx("input",{id:"speed","data-tooltip":"Animation speed",type:"range",min:1,max:20,value:n,step:1,onChange:i=>e(Dp(i.target.valueAsNumber))})]})}function Mf(){return Mf=Object.assign?Object.assign.bind():function(e){for(var t=1;t=s)&&this.A(n),this.W&&this.setState({N:!1,j:!1}),this.l=Date.now()},t.prototype.p=function(n){n.preventDefault(),typeof n.button=="number"&&n.button!==0||(this.I(n.clientX),window.addEventListener("mousemove",this.v),window.addEventListener("mouseup",this.g))},t.prototype.v=function(n){n.preventDefault(),this.L(n.clientX)},t.prototype.g=function(n){this.U(n),window.removeEventListener("mousemove",this.v),window.removeEventListener("mouseup",this.g)},t.prototype.k=function(n){this.X=null,this.I(n.touches[0].clientX)},t.prototype.m=function(n){this.L(n.touches[0].clientX)},t.prototype.M=function(n){n.preventDefault(),this.U(n)},t.prototype.$=function(n){Date.now()-this.l>50&&(this.A(n),Date.now()-this.u>50&&this.W&&this.setState({j:!1}))},t.prototype.C=function(){this.u=Date.now()},t.prototype.D=function(){this.setState({j:!0})},t.prototype.O=function(){this.setState({j:!1})},t.prototype.S=function(n){this.H=n},t.prototype.T=function(n){n.preventDefault(),this.H.focus(),this.A(n),this.W&&this.setState({j:!1})},t.prototype.A=function(n){var r=this.props;(0,r.onChange)(!r.checked,n,r.id)},t.prototype.render=function(){var n=this.props,r=n.checked,o=n.disabled,i=n.className,a=n.offColor,l=n.onColor,s=n.offHandleColor,u=n.onHandleColor,c=n.checkedIcon,f=n.uncheckedIcon,d=n.checkedHandleIcon,h=n.uncheckedHandleIcon,m=n.boxShadow,y=n.activeBoxShadow,S=n.height,g=n.width,p=n.borderRadius,v=function(Ce,qe){var me={};for(var L in Ce)Object.prototype.hasOwnProperty.call(Ce,L)&&qe.indexOf(L)===-1&&(me[L]=Ce[L]);return me}(n,["checked","disabled","className","offColor","onColor","offHandleColor","onHandleColor","checkedIcon","uncheckedIcon","checkedHandleIcon","uncheckedHandleIcon","boxShadow","activeBoxShadow","height","width","borderRadius","handleDiameter"]),b=this.state,C=b.h,w=b.N,P=b.j,M={position:"relative",display:"inline-block",textAlign:"left",opacity:o?.5:1,direction:"ltr",borderRadius:S/2,WebkitTransition:"opacity 0.25s",MozTransition:"opacity 0.25s",transition:"opacity 0.25s",touchAction:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},I={height:S,width:g,margin:Math.max(0,(this.t-S)/2),position:"relative",background:lg(C,this.i,this.o,a,l),borderRadius:typeof p=="number"?p:S/2,cursor:o?"default":"pointer",WebkitTransition:w?null:"background 0.25s",MozTransition:w?null:"background 0.25s",transition:w?null:"background 0.25s"},$={height:S,width:Math.min(1.5*S,g-(this.t+S)/2+1),position:"relative",opacity:(C-this.o)/(this.i-this.o),pointerEvents:"none",WebkitTransition:w?null:"opacity 0.25s",MozTransition:w?null:"opacity 0.25s",transition:w?null:"opacity 0.25s"},X={height:S,width:Math.min(1.5*S,g-(this.t+S)/2+1),position:"absolute",opacity:1-(C-this.o)/(this.i-this.o),right:0,top:0,pointerEvents:"none",WebkitTransition:w?null:"opacity 0.25s",MozTransition:w?null:"opacity 0.25s",transition:w?null:"opacity 0.25s"},xe={height:this.t,width:this.t,background:lg(C,this.i,this.o,s,u),display:"inline-block",cursor:o?"default":"pointer",borderRadius:typeof p=="number"?p-1:"50%",position:"absolute",transform:"translateX("+C+"px)",top:Math.max(0,(S-this.t)/2),outline:0,boxShadow:P?y:m,border:0,WebkitTransition:w?null:"background-color 0.25s, transform 0.25s, box-shadow 0.15s",MozTransition:w?null:"background-color 0.25s, transform 0.25s, box-shadow 0.15s",transition:w?null:"background-color 0.25s, transform 0.25s, box-shadow 0.15s"},ye={height:this.t,width:this.t,opacity:Math.max(2*(1-(C-this.o)/(this.i-this.o)-.5),0),position:"absolute",left:0,top:0,pointerEvents:"none",WebkitTransition:w?null:"opacity 0.25s",MozTransition:w?null:"opacity 0.25s",transition:w?null:"opacity 0.25s"},le={height:this.t,width:this.t,opacity:Math.max(2*((C-this.o)/(this.i-this.o)-.5),0),position:"absolute",left:0,top:0,pointerEvents:"none",WebkitTransition:w?null:"opacity 0.25s",MozTransition:w?null:"opacity 0.25s",transition:w?null:"opacity 0.25s"};return O.createElement("div",{className:i,style:M},O.createElement("div",{className:"react-switch-bg",style:I,onClick:o?null:this.T,onMouseDown:function(Ce){return Ce.preventDefault()}},c&&O.createElement("div",{style:$},c),f&&O.createElement("div",{style:X},f)),O.createElement("div",{className:"react-switch-handle",style:xe,onClick:function(Ce){return Ce.preventDefault()},onMouseDown:o?null:this.p,onTouchStart:o?null:this.k,onTouchMove:o?null:this.m,onTouchEnd:o?null:this.M,onTouchCancel:o?null:this.O},h&&O.createElement("div",{style:ye},h),d&&O.createElement("div",{style:le},d)),O.createElement("input",Mf({},{type:"checkbox",role:"switch","aria-checked":r,checked:r,disabled:o,style:{border:0,clip:"rect(0 0 0 0)",height:1,margin:-1,overflow:"hidden",padding:0,position:"absolute",width:1}},v,{ref:this.S,onFocus:this.D,onBlur:this.O,onKeyUp:this.C,onChange:this.$})))},t}(_.Component);w1.defaultProps={disabled:!1,offColor:"#888",onColor:"#080",offHandleColor:"#fff",onHandleColor:"#fff",uncheckedIcon:PR,checkedIcon:OR,boxShadow:null,activeBoxShadow:"0 0 2px 3px #3bf",height:28,width:56};function RR(){const e=Nt(),t=Pe(n=>n.sortViz.visualizerType);return x.jsxs("div",{className:fn.switchContainer,children:[x.jsx("span",{children:"Cell"}),x.jsx(w1,{id:"visualizerType",onChange:()=>e(US()),checked:t==="bar",checkedIcon:!1,uncheckedIcon:!1,height:20,width:40,offColor:"#2b4bfe",onColor:"#2b4bfe"}),x.jsx("span",{children:"Bar"})]})}function NR(){const{algoName:e}=Qd(),t=Nt();return _.useEffect(()=>{t(ci(!1)),t(Bs())},[e,t]),x.jsxs("section",{className:fn.controllerWrapper,children:[x.jsxs("div",{className:fn.controller,"data-testid":"controller",children:[x.jsx(bR,{}),x.jsx(TR,{})]}),x.jsx(RR,{})]})}const MR="_navbar_8y9jz_1",IR="_active_8y9jz_40",LR="_hamButton_8y9jz_62",lc={navbar:MR,active:IR,hamButton:LR},jR="/algo-visualizers/icons/ham.svg";function AR({title:e,menuItems:t}){const[n,r]=_.useState(!1);return x.jsxs("nav",{className:lc.navbar,children:[x.jsx(Xd,{title:e}),x.jsxs(x.Fragment,{children:[x.jsx("button",{onClick:()=>r(!n),className:lc.hamButton,children:x.jsx("img",{src:jR,alt:"hamburger"})}),x.jsx("ul",{"data-toggle":n,children:t.map(o=>x.jsx("li",{children:x.jsx(h0,{to:`/sorting-visualizer/${o}`,className:({isActive:i})=>i?lc.active:"",onClick:()=>r(!1),children:o})},o))})]})]})}const DR="_main_1hg6y_1",zR="_allAlgos_1hg6y_6",S1={main:DR,allAlgos:zR};function Is({children:e}){return x.jsxs("div",{children:[x.jsx(Zd,{bottom:10,right:20}),x.jsx(AR,{title:"Sorting Visualizer",menuItems:Wg}),x.jsx(NR,{}),x.jsx("main",{className:S1.main,children:e})]})}const FR="_container_wgxfy_1",$R="_warning_wgxfy_20",x1={container:FR,warning:$R};function E1(){return x.jsx("p",{className:x1.warning,children:"Please enter a valid list of numbers to play with the visualization"})}function UR({algoName:e,isCompleted:t}){const n=Pe(o=>o.sortViz.time),r=_.useRef(0);return _.useEffect(()=>{t&&(r.current=n)},[t]),x.jsxs("header",{children:[x.jsxs("h2",{children:[e," Sort"]}),x.jsxs("span",{children:["Time: ",x.jsx("strong",{children:r.current||n})]})]})}const BR="_arrayContainer_116to_1",WR="_values_116to_6",HR="_pivot_116to_19",VR="_sort_116to_22",GR="_highlight_116to_25",KR="_indices_116to_28",Pl={arrayContainer:BR,values:WR,pivot:HR,sort:VR,highlight:GR,indices:KR};function YR({array:e,sorts:t,highlights:n,pivot:r}){const o=_.useMemo(()=>Math.max(...e),[e]);function i(a){let l="";return r===a&&(l="pivot"),t.includes(a)&&(l="sort"),n.includes(a)&&(l="highlight"),l}return x.jsxs("div",{className:Pl.arrayContainer,children:[x.jsx("ul",{className:Pl.values,"data-testid":"bar-values",children:e.map((a,l)=>x.jsx("li",{className:Pl[i(l)],style:{height:`${a/o*100}%`}},l))}),x.jsx("ul",{className:Pl.indices,children:e.map((a,l)=>x.jsx("li",{children:l},l))})]})}const qR="_arrayContainer_9tgyc_1",QR="_values_9tgyc_6",XR="_cell_9tgyc_10",JR="_pivot_9tgyc_24",ZR="_sort_9tgyc_27",eN="_highlight_9tgyc_30",tN="_indices_9tgyc_33",ma={arrayContainer:qR,values:QR,cell:XR,pivot:JR,sort:ZR,highlight:eN,indices:tN};function cp({order:e,animation:t,value:n,isSorted:r=!1,isHighlighted:o=!1,isPivot:i=!1}){let a="";return i&&(a="pivot"),r&&(a="sort"),o&&(a="highlight"),x.jsx("li",{className:`${ma.cell} ${ma[a]}`,style:{animation:t,order:e},children:n})}const Fo=document.querySelector('[data-id="animation-element"]');function b1(e){var n;const t=(n=Fo==null?void 0:Fo.sheet)==null?void 0:n.insertRule(e);setTimeout(()=>{var r;t&&((r=Fo==null?void 0:Fo.sheet)==null||r.deleteRule(t))},xo)}function _1(e,t=1e3){const n=`anime-${Math.random().toString(36).substring(2,9)}`,r=`${t}ms linear forwards ${n}`,o=Mr.size+Mr.margin,i=`@keyframes ${n} { 25% { transform: translateY(${Math.sign(e)*(Mr.size+5)}px); } diff --git a/docs/assets/index-CdCdsSVj.css b/docs/assets/index-DI2khIP7.css similarity index 95% rename from docs/assets/index-CdCdsSVj.css rename to docs/assets/index-DI2khIP7.css index 4ab64cc..dda4e4a 100644 --- a/docs/assets/index-CdCdsSVj.css +++ b/docs/assets/index-DI2khIP7.css @@ -1 +1 @@ -@import"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap";@media screen and (width >= 960px){[data-tooltip]{position:relative}[data-tooltip]:hover:after{position:absolute;bottom:-6px;left:50%;z-index:1;padding:5px;font-size:.75rem;color:#fff;text-align:center;content:attr(data-tooltip);background-color:#333;border-radius:4px;transition:opacity .3s ease-in-out;transform:translate(-50%,100%)}[data-tooltip]:hover:before{position:absolute;bottom:-6px;left:50%;content:"";border-color:transparent transparent #333;border-style:solid;border-width:0 6px 10px;transform:translate(-50%)}}*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.grid{display:grid}.hidden{display:none}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.text-center{text-align:center}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}:root{--light: white;--dark: black;--base: black;--background: white;--primary: #2b4bfe;--shadow1: rgba(0, 0, 0, .15);--shadow2: rgba(0, 0, 0, .4);--error: red}@media screen and (prefers-color-scheme: dark){:root{--light: white;--dark: black;--base: white;--background: black;--primary: #2b4bfe;--shadow1: rgba(255, 255, 255, .15);--shadow2: rgba(255, 255, 255, .4);--error: red}}html[data-theme=light]{--light: white;--dark: black;--base: black;--background: white;--primary: #2b4bfe;--shadow1: rgba(0, 0, 0, .15);--shadow2: rgba(0, 0, 0, .4);--error: red}html[data-theme=dark]{--light: white;--dark: black;--base: white;--background: black;--primary: #2b4bfe;--shadow1: rgba(255, 255, 255, .15);--shadow2: rgba(255, 255, 255, .4);--error: red}body{font-family:Inter,sans-serif;color:var(--base);background-color:var(--background)}#screen-layout{position:fixed;top:0;left:0;width:100vw;height:100%;pointer-events:none}#screen-layout *{pointer-events:all}button.primary{padding:5px 10px;color:var(--light);background-color:var(--primary);border:1px solid var(--primary);border-radius:4px}button.primary-outline{padding:5px 10px;color:var(--base);border:1px solid var(--primary);border-radius:4px}select:disabled,button:disabled{cursor:not-allowed}button:active:enabled{transform:scale(.95)}._challenges_1ylei_1{display:flex;flex-direction:column;gap:50px;justify-content:center;width:90%;margin:auto}._card_1ylei_10{flex:1 1 0px;padding:20px;border-radius:4px;box-shadow:0 0 8px var(--shadow2)}._card_1ylei_10 h1{margin-bottom:1rem;font-size:1.25rem;font-weight:500;text-align:center}._card_1ylei_10 div{display:flex;justify-content:center}._card_1ylei_10 div img{height:250px}@media screen and (width >= 768px){._challenges_1ylei_1{flex-direction:row}}._title_6h70z_1{display:flex;gap:.5rem;align-items:center;font-size:1.5rem;font-weight:600}._title_6h70z_1 ._github_6h70z_8{margin-left:4px;width:25px;height:25px}[data-theme=dark] ._title_6h70z_1 img{filter:invert(1)}._navbar_ydqjy_1{position:relative;display:flex;align-items:center;justify-content:space-between;padding:10px 20px;margin-bottom:20px;box-shadow:0 4px 4px var(--shadow1)}._navbar_ydqjy_1 img{width:25px;height:25px}@media screen and (width >= 960px){._navbar_ydqjy_1._navbar_ydqjy_1{padding:10px 10px 10px 20px}}[data-theme=dark] ._navbar_ydqjy_1 img{filter:invert(1)}._iconBtn_5is4s_1{position:absolute;padding:5px;cursor:pointer;background-color:var(--light);border:1px solid var(--dark);border-radius:50%;opacity:.5}._iconBtn_5is4s_1 img{width:25px;height:25px}._tourWrapper_1f5ok_1{display:none;justify-content:center;flex-grow:1;flex-basis:0}._tourWrapper_1f5ok_1 ._tour_1f5ok_1{border:1px solid var(--base);padding:2px 4px}._tourWrapper_1f5ok_1 ._tour_1f5ok_1:disabled{opacity:.5}@media (width >= 1024px){._tourWrapper_1f5ok_1{display:flex}}._cellInfo_wpa4p_1{display:none;justify-content:flex-end;gap:20px;flex-basis:0;flex-grow:1;margin-right:60px}._cellInfo_wpa4p_1>div{display:flex;align-items:center;gap:5px}._cellInfo_wpa4p_1 ._item_wpa4p_14{height:15px;width:15px}._cellInfo_wpa4p_1 ._entry_wpa4p_18{background-color:var(--pf-cell-entry)}._cellInfo_wpa4p_1 ._exit_wpa4p_21{background-color:var(--pf-cell-exit)}._cellInfo_wpa4p_1 ._wall_wpa4p_24{background-color:var(--pf-cell-wall)}._cellInfo_wpa4p_1 ._visited_wpa4p_27{background-color:var(--pf-cell-visited)}._cellInfo_wpa4p_1 ._path_wpa4p_30{background-color:var(--pf-cell-path)}@media (width >= 768px){._cellInfo_wpa4p_1{display:flex}}._navbar_28m7j_1{position:relative;display:flex;align-items:center;padding:10px 20px;margin-bottom:20px;box-shadow:0 4px 4px var(--shadow1)}._navbar_28m7j_1 img{width:25px;height:25px}._navbar_28m7j_1 h1{flex-grow:1;flex-basis:0;display:flex;flex-basis:60px}@media screen and (width >= 960px){._navbar_28m7j_1._navbar_28m7j_1{padding:10px 10px 10px 20px}}[data-theme=dark] ._navbar_28m7j_1 img{filter:invert(1)}._infoButton_1nrkm_1{display:none}::backdrop{position:fixed;top:0;left:0;width:100%;height:100%;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);display:flex;justify-content:center;align-items:center;z-index:1}._dialog_1nrkm_18{background-color:var(--background);width:max(800px,50%);max-height:80%;padding:40px 20px 20px;border-radius:8px;position:relative;left:50%;transform:translate(-50%);overflow-y:scroll;box-shadow:0 0 10px 0 var(--shadow2)}._dialog_1nrkm_18::-webkit-scrollbar{width:8px}._dialog_1nrkm_18::-webkit-scrollbar-thumb{background-color:var(--shadow1);border-radius:10px}._closeButton_1nrkm_38{position:sticky;top:0;left:97%;background:none;border:none;cursor:pointer;font:bold}._closeButton_1nrkm_38:hover{transform:scale(1.2)}._body_1nrkm_51{display:flex;flex-direction:column;gap:40px;color:var(--base)}._body_1nrkm_51 ._contentHeading_1nrkm_57{font-size:20px;line-height:28px;font-weight:700;padding-bottom:5px;padding-top:6px}._body_1nrkm_51 ._content_1nrkm_57{display:flex;flex-direction:column;align-items:center;gap:12px}._body_1nrkm_51 ._contentPara_1nrkm_70{padding-left:20px;padding-right:20px}@media (width >= 1200px){._infoButton_1nrkm_1{display:inline-block}}[data-theme=dark] ._closeButton_1nrkm_38{filter:invert(1)}._controller_1m4sf_1{display:flex;align-items:center;justify-content:space-between;margin:20px 10px 16px;padding-left:15px;padding-right:15px}._controller_1m4sf_1 ._operation_1m4sf_9,._controller_1m4sf_1 ._execution_1m4sf_13{display:flex;gap:10px}._controller_1m4sf_1 ._mazeSelector_1m4sf_17,._controller_1m4sf_1 ._pathFinder_1m4sf_18{width:125px;border:1px solid var(--base);padding:0 5px}._controller_1m4sf_1 button:disabled{opacity:.5}._controller_1m4sf_1 ._speed_1m4sf_26,._controller_1m4sf_1 ._play_1m4sf_27{display:none}._controller_1m4sf_1 ._pathInfo_1m4sf_30{display:none;gap:10px}._controller_1m4sf_1 ._pathInfo_1m4sf_30 ._highlight_1m4sf_34{font-weight:600;min-width:3ch;display:inline-block}@media (width >= 600px){._controller_1m4sf_1 ._pathInfo_1m4sf_30{display:flex}}@media (width >= 1024px){._controller_1m4sf_1 ._speed_1m4sf_26,._controller_1m4sf_1 ._play_1m4sf_27{display:block}._controller_1m4sf_1 ._mazeSelector_1m4sf_17,._controller_1m4sf_1 ._pathFinder_1m4sf_18{width:auto}}[data-theme=dark] ._execution_1m4sf_13 img{filter:invert(1)}[data-theme=dark] select{background-color:var(--dark);color:var(--light)}._grid_58jdc_1._grid_58jdc_1{display:inline-grid;margin:auto;border:var(--pf-cell-size) solid var(--pf-cell-wall)}._grid_58jdc_1._grid_58jdc_1 ._type0_58jdc_6{background-color:var(--pf-cell-clear)}._grid_58jdc_1._grid_58jdc_1 ._type1_58jdc_9{background-color:var(--pf-cell-entry);border-color:var(--base)}._grid_58jdc_1._grid_58jdc_1 ._type2_58jdc_13{background-color:var(--pf-cell-exit);border-color:var(--base)}._grid_58jdc_1._grid_58jdc_1 ._type3_58jdc_17{background-color:var(--pf-cell-wall);border-color:var(--pf-cell-wall);animation:_wallAnimation_58jdc_1 .5s}._grid_58jdc_1._grid_58jdc_1 ._type4_58jdc_22{background-color:var(--pf-cell-visited);border-color:var(--pf-cell-visited);animation:_visitedAnimation_58jdc_1 1s}._grid_58jdc_1._grid_58jdc_1 ._type5_58jdc_27{background-color:var(--pf-cell-path);border-color:var(--pf-cell-path-border);border-width:8px}._grid_58jdc_1._grid_58jdc_1 button{border:.5px solid rgb(240,240,240)}[data-theme=dark] ._grid_58jdc_1 button{border-color:#141414}@keyframes _visitedAnimation_58jdc_1{0%{transform:scale(.3);border-radius:50%;background-color:var(--pf-cell-visited-start)}30%{transform:scale(.6);border-radius:65%;background-color:var(--pf-cell-visited-mid)}60%{transform:scale(1.05);border-radius:80%}to{transform:scale(1);background-color:var(--pf-cell-visited)}}@keyframes _wallAnimation_58jdc_1{0%{transform:scale(.3);opacity:.75}50%{transform:scale(1.2);opacity:.9}to{transform:scale(1);opacity:1}}._controllerWrapper_18ff3_1{padding:0 20px;margin-bottom:16px}._controllerWrapper_18ff3_1 ._controller_18ff3_1{gap:10px;margin-bottom:20px}._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._numbers_18ff3_9{display:flex;flex-basis:80%;flex-wrap:wrap;gap:16px}._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._numbers_18ff3_9 ._generator_18ff3_15{display:flex;flex:1;gap:16px}._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._numbers_18ff3_9 ._generator_18ff3_15 ._rndmBtn_18ff3_20{flex:1;padding:5px 10px;color:var(--light);background-color:var(--primary);border:none;border-radius:4px}._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._numbers_18ff3_9 ._generator_18ff3_15 ._select_18ff3_28{flex:1;padding:0 4px;color:var(--dark);text-transform:capitalize;background-color:var(--light);border:1px solid var(--shadow1);border-radius:4px}._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._numbers_18ff3_9 ._arrayInput_18ff3_37{flex:2;width:100%;min-width:300px;padding:5px;color:var(--dark);background-color:var(--light);border:1px solid var(--dark);border-radius:4px}._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._numbers_18ff3_9 ._arrayInput_18ff3_37:-moz-placeholder-shown{border:1px solid transparent;outline:2px solid var(--error)}._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._numbers_18ff3_9 ._arrayInput_18ff3_37:placeholder-shown{border:1px solid transparent;outline:2px solid var(--error)}._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._controls_18ff3_51{display:flex;flex:1;flex-basis:25%;gap:16px;margin-top:20px}._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._controls_18ff3_51 input[type=range]{flex:1;cursor:pointer}._checkboxWrapper_18ff3_63{display:flex;flex-wrap:wrap;gap:20px;align-items:center;justify-content:center}._checkboxWrapper_18ff3_63 ._listItem_18ff3_70{list-style-type:none}._checkboxWrapper_18ff3_63 ._listItem_18ff3_70 ._checkbox_18ff3_63{display:flex;gap:4px;align-items:center;justify-content:center}._checkboxWrapper_18ff3_63 ._listItem_18ff3_70 ._checkbox_18ff3_63>input,._checkboxWrapper_18ff3_63 ._listItem_18ff3_70 ._checkbox_18ff3_63>label{cursor:pointer}._checkboxWrapper_18ff3_63 ._listItem_18ff3_70 ._checkbox_18ff3_63>label{text-transform:capitalize}._switchContainer_18ff3_87{display:flex;gap:20px;align-items:center;justify-content:center}@media screen and (width >= 768px){._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._numbers_18ff3_9 ._generator_18ff3_15,._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._numbers_18ff3_9 ._rndmBtn_18ff3_20{flex-grow:0}}@media screen and (width >= 960px){._controllerWrapper_18ff3_1 ._controller_18ff3_1{display:flex}._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._controls_18ff3_51{margin-top:0}}[data-theme=dark] ._controllerWrapper_18ff3_1 img{filter:invert(1)}._navbar_8y9jz_1{position:relative;display:flex;align-items:center;justify-content:space-between;padding:10px 20px;margin-bottom:20px;box-shadow:0 4px 4px var(--shadow1)}._navbar_8y9jz_1 img{width:25px;height:25px}._navbar_8y9jz_1 ul{position:absolute;top:65px;left:0;z-index:1;gap:10px;width:100%;padding-bottom:12px;list-style:none;background-color:var(--background);box-shadow:0 4px 4px var(--shadow1)}._navbar_8y9jz_1 ul[data-toggle=false]{display:none}._navbar_8y9jz_1 ul li{width:100%;padding:10px}._navbar_8y9jz_1 ul li a{display:block;width:auto;padding:6px;text-transform:capitalize;border-radius:8px}._navbar_8y9jz_1 ul li a._active_8y9jz_40{color:var(--light);background-color:var(--primary)}._navbar_8y9jz_1 ul li a:hover{outline:1px solid var(--primary)}@media screen and (width >= 960px){._navbar_8y9jz_1._navbar_8y9jz_1{padding:10px 10px 10px 20px}._navbar_8y9jz_1._navbar_8y9jz_1 ul{position:static;display:flex;width:auto;padding-bottom:0;box-shadow:none}._navbar_8y9jz_1._navbar_8y9jz_1 ul li{padding:0}._navbar_8y9jz_1._navbar_8y9jz_1 ._hamButton_8y9jz_62{display:none}}[data-theme=dark] ._navbar_8y9jz_1 img{filter:invert(1)}._main_1hg6y_1{padding:10px 20px 0;text-align:center}._allAlgos_1hg6y_6{display:flex;flex-wrap:wrap;gap:20px;justify-content:center;margin:30px 0 80px}._container_wgxfy_1{display:inline-block;min-width:300px;max-width:100%;padding:20px;box-shadow:0 0 4px var(--shadow2)}._container_wgxfy_1 header,._container_wgxfy_1 footer{display:flex;align-items:center;justify-content:space-between}._container_wgxfy_1 h2{font-size:1.1rem;font-weight:700;text-transform:capitalize}._warning_wgxfy_20{font-size:1.15rem;font-weight:500;color:var(--error)}._arrayContainer_116to_1{position:relative;padding:25px 0 40px;overflow-x:auto}._arrayContainer_116to_1 ._values_116to_6{display:flex;align-items:flex-end;height:var(--bar-max-height)}._arrayContainer_116to_1 ._values_116to_6 li{flex-shrink:1;width:var(--bar-size);min-width:var(--bar-min-size);margin:0 calc(var(--bar-margin) / 2);background-color:var(--color-bar);border:1px solid var(--color-bar)}._arrayContainer_116to_1 ._values_116to_6 ._pivot_116to_19{background-color:var(--color-pivot)}._arrayContainer_116to_1 ._values_116to_6 ._sort_116to_22{background-color:var(--color-sort)}._arrayContainer_116to_1 ._values_116to_6 ._highlight_116to_25{background-color:var(--color-highlight)}._arrayContainer_116to_1 ._indices_116to_28{position:absolute;bottom:20px;display:flex;width:100%;font-size:.4rem;opacity:.4}._arrayContainer_116to_1 ._indices_116to_28 li{flex-shrink:1;width:var(--bar-size);min-width:var(--bar-min-size);margin:0 calc(var(--bar-margin) / 2)}._arrayContainer_9tgyc_1{position:relative;padding:0 20px;overflow:auto}._arrayContainer_9tgyc_1 ._values_9tgyc_6{display:flex;padding:calc(var(--cell-size) + 20px) 0}._arrayContainer_9tgyc_1 ._values_9tgyc_6 ._cell_9tgyc_10{display:flex;flex-shrink:0;align-items:center;justify-content:center;width:var(--cell-size);height:var(--cell-size);margin:0 calc(var(--cell-margin) / 2);color:var(--dark);background-color:var(--light);border:1px solid var(--base);border-radius:4px;box-shadow:0 4px 4px var(--shadow1)}._arrayContainer_9tgyc_1 ._values_9tgyc_6 ._pivot_9tgyc_24{background-color:var(--color-pivot)}._arrayContainer_9tgyc_1 ._values_9tgyc_6 ._sort_9tgyc_27{background-color:var(--color-sort)}._arrayContainer_9tgyc_1 ._values_9tgyc_6 ._highlight_9tgyc_30{background-color:var(--color-highlight)}._arrayContainer_9tgyc_1 ._indices_9tgyc_33{position:absolute;bottom:calc(var(--cell-size) - 5px);z-index:-1;display:flex;font-size:.75rem;opacity:.25}._arrayContainer_9tgyc_1 ._indices_9tgyc_33 li{display:flex;justify-content:center;width:var(--cell-size);margin:0 calc(var(--cell-margin) / 2)} +@import"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap";@media screen and (width >= 960px){[data-tooltip]{position:relative}[data-tooltip]:hover:after{position:absolute;bottom:-6px;left:50%;z-index:1;padding:5px;font-size:.75rem;color:#fff;text-align:center;content:attr(data-tooltip);background-color:#333;border-radius:4px;transition:opacity .3s ease-in-out;transform:translate(-50%,100%)}[data-tooltip]:hover:before{position:absolute;bottom:-6px;left:50%;content:"";border-color:transparent transparent #333;border-style:solid;border-width:0 6px 10px;transform:translate(-50%)}}*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.grid{display:grid}.hidden{display:none}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.text-center{text-align:center}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}:root{--light: white;--dark: black;--base: black;--background: white;--primary: #2b4bfe;--shadow1: rgba(0, 0, 0, .15);--shadow2: rgba(0, 0, 0, .4);--error: red}@media screen and (prefers-color-scheme: dark){:root{--light: white;--dark: black;--base: white;--background: black;--primary: #2b4bfe;--shadow1: rgba(255, 255, 255, .15);--shadow2: rgba(255, 255, 255, .4);--error: red}}html[data-theme=light]{--light: white;--dark: black;--base: black;--background: white;--primary: #2b4bfe;--shadow1: rgba(0, 0, 0, .15);--shadow2: rgba(0, 0, 0, .4);--error: red}html[data-theme=dark]{--light: white;--dark: black;--base: white;--background: black;--primary: #2b4bfe;--shadow1: rgba(255, 255, 255, .15);--shadow2: rgba(255, 255, 255, .4);--error: red}body{font-family:Inter,sans-serif;color:var(--base);background-color:var(--background)}#screen-layout{position:fixed;top:0;left:0;width:100vw;height:100%;pointer-events:none}#screen-layout *{pointer-events:all}button.primary{padding:5px 10px;color:var(--light);background-color:var(--primary);border:1px solid var(--primary);border-radius:4px}button.primary-outline{padding:5px 10px;color:var(--base);border:1px solid var(--primary);border-radius:4px}select:disabled,button:disabled{cursor:not-allowed}button:active:enabled{transform:scale(.95)}._challenges_1ylei_1{display:flex;flex-direction:column;gap:50px;justify-content:center;width:90%;margin:auto}._card_1ylei_10{flex:1 1 0px;padding:20px;border-radius:4px;box-shadow:0 0 8px var(--shadow2)}._card_1ylei_10 h1{margin-bottom:1rem;font-size:1.25rem;font-weight:500;text-align:center}._card_1ylei_10 div{display:flex;justify-content:center}._card_1ylei_10 div img{height:250px}@media screen and (width >= 768px){._challenges_1ylei_1{flex-direction:row}}._title_6h70z_1{display:flex;gap:.5rem;align-items:center;font-size:1.5rem;font-weight:600}._title_6h70z_1 ._github_6h70z_8{margin-left:4px;width:25px;height:25px}[data-theme=dark] ._title_6h70z_1 img{filter:invert(1)}._navbar_ydqjy_1{position:relative;display:flex;align-items:center;justify-content:space-between;padding:10px 20px;margin-bottom:20px;box-shadow:0 4px 4px var(--shadow1)}._navbar_ydqjy_1 img{width:25px;height:25px}@media screen and (width >= 960px){._navbar_ydqjy_1._navbar_ydqjy_1{padding:10px 10px 10px 20px}}[data-theme=dark] ._navbar_ydqjy_1 img{filter:invert(1)}._iconBtn_5is4s_1{position:absolute;padding:5px;cursor:pointer;background-color:var(--light);border:1px solid var(--dark);border-radius:50%;opacity:.5}._iconBtn_5is4s_1 img{width:25px;height:25px}._tourWrapper_1f5ok_1{display:none;justify-content:center;flex-grow:1;flex-basis:0}._tourWrapper_1f5ok_1 ._tour_1f5ok_1{border:1px solid var(--base);padding:2px 4px}._tourWrapper_1f5ok_1 ._tour_1f5ok_1:disabled{opacity:.5}@media (width >= 1024px){._tourWrapper_1f5ok_1{display:flex}}._cellInfo_wpa4p_1{display:none;justify-content:flex-end;gap:20px;flex-basis:0;flex-grow:1;margin-right:60px}._cellInfo_wpa4p_1>div{display:flex;align-items:center;gap:5px}._cellInfo_wpa4p_1 ._item_wpa4p_14{height:15px;width:15px}._cellInfo_wpa4p_1 ._entry_wpa4p_18{background-color:var(--pf-cell-entry)}._cellInfo_wpa4p_1 ._exit_wpa4p_21{background-color:var(--pf-cell-exit)}._cellInfo_wpa4p_1 ._wall_wpa4p_24{background-color:var(--pf-cell-wall)}._cellInfo_wpa4p_1 ._visited_wpa4p_27{background-color:var(--pf-cell-visited)}._cellInfo_wpa4p_1 ._path_wpa4p_30{background-color:var(--pf-cell-path)}@media (width >= 768px){._cellInfo_wpa4p_1{display:flex}}._navbar_28m7j_1{position:relative;display:flex;align-items:center;padding:10px 20px;margin-bottom:20px;box-shadow:0 4px 4px var(--shadow1)}._navbar_28m7j_1 img{width:25px;height:25px}._navbar_28m7j_1 h1{flex-grow:1;flex-basis:0;display:flex;flex-basis:60px}@media screen and (width >= 960px){._navbar_28m7j_1._navbar_28m7j_1{padding:10px 10px 10px 20px}}[data-theme=dark] ._navbar_28m7j_1 img{filter:invert(1)}._infoButton_1nrkm_1{display:none}::backdrop{position:fixed;top:0;left:0;width:100%;height:100%;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);display:flex;justify-content:center;align-items:center;z-index:1}._dialog_1nrkm_18{background-color:var(--background);width:max(800px,50%);max-height:80%;padding:40px 20px 20px;border-radius:8px;position:relative;left:50%;transform:translate(-50%);overflow-y:scroll;box-shadow:0 0 10px 0 var(--shadow2)}._dialog_1nrkm_18::-webkit-scrollbar{width:8px}._dialog_1nrkm_18::-webkit-scrollbar-thumb{background-color:var(--shadow1);border-radius:10px}._closeButton_1nrkm_38{position:sticky;top:0;left:97%;background:none;border:none;cursor:pointer;font:bold}._closeButton_1nrkm_38:hover{transform:scale(1.2)}._body_1nrkm_51{display:flex;flex-direction:column;gap:40px;color:var(--base)}._body_1nrkm_51 ._contentHeading_1nrkm_57{font-size:20px;line-height:28px;font-weight:700;padding-bottom:5px;padding-top:6px}._body_1nrkm_51 ._content_1nrkm_57{display:flex;flex-direction:column;align-items:center;gap:12px}._body_1nrkm_51 ._contentPara_1nrkm_70{padding-left:20px;padding-right:20px}@media (width >= 1200px){._infoButton_1nrkm_1{display:inline-block}}[data-theme=dark] ._closeButton_1nrkm_38{filter:invert(1)}._controller_1ap2y_1{display:flex;align-items:center;justify-content:space-between;margin:20px 10px 16px;padding-left:15px;padding-right:15px}._controller_1ap2y_1 ._operation_1ap2y_9,._controller_1ap2y_1 ._execution_1ap2y_13{display:flex;gap:10px}._controller_1ap2y_1 ._mazeSelector_1ap2y_17,._controller_1ap2y_1 ._pathFinder_1ap2y_18{width:125px;border:1px solid var(--base);padding:0 5px}._controller_1ap2y_1 button:disabled{opacity:.5}._controller_1ap2y_1 ._speed_1ap2y_26,._controller_1ap2y_1 ._play_1ap2y_27{display:none}._controller_1ap2y_1 ._pathInfo_1ap2y_30{display:none;gap:10px}._controller_1ap2y_1 ._pathInfo_1ap2y_30 ._highlight_1ap2y_34{font-weight:600;min-width:3ch;display:inline-block}@media (width >= 640px){._controller_1ap2y_1 ._pathInfo_1ap2y_30{display:flex}}@media (width >= 1024px){._controller_1ap2y_1 ._speed_1ap2y_26,._controller_1ap2y_1 ._play_1ap2y_27{display:block}._controller_1ap2y_1 ._mazeSelector_1ap2y_17,._controller_1ap2y_1 ._pathFinder_1ap2y_18{width:auto}}[data-theme=dark] ._execution_1ap2y_13 img{filter:invert(1)}[data-theme=dark] select{background-color:var(--dark);color:var(--light)}._grid_58jdc_1._grid_58jdc_1{display:inline-grid;margin:auto;border:var(--pf-cell-size) solid var(--pf-cell-wall)}._grid_58jdc_1._grid_58jdc_1 ._type0_58jdc_6{background-color:var(--pf-cell-clear)}._grid_58jdc_1._grid_58jdc_1 ._type1_58jdc_9{background-color:var(--pf-cell-entry);border-color:var(--base)}._grid_58jdc_1._grid_58jdc_1 ._type2_58jdc_13{background-color:var(--pf-cell-exit);border-color:var(--base)}._grid_58jdc_1._grid_58jdc_1 ._type3_58jdc_17{background-color:var(--pf-cell-wall);border-color:var(--pf-cell-wall);animation:_wallAnimation_58jdc_1 .5s}._grid_58jdc_1._grid_58jdc_1 ._type4_58jdc_22{background-color:var(--pf-cell-visited);border-color:var(--pf-cell-visited);animation:_visitedAnimation_58jdc_1 1s}._grid_58jdc_1._grid_58jdc_1 ._type5_58jdc_27{background-color:var(--pf-cell-path);border-color:var(--pf-cell-path-border);border-width:8px}._grid_58jdc_1._grid_58jdc_1 button{border:.5px solid rgb(240,240,240)}[data-theme=dark] ._grid_58jdc_1 button{border-color:#141414}@keyframes _visitedAnimation_58jdc_1{0%{transform:scale(.3);border-radius:50%;background-color:var(--pf-cell-visited-start)}30%{transform:scale(.6);border-radius:65%;background-color:var(--pf-cell-visited-mid)}60%{transform:scale(1.05);border-radius:80%}to{transform:scale(1);background-color:var(--pf-cell-visited)}}@keyframes _wallAnimation_58jdc_1{0%{transform:scale(.3);opacity:.75}50%{transform:scale(1.2);opacity:.9}to{transform:scale(1);opacity:1}}._controllerWrapper_18ff3_1{padding:0 20px;margin-bottom:16px}._controllerWrapper_18ff3_1 ._controller_18ff3_1{gap:10px;margin-bottom:20px}._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._numbers_18ff3_9{display:flex;flex-basis:80%;flex-wrap:wrap;gap:16px}._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._numbers_18ff3_9 ._generator_18ff3_15{display:flex;flex:1;gap:16px}._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._numbers_18ff3_9 ._generator_18ff3_15 ._rndmBtn_18ff3_20{flex:1;padding:5px 10px;color:var(--light);background-color:var(--primary);border:none;border-radius:4px}._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._numbers_18ff3_9 ._generator_18ff3_15 ._select_18ff3_28{flex:1;padding:0 4px;color:var(--dark);text-transform:capitalize;background-color:var(--light);border:1px solid var(--shadow1);border-radius:4px}._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._numbers_18ff3_9 ._arrayInput_18ff3_37{flex:2;width:100%;min-width:300px;padding:5px;color:var(--dark);background-color:var(--light);border:1px solid var(--dark);border-radius:4px}._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._numbers_18ff3_9 ._arrayInput_18ff3_37:-moz-placeholder-shown{border:1px solid transparent;outline:2px solid var(--error)}._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._numbers_18ff3_9 ._arrayInput_18ff3_37:placeholder-shown{border:1px solid transparent;outline:2px solid var(--error)}._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._controls_18ff3_51{display:flex;flex:1;flex-basis:25%;gap:16px;margin-top:20px}._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._controls_18ff3_51 input[type=range]{flex:1;cursor:pointer}._checkboxWrapper_18ff3_63{display:flex;flex-wrap:wrap;gap:20px;align-items:center;justify-content:center}._checkboxWrapper_18ff3_63 ._listItem_18ff3_70{list-style-type:none}._checkboxWrapper_18ff3_63 ._listItem_18ff3_70 ._checkbox_18ff3_63{display:flex;gap:4px;align-items:center;justify-content:center}._checkboxWrapper_18ff3_63 ._listItem_18ff3_70 ._checkbox_18ff3_63>input,._checkboxWrapper_18ff3_63 ._listItem_18ff3_70 ._checkbox_18ff3_63>label{cursor:pointer}._checkboxWrapper_18ff3_63 ._listItem_18ff3_70 ._checkbox_18ff3_63>label{text-transform:capitalize}._switchContainer_18ff3_87{display:flex;gap:20px;align-items:center;justify-content:center}@media screen and (width >= 768px){._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._numbers_18ff3_9 ._generator_18ff3_15,._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._numbers_18ff3_9 ._rndmBtn_18ff3_20{flex-grow:0}}@media screen and (width >= 960px){._controllerWrapper_18ff3_1 ._controller_18ff3_1{display:flex}._controllerWrapper_18ff3_1 ._controller_18ff3_1 ._controls_18ff3_51{margin-top:0}}[data-theme=dark] ._controllerWrapper_18ff3_1 img{filter:invert(1)}._navbar_8y9jz_1{position:relative;display:flex;align-items:center;justify-content:space-between;padding:10px 20px;margin-bottom:20px;box-shadow:0 4px 4px var(--shadow1)}._navbar_8y9jz_1 img{width:25px;height:25px}._navbar_8y9jz_1 ul{position:absolute;top:65px;left:0;z-index:1;gap:10px;width:100%;padding-bottom:12px;list-style:none;background-color:var(--background);box-shadow:0 4px 4px var(--shadow1)}._navbar_8y9jz_1 ul[data-toggle=false]{display:none}._navbar_8y9jz_1 ul li{width:100%;padding:10px}._navbar_8y9jz_1 ul li a{display:block;width:auto;padding:6px;text-transform:capitalize;border-radius:8px}._navbar_8y9jz_1 ul li a._active_8y9jz_40{color:var(--light);background-color:var(--primary)}._navbar_8y9jz_1 ul li a:hover{outline:1px solid var(--primary)}@media screen and (width >= 960px){._navbar_8y9jz_1._navbar_8y9jz_1{padding:10px 10px 10px 20px}._navbar_8y9jz_1._navbar_8y9jz_1 ul{position:static;display:flex;width:auto;padding-bottom:0;box-shadow:none}._navbar_8y9jz_1._navbar_8y9jz_1 ul li{padding:0}._navbar_8y9jz_1._navbar_8y9jz_1 ._hamButton_8y9jz_62{display:none}}[data-theme=dark] ._navbar_8y9jz_1 img{filter:invert(1)}._main_1hg6y_1{padding:10px 20px 0;text-align:center}._allAlgos_1hg6y_6{display:flex;flex-wrap:wrap;gap:20px;justify-content:center;margin:30px 0 80px}._container_wgxfy_1{display:inline-block;min-width:300px;max-width:100%;padding:20px;box-shadow:0 0 4px var(--shadow2)}._container_wgxfy_1 header,._container_wgxfy_1 footer{display:flex;align-items:center;justify-content:space-between}._container_wgxfy_1 h2{font-size:1.1rem;font-weight:700;text-transform:capitalize}._warning_wgxfy_20{font-size:1.15rem;font-weight:500;color:var(--error)}._arrayContainer_116to_1{position:relative;padding:25px 0 40px;overflow-x:auto}._arrayContainer_116to_1 ._values_116to_6{display:flex;align-items:flex-end;height:var(--bar-max-height)}._arrayContainer_116to_1 ._values_116to_6 li{flex-shrink:1;width:var(--bar-size);min-width:var(--bar-min-size);margin:0 calc(var(--bar-margin) / 2);background-color:var(--color-bar);border:1px solid var(--color-bar)}._arrayContainer_116to_1 ._values_116to_6 ._pivot_116to_19{background-color:var(--color-pivot)}._arrayContainer_116to_1 ._values_116to_6 ._sort_116to_22{background-color:var(--color-sort)}._arrayContainer_116to_1 ._values_116to_6 ._highlight_116to_25{background-color:var(--color-highlight)}._arrayContainer_116to_1 ._indices_116to_28{position:absolute;bottom:20px;display:flex;width:100%;font-size:.4rem;opacity:.4}._arrayContainer_116to_1 ._indices_116to_28 li{flex-shrink:1;width:var(--bar-size);min-width:var(--bar-min-size);margin:0 calc(var(--bar-margin) / 2)}._arrayContainer_9tgyc_1{position:relative;padding:0 20px;overflow:auto}._arrayContainer_9tgyc_1 ._values_9tgyc_6{display:flex;padding:calc(var(--cell-size) + 20px) 0}._arrayContainer_9tgyc_1 ._values_9tgyc_6 ._cell_9tgyc_10{display:flex;flex-shrink:0;align-items:center;justify-content:center;width:var(--cell-size);height:var(--cell-size);margin:0 calc(var(--cell-margin) / 2);color:var(--dark);background-color:var(--light);border:1px solid var(--base);border-radius:4px;box-shadow:0 4px 4px var(--shadow1)}._arrayContainer_9tgyc_1 ._values_9tgyc_6 ._pivot_9tgyc_24{background-color:var(--color-pivot)}._arrayContainer_9tgyc_1 ._values_9tgyc_6 ._sort_9tgyc_27{background-color:var(--color-sort)}._arrayContainer_9tgyc_1 ._values_9tgyc_6 ._highlight_9tgyc_30{background-color:var(--color-highlight)}._arrayContainer_9tgyc_1 ._indices_9tgyc_33{position:absolute;bottom:calc(var(--cell-size) - 5px);z-index:-1;display:flex;font-size:.75rem;opacity:.25}._arrayContainer_9tgyc_1 ._indices_9tgyc_33 li{display:flex;justify-content:center;width:var(--cell-size);margin:0 calc(var(--cell-margin) / 2)} diff --git a/docs/index.html b/docs/index.html index 988ab34..211b4e2 100644 --- a/docs/index.html +++ b/docs/index.html @@ -7,8 +7,8 @@ Algo Visualizers - - + +