From 17bd6467deabadc5982a3a7692fe383c3c80e98f Mon Sep 17 00:00:00 2001 From: Sadanand Pai Date: Mon, 2 Oct 2023 04:50:35 +0000 Subject: [PATCH] build files - github action --- dist/assets/index-113bf215.css | 1 - dist/assets/index-47196185.css | 1 + dist/assets/{index-8b63cd36.js => index-ebf72530.js} | 4 ++-- dist/index.html | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) delete mode 100644 dist/assets/index-113bf215.css create mode 100644 dist/assets/index-47196185.css rename dist/assets/{index-8b63cd36.js => index-ebf72530.js} (99%) diff --git a/dist/assets/index-113bf215.css b/dist/assets/index-113bf215.css deleted file mode 100644 index 4b79daa..0000000 --- a/dist/assets/index-113bf215.css +++ /dev/null @@ -1 +0,0 @@ -@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{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,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}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-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;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[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: }::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: }.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}}.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))}.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{--base: black;--background: white;--primary: #2b4bfe;--shadow1: rgba(0, 0, 0, .15);--shadow2: rgba(0, 0, 0, .4)}@media screen and (prefers-color-scheme: dark){:root{--base: white;--background: black;--primary: #2b4bfe;--shadow1: rgba(255, 255, 255, .15);--shadow2: rgba(255, 255, 255, .4)}}html[data-theme=light]{--base: black;--background: white;--primary: #2b4bfe;--shadow1: rgba(0, 0, 0, .15);--shadow2: rgba(0, 0, 0, .4)}html[data-theme=dark]{--base: white;--background: black;--primary: #2b4bfe;--shadow1: rgba(255, 255, 255, .15);--shadow2: rgba(255, 255, 255, .4)}body{font-family:Inter,sans-serif;color:var(--base);background-color:var(--background)}#screen-layout{position:fixed;top:0;left:0;width:100vw;height:100vh;pointer-events:none}#screen-layout *{pointer-events:all}._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_1svdl_1{position:relative;padding:0 20px;overflow:auto}._arrayContainer_1svdl_1 ._values_1svdl_6{display:flex;padding:calc(var(--cell-size) + 20px) 0}._arrayContainer_1svdl_1 ._values_1svdl_6 ._cell_1svdl_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:#000;background-color:#fff;border:1px solid var(--base);border-radius:4px;box-shadow:0 4px 4px var(--shadow1)}._arrayContainer_1svdl_1 ._values_1svdl_6 ._pivot_1svdl_24{background-color:var(--color-pivot)}._arrayContainer_1svdl_1 ._values_1svdl_6 ._sort_1svdl_27{background-color:var(--color-sort)}._arrayContainer_1svdl_1 ._values_1svdl_6 ._highlight_1svdl_30{background-color:var(--color-highlight)}._arrayContainer_1svdl_1 ._indices_1svdl_33{position:absolute;bottom:calc(var(--cell-size) - 5px);z-index:-1;display:flex;font-size:.75rem;opacity:.25}._arrayContainer_1svdl_1 ._indices_1svdl_33 li{display:flex;justify-content:center;width:var(--cell-size);margin:0 calc(var(--cell-margin) / 2)}._controllerWrapper_1i192_1{padding:0 20px;margin-bottom:16px}._controllerWrapper_1i192_1 ._controller_1i192_1{gap:10px;margin-bottom:20px}._controllerWrapper_1i192_1 ._controller_1i192_1 ._numbers_1i192_9{display:flex;flex-basis:75%;gap:16px}._controllerWrapper_1i192_1 ._controller_1i192_1 ._numbers_1i192_9 ._arrayInput_1i192_14{flex:1;width:100%;padding:5px;color:#000;background-color:#fff;border:1px solid black;border-radius:4px}._controllerWrapper_1i192_1 ._controller_1i192_1 ._numbers_1i192_9 ._arrayInput_1i192_14:-moz-placeholder-shown{border:1px solid transparent;outline:2px solid red}._controllerWrapper_1i192_1 ._controller_1i192_1 ._numbers_1i192_9 ._arrayInput_1i192_14:placeholder-shown{border:1px solid transparent;outline:2px solid red}._controllerWrapper_1i192_1 ._controller_1i192_1 ._numbers_1i192_9 ._rndmBtn_1i192_27{padding:5px 10px;color:#fff;background-color:var(--primary);border:none;border-radius:4px}._controllerWrapper_1i192_1 ._controller_1i192_1 ._controls_1i192_34{display:flex;flex:1;flex-basis:25%;gap:16px;margin-top:20px}._controllerWrapper_1i192_1 ._controller_1i192_1 ._controls_1i192_34 button:disabled{cursor:not-allowed}._controllerWrapper_1i192_1 ._controller_1i192_1 ._controls_1i192_34 button:disabled img{opacity:.5}._controllerWrapper_1i192_1 ._controller_1i192_1 ._controls_1i192_34 input[type=range]{flex:1;cursor:pointer}._checkboxWrapper_1i192_52{display:flex;flex-wrap:wrap;gap:20px;align-items:center;justify-content:center}._checkboxWrapper_1i192_52 ._listItem_1i192_59{list-style-type:none}._checkboxWrapper_1i192_52 ._listItem_1i192_59 ._checkbox_1i192_52{display:flex;gap:4px;align-items:center;justify-content:center}._checkboxWrapper_1i192_52 ._listItem_1i192_59 ._checkbox_1i192_52>input,._checkboxWrapper_1i192_52 ._listItem_1i192_59 ._checkbox_1i192_52>label{cursor:pointer}._checkboxWrapper_1i192_52 ._listItem_1i192_59 ._checkbox_1i192_52>label{text-transform:capitalize}._switchContainer_1i192_76{display:flex;gap:20px;align-items:center;justify-content:center}@media screen and (width >= 960px){._controllerWrapper_1i192_1 ._controller_1i192_1{display:flex}._controllerWrapper_1i192_1 ._controller_1i192_1 ._controls_1i192_34{margin-top:0}}[data-theme=dark] ._controllerWrapper_1i192_1 img{filter:invert(1)}._iconBtn_bxmqs_1{position:absolute;right:25px;bottom:15px;padding:5px;cursor:pointer;background-color:#fff;border:1px solid black;border-radius:50%;opacity:.5;fill:red;transition:all .5s}._iconBtn_bxmqs_1 img{width:25px;height:25px}._navbar_1y7w0_1{position:relative;display:flex;align-items:center;justify-content:space-between;padding:12px 20px;margin-bottom:24px;box-shadow:0 4px 4px var(--shadow1)}._navbar_1y7w0_1 img{width:25px;height:25px}._navbar_1y7w0_1 h1{font-size:1.5rem;font-weight:600}._navbar_1y7w0_1 h1 img{display:inline-block;margin-top:2px;margin-left:10px;vertical-align:text-top}._navbar_1y7w0_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_1y7w0_1 ul[data-toggle=false]{display:none}._navbar_1y7w0_1 ul li{width:100%;padding:10px}._navbar_1y7w0_1 ul li a{display:block;width:auto;padding:8px 6px;text-transform:capitalize;border-radius:8px}._navbar_1y7w0_1 ul li a._active_1y7w0_50{color:#fff;background-color:var(--primary)}._navbar_1y7w0_1 ul li a:hover{outline:1px solid var(--primary)}@media screen and (width >= 960px){._navbar_1y7w0_1._navbar_1y7w0_1{padding:10px 10px 10px 20px}._navbar_1y7w0_1._navbar_1y7w0_1 ul{position:static;display:flex;width:auto;padding-bottom:0;box-shadow:none}._navbar_1y7w0_1._navbar_1y7w0_1 ul li{padding:0}._navbar_1y7w0_1._navbar_1y7w0_1 button{display:none}}[data-theme=dark] ._navbar_1y7w0_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_13os8_1{display:inline-block;min-width:300px;max-width:100%;padding:20px;box-shadow:0 0 4px var(--shadow2)}._container_13os8_1 header,._container_13os8_1 footer{display:flex;align-items:center;justify-content:space-between}._container_13os8_1 h2{font-size:1.1rem;font-weight:700;text-transform:capitalize}._warning_13os8_20{font-size:1.15rem;font-weight:500;color:#ff2f2f} diff --git a/dist/assets/index-47196185.css b/dist/assets/index-47196185.css new file mode 100644 index 0000000..5a624cd --- /dev/null +++ b/dist/assets/index-47196185.css @@ -0,0 +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{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,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}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-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;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[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: }::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: }.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}}.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))}.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}._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)}._controllerWrapper_dofm1_1{padding:0 20px;margin-bottom:16px}._controllerWrapper_dofm1_1 ._controller_dofm1_1{gap:10px;margin-bottom:20px}._controllerWrapper_dofm1_1 ._controller_dofm1_1 ._numbers_dofm1_9{display:flex;flex-basis:75%;gap:16px}._controllerWrapper_dofm1_1 ._controller_dofm1_1 ._numbers_dofm1_9 ._arrayInput_dofm1_14{flex:1;width:100%;padding:5px;color:var(--dark);background-color:var(--light);border:1px solid var(--dark);border-radius:4px}._controllerWrapper_dofm1_1 ._controller_dofm1_1 ._numbers_dofm1_9 ._arrayInput_dofm1_14:-moz-placeholder-shown{border:1px solid transparent;outline:2px solid var(--error)}._controllerWrapper_dofm1_1 ._controller_dofm1_1 ._numbers_dofm1_9 ._arrayInput_dofm1_14:placeholder-shown{border:1px solid transparent;outline:2px solid var(--error)}._controllerWrapper_dofm1_1 ._controller_dofm1_1 ._numbers_dofm1_9 ._rndmBtn_dofm1_27{padding:5px 10px;color:var(--light);background-color:var(--primary);border:none;border-radius:4px}._controllerWrapper_dofm1_1 ._controller_dofm1_1 ._controls_dofm1_34{display:flex;flex:1;flex-basis:25%;gap:16px;margin-top:20px}._controllerWrapper_dofm1_1 ._controller_dofm1_1 ._controls_dofm1_34 button:disabled{cursor:not-allowed}._controllerWrapper_dofm1_1 ._controller_dofm1_1 ._controls_dofm1_34 button:disabled img{opacity:.5}._controllerWrapper_dofm1_1 ._controller_dofm1_1 ._controls_dofm1_34 input[type=range]{flex:1;cursor:pointer}._checkboxWrapper_dofm1_52{display:flex;flex-wrap:wrap;gap:20px;align-items:center;justify-content:center}._checkboxWrapper_dofm1_52 ._listItem_dofm1_59{list-style-type:none}._checkboxWrapper_dofm1_52 ._listItem_dofm1_59 ._checkbox_dofm1_52{display:flex;gap:4px;align-items:center;justify-content:center}._checkboxWrapper_dofm1_52 ._listItem_dofm1_59 ._checkbox_dofm1_52>input,._checkboxWrapper_dofm1_52 ._listItem_dofm1_59 ._checkbox_dofm1_52>label{cursor:pointer}._checkboxWrapper_dofm1_52 ._listItem_dofm1_59 ._checkbox_dofm1_52>label{text-transform:capitalize}._switchContainer_dofm1_76{display:flex;gap:20px;align-items:center;justify-content:center}@media screen and (width >= 960px){._controllerWrapper_dofm1_1 ._controller_dofm1_1{display:flex}._controllerWrapper_dofm1_1 ._controller_dofm1_1 ._controls_dofm1_34{margin-top:0}}[data-theme=dark] ._controllerWrapper_dofm1_1 img{filter:invert(1)}._iconBtn_9tcdq_1{position:absolute;right:20px;bottom:15px;padding:5px;cursor:pointer;background-color:var(--light);border:1px solid var(--dark);border-radius:50%;opacity:.5}._iconBtn_9tcdq_1 img{width:25px;height:25px}._navbar_hoafu_1{position:relative;display:flex;align-items:center;justify-content:space-between;padding:12px 20px;margin-bottom:24px;box-shadow:0 4px 4px var(--shadow1)}._navbar_hoafu_1 img{width:25px;height:25px}._navbar_hoafu_1 h1{font-size:1.5rem;font-weight:600}._navbar_hoafu_1 h1 img{display:inline-block;margin-top:2px;margin-left:10px;vertical-align:text-top}._navbar_hoafu_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_hoafu_1 ul[data-toggle=false]{display:none}._navbar_hoafu_1 ul li{width:100%;padding:10px}._navbar_hoafu_1 ul li a{display:block;width:auto;padding:8px 6px;text-transform:capitalize;border-radius:8px}._navbar_hoafu_1 ul li a._active_hoafu_50{color:var(--light);background-color:var(--primary)}._navbar_hoafu_1 ul li a:hover{outline:1px solid var(--primary)}@media screen and (width >= 960px){._navbar_hoafu_1._navbar_hoafu_1{padding:10px 10px 10px 20px}._navbar_hoafu_1._navbar_hoafu_1 ul{position:static;display:flex;width:auto;padding-bottom:0;box-shadow:none}._navbar_hoafu_1._navbar_hoafu_1 ul li{padding:0}._navbar_hoafu_1._navbar_hoafu_1 button{display:none}}[data-theme=dark] ._navbar_hoafu_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)} diff --git a/dist/assets/index-8b63cd36.js b/dist/assets/index-ebf72530.js similarity index 99% rename from dist/assets/index-8b63cd36.js rename to dist/assets/index-ebf72530.js index e103460..dc0f05f 100644 --- a/dist/assets/index-8b63cd36.js +++ b/dist/assets/index-ebf72530.js @@ -96,7 +96,7 @@ Error generating stack: `+i.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Mc=Symbol.for("react.element"),zc=Symbol.for("react.portal"),Gl=Symbol.for("react.fragment"),Jl=Symbol.for("react.strict_mode"),ql=Symbol.for("react.profiler"),Zl=Symbol.for("react.provider"),eu=Symbol.for("react.context"),$S=Symbol.for("react.server_context"),tu=Symbol.for("react.forward_ref"),nu=Symbol.for("react.suspense"),ru=Symbol.for("react.suspense_list"),ou=Symbol.for("react.memo"),iu=Symbol.for("react.lazy"),AS=Symbol.for("react.offscreen"),Zm;Zm=Symbol.for("react.module.reference");function dt(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Mc:switch(e=e.type,e){case Gl:case ql:case Jl:case nu:case ru:return e;default:switch(e=e&&e.$$typeof,e){case $S:case eu:case tu:case iu:case ou:case Zl:return e;default:return t}}case zc:return t}}}J.ContextConsumer=eu;J.ContextProvider=Zl;J.Element=Mc;J.ForwardRef=tu;J.Fragment=Gl;J.Lazy=iu;J.Memo=ou;J.Portal=zc;J.Profiler=ql;J.StrictMode=Jl;J.Suspense=nu;J.SuspenseList=ru;J.isAsyncMode=function(){return!1};J.isConcurrentMode=function(){return!1};J.isContextConsumer=function(e){return dt(e)===eu};J.isContextProvider=function(e){return dt(e)===Zl};J.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Mc};J.isForwardRef=function(e){return dt(e)===tu};J.isFragment=function(e){return dt(e)===Gl};J.isLazy=function(e){return dt(e)===iu};J.isMemo=function(e){return dt(e)===ou};J.isPortal=function(e){return dt(e)===zc};J.isProfiler=function(e){return dt(e)===ql};J.isStrictMode=function(e){return dt(e)===Jl};J.isSuspense=function(e){return dt(e)===nu};J.isSuspenseList=function(e){return dt(e)===ru};J.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Gl||e===ql||e===Jl||e===nu||e===ru||e===AS||typeof e=="object"&&e!==null&&(e.$$typeof===iu||e.$$typeof===ou||e.$$typeof===Zl||e.$$typeof===eu||e.$$typeof===tu||e.$$typeof===Zm||e.getModuleId!==void 0)};J.typeOf=dt;function US(){const e=xS();let t=null,n=null;return{clear(){t=null,n=null},notify(){e(()=>{let r=t;for(;r;)r.callback(),r=r.next})},get(){let r=[],o=t;for(;o;)r.push(o),o=o.next;return r},subscribe(r){let o=!0,i=n={callback:r,next:null,prev:n};return i.prev?i.prev.next=i:t=i,function(){!o||t===null||(o=!1,i.next?i.next.prev=i.prev:n=i.prev,i.prev?i.prev.next=i.next:t=i.next)}}}}const Hd={notify(){},get:()=>[]};function FS(e,t){let n,r=Hd;function o(f){return u(),r.subscribe(f)}function i(){r.notify()}function l(){c.onStateChange&&c.onStateChange()}function a(){return!!n}function u(){n||(n=t?t.addNestedSub(l):e.subscribe(l),r=US())}function s(){n&&(n(),n=void 0,r.clear(),r=Hd)}const c={addNestedSub:o,notifyNestedSubs:i,handleChangeWrapper:l,isSubscribed:a,trySubscribe:u,tryUnsubscribe:s,getListeners:()=>r};return c}const bS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",BS=bS?_.useLayoutEffect:_.useEffect;function WS({store:e,context:t,children:n,serverState:r,stabilityCheck:o="once",noopCheck:i="once"}){const l=_.useMemo(()=>{const s=FS(e);return{store:e,subscription:s,getServerState:r?()=>r:void 0,stabilityCheck:o,noopCheck:i}},[e,r,o,i]),a=_.useMemo(()=>e.getState(),[e]);BS(()=>{const{subscription:s}=l;return s.onStateChange=s.notifyNestedSubs,s.trySubscribe(),a!==e.getState()&&s.notifyNestedSubs(),()=>{s.tryUnsubscribe(),s.onStateChange=void 0}},[l,a]);const u=t||kn;return _.createElement(u.Provider,{value:l},n)}function ev(e=kn){const t=e===kn?Qm:Oc(e);return function(){const{store:r}=t();return r}}const VS=ev();function HS(e=kn){const t=e===kn?VS:ev(e);return function(){return t().dispatch}}const KS=HS();_S(v1.useSyncExternalStoreWithSelector);ES(Rc.unstable_batchedUpdates);const On=KS,Le=OS,QS="_arrayContainer_116to_1",XS="_values_116to_6",YS="_pivot_116to_19",GS="_sort_116to_22",JS="_highlight_116to_25",qS="_indices_116to_28",gi={arrayContainer:QS,values:XS,pivot:YS,sort:GS,highlight:JS,indices:qS};function tv({array:e,sorts:t,highlights:n,pivot:r}){const o=_.useMemo(()=>Math.max(...e),[e]);function i(l){let a="";return r===l&&(a="pivot"),t.includes(l)&&(a="sort"),n.includes(l)&&(a="highlight"),a}return j.jsxs("div",{className:gi.arrayContainer,children:[j.jsx("ul",{className:gi.values,children:e.map((l,a)=>j.jsx("li",{className:gi[i(a)],style:{height:`${l/o*100}%`}},a))}),j.jsx("ul",{className:gi.indices,children:e.map((l,a)=>j.jsx("li",{children:a},a))})]})}const ZS="_arrayContainer_1svdl_1",eE="_values_1svdl_6",tE="_cell_1svdl_10",nE="_pivot_1svdl_24",rE="_sort_1svdl_27",oE="_highlight_1svdl_30",iE="_indices_1svdl_33",xo={arrayContainer:ZS,values:eE,cell:tE,pivot:nE,sort:rE,highlight:oE,indices:iE};function Dc({order:e,animation:t,value:n,isSorted:r=!1,isHighlighted:o=!1,isPivot:i=!1}){let l="";return i&&(l="pivot"),r&&(l="sort"),o&&(l="highlight"),j.jsx("li",{className:`${xo.cell} ${xo[l]}`,style:{animation:t,order:e},children:n})}const ir=document.querySelector('[data-id="animation-element"]');function nv(e,t=1e3){const n=`anime-${Math.random().toString(36).substring(2,9)}`,r=`${t}ms linear forwards ${n}`,o=un.size+un.margin,i=`@keyframes ${n} { + */var Mc=Symbol.for("react.element"),zc=Symbol.for("react.portal"),Gl=Symbol.for("react.fragment"),Jl=Symbol.for("react.strict_mode"),ql=Symbol.for("react.profiler"),Zl=Symbol.for("react.provider"),eu=Symbol.for("react.context"),$S=Symbol.for("react.server_context"),tu=Symbol.for("react.forward_ref"),nu=Symbol.for("react.suspense"),ru=Symbol.for("react.suspense_list"),ou=Symbol.for("react.memo"),iu=Symbol.for("react.lazy"),AS=Symbol.for("react.offscreen"),Zm;Zm=Symbol.for("react.module.reference");function dt(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Mc:switch(e=e.type,e){case Gl:case ql:case Jl:case nu:case ru:return e;default:switch(e=e&&e.$$typeof,e){case $S:case eu:case tu:case iu:case ou:case Zl:return e;default:return t}}case zc:return t}}}J.ContextConsumer=eu;J.ContextProvider=Zl;J.Element=Mc;J.ForwardRef=tu;J.Fragment=Gl;J.Lazy=iu;J.Memo=ou;J.Portal=zc;J.Profiler=ql;J.StrictMode=Jl;J.Suspense=nu;J.SuspenseList=ru;J.isAsyncMode=function(){return!1};J.isConcurrentMode=function(){return!1};J.isContextConsumer=function(e){return dt(e)===eu};J.isContextProvider=function(e){return dt(e)===Zl};J.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Mc};J.isForwardRef=function(e){return dt(e)===tu};J.isFragment=function(e){return dt(e)===Gl};J.isLazy=function(e){return dt(e)===iu};J.isMemo=function(e){return dt(e)===ou};J.isPortal=function(e){return dt(e)===zc};J.isProfiler=function(e){return dt(e)===ql};J.isStrictMode=function(e){return dt(e)===Jl};J.isSuspense=function(e){return dt(e)===nu};J.isSuspenseList=function(e){return dt(e)===ru};J.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Gl||e===ql||e===Jl||e===nu||e===ru||e===AS||typeof e=="object"&&e!==null&&(e.$$typeof===iu||e.$$typeof===ou||e.$$typeof===Zl||e.$$typeof===eu||e.$$typeof===tu||e.$$typeof===Zm||e.getModuleId!==void 0)};J.typeOf=dt;function US(){const e=xS();let t=null,n=null;return{clear(){t=null,n=null},notify(){e(()=>{let r=t;for(;r;)r.callback(),r=r.next})},get(){let r=[],o=t;for(;o;)r.push(o),o=o.next;return r},subscribe(r){let o=!0,i=n={callback:r,next:null,prev:n};return i.prev?i.prev.next=i:t=i,function(){!o||t===null||(o=!1,i.next?i.next.prev=i.prev:n=i.prev,i.prev?i.prev.next=i.next:t=i.next)}}}}const Hd={notify(){},get:()=>[]};function FS(e,t){let n,r=Hd;function o(f){return u(),r.subscribe(f)}function i(){r.notify()}function l(){c.onStateChange&&c.onStateChange()}function a(){return!!n}function u(){n||(n=t?t.addNestedSub(l):e.subscribe(l),r=US())}function s(){n&&(n(),n=void 0,r.clear(),r=Hd)}const c={addNestedSub:o,notifyNestedSubs:i,handleChangeWrapper:l,isSubscribed:a,trySubscribe:u,tryUnsubscribe:s,getListeners:()=>r};return c}const bS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",BS=bS?_.useLayoutEffect:_.useEffect;function WS({store:e,context:t,children:n,serverState:r,stabilityCheck:o="once",noopCheck:i="once"}){const l=_.useMemo(()=>{const s=FS(e);return{store:e,subscription:s,getServerState:r?()=>r:void 0,stabilityCheck:o,noopCheck:i}},[e,r,o,i]),a=_.useMemo(()=>e.getState(),[e]);BS(()=>{const{subscription:s}=l;return s.onStateChange=s.notifyNestedSubs,s.trySubscribe(),a!==e.getState()&&s.notifyNestedSubs(),()=>{s.tryUnsubscribe(),s.onStateChange=void 0}},[l,a]);const u=t||kn;return _.createElement(u.Provider,{value:l},n)}function ev(e=kn){const t=e===kn?Qm:Oc(e);return function(){const{store:r}=t();return r}}const VS=ev();function HS(e=kn){const t=e===kn?VS:ev(e);return function(){return t().dispatch}}const KS=HS();_S(v1.useSyncExternalStoreWithSelector);ES(Rc.unstable_batchedUpdates);const On=KS,Le=OS,QS="_arrayContainer_116to_1",XS="_values_116to_6",YS="_pivot_116to_19",GS="_sort_116to_22",JS="_highlight_116to_25",qS="_indices_116to_28",gi={arrayContainer:QS,values:XS,pivot:YS,sort:GS,highlight:JS,indices:qS};function tv({array:e,sorts:t,highlights:n,pivot:r}){const o=_.useMemo(()=>Math.max(...e),[e]);function i(l){let a="";return r===l&&(a="pivot"),t.includes(l)&&(a="sort"),n.includes(l)&&(a="highlight"),a}return j.jsxs("div",{className:gi.arrayContainer,children:[j.jsx("ul",{className:gi.values,children:e.map((l,a)=>j.jsx("li",{className:gi[i(a)],style:{height:`${l/o*100}%`}},a))}),j.jsx("ul",{className:gi.indices,children:e.map((l,a)=>j.jsx("li",{children:a},a))})]})}const ZS="_arrayContainer_9tgyc_1",eE="_values_9tgyc_6",tE="_cell_9tgyc_10",nE="_pivot_9tgyc_24",rE="_sort_9tgyc_27",oE="_highlight_9tgyc_30",iE="_indices_9tgyc_33",xo={arrayContainer:ZS,values:eE,cell:tE,pivot:nE,sort:rE,highlight:oE,indices:iE};function Dc({order:e,animation:t,value:n,isSorted:r=!1,isHighlighted:o=!1,isPivot:i=!1}){let l="";return i&&(l="pivot"),r&&(l="sort"),o&&(l="highlight"),j.jsx("li",{className:`${xo.cell} ${xo[l]}`,style:{animation:t,order:e},children:n})}const ir=document.querySelector('[data-id="animation-element"]');function nv(e,t=1e3){const n=`anime-${Math.random().toString(36).substring(2,9)}`,r=`${t}ms linear forwards ${n}`,o=un.size+un.margin,i=`@keyframes ${n} { 25% { transform: translateY(${Math.sign(e)*(un.size+5)}px); } @@ -110,4 +110,4 @@ Error generating stack: `+i.message+` 100% { transform: translateX(${e*o}px); } - }`;return rv(i),r}function rv(e){var n;const t=(n=ir==null?void 0:ir.sheet)==null?void 0:n.insertRule(e);setTimeout(()=>{var r;t&&((r=ir==null?void 0:ir.sheet)==null||r.deleteRule(t))},Kn)}function uE({originalOrder:e,isSwap:t,order:n,value:r,isHighlighted:o}){let i=lE(e-n,Kn);return t&&(i=nv(e-n,Kn)),j.jsx(Dc,{animation:i,order:n,value:r,isHighlighted:o})}function aE({originalOrder:e,order:t,value:n,isHighlighted:r}){const o=nv(e-t,Kn);return j.jsx(Dc,{animation:o,order:t,value:n,isHighlighted:r})}const ov=function({array:t,swaps:n,sorts:r,highlights:o,moves:i,pivot:l}){function a(u,s){return n.includes(u)?j.jsx(aE,{originalOrder:u,order:n[0]===u?n[1]:n[0],value:s,isHighlighted:o.includes(u)},u):i&&u>=i[0]&&u<=i[1]?j.jsx(uE,{originalOrder:u,order:u===i[0]?i[1]:u-1,isSwap:u===i[0],value:s,isHighlighted:o.includes(u)},u):j.jsx(Dc,{order:u,value:s,isSorted:r.includes(u),isHighlighted:o.includes(u),isPivot:u===l},u)}return j.jsxs("div",{className:xo.arrayContainer,children:[j.jsx("ul",{className:xo.values,children:t.map((u,s)=>a(s,u))}),j.jsx("ul",{className:xo.indices,children:t.map((u,s)=>j.jsx("li",{children:s},s))})]})};function sE(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 cE(e){return e.split(",").filter(t=>t!=="").map(t=>+t)}function Kd(e=0,t=999){return Math.floor(Math.random()*(t-e))+e}const fE="_controllerWrapper_1i192_1",dE="_controller_1i192_1",pE="_numbers_1i192_9",hE="_arrayInput_1i192_14",mE="_rndmBtn_1i192_27",vE="_controls_1i192_34",yE="_checkboxWrapper_1i192_52",gE="_listItem_1i192_59",wE="_checkbox_1i192_52",SE="_switchContainer_1i192_76",Mt={controllerWrapper:fE,controller:dE,numbers:pE,arrayInput:hE,rndmBtn:mE,controls:vE,checkboxWrapper:yE,listItem:gE,checkbox:wE,switchContainer:SE};function EE(){const e=On(),t=Le(l=>l.sortViz.array),[n,r]=_.useState(t.join(", "));_.useEffect(()=>{e(Qn(!1)),e(Qo())},[t,e]);const o=()=>{const l=Array.from(new Array(Kd(10,40)),()=>Kd());r(l.join(", ")),e(If(l))},i=l=>{const a=sE(l.target.value);r(a),e(If(cE(a)))};return j.jsxs("div",{className:Mt.numbers,children:[j.jsx("button",{className:Mt.rndmBtn,onClick:o,children:"Randomize"}),j.jsx("input",{className:Mt.arrayInput,type:"text",placeholder:"Numbers to sort (comma separate - max 3 digits)",value:n,onChange:i})]})}const xE="/sorting-visualizer/dist/icons/pause.svg",kE="/sorting-visualizer/dist/icons/play.svg",PE="/sorting-visualizer/dist/icons/reset.svg";function _E(){const e=On(),t=Le(i=>i.sortViz.array),n=Le(i=>i.sortViz.speed),r=Le(i=>i.sortViz.isPlaying),o=Le(i=>i.sortViz.reset);return _.useEffect(()=>{r&&e(b0())},[e,r]),_.useEffect(()=>{e(Qn(!1))},[e,o]),_.useEffect(()=>{e($f(n))},[e,n]),j.jsxs("div",{className:Mt.controls,children:[j.jsx("button",{onClick:()=>e(Qn(!r)),disabled:t.length===0||r===null,"data-tooltip":r?"Pause":"Play",children:j.jsx("img",{src:r?xE:kE,alt:r?"Pause":"Play",height:24,width:24})}),j.jsx("button",{onClick:()=>e(Qo()),disabled:t.length===0,"data-tooltip":"Reset",children:j.jsx("img",{src:PE,height:24,width:24})}),j.jsx("input",{"data-tooltip":"Animation speed",type:"range",min:1,max:20,value:n,step:1,onChange:i=>e($f(i.target.valueAsNumber))})]})}function ls(){return ls=Object.assign?Object.assign.bind():function(e){for(var t=1;t=u)&&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,l=n.offColor,a=n.onColor,u=n.offHandleColor,s=n.onHandleColor,c=n.checkedIcon,f=n.uncheckedIcon,p=n.checkedHandleIcon,g=n.uncheckedHandleIcon,w=n.boxShadow,y=n.activeBoxShadow,E=n.height,m=n.width,d=n.borderRadius,v=function(je,$e){var Xe={};for(var N in je)Object.prototype.hasOwnProperty.call(je,N)&&$e.indexOf(N)===-1&&(Xe[N]=je[N]);return Xe}(n,["checked","disabled","className","offColor","onColor","offHandleColor","onHandleColor","checkedIcon","uncheckedIcon","checkedHandleIcon","uncheckedHandleIcon","boxShadow","activeBoxShadow","height","width","borderRadius","handleDiameter"]),h=this.state,x=h.h,P=h.N,R=h.j,T={position:"relative",display:"inline-block",textAlign:"left",opacity:o?.5:1,direction:"ltr",borderRadius:E/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:E,width:m,margin:Math.max(0,(this.t-E)/2),position:"relative",background:Xd(x,this.i,this.o,l,a),borderRadius:typeof d=="number"?d:E/2,cursor:o?"default":"pointer",WebkitTransition:P?null:"background 0.25s",MozTransition:P?null:"background 0.25s",transition:P?null:"background 0.25s"},D={height:E,width:Math.min(1.5*E,m-(this.t+E)/2+1),position:"relative",opacity:(x-this.o)/(this.i-this.o),pointerEvents:"none",WebkitTransition:P?null:"opacity 0.25s",MozTransition:P?null:"opacity 0.25s",transition:P?null:"opacity 0.25s"},Z={height:E,width:Math.min(1.5*E,m-(this.t+E)/2+1),position:"absolute",opacity:1-(x-this.o)/(this.i-this.o),right:0,top:0,pointerEvents:"none",WebkitTransition:P?null:"opacity 0.25s",MozTransition:P?null:"opacity 0.25s",transition:P?null:"opacity 0.25s"},Y={height:this.t,width:this.t,background:Xd(x,this.i,this.o,u,s),display:"inline-block",cursor:o?"default":"pointer",borderRadius:typeof d=="number"?d-1:"50%",position:"absolute",transform:"translateX("+x+"px)",top:Math.max(0,(E-this.t)/2),outline:0,boxShadow:R?y:w,border:0,WebkitTransition:P?null:"background-color 0.25s, transform 0.25s, box-shadow 0.15s",MozTransition:P?null:"background-color 0.25s, transform 0.25s, box-shadow 0.15s",transition:P?null:"background-color 0.25s, transform 0.25s, box-shadow 0.15s"},ot={height:this.t,width:this.t,opacity:Math.max(2*(1-(x-this.o)/(this.i-this.o)-.5),0),position:"absolute",left:0,top:0,pointerEvents:"none",WebkitTransition:P?null:"opacity 0.25s",MozTransition:P?null:"opacity 0.25s",transition:P?null:"opacity 0.25s"},Pt={height:this.t,width:this.t,opacity:Math.max(2*((x-this.o)/(this.i-this.o)-.5),0),position:"absolute",left:0,top:0,pointerEvents:"none",WebkitTransition:P?null:"opacity 0.25s",MozTransition:P?null:"opacity 0.25s",transition:P?null:"opacity 0.25s"};return Be.createElement("div",{className:i,style:T},Be.createElement("div",{className:"react-switch-bg",style:I,onClick:o?null:this.T,onMouseDown:function(je){return je.preventDefault()}},c&&Be.createElement("div",{style:D},c),f&&Be.createElement("div",{style:Z},f)),Be.createElement("div",{className:"react-switch-handle",style:Y,onClick:function(je){return je.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},g&&Be.createElement("div",{style:ot},g),p&&Be.createElement("div",{style:Pt},p)),Be.createElement("input",ls({},{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);iv.defaultProps={disabled:!1,offColor:"#888",onColor:"#080",offHandleColor:"#fff",onHandleColor:"#fff",uncheckedIcon:CE,checkedIcon:RE,boxShadow:null,activeBoxShadow:"0 0 2px 3px #3bf",height:28,width:56};function OE(){const e=On(),t=Le(n=>n.sortViz.visualizerType);return _.useEffect(()=>{e(Qn(!1)),e(Qo())},[t,e]),j.jsxs("div",{className:Mt.switchContainer,children:[j.jsx("label",{children:"Cell"}),j.jsx(iv,{id:"visualizerType",onChange:()=>e(U0()),checked:t==="bar",checkedIcon:!1,uncheckedIcon:!1,height:20,width:40,offColor:"#2b4bfe",onColor:"#2b4bfe"}),j.jsx("label",{children:"Bar"})]})}function jE(){const{algoName:e}=ws(),t=On();return _.useEffect(()=>{t(Qn(!1)),t(Qo())},[e,t]),j.jsxs("section",{className:Mt.controllerWrapper,children:[j.jsxs("div",{className:Mt.controller,children:[j.jsx(EE,{}),j.jsx(_E,{})]}),j.jsx(OE,{})]})}var Ln=(e=>(e.LIGHT="light",e.DARK="dark",e))(Ln||{});const NE="_iconBtn_bxmqs_1",TE={iconBtn:NE},ME="/sorting-visualizer/dist/icons/moon.svg",zE="/sorting-visualizer/dist/icons/sun.svg",DE=j.jsx("img",{src:zE,alt:"dark mode"}),LE=j.jsx("img",{src:ME,alt:"dark mode"});function IE(){const e=On(),t=Le(o=>o.app.theme),n=window.matchMedia("(prefers-color-scheme: dark)").matches?Ln.DARK:Ln.LIGHT,r=t??n;return _.useEffect(()=>{t?e(Mf(t)):document.documentElement.setAttribute("data-theme",n)},[]),j.jsx(j.Fragment,{children:Rc.createPortal(j.jsx("button",{className:TE.iconBtn,onClick:()=>e(Mf(r===Ln.LIGHT?Ln.DARK:Ln.LIGHT)),children:r===Ln.LIGHT?LE:DE}),document.getElementById("screen-layout"))})}const $E="_navbar_1y7w0_1",AE="_active_1y7w0_50",Yd={navbar:$E,active:AE},UE="/sorting-visualizer/dist/icons/ham.svg";function FE({menuItems:e}){const[t,n]=_.useState(!1);return j.jsxs("nav",{className:Yd.navbar,children:[j.jsxs("h1",{children:["Sorting visualizers",j.jsx("a",{href:"https://github.com/sadanandpai/sorting-visualizer",target:"blank",children:j.jsx("img",{src:"https://cdn-icons-png.flaticon.com/512/25/25231.png",alt:"github repo",className:"github"})})]}),j.jsx("button",{onClick:()=>n(!t),children:j.jsx("img",{src:UE,alt:"hamburger"})}),j.jsx("ul",{"data-toggle":t,children:e.map(r=>j.jsx("li",{children:j.jsx(sg,{to:`/sorting-visualizer/${r}`,className:({isActive:o})=>o?Yd.active:"",onClick:()=>n(!1),children:r})},r))})]})}const bE="_main_1hg6y_1",BE="_allAlgos_1hg6y_6",lv={main:bE,allAlgos:BE};function vl({children:e}){return j.jsxs("div",{children:[j.jsx(FE,{menuItems:Ip}),j.jsx(jE,{}),j.jsx("main",{className:lv.main,children:e}),j.jsx(IE,{})]})}const WE="_container_13os8_1",VE="_warning_13os8_20",uv={container:WE,warning:VE};function av(){return j.jsx("p",{className:uv.warning,children:"Please enter a valid list of numbers to play with the visualization"})}function HE({algoName:e,isCompleted:t}){const n=Le(o=>o.sortViz.time),r=_.useRef(0);return _.useEffect(()=>{t&&(r.current=n)},[t]),j.jsxs("header",{children:[j.jsxs("h2",{children:[e," Sort"]}),j.jsxs("span",{children:["Time: ",j.jsx("strong",{children:r.current||n})]})]})}function KE(e,t){const[n,r]=_.useState([-1,-1]),[o,i]=_.useState([-1,-1]),[l,a]=_.useState([]),[u,s]=_.useState([-1,-1]),[c,f]=_.useState(-1),[p,g]=_.useState(!1),w=_.useRef(t(e)),y=_.useRef(0),E=_.useRef(0),m=async()=>{await Hn;for await(const d of w.current)switch(r([-1,-1]),s([-1,-1]),i([-1,-1]),d.type){case"swap":s(d.positions),r(d.positions),d.positions[0]!==d.positions[1]&&y.current++;break;case"sort":a(v=>[...v,d.position]);break;case"highlight":s(d.positions),d.positions[0]!==d.positions[1]&&E.current++;break;case"pivot":f(d.position);break;case"move":s([d.positions[0],d.positions[0]+1]),i(d.positions),d.positions[0]!==d.positions[1]&&y.current++;break}g(!0)};return _.useEffect(()=>{m()},[]),{pivot:c,isCompleted:p,swaps:n,sorts:l,highlights:u,moves:o,swapCount:y.current,compareCount:E.current}}const sv=function({array:t,algoFn:n,algoName:r="Bubble",onComplete:o,Render:i}){const l=_.useRef([...t]),{swapCount:a,compareCount:u,isCompleted:s,swaps:c,sorts:f,highlights:p,pivot:g,moves:w}=KE(l.current,n);return _.useEffect(()=>{s&&o()},[s,o]),j.jsxs("section",{className:uv.container,children:[j.jsx(HE,{algoName:r,isCompleted:s}),j.jsx(i,{pivot:g,array:l.current,swaps:c,highlights:p,sorts:f,moves:w}),j.jsxs("footer",{children:[j.jsxs("span",{children:["Swaps: ",j.jsx("strong",{children:a})]}),j.jsxs("span",{children:["Comparisons: ",j.jsx("strong",{children:u})]})]})]})};function cv(e,t){const[n,r]=_.useState(!1),o=_.useRef(0);_.useEffect(()=>{o.current=0,r(!1)},[t]);function i(){o.current++,o.current===e&&r(!0)}return{onComplete:i,isComplete:n}}function QE(){const{algoName:e}=ws(),t=On(),n=Le(u=>u.sortViz.array),r=Le(u=>u.sortViz.reset),o=Le(u=>u.sortViz.visualizerType),i=St.find(({name:u})=>u===e)??St[0],{onComplete:l,isComplete:a}=cv(1,r);return _.useEffect(()=>{a&&t(Qn(null))},[t,a]),n.length===0?j.jsx(vl,{children:j.jsx(av,{})}):j.jsx(vl,{children:j.jsx(sv,{array:n,algoName:i.name,algoFn:i.fn,onComplete:l,Render:o==="cell"?ov:tv},i.name+n.toString()+r+o)})}function us(){const{algoName:e}=ws(),t=gp();return _.useEffect(()=>{e||t(`/sorting-visualizer/${Ip[0]}`)},[e,t]),j.jsx(QE,{})}function zi(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?zi=function(n){return typeof n}:zi=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},zi(e)}function XE(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Gd(e,t){for(var n=0;nr.sortViz.selectedAlgosStatus),n=r=>{e(A0(r)),e(Qo())};return j.jsx("div",{className:Mt.checkboxWrapper,children:t.map((r,o)=>j.jsx("li",{className:Mt.listItem,children:j.jsxs("div",{className:Mt.checkbox,children:[j.jsx("input",{type:"checkbox",id:`custom-checkbox-${St[o].name}`,name:St[o].name,value:St[o].name,checked:r,onChange:()=>n(o)}),j.jsx("label",{htmlFor:`custom-checkbox-${St[o].name}`,children:St[o].name})]})},o))})}function ZE(){const e=On(),t=Le(u=>u.sortViz.array),n=Le(u=>u.sortViz.reset),r=Le(u=>u.sortViz.selectedAlgosStatus),o=Le(u=>u.sortViz.visualizerType);let i=St.filter((u,s)=>r[s]);i.length===0&&(i=St);const{onComplete:l,isComplete:a}=cv(i.length,n);return _.useEffect(()=>{a&&e(Qn(null))},[e,a]),t.length===0?j.jsx(vl,{children:j.jsx(av,{})}):j.jsxs(vl,{children:[j.jsx(qE,{}),j.jsx("div",{className:lv.allAlgos,children:i.map(u=>j.jsx(sv,{array:t,algoName:u.name,algoFn:u.fn,onComplete:l,Render:o==="cell"?ov:tv},t.toString()+n+u.name+o))})]})}function ex(){return j.jsx(ZE,{})}const tx=[{path:"/sorting-visualizer/",element:j.jsx(us,{})},{path:"/sorting-visualizer/all",element:j.jsx(ex,{})},{path:"/sorting-visualizer/:algoName",element:j.jsx(us,{})}],nx=rg([...tx,{path:"/",element:j.jsx(us,{})}]);cs.createRoot(document.getElementById("root")).render(j.jsx(Be.StrictMode,{children:j.jsx(WS,{store:Ap,children:j.jsx(fv,{loading:null,persistor:J0,children:j.jsx(Yy,{router:nx})})})})); + }`;return rv(i),r}function rv(e){var n;const t=(n=ir==null?void 0:ir.sheet)==null?void 0:n.insertRule(e);setTimeout(()=>{var r;t&&((r=ir==null?void 0:ir.sheet)==null||r.deleteRule(t))},Kn)}function uE({originalOrder:e,isSwap:t,order:n,value:r,isHighlighted:o}){let i=lE(e-n,Kn);return t&&(i=nv(e-n,Kn)),j.jsx(Dc,{animation:i,order:n,value:r,isHighlighted:o})}function aE({originalOrder:e,order:t,value:n,isHighlighted:r}){const o=nv(e-t,Kn);return j.jsx(Dc,{animation:o,order:t,value:n,isHighlighted:r})}const ov=function({array:t,swaps:n,sorts:r,highlights:o,moves:i,pivot:l}){function a(u,s){return n.includes(u)?j.jsx(aE,{originalOrder:u,order:n[0]===u?n[1]:n[0],value:s,isHighlighted:o.includes(u)},u):i&&u>=i[0]&&u<=i[1]?j.jsx(uE,{originalOrder:u,order:u===i[0]?i[1]:u-1,isSwap:u===i[0],value:s,isHighlighted:o.includes(u)},u):j.jsx(Dc,{order:u,value:s,isSorted:r.includes(u),isHighlighted:o.includes(u),isPivot:u===l},u)}return j.jsxs("div",{className:xo.arrayContainer,children:[j.jsx("ul",{className:xo.values,children:t.map((u,s)=>a(s,u))}),j.jsx("ul",{className:xo.indices,children:t.map((u,s)=>j.jsx("li",{children:s},s))})]})};function sE(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 cE(e){return e.split(",").filter(t=>t!=="").map(t=>+t)}function Kd(e=0,t=999){return Math.floor(Math.random()*(t-e))+e}const fE="_controllerWrapper_dofm1_1",dE="_controller_dofm1_1",pE="_numbers_dofm1_9",hE="_arrayInput_dofm1_14",mE="_rndmBtn_dofm1_27",vE="_controls_dofm1_34",yE="_checkboxWrapper_dofm1_52",gE="_listItem_dofm1_59",wE="_checkbox_dofm1_52",SE="_switchContainer_dofm1_76",Mt={controllerWrapper:fE,controller:dE,numbers:pE,arrayInput:hE,rndmBtn:mE,controls:vE,checkboxWrapper:yE,listItem:gE,checkbox:wE,switchContainer:SE};function EE(){const e=On(),t=Le(l=>l.sortViz.array),[n,r]=_.useState(t.join(", "));_.useEffect(()=>{e(Qn(!1)),e(Qo())},[t,e]);const o=()=>{const l=Array.from(new Array(Kd(10,40)),()=>Kd());r(l.join(", ")),e(If(l))},i=l=>{const a=sE(l.target.value);r(a),e(If(cE(a)))};return j.jsxs("div",{className:Mt.numbers,children:[j.jsx("button",{className:Mt.rndmBtn,onClick:o,children:"Randomize"}),j.jsx("input",{className:Mt.arrayInput,type:"text",placeholder:"Numbers to sort (comma separate - max 3 digits)",value:n,onChange:i})]})}const xE="/sorting-visualizer/dist/icons/pause.svg",kE="/sorting-visualizer/dist/icons/play.svg",PE="/sorting-visualizer/dist/icons/reset.svg";function _E(){const e=On(),t=Le(i=>i.sortViz.array),n=Le(i=>i.sortViz.speed),r=Le(i=>i.sortViz.isPlaying),o=Le(i=>i.sortViz.reset);return _.useEffect(()=>{r&&e(b0())},[e,r]),_.useEffect(()=>{e(Qn(!1))},[e,o]),_.useEffect(()=>{e($f(n))},[e,n]),j.jsxs("div",{className:Mt.controls,children:[j.jsx("button",{onClick:()=>e(Qn(!r)),disabled:t.length===0||r===null,"data-tooltip":r?"Pause":"Play",children:j.jsx("img",{src:r?xE:kE,alt:r?"Pause":"Play",height:24,width:24})}),j.jsx("button",{onClick:()=>e(Qo()),disabled:t.length===0,"data-tooltip":"Reset",children:j.jsx("img",{src:PE,height:24,width:24})}),j.jsx("input",{"data-tooltip":"Animation speed",type:"range",min:1,max:20,value:n,step:1,onChange:i=>e($f(i.target.valueAsNumber))})]})}function ls(){return ls=Object.assign?Object.assign.bind():function(e){for(var t=1;t=u)&&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,l=n.offColor,a=n.onColor,u=n.offHandleColor,s=n.onHandleColor,c=n.checkedIcon,f=n.uncheckedIcon,p=n.checkedHandleIcon,g=n.uncheckedHandleIcon,w=n.boxShadow,y=n.activeBoxShadow,E=n.height,m=n.width,d=n.borderRadius,v=function(je,$e){var Xe={};for(var N in je)Object.prototype.hasOwnProperty.call(je,N)&&$e.indexOf(N)===-1&&(Xe[N]=je[N]);return Xe}(n,["checked","disabled","className","offColor","onColor","offHandleColor","onHandleColor","checkedIcon","uncheckedIcon","checkedHandleIcon","uncheckedHandleIcon","boxShadow","activeBoxShadow","height","width","borderRadius","handleDiameter"]),h=this.state,x=h.h,P=h.N,R=h.j,T={position:"relative",display:"inline-block",textAlign:"left",opacity:o?.5:1,direction:"ltr",borderRadius:E/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:E,width:m,margin:Math.max(0,(this.t-E)/2),position:"relative",background:Xd(x,this.i,this.o,l,a),borderRadius:typeof d=="number"?d:E/2,cursor:o?"default":"pointer",WebkitTransition:P?null:"background 0.25s",MozTransition:P?null:"background 0.25s",transition:P?null:"background 0.25s"},D={height:E,width:Math.min(1.5*E,m-(this.t+E)/2+1),position:"relative",opacity:(x-this.o)/(this.i-this.o),pointerEvents:"none",WebkitTransition:P?null:"opacity 0.25s",MozTransition:P?null:"opacity 0.25s",transition:P?null:"opacity 0.25s"},Z={height:E,width:Math.min(1.5*E,m-(this.t+E)/2+1),position:"absolute",opacity:1-(x-this.o)/(this.i-this.o),right:0,top:0,pointerEvents:"none",WebkitTransition:P?null:"opacity 0.25s",MozTransition:P?null:"opacity 0.25s",transition:P?null:"opacity 0.25s"},Y={height:this.t,width:this.t,background:Xd(x,this.i,this.o,u,s),display:"inline-block",cursor:o?"default":"pointer",borderRadius:typeof d=="number"?d-1:"50%",position:"absolute",transform:"translateX("+x+"px)",top:Math.max(0,(E-this.t)/2),outline:0,boxShadow:R?y:w,border:0,WebkitTransition:P?null:"background-color 0.25s, transform 0.25s, box-shadow 0.15s",MozTransition:P?null:"background-color 0.25s, transform 0.25s, box-shadow 0.15s",transition:P?null:"background-color 0.25s, transform 0.25s, box-shadow 0.15s"},ot={height:this.t,width:this.t,opacity:Math.max(2*(1-(x-this.o)/(this.i-this.o)-.5),0),position:"absolute",left:0,top:0,pointerEvents:"none",WebkitTransition:P?null:"opacity 0.25s",MozTransition:P?null:"opacity 0.25s",transition:P?null:"opacity 0.25s"},Pt={height:this.t,width:this.t,opacity:Math.max(2*((x-this.o)/(this.i-this.o)-.5),0),position:"absolute",left:0,top:0,pointerEvents:"none",WebkitTransition:P?null:"opacity 0.25s",MozTransition:P?null:"opacity 0.25s",transition:P?null:"opacity 0.25s"};return Be.createElement("div",{className:i,style:T},Be.createElement("div",{className:"react-switch-bg",style:I,onClick:o?null:this.T,onMouseDown:function(je){return je.preventDefault()}},c&&Be.createElement("div",{style:D},c),f&&Be.createElement("div",{style:Z},f)),Be.createElement("div",{className:"react-switch-handle",style:Y,onClick:function(je){return je.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},g&&Be.createElement("div",{style:ot},g),p&&Be.createElement("div",{style:Pt},p)),Be.createElement("input",ls({},{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);iv.defaultProps={disabled:!1,offColor:"#888",onColor:"#080",offHandleColor:"#fff",onHandleColor:"#fff",uncheckedIcon:CE,checkedIcon:RE,boxShadow:null,activeBoxShadow:"0 0 2px 3px #3bf",height:28,width:56};function OE(){const e=On(),t=Le(n=>n.sortViz.visualizerType);return _.useEffect(()=>{e(Qn(!1)),e(Qo())},[t,e]),j.jsxs("div",{className:Mt.switchContainer,children:[j.jsx("label",{children:"Cell"}),j.jsx(iv,{id:"visualizerType",onChange:()=>e(U0()),checked:t==="bar",checkedIcon:!1,uncheckedIcon:!1,height:20,width:40,offColor:"#2b4bfe",onColor:"#2b4bfe"}),j.jsx("label",{children:"Bar"})]})}function jE(){const{algoName:e}=ws(),t=On();return _.useEffect(()=>{t(Qn(!1)),t(Qo())},[e,t]),j.jsxs("section",{className:Mt.controllerWrapper,children:[j.jsxs("div",{className:Mt.controller,children:[j.jsx(EE,{}),j.jsx(_E,{})]}),j.jsx(OE,{})]})}var Ln=(e=>(e.LIGHT="light",e.DARK="dark",e))(Ln||{});const NE="_iconBtn_9tcdq_1",TE={iconBtn:NE},ME="/sorting-visualizer/dist/icons/moon.svg",zE="/sorting-visualizer/dist/icons/sun.svg",DE=j.jsx("img",{src:zE,alt:"dark mode"}),LE=j.jsx("img",{src:ME,alt:"dark mode"});function IE(){const e=On(),t=Le(o=>o.app.theme),n=window.matchMedia("(prefers-color-scheme: dark)").matches?Ln.DARK:Ln.LIGHT,r=t??n;return _.useEffect(()=>{t?e(Mf(t)):document.documentElement.setAttribute("data-theme",n)},[]),j.jsx(j.Fragment,{children:Rc.createPortal(j.jsx("button",{className:TE.iconBtn,onClick:()=>e(Mf(r===Ln.LIGHT?Ln.DARK:Ln.LIGHT)),children:r===Ln.LIGHT?LE:DE}),document.getElementById("screen-layout"))})}const $E="_navbar_hoafu_1",AE="_active_hoafu_50",Yd={navbar:$E,active:AE},UE="/sorting-visualizer/dist/icons/ham.svg";function FE({menuItems:e}){const[t,n]=_.useState(!1);return j.jsxs("nav",{className:Yd.navbar,children:[j.jsxs("h1",{children:["Sorting visualizers",j.jsx("a",{href:"https://github.com/sadanandpai/sorting-visualizer",target:"blank",children:j.jsx("img",{src:"https://cdn-icons-png.flaticon.com/512/25/25231.png",alt:"github repo",className:"github"})})]}),j.jsx("button",{onClick:()=>n(!t),children:j.jsx("img",{src:UE,alt:"hamburger"})}),j.jsx("ul",{"data-toggle":t,children:e.map(r=>j.jsx("li",{children:j.jsx(sg,{to:`/sorting-visualizer/${r}`,className:({isActive:o})=>o?Yd.active:"",onClick:()=>n(!1),children:r})},r))})]})}const bE="_main_1hg6y_1",BE="_allAlgos_1hg6y_6",lv={main:bE,allAlgos:BE};function vl({children:e}){return j.jsxs("div",{children:[j.jsx(FE,{menuItems:Ip}),j.jsx(jE,{}),j.jsx("main",{className:lv.main,children:e}),j.jsx(IE,{})]})}const WE="_container_wgxfy_1",VE="_warning_wgxfy_20",uv={container:WE,warning:VE};function av(){return j.jsx("p",{className:uv.warning,children:"Please enter a valid list of numbers to play with the visualization"})}function HE({algoName:e,isCompleted:t}){const n=Le(o=>o.sortViz.time),r=_.useRef(0);return _.useEffect(()=>{t&&(r.current=n)},[t]),j.jsxs("header",{children:[j.jsxs("h2",{children:[e," Sort"]}),j.jsxs("span",{children:["Time: ",j.jsx("strong",{children:r.current||n})]})]})}function KE(e,t){const[n,r]=_.useState([-1,-1]),[o,i]=_.useState([-1,-1]),[l,a]=_.useState([]),[u,s]=_.useState([-1,-1]),[c,f]=_.useState(-1),[p,g]=_.useState(!1),w=_.useRef(t(e)),y=_.useRef(0),E=_.useRef(0),m=async()=>{await Hn;for await(const d of w.current)switch(r([-1,-1]),s([-1,-1]),i([-1,-1]),d.type){case"swap":s(d.positions),r(d.positions),d.positions[0]!==d.positions[1]&&y.current++;break;case"sort":a(v=>[...v,d.position]);break;case"highlight":s(d.positions),d.positions[0]!==d.positions[1]&&E.current++;break;case"pivot":f(d.position);break;case"move":s([d.positions[0],d.positions[0]+1]),i(d.positions),d.positions[0]!==d.positions[1]&&y.current++;break}g(!0)};return _.useEffect(()=>{m()},[]),{pivot:c,isCompleted:p,swaps:n,sorts:l,highlights:u,moves:o,swapCount:y.current,compareCount:E.current}}const sv=function({array:t,algoFn:n,algoName:r="Bubble",onComplete:o,Render:i}){const l=_.useRef([...t]),{swapCount:a,compareCount:u,isCompleted:s,swaps:c,sorts:f,highlights:p,pivot:g,moves:w}=KE(l.current,n);return _.useEffect(()=>{s&&o()},[s,o]),j.jsxs("section",{className:uv.container,children:[j.jsx(HE,{algoName:r,isCompleted:s}),j.jsx(i,{pivot:g,array:l.current,swaps:c,highlights:p,sorts:f,moves:w}),j.jsxs("footer",{children:[j.jsxs("span",{children:["Swaps: ",j.jsx("strong",{children:a})]}),j.jsxs("span",{children:["Comparisons: ",j.jsx("strong",{children:u})]})]})]})};function cv(e,t){const[n,r]=_.useState(!1),o=_.useRef(0);_.useEffect(()=>{o.current=0,r(!1)},[t]);function i(){o.current++,o.current===e&&r(!0)}return{onComplete:i,isComplete:n}}function QE(){const{algoName:e}=ws(),t=On(),n=Le(u=>u.sortViz.array),r=Le(u=>u.sortViz.reset),o=Le(u=>u.sortViz.visualizerType),i=St.find(({name:u})=>u===e)??St[0],{onComplete:l,isComplete:a}=cv(1,r);return _.useEffect(()=>{a&&t(Qn(null))},[t,a]),n.length===0?j.jsx(vl,{children:j.jsx(av,{})}):j.jsx(vl,{children:j.jsx(sv,{array:n,algoName:i.name,algoFn:i.fn,onComplete:l,Render:o==="cell"?ov:tv},i.name+n.toString()+r+o)})}function us(){const{algoName:e}=ws(),t=gp();return _.useEffect(()=>{e||t(`/sorting-visualizer/${Ip[0]}`)},[e,t]),j.jsx(QE,{})}function zi(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?zi=function(n){return typeof n}:zi=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},zi(e)}function XE(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Gd(e,t){for(var n=0;nr.sortViz.selectedAlgosStatus),n=r=>{e(A0(r)),e(Qo())};return j.jsx("div",{className:Mt.checkboxWrapper,children:t.map((r,o)=>j.jsx("li",{className:Mt.listItem,children:j.jsxs("div",{className:Mt.checkbox,children:[j.jsx("input",{type:"checkbox",id:`custom-checkbox-${St[o].name}`,name:St[o].name,value:St[o].name,checked:r,onChange:()=>n(o)}),j.jsx("label",{htmlFor:`custom-checkbox-${St[o].name}`,children:St[o].name})]})},o))})}function ZE(){const e=On(),t=Le(u=>u.sortViz.array),n=Le(u=>u.sortViz.reset),r=Le(u=>u.sortViz.selectedAlgosStatus),o=Le(u=>u.sortViz.visualizerType);let i=St.filter((u,s)=>r[s]);i.length===0&&(i=St);const{onComplete:l,isComplete:a}=cv(i.length,n);return _.useEffect(()=>{a&&e(Qn(null))},[e,a]),t.length===0?j.jsx(vl,{children:j.jsx(av,{})}):j.jsxs(vl,{children:[j.jsx(qE,{}),j.jsx("div",{className:lv.allAlgos,children:i.map(u=>j.jsx(sv,{array:t,algoName:u.name,algoFn:u.fn,onComplete:l,Render:o==="cell"?ov:tv},t.toString()+n+u.name+o))})]})}function ex(){return j.jsx(ZE,{})}const tx=[{path:"/sorting-visualizer/",element:j.jsx(us,{})},{path:"/sorting-visualizer/all",element:j.jsx(ex,{})},{path:"/sorting-visualizer/:algoName",element:j.jsx(us,{})}],nx=rg([...tx,{path:"/",element:j.jsx(us,{})}]);cs.createRoot(document.getElementById("root")).render(j.jsx(Be.StrictMode,{children:j.jsx(WS,{store:Ap,children:j.jsx(fv,{loading:null,persistor:J0,children:j.jsx(Yy,{router:nx})})})})); diff --git a/dist/index.html b/dist/index.html index 406f448..5ca3b97 100644 --- a/dist/index.html +++ b/dist/index.html @@ -6,8 +6,8 @@ Algo Visualizer - - + +